From fc89183cdc6be5afa8deb7250fd15a20832ab528 Mon Sep 17 00:00:00 2001 From: obrien Date: Sun, 27 Jan 2002 12:00:11 +0000 Subject: Enlist the FreeBSD-CURRENT users as testers of what is to become Binutils version 2.12.0. These bits are taken from the FSF anoncvs repo on 27-January-2002 03:41 PST. --- contrib/binutils/ChangeLog | 464 +- contrib/binutils/MAINTAINERS | 27 +- contrib/binutils/Makefile.in | 217 +- contrib/binutils/bfd/ChangeLog | 5308 +----------- contrib/binutils/bfd/ChangeLog-0001 | 9592 +++++++++++++++++++++ contrib/binutils/bfd/ChangeLog-9193 | 109 +- contrib/binutils/bfd/ChangeLog-9495 | 16 +- contrib/binutils/bfd/ChangeLog-9697 | 62 +- contrib/binutils/bfd/ChangeLog-9899 | 24 +- contrib/binutils/bfd/Makefile.am | 462 +- contrib/binutils/bfd/Makefile.in | 471 +- contrib/binutils/bfd/README | 2 +- contrib/binutils/bfd/aout-arm.c | 320 +- contrib/binutils/bfd/aout-encap.c | 84 +- contrib/binutils/bfd/aout-sparcle.c | 8 +- contrib/binutils/bfd/aout-target.h | 26 +- contrib/binutils/bfd/aout0.c | 8 +- contrib/binutils/bfd/aoutf1.h | 159 +- contrib/binutils/bfd/aoutx.h | 1328 +-- contrib/binutils/bfd/archive.c | 254 +- contrib/binutils/bfd/archive64.c | 245 + contrib/binutils/bfd/archures.c | 38 +- contrib/binutils/bfd/armnetbsd.c | 10 +- contrib/binutils/bfd/bfd-in.h | 162 +- contrib/binutils/bfd/bfd-in2.h | 1125 ++- contrib/binutils/bfd/bfd.c | 406 +- contrib/binutils/bfd/binary.c | 37 +- contrib/binutils/bfd/cache.c | 4 +- contrib/binutils/bfd/coff-alpha.c | 133 +- contrib/binutils/bfd/coff-arm.c | 888 +- contrib/binutils/bfd/coff-i386.c | 4 +- contrib/binutils/bfd/coff-ia64.c | 27 +- contrib/binutils/bfd/coff-ppc.c | 207 +- contrib/binutils/bfd/coff-rs6000.c | 2953 +++++-- contrib/binutils/bfd/coff-sparc.c | 15 +- contrib/binutils/bfd/coffcode.h | 860 +- contrib/binutils/bfd/coffgen.c | 307 +- contrib/binutils/bfd/cofflink.c | 271 +- contrib/binutils/bfd/coffswap.h | 808 +- contrib/binutils/bfd/config.bfd | 199 +- contrib/binutils/bfd/configure | 951 +- contrib/binutils/bfd/configure.host | 10 +- contrib/binutils/bfd/configure.in | 251 +- contrib/binutils/bfd/corefile.c | 4 +- contrib/binutils/bfd/cpu-arc.c | 2 + contrib/binutils/bfd/cpu-i386.c | 8 +- contrib/binutils/bfd/cpu-ia64-opc.c | 2 +- contrib/binutils/bfd/cpu-powerpc.c | 6 +- contrib/binutils/bfd/demo64.c | 10 +- contrib/binutils/bfd/dep-in.sed | 7 +- contrib/binutils/bfd/doc/ChangeLog | 62 +- contrib/binutils/bfd/doc/Makefile.am | 88 +- contrib/binutils/bfd/doc/Makefile.in | 145 +- contrib/binutils/bfd/doc/bfd.texinfo | 20 +- contrib/binutils/bfd/doc/bfdint.texi | 21 +- contrib/binutils/bfd/doc/bfdsumm.texi | 2 +- contrib/binutils/bfd/doc/header.sed | 12 + contrib/binutils/bfd/dwarf1.c | 62 +- contrib/binutils/bfd/dwarf2.c | 474 +- contrib/binutils/bfd/ecoff.c | 344 +- contrib/binutils/bfd/ecofflink.c | 122 +- contrib/binutils/bfd/ecoffswap.h | 439 +- contrib/binutils/bfd/elf-bfd.h | 797 +- contrib/binutils/bfd/elf-eh-frame.c | 1212 +++ contrib/binutils/bfd/elf-strtab.c | 449 + contrib/binutils/bfd/elf.c | 2492 ++++-- contrib/binutils/bfd/elf32-arc.c | 52 +- contrib/binutils/bfd/elf32-arm.h | 740 +- contrib/binutils/bfd/elf32-gen.c | 23 +- contrib/binutils/bfd/elf32-i386.c | 1979 +++-- contrib/binutils/bfd/elf32-ppc.c | 309 +- contrib/binutils/bfd/elf32-sparc.c | 221 +- contrib/binutils/bfd/elf64-alpha.c | 1108 +-- contrib/binutils/bfd/elf64-gen.c | 19 +- contrib/binutils/bfd/elf64-ppc.c | 4463 ++++++++++ contrib/binutils/bfd/elf64-ppc.h | 22 + contrib/binutils/bfd/elf64-sparc.c | 376 +- contrib/binutils/bfd/elf64-x86-64.c | 252 +- contrib/binutils/bfd/elfarm-nabi.c | 117 +- contrib/binutils/bfd/elfarm-oabi.c | 629 +- contrib/binutils/bfd/elfcode.h | 555 +- contrib/binutils/bfd/elfcore.h | 63 +- contrib/binutils/bfd/elflink.c | 57 +- contrib/binutils/bfd/elflink.h | 2762 ++++-- contrib/binutils/bfd/elfxx-ia64.c | 828 +- contrib/binutils/bfd/elfxx-target.h | 87 +- contrib/binutils/bfd/format.c | 102 +- contrib/binutils/bfd/gen-aout.c | 9 +- contrib/binutils/bfd/hash.c | 14 +- contrib/binutils/bfd/host-aout.c | 8 +- contrib/binutils/bfd/i386aout.c | 15 +- contrib/binutils/bfd/i386bsd.c | 8 +- contrib/binutils/bfd/i386freebsd.c | 8 +- contrib/binutils/bfd/i386linux.c | 55 +- contrib/binutils/bfd/i386netbsd.c | 8 +- contrib/binutils/bfd/ieee.c | 572 +- contrib/binutils/bfd/ihex.c | 110 +- contrib/binutils/bfd/libaout.h | 344 +- contrib/binutils/bfd/libbfd-in.h | 64 +- contrib/binutils/bfd/libbfd.c | 260 +- contrib/binutils/bfd/libbfd.h | 174 +- contrib/binutils/bfd/libcoff-in.h | 108 +- contrib/binutils/bfd/libcoff.h | 608 +- contrib/binutils/bfd/libecoff.h | 11 +- contrib/binutils/bfd/libieee.h | 28 +- contrib/binutils/bfd/linker.c | 231 +- contrib/binutils/bfd/merge.c | 955 ++ contrib/binutils/bfd/netbsd-core.c | 221 +- contrib/binutils/bfd/opncls.c | 105 +- contrib/binutils/bfd/osf-core.c | 92 +- contrib/binutils/bfd/peXXigen.c | 663 +- contrib/binutils/bfd/po/Make-in | 4 +- contrib/binutils/bfd/po/SRC-POTFILES.in | 22 +- contrib/binutils/bfd/po/bfd.pot | 2069 +++-- contrib/binutils/bfd/ppcboot.c | 40 +- contrib/binutils/bfd/ptrace-core.c | 39 +- contrib/binutils/bfd/reloc.c | 567 +- contrib/binutils/bfd/reloc16.c | 26 +- contrib/binutils/bfd/sco5-core.c | 115 +- contrib/binutils/bfd/section.c | 392 +- contrib/binutils/bfd/sparclinux.c | 45 +- contrib/binutils/bfd/sparcnetbsd.c | 8 +- contrib/binutils/bfd/srec.c | 97 +- contrib/binutils/bfd/stabs.c | 211 +- contrib/binutils/bfd/sunos.c | 199 +- contrib/binutils/bfd/syms.c | 98 +- contrib/binutils/bfd/sysdep.h | 6 + contrib/binutils/bfd/targets.c | 550 +- contrib/binutils/bfd/targmatch.sed | 1 + contrib/binutils/bfd/tekhex.c | 80 +- contrib/binutils/bfd/trad-core.c | 41 +- contrib/binutils/bfd/version.h | 1 + contrib/binutils/binutils/ChangeLog | 1111 ++- contrib/binutils/binutils/ChangeLog-9197 | 11 +- contrib/binutils/binutils/MAINTAINERS | 149 +- contrib/binutils/binutils/Makefile.am | 243 +- contrib/binutils/binutils/Makefile.in | 452 +- contrib/binutils/binutils/NEWS | 25 + contrib/binutils/binutils/README | 71 +- contrib/binutils/binutils/aclocal.m4 | 18 + contrib/binutils/binutils/addr2line.c | 34 +- contrib/binutils/binutils/ar.c | 30 +- contrib/binutils/binutils/arlex.l | 6 +- contrib/binutils/binutils/arsup.c | 3 +- contrib/binutils/binutils/arsup.h | 50 +- contrib/binutils/binutils/bucomm.c | 64 +- contrib/binutils/binutils/bucomm.h | 2 + contrib/binutils/binutils/coffdump.c | 205 +- contrib/binutils/binutils/coffgrok.c | 18 +- contrib/binutils/binutils/coffgrok.h | 2 +- contrib/binutils/binutils/config.in | 18 +- contrib/binutils/binutils/configure | 1363 +-- contrib/binutils/binutils/configure.in | 34 +- contrib/binutils/binutils/defparse.y | 6 + contrib/binutils/binutils/dlltool.c | 83 +- contrib/binutils/binutils/dllwrap.c | 18 +- contrib/binutils/binutils/doc/Makefile.am | 161 + contrib/binutils/binutils/doc/Makefile.in | 557 ++ contrib/binutils/binutils/doc/binutils.texi | 3832 ++++++++ contrib/binutils/binutils/nm.c | 45 +- contrib/binutils/binutils/objcopy.c | 355 +- contrib/binutils/binutils/objdump.c | 261 +- contrib/binutils/binutils/po/binutils.pot | 1713 ++-- contrib/binutils/binutils/rclex.l | 14 +- contrib/binutils/binutils/rcparse.y | 19 +- contrib/binutils/binutils/readelf.c | 2731 ++++-- contrib/binutils/binutils/resrc.c | 22 +- contrib/binutils/binutils/resres.c | 6 +- contrib/binutils/binutils/size.c | 148 +- contrib/binutils/binutils/srconv.c | 428 +- contrib/binutils/binutils/stabs.c | 52 +- contrib/binutils/binutils/strings.c | 255 +- contrib/binutils/binutils/sysdump.c | 188 +- contrib/binutils/binutils/sysinfo.y | 8 + contrib/binutils/binutils/unwind-ia64.c | 74 +- contrib/binutils/binutils/version.c | 11 +- contrib/binutils/binutils/wrstabs.c | 6 +- contrib/binutils/config.guess | 457 +- contrib/binutils/config.if | 4 +- contrib/binutils/config.sub | 205 +- contrib/binutils/config/ChangeLog | 7 +- contrib/binutils/configure | 74 +- contrib/binutils/configure.in | 183 +- contrib/binutils/gas/CONTRIBUTORS | 2 +- contrib/binutils/gas/ChangeLog | 5437 +----------- contrib/binutils/gas/ChangeLog-0001 | 7703 +++++++++++++++++ contrib/binutils/gas/ChangeLog-9295 | 225 +- contrib/binutils/gas/ChangeLog-9697 | 40 +- contrib/binutils/gas/ChangeLog-9899 | 74 +- contrib/binutils/gas/Makefile.am | 1953 +++-- contrib/binutils/gas/Makefile.in | 2025 +++-- contrib/binutils/gas/NEWS | 17 + contrib/binutils/gas/README | 32 +- contrib/binutils/gas/app.c | 31 +- contrib/binutils/gas/as.c | 26 +- contrib/binutils/gas/as.h | 20 +- contrib/binutils/gas/atof-generic.c | 16 +- contrib/binutils/gas/bit_fix.h | 6 +- contrib/binutils/gas/cgen.c | 165 +- contrib/binutils/gas/cgen.h | 13 +- contrib/binutils/gas/cond.c | 8 +- contrib/binutils/gas/config.in | 10 +- contrib/binutils/gas/config/e-i386aout.c | 2 + contrib/binutils/gas/config/e-i386coff.c | 2 + contrib/binutils/gas/config/e-i386elf.c | 2 + contrib/binutils/gas/config/obj-aout.c | 4 +- contrib/binutils/gas/config/obj-coff.c | 103 +- contrib/binutils/gas/config/obj-coff.h | 7 + contrib/binutils/gas/config/obj-ecoff.c | 72 +- contrib/binutils/gas/config/obj-elf.c | 392 +- contrib/binutils/gas/config/obj-elf.h | 28 +- contrib/binutils/gas/config/obj-ieee.c | 5 +- contrib/binutils/gas/config/tc-alpha.c | 1469 ++-- contrib/binutils/gas/config/tc-alpha.h | 30 +- contrib/binutils/gas/config/tc-arc.c | 50 +- contrib/binutils/gas/config/tc-arc.h | 8 +- contrib/binutils/gas/config/tc-arm.c | 7709 +++++++++++------ contrib/binutils/gas/config/tc-arm.h | 6 - contrib/binutils/gas/config/tc-i386.c | 227 +- contrib/binutils/gas/config/tc-i386.h | 11 +- contrib/binutils/gas/config/tc-ia64.c | 432 +- contrib/binutils/gas/config/tc-ia64.h | 25 +- contrib/binutils/gas/config/tc-ppc.c | 1348 +-- contrib/binutils/gas/config/tc-ppc.h | 71 +- contrib/binutils/gas/config/tc-sparc.c | 276 +- contrib/binutils/gas/config/tc-sparc.h | 12 +- contrib/binutils/gas/configure | 703 +- contrib/binutils/gas/configure.in | 93 +- contrib/binutils/gas/depend.c | 24 +- contrib/binutils/gas/doc/Makefile.am | 29 + contrib/binutils/gas/doc/Makefile.in | 30 + contrib/binutils/gas/doc/all.texi | 4 + contrib/binutils/gas/doc/as.texinfo | 1052 ++- contrib/binutils/gas/doc/c-arm.texi | 164 +- contrib/binutils/gas/doc/c-ppc.texi | 95 + contrib/binutils/gas/doc/internals.texi | 67 +- contrib/binutils/gas/dwarf2dbg.c | 34 +- contrib/binutils/gas/ecoff.c | 64 +- contrib/binutils/gas/ehopt.c | 4 +- contrib/binutils/gas/emul-target.h | 23 +- contrib/binutils/gas/emul.h | 35 +- contrib/binutils/gas/expr.c | 93 +- contrib/binutils/gas/frags.c | 2 +- contrib/binutils/gas/frags.h | 20 +- contrib/binutils/gas/gasp.c | 54 +- contrib/binutils/gas/hash.c | 6 +- contrib/binutils/gas/input-file.c | 111 +- contrib/binutils/gas/input-scrub.c | 2 +- contrib/binutils/gas/itbl-lex.l | 3 +- contrib/binutils/gas/itbl-ops.c | 13 +- contrib/binutils/gas/listing.c | 22 +- contrib/binutils/gas/macro.c | 88 +- contrib/binutils/gas/output-file.c | 46 +- contrib/binutils/gas/po/POTFILES.in | 10 + contrib/binutils/gas/po/gas.pot | 5198 ++++++----- contrib/binutils/gas/read.c | 346 +- contrib/binutils/gas/read.h | 2 + contrib/binutils/gas/stabs.c | 47 +- contrib/binutils/gas/struc-symbol.h | 12 +- contrib/binutils/gas/subsegs.c | 4 +- contrib/binutils/gas/symbols.c | 258 +- contrib/binutils/gas/symbols.h | 3 +- contrib/binutils/gas/tc.h | 7 +- contrib/binutils/gas/write.c | 303 +- contrib/binutils/gas/write.h | 4 +- contrib/binutils/include/ChangeLog | 274 +- contrib/binutils/include/ansidecl.h | 312 +- contrib/binutils/include/aout/ChangeLog | 24 +- contrib/binutils/include/aout/aout64.h | 75 +- contrib/binutils/include/aout/sun4.h | 20 +- contrib/binutils/include/bfdlink.h | 35 + contrib/binutils/include/coff/ChangeLog | 110 +- contrib/binutils/include/coff/alpha.h | 16 +- contrib/binutils/include/coff/arm.h | 223 +- contrib/binutils/include/coff/external.h | 254 + contrib/binutils/include/coff/i386.h | 195 +- contrib/binutils/include/coff/ia64.h | 162 +- contrib/binutils/include/coff/internal.h | 82 +- contrib/binutils/include/coff/powerpc.h | 175 +- contrib/binutils/include/coff/rs6000.h | 72 +- contrib/binutils/include/coff/rs6k64.h | 70 +- contrib/binutils/include/coff/sh.h | 209 +- contrib/binutils/include/coff/sparc.h | 85 +- contrib/binutils/include/coff/ti.h | 219 +- contrib/binutils/include/demangle.h | 45 +- contrib/binutils/include/dis-asm.h | 39 +- contrib/binutils/include/dyn-string.h | 8 +- contrib/binutils/include/elf/ChangeLog | 151 +- contrib/binutils/include/elf/alpha.h | 26 +- contrib/binutils/include/elf/arm.h | 51 +- contrib/binutils/include/elf/common.h | 46 +- contrib/binutils/include/elf/cris.h | 54 + contrib/binutils/include/elf/dwarf2.h | 55 +- contrib/binutils/include/elf/external.h | 4 + contrib/binutils/include/elf/h8.h | 96 + contrib/binutils/include/elf/ia64.h | 22 + contrib/binutils/include/elf/internal.h | 36 +- contrib/binutils/include/elf/mips.h | 2 - contrib/binutils/include/elf/mmix.h | 151 + contrib/binutils/include/elf/openrisc.h | 39 + contrib/binutils/include/elf/ppc.h | 77 +- contrib/binutils/include/elf/s390.h | 73 + contrib/binutils/include/elf/x86-64.h | 2 + contrib/binutils/include/elf/xstormy16.h | 53 + contrib/binutils/include/fibheap.h | 81 + contrib/binutils/include/filenames.h | 4 +- contrib/binutils/include/floatformat.h | 10 +- contrib/binutils/include/hashtab.h | 3 + contrib/binutils/include/libiberty.h | 84 +- contrib/binutils/include/objalloc.h | 11 +- contrib/binutils/include/opcode/ChangeLog | 275 +- contrib/binutils/include/opcode/alpha.h | 8 +- contrib/binutils/include/opcode/arc.h | 6 + contrib/binutils/include/opcode/cgen.h | 57 +- contrib/binutils/include/opcode/i386.h | 9 +- contrib/binutils/include/opcode/ppc.h | 19 +- contrib/binutils/include/partition.h | 8 +- contrib/binutils/include/safe-ctype.h | 7 +- contrib/binutils/include/sort.h | 8 +- contrib/binutils/include/splay-tree.h | 12 +- contrib/binutils/include/ternary.h | 51 + contrib/binutils/include/xregex.h | 28 + contrib/binutils/include/xregex2.h | 565 ++ contrib/binutils/ld/ChangeLog | 1774 +++- contrib/binutils/ld/ChangeLog-9197 | 225 +- contrib/binutils/ld/ChangeLog-9899 | 14 +- contrib/binutils/ld/Makefile.am | 257 +- contrib/binutils/ld/Makefile.in | 263 +- contrib/binutils/ld/NEWS | 9 + contrib/binutils/ld/README | 2 + contrib/binutils/ld/aclocal.m4 | 18 + contrib/binutils/ld/config.in | 215 +- contrib/binutils/ld/configure | 1032 +-- contrib/binutils/ld/configure.host | 31 +- contrib/binutils/ld/configure.in | 4 +- contrib/binutils/ld/configure.tgt | 120 +- contrib/binutils/ld/deffilep.y | 27 +- contrib/binutils/ld/emulparams/armelf.sh | 7 +- contrib/binutils/ld/emulparams/armelf_nbsd.sh | 6 + contrib/binutils/ld/emulparams/armelf_oabi.sh | 5 +- contrib/binutils/ld/emulparams/elf32_sparc.sh | 1 + contrib/binutils/ld/emulparams/elf32b4300.sh | 33 +- contrib/binutils/ld/emulparams/elf32l4300.sh | 27 +- contrib/binutils/ld/emulparams/elf32lppc.sh | 21 +- contrib/binutils/ld/emulparams/elf32lppcsim.sh | 18 +- contrib/binutils/ld/emulparams/elf32ppc.sh | 15 +- contrib/binutils/ld/emulparams/elf32ppclinux.sh | 24 +- contrib/binutils/ld/emulparams/elf32ppcsim.sh | 18 +- contrib/binutils/ld/emulparams/elf64_ia64.sh | 11 +- contrib/binutils/ld/emulparams/elf64_sparc.sh | 1 + contrib/binutils/ld/emulparams/elf64alpha.sh | 7 +- contrib/binutils/ld/emulparams/elf64alpha_nbsd.sh | 2 + contrib/binutils/ld/emulparams/elf64lppc.sh | 3 + contrib/binutils/ld/emulparams/elf64ppc.sh | 29 + contrib/binutils/ld/emulparams/elf_i386.sh | 3 +- contrib/binutils/ld/emulparams/elf_i386_chaos.sh | 3 +- contrib/binutils/ld/emulparams/elf_i386_ldso.sh | 12 + contrib/binutils/ld/emulparams/elf_x86_64.sh | 3 +- contrib/binutils/ld/emulparams/i386moss.sh | 2 +- contrib/binutils/ld/emulparams/i386nw.sh | 2 +- contrib/binutils/ld/emulparams/sh.sh | 3 + contrib/binutils/ld/emultempl/armcoff.em | 3 +- contrib/binutils/ld/emultempl/armelf.em | 9 +- contrib/binutils/ld/emultempl/armelf_oabi.em | 3 +- contrib/binutils/ld/emultempl/elf32.em | 265 +- contrib/binutils/ld/emultempl/generic.em | 61 +- contrib/binutils/ld/emultempl/linux.em | 15 +- contrib/binutils/ld/emultempl/pe.em | 494 +- contrib/binutils/ld/emultempl/ppc64elf.em | 99 + contrib/binutils/ld/emultempl/vanilla.em | 7 +- contrib/binutils/ld/gen-doc.texi | 1 + contrib/binutils/ld/genscripts.sh | 71 +- contrib/binutils/ld/ld.h | 21 +- contrib/binutils/ld/ld.texinfo | 756 +- contrib/binutils/ld/ldcref.c | 151 +- contrib/binutils/ld/ldctor.c | 7 +- contrib/binutils/ld/ldemul.c | 11 +- contrib/binutils/ld/ldemul.h | 6 +- contrib/binutils/ld/ldexp.c | 102 +- contrib/binutils/ld/ldfile.c | 14 +- contrib/binutils/ld/ldgram.y | 68 +- contrib/binutils/ld/ldint.texinfo | 122 +- contrib/binutils/ld/ldlang.c | 718 +- contrib/binutils/ld/ldlang.h | 11 +- contrib/binutils/ld/ldlex.l | 26 +- contrib/binutils/ld/ldmain.c | 97 +- contrib/binutils/ld/ldmisc.c | 108 +- contrib/binutils/ld/ldmisc.h | 19 +- contrib/binutils/ld/ldver.c | 18 +- contrib/binutils/ld/ldver.h | 2 - contrib/binutils/ld/lexsup.c | 148 +- contrib/binutils/ld/mri.c | 17 +- contrib/binutils/ld/pe-dll.c | 1046 ++- contrib/binutils/ld/pe-dll.h | 6 + contrib/binutils/ld/po/ld.pot | 890 +- contrib/binutils/ld/scripttempl/armaout.sc | 6 +- contrib/binutils/ld/scripttempl/armcoff.sc | 26 +- contrib/binutils/ld/scripttempl/elf.sc | 310 +- contrib/binutils/ld/scripttempl/nw.sc | 7 +- contrib/binutils/ld/scripttempl/pe.sc | 4 +- contrib/binutils/libiberty/ChangeLog | 656 +- contrib/binutils/libiberty/Makefile.in | 306 +- contrib/binutils/libiberty/_doprnt.c | 303 + contrib/binutils/libiberty/aclocal.m4 | 55 + contrib/binutils/libiberty/alloca.c | 101 +- contrib/binutils/libiberty/argv.c | 120 +- contrib/binutils/libiberty/asprintf.c | 44 +- contrib/binutils/libiberty/atexit.c | 10 + contrib/binutils/libiberty/basename.c | 16 +- contrib/binutils/libiberty/bcmp.c | 27 +- contrib/binutils/libiberty/bcopy.c | 16 +- contrib/binutils/libiberty/bsearch.c | 17 + contrib/binutils/libiberty/bzero.c | 14 +- contrib/binutils/libiberty/calloc.c | 11 + contrib/binutils/libiberty/choose-temp.c | 163 +- contrib/binutils/libiberty/clock.c | 12 + contrib/binutils/libiberty/concat.c | 239 +- contrib/binutils/libiberty/config.in | 48 +- contrib/binutils/libiberty/config.table | 1 - contrib/binutils/libiberty/configure | 878 +- contrib/binutils/libiberty/configure.in | 115 +- contrib/binutils/libiberty/copying-lib.texi | 565 ++ contrib/binutils/libiberty/copysign.c | 12 + contrib/binutils/libiberty/cp-demangle.c | 348 +- contrib/binutils/libiberty/cplus-dem.c | 88 +- contrib/binutils/libiberty/fdmatch.c | 32 +- contrib/binutils/libiberty/ffs.c | 27 + contrib/binutils/libiberty/fibheap.c | 523 ++ contrib/binutils/libiberty/floatformat.c | 54 +- contrib/binutils/libiberty/fnmatch.txh | 48 + contrib/binutils/libiberty/functions.texi | 937 ++ contrib/binutils/libiberty/gather-docs | 128 + contrib/binutils/libiberty/getcwd.c | 24 +- contrib/binutils/libiberty/getopt.c | 2 +- contrib/binutils/libiberty/getpagesize.c | 18 +- contrib/binutils/libiberty/getpwd.c | 12 + contrib/binutils/libiberty/getruntime.c | 12 + contrib/binutils/libiberty/hashtab.c | 112 +- contrib/binutils/libiberty/hex.c | 100 +- contrib/binutils/libiberty/index.c | 12 + contrib/binutils/libiberty/insque.c | 31 +- contrib/binutils/libiberty/lbasename.c | 37 +- contrib/binutils/libiberty/libiberty.texi | 324 + contrib/binutils/libiberty/maint-tool | 278 + contrib/binutils/libiberty/make-temp-file.c | 179 + contrib/binutils/libiberty/md5.c | 136 +- contrib/binutils/libiberty/memchr.c | 41 +- contrib/binutils/libiberty/memcmp.c | 17 +- contrib/binutils/libiberty/memcpy.c | 13 +- contrib/binutils/libiberty/memmove.c | 12 + contrib/binutils/libiberty/memset.c | 11 + contrib/binutils/libiberty/mkstemps.c | 27 +- contrib/binutils/libiberty/obstack.c | 2 +- contrib/binutils/libiberty/obstacks.texi | 758 ++ contrib/binutils/libiberty/partition.c | 4 +- contrib/binutils/libiberty/pexecute.c | 81 +- contrib/binutils/libiberty/putenv.c | 19 +- contrib/binutils/libiberty/random.c | 18 + contrib/binutils/libiberty/regex.c | 8373 ++++++++++++++++++ contrib/binutils/libiberty/rename.c | 11 +- contrib/binutils/libiberty/rindex.c | 12 + contrib/binutils/libiberty/setenv.c | 24 +- contrib/binutils/libiberty/sigsetmask.c | 13 +- contrib/binutils/libiberty/spaces.c | 18 +- contrib/binutils/libiberty/splay-tree.c | 36 +- contrib/binutils/libiberty/strcasecmp.c | 12 +- contrib/binutils/libiberty/strchr.c | 18 +- contrib/binutils/libiberty/strdup.c | 11 + contrib/binutils/libiberty/strerror.c | 125 +- contrib/binutils/libiberty/strncasecmp.c | 12 +- contrib/binutils/libiberty/strncmp.c | 11 + contrib/binutils/libiberty/strrchr.c | 22 +- contrib/binutils/libiberty/strsignal.c | 135 +- contrib/binutils/libiberty/strstr.c | 22 +- contrib/binutils/libiberty/strtod.c | 15 + contrib/binutils/libiberty/strtol.c | 19 + contrib/binutils/libiberty/ternary.c | 166 + contrib/binutils/libiberty/tmpnam.c | 14 + contrib/binutils/libiberty/vasprintf.c | 40 +- contrib/binutils/libiberty/vfork.c | 10 + contrib/binutils/libiberty/vprintf.c | 17 + contrib/binutils/libiberty/vsprintf.c | 6 +- contrib/binutils/libiberty/waitpid.c | 12 + contrib/binutils/libiberty/xatexit.c | 14 + contrib/binutils/libiberty/xexit.c | 12 + contrib/binutils/libiberty/xmalloc.c | 43 + contrib/binutils/libiberty/xmemdup.c | 13 + contrib/binutils/libiberty/xstrdup.c | 11 + contrib/binutils/libiberty/xstrerror.c | 11 + contrib/binutils/libtool.m4 | 234 +- contrib/binutils/ltcf-c.sh | 306 +- contrib/binutils/ltcf-cxx.sh | 398 +- contrib/binutils/ltcf-gcj.sh | 212 +- contrib/binutils/ltconfig | 387 +- contrib/binutils/ltmain.sh | 1011 ++- contrib/binutils/opcodes/ChangeLog | 1105 ++- contrib/binutils/opcodes/ChangeLog-9297 | 16 +- contrib/binutils/opcodes/ChangeLog-9899 | 118 +- contrib/binutils/opcodes/Makefile.am | 248 +- contrib/binutils/opcodes/Makefile.in | 248 +- contrib/binutils/opcodes/aclocal.m4 | 18 + contrib/binutils/opcodes/alpha-dis.c | 38 +- contrib/binutils/opcodes/alpha-opc.c | 8 +- contrib/binutils/opcodes/arc-dis.c | 415 +- contrib/binutils/opcodes/arc-ext.c | 73 +- contrib/binutils/opcodes/arc-opc.c | 9 +- contrib/binutils/opcodes/arm-dis.c | 133 +- contrib/binutils/opcodes/arm-opc.h | 176 +- contrib/binutils/opcodes/cgen-asm.c | 38 +- contrib/binutils/opcodes/cgen-asm.in | 168 +- contrib/binutils/opcodes/cgen-dis.c | 63 +- contrib/binutils/opcodes/cgen-dis.in | 96 +- contrib/binutils/opcodes/cgen-ibld.in | 72 +- contrib/binutils/opcodes/cgen-opc.c | 81 +- contrib/binutils/opcodes/config.in | 3 - contrib/binutils/opcodes/configure | 1022 ++- contrib/binutils/opcodes/configure.in | 12 +- contrib/binutils/opcodes/dis-buf.c | 4 + contrib/binutils/opcodes/disassemble.c | 36 +- contrib/binutils/opcodes/i386-dis.c | 205 +- contrib/binutils/opcodes/ia64-gen.c | 18 +- contrib/binutils/opcodes/ia64-opc.c | 24 +- contrib/binutils/opcodes/po/POTFILES.in | 21 + contrib/binutils/opcodes/po/opcodes.pot | 181 +- contrib/binutils/opcodes/ppc-dis.c | 54 +- contrib/binutils/opcodes/ppc-opc.c | 1658 ++-- contrib/binutils/opcodes/sh-dis.c | 9 +- contrib/binutils/opcodes/sh-opc.h | 2 +- contrib/binutils/symlink-tree | 4 +- 529 files changed, 108388 insertions(+), 47547 deletions(-) create mode 100644 contrib/binutils/bfd/ChangeLog-0001 create mode 100644 contrib/binutils/bfd/archive64.c create mode 100644 contrib/binutils/bfd/doc/header.sed create mode 100644 contrib/binutils/bfd/elf-eh-frame.c create mode 100644 contrib/binutils/bfd/elf-strtab.c create mode 100644 contrib/binutils/bfd/elf64-ppc.c create mode 100644 contrib/binutils/bfd/elf64-ppc.h create mode 100644 contrib/binutils/bfd/merge.c create mode 100644 contrib/binutils/bfd/version.h create mode 100644 contrib/binutils/binutils/doc/Makefile.am create mode 100644 contrib/binutils/binutils/doc/Makefile.in create mode 100644 contrib/binutils/binutils/doc/binutils.texi create mode 100644 contrib/binutils/gas/ChangeLog-0001 create mode 100644 contrib/binutils/gas/doc/c-ppc.texi create mode 100644 contrib/binutils/include/coff/external.h create mode 100644 contrib/binutils/include/elf/h8.h create mode 100644 contrib/binutils/include/elf/mmix.h create mode 100644 contrib/binutils/include/elf/openrisc.h create mode 100644 contrib/binutils/include/elf/s390.h create mode 100644 contrib/binutils/include/elf/xstormy16.h create mode 100644 contrib/binutils/include/fibheap.h create mode 100644 contrib/binutils/include/ternary.h create mode 100644 contrib/binutils/include/xregex.h create mode 100644 contrib/binutils/include/xregex2.h create mode 100644 contrib/binutils/ld/emulparams/armelf_nbsd.sh create mode 100644 contrib/binutils/ld/emulparams/elf64alpha_nbsd.sh create mode 100644 contrib/binutils/ld/emulparams/elf64lppc.sh create mode 100644 contrib/binutils/ld/emulparams/elf64ppc.sh create mode 100644 contrib/binutils/ld/emulparams/elf_i386_ldso.sh create mode 100644 contrib/binutils/ld/emultempl/ppc64elf.em create mode 100644 contrib/binutils/libiberty/_doprnt.c create mode 100644 contrib/binutils/libiberty/copying-lib.texi create mode 100644 contrib/binutils/libiberty/ffs.c create mode 100644 contrib/binutils/libiberty/fibheap.c create mode 100644 contrib/binutils/libiberty/fnmatch.txh create mode 100644 contrib/binutils/libiberty/functions.texi create mode 100644 contrib/binutils/libiberty/gather-docs create mode 100644 contrib/binutils/libiberty/libiberty.texi create mode 100644 contrib/binutils/libiberty/maint-tool create mode 100644 contrib/binutils/libiberty/make-temp-file.c create mode 100644 contrib/binutils/libiberty/obstacks.texi create mode 100644 contrib/binutils/libiberty/regex.c create mode 100644 contrib/binutils/libiberty/ternary.c (limited to 'contrib') diff --git a/contrib/binutils/ChangeLog b/contrib/binutils/ChangeLog index f6aa08d..03b39e0 100644 --- a/contrib/binutils/ChangeLog +++ b/contrib/binutils/ChangeLog @@ -1,3 +1,195 @@ +2002-01-26 Jason Thorpe + + * configure.in (*-*-netbsd*): New. Skip target-newlib, + target-libiberty, and target-libgloss. Skip Java-related + libraries if not supported for NetBSD on target CPU. + +2002-01-23 Nick Clifton + + * configure.in: Import StrongARM and XScale target_configdirs from + FSF GCC version. + +2002-01-16 H.J. Lu (hjl@gnu.org) + + * config.guess: Import from master sources, rev 1.225. + * config.sub: Import from master sources, rev 1.238. + + * MAINTAINERS: Updated notes on config.guess and config.sub. + +2002-01-11 Steve Ellcey + + * configure.in (ia64*-*-hpux*): New target for IA64 HP-UX, + ld and gdb are not supported. + +2002-01-07 Jeff Johnston + + * Change reference to Cygnus Solutions to be Red Hat. + +2002-01-07 Jeff Johnston + + * COPYING.NEWLIB: Update generic copyright date. + +2002-01-07 Mark Salter + + * configure.in: Remove target-bsp and target-cygmon from arm builds. + Allow target-libgloss to be built for arm, strongarm, and xscale. + +2002-01-03 Ben Elliston + + * MAINTAINERS: Update URL for config.* scripts. + +2001-12-18 Alan Modra + + * config.sub: Import latest version. + * config.guess: Likewise. + +2001-12-13 Thomas Fitzsimmons + + * configure.in (FLAGS_FOR_TARGET): Remove -nostdinc and -isystem + options for i[3456]86-pc-linux* native builds. + +2001-12-05 Laurent Guerby + + * MAINTAINERS: gcc adopts symlink-tree, refer more to + libiberty. + + Import this patch from gcc: + + 2000-12-09 Laurynas Biveinis + + * symlink-tree: handle DOS-style absolute paths. + +2001-11-28 DJ Delorie + Zack Weinberg + + When build != host, create libiberty for the build machine. + + * Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace + CONFIG_ARGUMENTS. + (ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR): + New variables. + (ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables + and rules. + (all.normal): Depend on ALL_BUILD_MODULES. + (CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS. + (all-build-libiberty): Depend on configure-build-libiberty. + + * configure: Calculate and substitute proper value for + ALL_BUILD_MODULES. + * configure.in: Create the build subdirectory. + Calculate and substitute TARGET_CONFIGARGS (formerly + CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new). + +2001-11-26 Geoffrey Keating + + * config.sub: Update to version 1.232 on subversion. + +2001-11-20 Nick Clifton + + * Makefile.in (do-proto-toplev): Use msgfmt to generate .gmo + files from .po files for a distribution. + +2001-11-19 Hans-Peter Nilsson + + * COPYING.NEWLIB: Mention preserved notice in specific parts. + +2001-11-13 Jeff Holcomb + + Merged from net gcc: + 2001-07-30 Jeff Sturm + * ltcf-c.sh: Use $objext, not $ac_objext. + 2001-07-27 Mark Kettenis + * ltcf-cxx.sh: Add support for GNU. + 2001-07-22 Timothy Wall + * ltcf-c.sh: Don't disable shared libraries for AIX5/IA64. Preserve + default settings if using GNU tools with that configuration. + * ltcf-cxx.sh: Ditto. + * ltcf-gcj.sh: Ditto. + 2001-07-21 Michael Chastain + * ltconfig: Set max_cmd_len to a maximum of 512Kb, as it seems some + HPUX 11.0 systems have trouble with 1MB. Mark as gcc-local. + * ltmain.sh: Mark as gcc-local. + +2001-11-13 Jeff Holcomb + + * Makefile.in (all-bison): Revert 2001-10-24. + Don't depend on texinfo. + +2001-11-12 Hans-Peter Nilsson + + * COPYING.NEWLIB: Add BSD-style license/copyright blurb for my work. + +2001-11-08 Phil Edwards + + * configure.in (--enable-languages): Be more permissive about + syntax. Check for empty lists better. Warn about $LANGUAGES. + +2001-11-06 Hans-Peter Nilsson + + * Makefile.in (MAKEINFO): Use "missing" for makeinfo older than 4.0. + +2001-10-24 Jeff Holcomb + + Makefile.in (all-bison): Don't depend on texinfo. + +2001-10-03 Alan Modra + + * gettext.m4: Test po/POTFILES.in exists before trying to read. + +2001-09-29 Alexandre Oliva + + * Makefile.in (configure-target-gperf): Depend on $(ALL_GCC_CXX). + +2001-09-28 Hans-Peter Nilsson + + * config.sub, config.guess: Import latest from subversions. + +2001-09-21 Alexandre Oliva + + * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, + DLLTOOL_FOR_TARGET, WINDRES_FOR_TARGET, AR_FOR_TARGET, + RANLIB_FOR_TARGET, NM_FOR_TARGET): Don't use double quotes to + avoid quotes nesting problems. + (NATIVE_CHECK_MODULES): Ditto, just for consistency. + (DO_X): Export only variables that are set. + +2001-09-19 Ben Elliston + + * configure.in (sparc-sun-solaris2*): Don't use /usr/bin/which on + Solaris when testing for the /usr/ucb/cc compiler; it has incorrect + semantics. Use the shell built-in "type" command instead. + +2001-09-15 Thiemo Seufer + + * config.sub: Reverted the earlier change, this version is not the + master file. + +2001-09-14 Thiemo Seufer + + * config.sub: Change machine triplets from mipsel*-* to mips*el-*. + Add support for mips64. + +2001-09-03 Jeff Holcomb + + * configure.in: Enable libstdc++-v3 for h8300 targets. + +2001-08-30 Eric Christopher + Jason Eckhardt + + * config.sub: Add support for mipsisa32. + +2001-08-30 Eric Christopher + + * config.sub, config.guess: Import latest from subversions. + +2001-08-20 Alan Modra + + * config.sub, config.guess: Import latest from subversions. + +2001-07-26 DJ Delorie + + * MAINTAINERS: Clarify libiberty merge rules and procedures. + 2001-06-19 Alan Modra * Makefile.in: Revert 2001-06-17. @@ -9,21 +201,177 @@ (gas+binutils.tar.bz2): Likewise. (binutils.tar.bz2): Pass TOOL=bfd PACKAGE=binutils to make. -2001-06-11 Alan Modra +Fri Jun 8 11:14:02 2001 Andrew Cagney + + * Makefile.in (VER): When present, extract the version number from + the file version.in. + +2001-06-08 Alexandre Oliva , Jeff Sturm + + * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): If + gcc/xgcc is built, use -print-prog-name to find out the program + name to use. + +2001-06-04 Mark Mitchell + + * ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris, + with_gcc]: Use `gcc -shared' to build a shared library. + +2001-06-04 John David Anglin + + * ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared + archives. + +2001-05-28 Simon Patarin + + * ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared + libraries when using g++ with native linker. + +2001-05-28 Alexandre Oliva + + * ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256. + +2001-05-24 Tom Rix + + * configure.in : enable ld for aix + +2001-05-22 Alexandre Oliva + + * ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag) + [aix4*|aix5*]: Prepend blank. + +2001-05-20 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number + of subdir/configure scripts to use the new libtool.m4. + +2001-05-14 H.J. Lu + + * config.if (libc_interface): Set to -libc6.2- for cross + compiling to Linux/glibc 2.2. + +2001-05-03 Alexandre Oliva + + * configure.in (noconfigdirs) [*-cygwin*, *-mingw*, *-beos]: Disable + libgcj. + +2001-04-26 Alexandre Oliva + + * configure.in (noconfigdirs): Don't reset it from scratch in the + target case; only append to it. + +2001-04-26 Alexandre Oliva + + * configure.in (noconfigdirs) [hppa*-*-*, mips*-*-irix6*, + sparc-*-solaris2.8]: Disable ${libgcj}. + +2001-04-25 Alexandre Oliva + + * configure.in (libgcj_saved): Copy from $libgcj. + (libgcj): Zero out if --enable-libgcj; add to noconfigdirs is + --disable-libgcj. + +2001-04-20 Alexandre Oliva + + * ltconfig, ltmain.sh, ltcf-cxx.sh: Upgraded to libtool 1.4a + 1.641.2.228. + +2001-04-12 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.226. + +2001-04-01 Alexandre Oliva + + * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS): + New macros. + (bootstrap, cross): Use RECURSE_FLAGS. + * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE. + +2001-03-27 Alexandre Oliva + + * configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3. + +2001-03-23 Nick Clifton - Merge from mainline. - 2001-03-23 Nick Clifton * README-maintainer-mode: Add note about inability to use "make distclean" in maintainer mode. +2001-03-22 Alexandre Oliva + + Re-installed: + 2001-01-02 Laurynas Biveinis + * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add + '-DPIC' to ac_cv_prog_cc_pic for DJGPP. + * ltcf-cxx.sh: Likewise. + * ltcf-gcj.sh: Likewise. + 2001-03-22 Philip Blundell * config.sub, config.guess: Import latest from subversions. +2001-03-22 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198. + +2001-03-20 Michael Chastain + + * Makefile.in: all-m4 depends on all-texinfo. + +2001-03-08 Alexandre Oliva + + * Makefile.in (ALL_GCC, ALL_GCC_C, ALL_GCC_CXX): Set before use. + +2001-02-22 Jeff Johnston + + * COPYING.NEWLIB: Remove DJ Delorie's address because it is no + longer valid. + +2001-02-16 Nick Clifton + + * configure.in (noconfigdirs): Allow configuration of texinfo + for Cygwin hosts. + +2001-02-09 Martin Schwidefsky + + * config.guess: Add linux target for S/390. + * config.sub: Likewise. + * configure.in: Likewise. + +2001-02-06 Ben Elliston + + * configure: Output host type to stdout, not stderr. + +2001-02-04 Michael Sokolov + + * config.guess: Import from subversions.gnu.org (revision 1.181). + * config.sub: Import from subversions.gnu.org (revision 1.199). + 2001-01-30 Alan Modra * config.guess: Handle hppa64-linux systems. +2001-01-27 Michael Sokolov + + * ltcf-cxx.sh (ac_cv_prog_cc_pic_works, ac_cv_prog_cc_static_works): + Don't unset, it's non-portable and no longer necessary, set to empty + instead. + +2001-01-27 Michael Sokolov , Alexandre Oliva + + * ltconfig: Shell portability fix for the tagname validity check. + +2001-01-27 Michael Sokolov + + * ltcf-cxx.sh: Use parentheses around eval $ac_compile. + +2001-01-27 Alexandre Oliva + + * ltcf-c.sh (ld_shlibs) [aix5*]: Disable on unknown CPU types. + * ltcf-cxx.sh, ltcf-gcj.sh: Likewise. + 2001-01-24 Alexandre Oliva * ltmain.sh (TAG disable-shared, TAG disable-static): Make sure we @@ -86,12 +434,12 @@ or C++ library to have already been built to work properly. (do_proto_toplev): Set them to an empty string. -Sat Nov 18 18:57:50 2000 Alexandre Oliva +2000-11-18 Alexandre Oliva * Makefile.in (HOST_LIB_PATH, TARGET_LIB_PATH): New macros. (REALLY_SET_LIB_PATH): Use them. -Mon Nov 6 14:19:35 2000 Christopher Faylor +2000-11-06 Christopher Faylor * config.sub: Add support for Sun Chorus @@ -252,7 +600,7 @@ Mon Nov 6 14:19:35 2000 Christopher Faylor * symlink-tree: Check number of arguments. -Thu Jul 6 15:36:55 2000 Andrew Cagney +2000-06-06 Andrew Cagney * texinfo/texinfo.tex: Update to version 2000-05-28.15. @@ -282,11 +630,11 @@ Thu Jul 6 15:36:55 2000 Andrew Cagney * README-maintainer-mode: New file: Contains notes on using --enable-maintainer-mode with binutils. -Mon May 29 13:50:03 2000 Andrew Cagney +2000-05-29 Andrew Cagney * texinfo/texinfo.tex: Update. Version from makeinfo 4.0. -Tue May 30 19:01:12 2000 Andrew Cagney +2000-05-30 Andrew Cagney * config.sub: Import CVS version 1.167 Tue May 30 09:00:07 2000. * config.guess: Import CVS version 1.148 Tue May 30 09:00:06 2000 @@ -300,11 +648,11 @@ Tue May 30 19:01:12 2000 Andrew Cagney (GCC_FOR_TARGET): Likewise. (CXX_FOR_TARGET): Likewise. -Thu May 18 10:58:13 2000 Jeffrey A Law (law@cygnus.com) +2000-05-18 Jeffrey A Law (law@cygnus.com) * configure.in (hppa*64*-*-*): Do build ld for this configuration. -Wed May 17 16:03:48 2000 Alexandre Oliva +2000-05-17 Alexandre Oliva * Makefile.in (configure-target-libiberty): Depend on configure-target-newlib. @@ -314,12 +662,12 @@ Wed May 17 16:03:48 2000 Alexandre Oliva * configure.in, Makefile.in: Merge all libffi-related configury stuff from the libgcj tree. -Tue May 16 10:06:21 2000 Andrew Cagney +2000-05-16 Andrew Cagney Thu Apr 27 11:01:48 2000 Andrew Cagney : * Makefile.in (do-tar-bz2, do-md5sum): Skip CVS directories. -Tue May 16 09:57:35 2000 Andrew Cagney +2000-05-16 Andrew Cagney Wed Apr 26 17:03:53 2000 Andrew Cagney : * Makefile.in (do-djunpack): New target. Update djunpack.bat with @@ -335,11 +683,11 @@ Tue May 16 09:57:35 2000 Andrew Cagney * ltmain.sh: Preserve in relink_command any environment variables that may affect the linker behavior. -Fri May 12 11:23:17 2000 Jeffrey A Law (law@cygnus.com) +2000-05-12 Jeffrey A Law (law@cygnus.com) * config.sub (basic_machine): Recognize hppa64 as a valid cpu type. -Wed May 10 21:26:51 2000 Jim Wilson +2000-05-10 Jim Wilson * configure.in (ia64*-*-elf*): Add gdb and friends to noconfigdirs. @@ -356,7 +704,7 @@ Wed May 10 21:26:51 2000 Jim Wilson * djunpack.bat: New file. -Wed Apr 19 12:46:26 2000 Andrew Cagney +2000-04-19 Andrew Cagney * Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2, gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2, @@ -368,7 +716,7 @@ Wed Apr 19 12:46:26 2000 Andrew Cagney * config.sub (case $basic_machine): Change default for "ibm-*" to "openedition". -Wed Apr 12 16:42:48 2000 Andrew Cagney +2000-04-12 Andrew Cagney * Makefile.in (gdb-taz): New target. GDB specific archive. (do-md5sum): New target. @@ -382,7 +730,7 @@ Wed Apr 12 16:42:48 2000 Andrew Cagney (gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2): Use gdb-taz to create archive. -Fri Apr 7 18:10:29 2000 Andrew Cagney +2000-04-07 Andrew Cagney * configure (warn_cflags): Delete. @@ -403,7 +751,7 @@ Fri Apr 7 18:10:29 2000 Andrew Cagney * configure.in: -linux-gnu*, not -linux-gnu. -Fri Mar 3 18:44:08 2000 Andrew Cagney +2000-03-03 Andrew Cagney * Makefile.in (taz): Set PACKAGE to TOOL when not defined. (do-tar-bz2): Replace TOOL with PACKAGE. @@ -424,7 +772,7 @@ Fri Mar 3 18:44:08 2000 Andrew Cagney * config.sub: Support an OS of "wince". -Thu Feb 24 16:15:56 2000 Andrew Cagney +2000-02-24 Andrew Cagney * config.guess, config.sub: Updated to match config's 2000-02-15 version. @@ -451,7 +799,7 @@ Thu Feb 24 16:15:56 2000 Andrew Cagney * config.sub: Add support for avr target. -Tue Feb 1 00:07:46 2000 Hans-Peter Nilsson +2000-02-01 Hans-Peter Nilsson * config.sub: Add mmix-knuth-mmixware. @@ -630,11 +978,11 @@ Thu Jul 8 12:32:23 1999 John David Anglin * config.sub: Add mcore target. -Sun May 30 16:03:16 1999 Cort Dougan +1999-05-30 Cort Dougan * config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux. -Tue May 25 11:20:46 1999 H.J. Lu (hjl@gnu.org) +1999-05-25 H.J. Lu (hjl@gnu.org) * config.guess (dummy): Changed to $dummy. @@ -651,7 +999,7 @@ Tue May 25 11:20:46 1999 H.J. Lu (hjl@gnu.org) more accurately recorded in this ChangeLog. * config.sub: Likewise. -Thu May 20 10:00:42 1999 Stephen L Moshier +1999-05-20 Stephen L Moshier * Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include. @@ -679,13 +1027,13 @@ Tue Apr 13 22:50:54 1999 Donn Terry (donn@interix.com) * configure.in (i?86-*-beos*): Do config gperf; don't config gdb, newlib, or libgloss. -Sun Apr 11 23:55:34 1999 Alexandre Oliva +1999-04-11 Alexandre Oliva * config-ml.in: On mips*-*-*, if multidirs contains mabi=64, try to link a trivial program with -mabi=64. If it fails, remove mabi=64 from multidirs. -Sat Apr 10 21:50:01 1999 Philipp Thomas (kthomas@gwdg.de) +1999-04-10 Philipp Thomas (kthomas@gwdg.de) * config.sub: Set basic_machine to i586 when target_alias = k6-*. @@ -765,7 +1113,7 @@ Wed Mar 10 17:39:09 1999 Drew Moseley * config.sub: Rename CYGNUS LOCAL to EGCS LOCAL -Sun Feb 28 02:20:00 1999 Geoffrey Noer +1999-02-28 Geoffrey Noer * config.sub: Check for "cygwin*" rather than "cygwin32*" @@ -773,14 +1121,14 @@ Sun Feb 28 02:20:00 1999 Geoffrey Noer * config.sub: Fix typo in arm recognition. -Wed Feb 24 13:51:40 1999 Drew Moseley +1999-02-24 Drew Moseley * configure.in (noconfigdirs): Changed target_configdirs to include target-bsp only for m68k-*-elf* and m68k-*-coff* rather than m68k-*-* since it is not known to work on m68k-aout. Ditto for arm-*-*oabi. -Wed Feb 24 12:52:17 1999 Stan Shebs +1999-02-24 Stan Shebs * configure.in (*-*-windows*): Remove, no longer used. * config/mh-windows: Ditto. @@ -790,11 +1138,11 @@ Wed Feb 24 12:52:17 1999 Stan Shebs * config.guess: Automatically recognise ELF on FreeBSD. From Niall Smart and improved by Andrew Cagney. -Thu Feb 18 19:55:09 1999 Marc Espie +1999-02-18 Marc Espie * config.guess: Recognize openbsd-*-hppa. -Wed Feb 17 01:38:59 1999 H.J. Lu (hjl@gnu.org) +1999-02-17 H.J. Lu (hjl@gnu.org) * Makefile.in (REALLY_SET_LIB_PATH): Append $$$(RPATH_ENVVAR) only if it is not empty. @@ -811,7 +1159,7 @@ Wed Feb 17 01:38:59 1999 H.J. Lu (hjl@gnu.org) * configure.in: Added target-bsp for sparclite. -Mon Feb 8 14:17:24 1999 Richard Henderson +1999-02-08 Richard Henderson * config.sub: Recognize alphapca5[67] and up to alphaev8. @@ -820,51 +1168,51 @@ Mon Feb 8 14:17:24 1999 Richard Henderson * configure.in: Add support for strongarm port. * config.sub: Add support for strongarm target. -Sun Feb 7 18:01:54 1999 Mumit Khan +1999-02-07 Mumit Khan * configure.in (*-*-cygwin32*): Use config/mh-cygwin instead of the old name config/mh-cygwin32. Enable texinfo. -Thu Feb 4 20:43:25 1999 Ian Lance Taylor +1999-02-04 Ian Lance Taylor * configure.in: Do build ld for ix86 Solaris. -Tue Feb 2 19:46:40 1999 Jim Wilson +1999-02-02 Jim Wilson * Makefile.in (EXTRA_GCC_FLAGS): Set AR to $AR instead of $AR_FOR_TARGET. Likewise for RANLIB. -Tue Feb 2 20:05:05 1999 Catherine Moore +1999-02-02 Catherine Moore * config.sub (oabi): Recognize. * configure.in (arm-*-oabi): Handle. -Sat Jan 30 06:09:00 1999 Robert Lipe (robertlipe@usa.net) +1999-01-30 Robert Lipe (robertlipe@usa.net) * config.guess: Improve detection of i686 on UnixWare 7. -Sat Jan 30 08:04:00 1999 Mumit Khan +1999-01-30 Mumit Khan * config.guess: Add support for i386-pc-interix. * config.sub: Likewise. * configure.in: Likewise. * config/mh-interix: New file. -Mon Jan 18 13:59:20 1999 Christopher Faylor +1999-01-18 Christopher Faylor * Makefile.in: Remove unneeded all-target-libio from from all-target-winsup target since it is now unneeded. Add all-target-libtermcap in its place since it is now needed. -Wed Dec 30 20:34:52 1998 Christopher Faylor +1998-12-30 Christopher Faylor * configure.in: makefile stub for cygwin target is probably unnecessary. Remove it for now. * config/mt-cygwin: Remove. -Wed Dec 30 01:13:03 1998 Christopher Faylor +1998-12-30 Christopher Faylor * configure.in: libtermcap.a should be built when cygwin is the target as well as the host. @@ -872,11 +1220,11 @@ Wed Dec 30 01:13:03 1998 Christopher Faylor * Makefile.in: Add libtermcap target. * config/mt-cygwin: New file. libtermcap target info. -Wed Dec 23 00:20:50 1998 Jeffrey A Law (law@cygnus.com) +1998-12-23 Jeffrey A Law (law@cygnus.com) * config.sub: Clean up handling of hppa2.0. -Tue Dec 22 23:56:31 1998 Rodney Brown (rodneybrown@pmsc.com) +1998-12-22 Rodney Brown (rodneybrown@pmsc.com) * config.guess: Use C code to identify more HP machines. @@ -924,7 +1272,7 @@ Wed Nov 18 20:13:29 1998 Christopher Faylor * configure.in: Add libtermcap to list of cygwin dependencies. -Tue Nov 17 16:57:51 1998 Geoffrey Noer +1998-11-17 Geoffrey Noer * Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that they include winsup/include when it's a cygwin target. @@ -939,25 +1287,25 @@ Tue Nov 17 16:57:51 1998 Geoffrey Noer (INSTALL_MODULES): Added install-zip. (CLEAN_MODULES): Added clean-zip. -Thu Nov 12 17:27:21 1998 Geoffrey Noer +1998-11-12 Geoffrey Noer * Makefile.in: lose "32" from comment about cygwin. -Thu Nov 5 15:00:31 1998 Nick Clifton +1998-11-05 Nick Clifton * configure.in: Use -Os to build target libraries for the fr30. -Wed Nov 4 18:49:43 1998 Dave Brolley +1998-11-04 Dave Brolley * config.sub: Add fr30. -Mon Nov 2 15:19:33 1998 Geoffrey Noer +1998-11-02 Geoffrey Noer * configure.in: drop "32" from config/mh-cygwin32. Check cygwin* instead of cygwin32*. * config.sub: Check cygwin* instead of cygwin32*. -Thu Oct 22 10:55:25 1998 Robert Lipe +1998-10-22 Robert Lipe * config.guess: Match any version of Unixware7. @@ -966,16 +1314,16 @@ Thu Oct 22 10:55:25 1998 Robert Lipe * Makefile.in configure.in: Add the ability to use tcl8.1 and tk8.1 if desired. -Sun Oct 18 18:34:50 1998 Jeffrey A Law (law@cygnus.com) +1998-10-18 Jeffrey A Law (law@cygnus.com) * config.if (cxx_interface, libstdcxx_interface): Do not try to set these if the appropriate directories and files to not exist. -Wed Oct 14 10:29:06 1998 Jeffrey A Law (law@cygnus.com) +1998-10-14 Jeffrey A Law (law@cygnus.com) * Makefile.in (DEVO_SUPPORT): Add config.if. -Tue Oct 13 15:45:36 1998 Manfred Hollstein +1998-10-13 Manfred Hollstein * configure: Add pattern to replace "build_tooldir"'s definition in the generated Makefile with "tooldir"'s @@ -7273,7 +7621,7 @@ Fri Dec 13 01:17:06 1991 K. Richard Pixley (rich at cygnus.com) * config.subr: resync from rms. -Wed Dec 11 22:25:20 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-11 K. Richard Pixley (rich at rtl.cygnus.com) * configure, config.sub, config.subr: merge config.sub into config.subr, call the result config.subr, remove config.sub, use @@ -7281,7 +7629,7 @@ Wed Dec 11 22:25:20 1991 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: revised install for dir.info. -Tue Dec 10 00:04:35 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) * configure.in: add decstation host makefile frag. @@ -7290,11 +7638,11 @@ Tue Dec 10 00:04:35 1991 K. Richard Pixley (rich at rtl.cygnus.com) Make directories for info install. Build dir.info here then install it. -Mon Dec 9 16:48:33 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-09 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: fix for bad directory tests. -Sat Dec 7 00:17:01 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-07 K. Richard Pixley (rich at rtl.cygnus.com) * configure: \{1,2\} appears to be a sysv'ism. Use a different regexp. -srcdir relative was being handled incorrectly. @@ -7303,13 +7651,13 @@ Sat Dec 7 00:17:01 1991 K. Richard Pixley (rich at rtl.cygnus.com) work again and so one can focus one's attention on a particular package. -Fri Dec 6 00:22:08 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) * configure: added PWD as a stand in for `pwd` (for speed). use elif wherever possible. make -srcdir work without -objdir. -objdir= commented out. -Thu Dec 5 22:46:52 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com) * configure: +options become --options. -subdirs commented out. added -host, -datadir. Renamed -destdir to -prefix. Comment in @@ -7321,7 +7669,7 @@ Thu Dec 5 22:46:52 1991 K. Richard Pixley (rich at rtl.cygnus.com) and shift gpl to v2. Added ChangeLog if it didn't exist. docdir and mandir now keyed off datadir by default. -Fri Nov 22 07:38:11 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-11-22 K. Richard Pixley (rich at rtl.cygnus.com) * Freshly created ChangeLog. diff --git a/contrib/binutils/MAINTAINERS b/contrib/binutils/MAINTAINERS index 16dab80..75f3240 100644 --- a/contrib/binutils/MAINTAINERS +++ b/contrib/binutils/MAINTAINERS @@ -21,18 +21,21 @@ cgen/; cgen parts of opcodes/, sim/ & include/ May need separate opcodes/ or sim/ approval for commits of regenerated files there. -config.guess; config.sub - config: http://gnu.org +config.guess; config.sub; dejagnu/config.guess; +readline/support/config.sub; readline/support/config.guess + config: http://savannah.gnu.org/projects/config Patches to config-patches@gnu.org. Changes need to be done in tandem with the official CONFIG sources or submitted to the master file maintainer and brought in via a merge. + Please notify the following of any committed patches: + binutils@sources.redhat.com + gdb-patches@sources.redhat.com dejagnu/ Notify http://dejagnu.sourceforge.net/ of generic changes. - Generic patches to gdb-patches@sources.redhat.com & - sid@sources.redhat.com. - See also SID & GDB. + Generic patches to gdb-patches@sources.redhat.com; + Other dependents of dejagnu include sid@, binutils@, gcc@, etc. gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/ gdb: http://sources.redhat.com/gdb/ @@ -46,7 +49,11 @@ libiberty/; libiberty's part of include/ gcc: http://gcc.gnu.org Changes need to be done in tandem with the official GCC sources or submitted to the master file maintainer and brought - in via a merge. + in via a merge. Note: approved patches in gcc's libiberty + are automatically approved in this libiberty also; feel free + to merge them yourself if needed sooner than the next merge. + Otherwise, changes are automatically merged, usually within + a day. ltconfig; ltmain.sh libtool: http://gnu.org @@ -54,13 +61,17 @@ ltconfig; ltmain.sh sources or submitted to the master file maintainer and brought in via a merge. -mkinstalldirs; move-if-change; symlink-tree +mkinstalldirs; move-if-change autoconf: http://gnu.org Patches to autoconf-patches@gnu.org. Changes need to be done in tandem with the official AUTOCONF sources or submitted to the master file maintainer and brought in via a merge. +symlink-tree + gcc: http://gcc.gnu.org + See libiberty. + newlib/; libgloss/ http://sources.redhat.com/newlib/ Patches to newlib@sources.redhat.com. @@ -89,7 +100,7 @@ expect/; config-ml.in; mpw-README; mpw-build.in; mpw-config.in; mpw-configure; mpw-install; setup.com; missing; makefile.vms; utils/; config/; config.if; makefile.vms; missing; ylwrap; mkdep; etc/; install-sh; intl/ - Ask. + Ask DJ Delorie after reading the libiberty entry. modules file Obviously changes to this file should not go through diff --git a/contrib/binutils/Makefile.in b/contrib/binutils/Makefile.in index d4ae7e9..e48d98a 100644 --- a/contrib/binutils/Makefile.in +++ b/contrib/binutils/Makefile.in @@ -141,9 +141,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \ then echo $$r/m4/m4 ; \ else echo ${DEFAULT_M4} ; fi` +# For an installed makeinfo, we require it to be from texinfo 4 or +# higher, else we use the "missing" dummy. MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \ then echo $$r/texinfo/makeinfo/makeinfo ; \ - else echo makeinfo ; fi` + else if (makeinfo --version \ + | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \ + then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` # This just becomes part of the MAKEINFO definition passed down to # sub-makes. It lets flags be given on the command line while still @@ -175,8 +179,16 @@ TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstd # Changed by configure to $(target_alias) if cross. TARGET_SUBDIR = . -# This is set by the configure script to the arguments passed to configure. -CONFIG_ARGUMENTS = +BUILD_CONFIGDIRS = libiberty +BUILD_SUBDIR = . + +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = + +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared # was used. @@ -220,6 +232,7 @@ FLAGS_FOR_TARGET = CC_FOR_TARGET = CHILL_FOR_TARGET = CXX_FOR_TARGET = +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = # If GCC_FOR_TARGET is not overriden on the command line, then this # variable is passed down to the gcc Makefile, where it is used to @@ -230,8 +243,10 @@ GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) AS_FOR_TARGET = ` \ if [ -f $$r/gas/as-new ] ; then \ echo $$r/gas/as-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=as ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(AS); \ else \ t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \ @@ -241,8 +256,10 @@ AS_FOR_TARGET = ` \ LD_FOR_TARGET = ` \ if [ -f $$r/ld/ld-new ] ; then \ echo $$r/ld/ld-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=ld ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(LD); \ else \ t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \ @@ -253,7 +270,7 @@ DLLTOOL_FOR_TARGET = ` \ if [ -f $$r/binutils/dlltool ] ; then \ echo $$r/binutils/dlltool ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(DLLTOOL); \ else \ t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \ @@ -264,7 +281,7 @@ WINDRES_FOR_TARGET = ` \ if [ -f $$r/binutils/windres ] ; then \ echo $$r/binutils/windres ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(WINDRES); \ else \ t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \ @@ -275,7 +292,7 @@ AR_FOR_TARGET = ` \ if [ -f $$r/binutils/ar ] ; then \ echo $$r/binutils/ar ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(AR); \ else \ t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \ @@ -286,8 +303,12 @@ RANLIB_FOR_TARGET = ` \ if [ -f $$r/binutils/ranlib ] ; then \ echo $$r/binutils/ranlib ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ - echo $(RANLIB); \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ x'$(RANLIB)' != x ]; then \ + echo $(RANLIB); \ + else \ + echo ranlib; \ + fi; \ else \ t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \ fi; \ @@ -296,8 +317,10 @@ RANLIB_FOR_TARGET = ` \ NM_FOR_TARGET = ` \ if [ -f $$r/binutils/nm-new ] ; then \ echo $$r/binutils/nm-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=nm ; \ else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ echo $(NM); \ else \ t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \ @@ -385,6 +408,14 @@ BASE_FLAGS_TO_PASS = \ "target_alias=$(target_alias)" \ "libsubdir=$(libsubdir)" +# For any flags above that may contain shell code that varies from one +# target library to another. When doing recursive invocations of the +# top-level Makefile, we don't want the outer make to evaluate them, +# so we pass these variables down unchanged. They must not contain +# single nor double quotes. +RECURSE_FLAGS = \ + CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' + # Flags to pass down to most sub-makes, in which we're building with # the host environment. # If any variables are added here, they must be added to do-*, below. @@ -466,6 +497,18 @@ EXTRA_GCC_FLAGS = \ GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) # This is a list of the targets for all of the modules which are compiled +# using the build machine's native compiler. Configure edits the second +# macro for build!=host builds. +ALL_BUILD_MODULES_LIST = \ + all-build-libiberty +ALL_BUILD_MODULES = + +# This is a list of the configure targets for all of the modules which +# are compiled using the native tools. +CONFIGURE_BUILD_MODULES = \ + configure-build-libiberty + +# This is a list of the targets for all of the modules which are compiled # using $(FLAGS_TO_PASS). ALL_MODULES = \ all-apache \ @@ -931,6 +974,7 @@ CLEAN_X11_MODULES = \ # The target built for a native build. .PHONY: all.normal all.normal: \ + $(ALL_BUILD_MODULES) \ $(ALL_MODULES) \ $(ALL_X11_MODULES) \ $(ALL_TARGET_MODULES) \ @@ -964,16 +1008,15 @@ $(DO_X): case $$i in \ gcc) \ for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ done; \ ;; \ *) \ for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ done; \ ;; \ esac ; \ - 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}" "LD=$${LD}" "NM=$${NM}" \ @@ -990,9 +1033,8 @@ $(DO_X): for i in $(TARGET_CONFIGDIRS) -dummy-; do \ if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ done; \ - 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}" "LD=$${LD}" "NM=$${NM}" \ @@ -1174,6 +1216,106 @@ gcc-no-fixedincludes: mv gcc/tmp-include gcc/include 2>/dev/null; \ else true; fi +# This rule is used to build the modules which are built with the +# build machine's native compiler. +.PHONY: $(ALL_BUILD_MODULES) +$(ALL_BUILD_MODULES): + dir=`echo $@ | sed -e 's/all-build-//'`; \ + if [ -f ./$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \ + else \ + true; \ + fi + +# This rule is used to configure the modules which are built with the +# native tools. +.PHONY: $(CONFIGURE_BUILD_MODULES) +$(CONFIGURE_BUILD_MODULES): + @dir=`echo $@ | sed -e 's/configure-build-//'`; \ + if [ ! -d $(BUILD_SUBDIR) ]; then \ + true; \ + elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \ + true; \ + elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ + if [ -d $(srcdir)/$${dir} ]; then \ + [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\ + r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + echo Configuring in $(BUILD_SUBDIR)/$${dir}; \ + cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/$${dir}"; \ + libsrcdir="$$s/$${dir}"; \ + fi; \ + if [ -f $${libsrcdir}/configure ] ; then \ + rm -f no-such-file skip-this-dir; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)"; \ + else \ + rm -f no-such-file skip-this-dir; \ + CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)"; \ + fi || exit 1; \ + if [ -f skip-this-dir ] ; then \ + sh skip-this-dir; \ + rm -f skip-this-dir; \ + cd ..; rmdir $${dir} || true; \ + else \ + true; \ + fi; \ + else \ + true; \ + fi; \ + 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. # @@ -1198,7 +1340,7 @@ $(ALL_MODULES) all-gui all-libproc: .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) $(NATIVE_CHECK_MODULES): - @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ dir=`echo $@ | sed -e 's/check-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ @@ -1318,12 +1460,12 @@ $(CONFIGURE_TARGET_MODULES): if [ -f $${libsrcdir}/configure ] ; then \ rm -f no-such-file skip-this-dir; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(CONFIG_ARGUMENTS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ --with-target-subdir="$(TARGET_SUBDIR)"; \ else \ rm -f no-such-file skip-this-dir; \ CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ - $(CONFIG_ARGUMENTS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ --with-target-subdir="$(TARGET_SUBDIR)"; \ fi; \ if [ -f skip-this-dir ] ; then \ @@ -1349,7 +1491,8 @@ $(ALL_TARGET_MODULES): r=`pwd`; export r; \ s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ + (cd $(TARGET_SUBDIR)/$${dir}; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ else \ true; \ fi @@ -1363,7 +1506,8 @@ $(CHECK_TARGET_MODULES): r=`pwd`; export r; \ s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ + (cd $(TARGET_SUBDIR)/$${dir}; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ else \ true; \ fi @@ -1478,7 +1622,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b s=`cd $(srcdir); pwd` ; export s; \ $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ - $(MAKE) $(BASE_FLAGS_TO_PASS) all + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all .PHONY: cross cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld @@ -1491,7 +1635,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld s=`cd $(srcdir); pwd` ; export s; \ $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ - $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++" + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ + LANGUAGES="c c++" all .PHONY: check-gcc check-gcc: @@ -1542,6 +1687,9 @@ install-dosrel: installdirs info install-dosrel-fake: +ALL_GCC = all-gcc +ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss +ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3 # This is a list of inter-dependencies among modules. all-apache: @@ -1578,17 +1726,14 @@ all-flex: all-libiberty all-bison all-byacc all-gas: all-libiberty all-opcodes all-bfd all-intl all-gash: all-tcl all-gawk: -ALL_GCC = all-gcc -ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss -ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib 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_C) -all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++ +configure-target-gperf: $(ALL_GCC_CXX) +all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3 all-gprof: all-libiberty all-bfd all-opcodes all-intl all-grep: all-libiberty all-grez: all-libiberty all-bfd all-opcodes @@ -1611,6 +1756,9 @@ all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libib check-target-libio: all-target-libstdc++ all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl all-libiberty: + +all-build-libiberty: configure-build-libiberty + configure-target-libffi: $(ALL_GCC_C) all-target-libffi: configure-target-libffi configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi @@ -1630,7 +1778,7 @@ configure-target-libchill: $(ALL_GCC_C) all-target-libchill: configure-target-libchill all-target-libiberty configure-target-libobjc: $(ALL_GCC_C) all-target-libobjc: configure-target-libobjc all-target-libiberty -all-m4: all-libiberty +all-m4: all-libiberty all-texinfo all-make: all-libiberty all-mmalloc: configure-target-newlib: $(ALL_GCC) @@ -1743,8 +1891,12 @@ VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ - else \ + elif test -f $(TOOL)/version.in; then \ + head -1 $(TOOL)/version.in; \ + elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \ sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ + else \ + echo VERSION; \ fi` PACKAGE = $(TOOL) @@ -1836,6 +1988,11 @@ do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex else true; fi chmod -R og=u . || chmod og=u `find . -print` # + # Create .gmo files from .po files. + for f in `find . -name '*.po' -type f -print`; do \ + msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \ + done + # -rm -f $(PACKAGE)-$(VER) ln -s proto-toplev $(PACKAGE)-$(VER) diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index d782ee5..b7a2496 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,5003 +1,467 @@ -2001-10-24 Richard Henderson +2002-01-26 Hans-Peter Nilsson - * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy - timestamp to time_t for ctime. - -2001-10-24 Richard Henderson - - 2001-08-23 Jakub Jelinek - * elfxx-ia64.c (elfNN_ia64_hash_table_create): Clear ia64_info. - -2001-10-06 Stephane Carrez - - * dwarf2.c (comp_unit_find_nearest_line): Check for end of - compilation unit. - -2001-08-29 Joel Sherrill - - * config.bfd (i[3456]86-*-rtems*, m68*-*-rtems*): Change - default from coff to elf. - -2001-08-03 Ben Harris - - * elf32-arm.h (elf32_arm_final_link_relocate): Include offset of - reloc from start of section when computing value for R_ARM_REL32 - reloc. - -2001-07-06 Philip Blundell - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct sense of - `interworking' warning message. - -2001-07-05 Nick Clifton - - * peicode.h (coff_swap_scnhdr_in): For sections containing - uninitialised data, only set their size to s_paddr if this does - not reset their size to zero. MS's latest compilers will set - s_paddr to zero. - -2001-06-20 Bo Thorsen - - * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of - shared libraries. - -2001-06-21 Alan Modra - - * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always - allocate local .got space. Use shortcuts from hash table for .got - and .plt rather than comparing section names. - (elf32_hppa_check_relocs): Use local_plt_refcounts var rather than - adjusting index into local_got_refcounts to document what we are - really doing. - (elf32_hppa_relocate_section): Similarly for local_plt_offsets. - Tidy .got and .plt error checking. - -2001-06-19 Philip Blundell - - * configure.in: Set version to 2.11.2. - * configure: Regenerate. - -2001-06-19 Andreas Jaeger - - Merge from mainline sources: - 2001-06-19 Andreas Jaeger - * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of - dynamic symbols. - 2001-06-07 Andreas Jaeger - * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an - assertion. - (elf64_x86_64_check_relocs): Set an alignment of 8 for .rela - sections; handle further relocations. - 2001-06-01 Andreas Jaeger - * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8 - relocation, small reformatting. - -2001-06-14 Nick Clifton - - Merge from mainline sources: - 2001-04-27 Sean McNeil - * config.bfd: Add arm-vxworks target. - * coff-arm (coff_arm_relocate_section): Add in symbol value to - addend (fro VXworks targets). - 2001-03-06 Nick Clifton - * elf32-arm.h (elf32_arm_final_link_relocate): Clear bit zero - of offset in BLX(1) instruction. - * coff-arm.c (coff_arm_relocate_section): Clear bit zero of - offset in BLX(1) instruction. - Fix formatting. - 2001-03-06 Nick Clifton - * coff-arm.c (coff_arm_reloc_type_lookup): Add - BFD_RELOC_THUMB_PCREL_BLX. - 2001-05-04 Nick Clifton - * elf32-arm.h (elf32_arm_final_link_relocate): Set - EF_ARM_HASENTRY if the start address is set. - -2001-06-11 Alan Modra - - * configure.in (): Move powerpc-*-*bsd* after - powerpc-*-freebsd*. - - Merge from mainline. - 2001-06-02 H.J. Lu - * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX - and ELFOSABI_HPUX. - * elf64-hppa.c (elf64_hppa_object_p): Likewise. - - 2001-06-02 Hans-Peter Nilsson - * section.c (_bfd_strip_section_from_output): Handle NULL - output_section. - - 2001-05-30 Alan Modra - * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for - millicode. Don't allocate .got and .rela.got space here.. - (elf32_hppa_gc_sweep_hook): ..and no need to deallocate here.. - (elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and - .rela.plt here.. - (hppa_handle_PIC_calls): ..nor here.. - (allocate_plt_and_got): ..instead do it all here. New function. - (elf32_hppa_size_dynamic_sections): Allocate local .got space and - call allocate_plt_and_got. No need to zap .got if not dynamic. - (elf32_hppa_final_link): Call regular bfd_final_link instead of - gc_common_final_link. - (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. - (elf32_hppa_relocate_section): Use it here. - (elf32_hppa_finish_dynamic_symbol): Remove superfluous test of - dynamic_sections_created. - (hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym. - - 2001-05-28 Thiemo Seufer - * elflink.h (elf_link_size_reloc_section): Use bfd_zmalloc instead of - a zeroing loop. - (elf_link_output_relocs): Handle MIPS ELF64 relocations correctly. - (elf_link_input_bfd): Likewise. - (elf_reloc_link_order): Likewise. - (elf_finish_pointer_linker_section): Typo. Handle MIPS ELF64 - relocations correctly. - - 2001-05-28 Alan Modra - * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries - for symbols forced local that need plabels. - (elf32_hppa_adjust_dynamic_symbol): Don't allocate space in - .plt.rela for local syms if non-shared. - (hppa_build_one_stub): Mask lsb of plt.offset. - (elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set. - (clobber_millicode_symbols): Correct comment. - (elf32_hppa_relocate_section): Likewise. - (elf32_hppa_finish_dynamic_symbol): Likewise. - - 2001-05-25 Alan Modra - * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow - undefined millicode syms in shared libs. - (hppa_build_one_stub): Turn BFD_ASSERTs into aborts. - (elf32_hppa_check_relocs): Likewise. - (elf32_hppa_adjust_dynamic_symbol): Likewise. - (elf32_hppa_size_dynamic_sections): Likewise. - (elf32_hppa_relocate_section): Likewise. - (elf32_hppa_finish_dynamic_symbol): Likewise. - (elf32_hppa_finish_dynamic_sections): Likewise. - - 2001-05-23 Alexandre Oliva - * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo - s/ENTIRES/ENTRIES/. - - 2001-05-23 Thiemo Seufer - * reloc.c (bfd_reloc_code_real): Add MIPS ELF64 relocations. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - * aoutx.h (aout_@var{size}_machine_type): Add MIPS r12k support. - * archures.c (bfd_mach_mips12000): Define. - * cpu-mips.c (arch_info_struct): Add MIPS r12k support. - * elf32-mips.c (_bfd_mips_elf_final_write_processing): Add MIPS r12k - support. - (_bfd_mips_elf_size_dynamic_sections): Use official bfd typedef. - * bfd-in2.h: Regenerate. - * elfxx-target.h: Do not redefine bfd_elfNN_bfd_make_debug_symbol. - - 2001-05-23 Nick Clifton - * elf-bfd.h (NUM_SHDR_ENTRIES): New macro: compute the number - of entries in a structured section. - * elf.c: Use new macro. - * elf32-i386.c: Use new macro. - * elf32-mips.c: Use new macro. - * elf64-alpha.c: Use new macro. - * elf64-sparc.c: Use new macro. - * elfcode.h: Use new macro. - * elflink.h: Use new macro. - - 2001-05-21 Andreas Jaeger - * dwarf2.c (decode_line_info): Fix error message. - (read_abbrevs): Fix test for offset as suggested by Alan Modra and - adjust error message. - - 2001-05-17 H.J. Lu - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the - version definition to basename of the output filename. - - 2001-05-15 Alexandre Oliva - * elf-m10300.c (mn10300_elf_relax_section): Don't relax - negative 32-bit operands to 16 operands when the operand is - going to be zero-extended by the modified opcode. - - 2001-05-11 Jakub Jelinek - * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind - sections as well. - (elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO - to .gnu.linkonce.t.FOO text section. - - 2001-05-11 Nick Clifton - * dwarf1.c (_bfd_dwarf1_find_nearest_line): Change type of 'addr' - to be unsigned long, in order to match its use. - - 2001-05-10 H.J. Lu - * linker.c (_bfd_generic_link_add_one_symbol): Check loop on - indirect symbols. - - 2001-05-09 H.J. Lu - * elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate - versymhdr->sh_size bytes for extversym instead of hdr->sh_size. - Remove the unused veriable `dynver'. - - 2001-05-07 Thiemo Seufer - * elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it - is always a positive integer. Cast away sign mismatch. - * elf32-mips.c: Fix misleading comment and typo. - (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use - correct data type. - * elflink.c: Fix typo. - (_bfd_elf_create_dynamic_sections): Remove superfluous initialization. - * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch. - - 2001-05-03 Nick Clifton - * targets.c (_bfd_target_vector_entries): Compute value based on - the size of the _bfd_target_vector and not bfd_target_vector. - - 2001-05-03 Andreas Jaeger - * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute. - (elf_generic_info_to_howto_rel): Likewise. - * coff-alpha.c (reloc_nil): Likewise. - (alpha_ecoff_bad_format_hook): Likewise. - (alpha_adjust_reloc_out): Likewise. - (alpha_bfd_reloc_type_lookup): Likewise. - (alpha_convert_external_reloc): Likewise. - * elf64-alpha.c (elf64_alpha_reloc_nil): Likewise. - (elf64_alpha_reloc_bad): Likewise. - (elf64_alpha_reloc_gpdisp): Likewise. - (elf64_alpha_bfd_reloc_type_lookup): Likewise. - (elf64_alpha_info_to_howto): Likewise. - (elf64_alpha_add_symbol_hook): Likewise. - (elf64_alpha_create_got_section): Likewise. - (elf64_alpha_is_local_label_name): Likewise. - (elf64_alpha_merge_ind_symbols): Likewise. - * elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise. - (mips_elf64_get_reloc_upper_bound): Likewise. - * nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise. - (nlm_alpha_get_public_offset): Likewise. - - 2001-04-30 H.J. Lu - * elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1 - only for ELF_LINK_FORCED_LOCAL. - * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. - * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise. - * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. - * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL - if the symbol has hidden or internal visibility. - - 2001-04-14 Mark Elbrecht - * coffcode.h (coff_write_object_contents): Use - bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out. - - 2001-04-09 Hans-Peter Nilsson - * elflink.h (elf_fix_symbol_flags): For non-default visibilities, - only hide symbols marked STV_INTERNAL or STV_HIDDEN. - - 2001-04-05 Steven J. Hill - * config.bfd (mips*el*-*-linux-gnu*): Use traditional little - endian MIPS ELF target. - (mips*-*-linux-gnu*): Use traditional big endian MIPS ELF target. - * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional - 64bit big endian MIPS ELF target. - (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little - endian MIPS ELF target. - * configure: Regenerated. - * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and - little endian targets. - (mips_elf_sym_is_global): Handle traditional targets. - * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional - 64bit big endian MIPS ELF target. - (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little - endian MIPS ELF target. - * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec - and bfd_elf64_tradlittlemips_vec. - - 2001-04-04 Alan Modra - * elflink.h (elf_fix_symbol_flags): Call elf_backend_hide_symbol - when -Bsymbolic causes a symbol to no longer need a .plt entry. - - 2001-04-03 David Mosberger - * efi-app-ia32.c (ALIGN_SECTIONS_IN_FILE): Deleted. - - 2001-03-30 H.J. Lu - * efi-app-ia32.c (PEI_TARGET_SUBSYSTEM): Rename from ... - (PEI_DEFAULT_TARGET_SUBSYSTEM): This. - - 2001-03-23 Nick Clifton - * Makefile.am (BUILD_CFILES): New variable: List of C source - files created in build directory. - (BUILD_HFILES): New variable: List of header files created in - build directory. - (POTFILES): Delete. - (po/POTFILES.in): Replace rule with empty entry. - (po/SRC-POTFILES.in): New rule: Create a list of source files - in the source directory. - (po/BLD-POTFILES.in): New rule: Create a list of source files - in the build directory. - (MOSTLYCLEAN): Do not delete source files created in build - directory. - * Makefile.in: Regenerate. - * configure.in: Insert SRC-POTFILES.in and BLD-POTFILES.in - into po/Makefile. - * configure: Regenerate. - * po/Make-in: Replace occurrences of POTFILES with SRC-POTFILES - and BLD_POTFILES. - Add .. to the search path when building bfd.pot. - Delete POTFILES when performing distclean. - Add comment describing why distclean is broken in maintainer mode. - * po/POTFILES.in: Delete. - * po/SRC-POTFILES.in: New file. - * po/BLD-POTFILES.in: New file. - * po/bfd.pot: Regenerate. - - 2001-03-06 Igor Shevlyakov - * archures.c (bfd_default_scan): Add Coldfire CPUs. - * bfd-in2.h: Regenerate. - * cpu-m68k.c: Add Coldfire CPUs for arch table. - * ieee.c (ieee_write_processor): Set proper id for - Coldfire CPUs. - - 2001-02-27 H.J. Lu - * aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if - abfd->tdata.aout_data == NULL. - - 2001-02-26 Nick Clifton - * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Tidy - up, replacing multiple if statements with a switch. - (handle_COMDAT): New function. - - 2001-02-26 H.J. Lu - * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Issue - a warning for section flags we do not handle instead of - aborting. - - 2001-02-19 Jakub Jelinek - * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT - entries that could serve as a definition for a weak symbol. - * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise. - - 2001-02-18 Jim Kingdon - * irix-core.c (irix_core_core_file_p): Set the architecture (GDB - multiarch needs it). - - 2001-02-18 H.J. Lu - * elflink.h (elf_link_input_bfd): Ignore invalid section symbol - index. - - 2001-02-18 Kazu Hirata - * vms-misc.c: Fix formatting. - - 2001-02-16 Kazu Hirata - * vms.c: Fix formatting. - - 2001-02-14 H.J. Lu - * elf.c (elf_find_function): New function. - (_bfd_elf_find_nearest_line): Call elf_find_function () to find - the file name and function name. - - 2001-02-14 Nick Clifton - * Makefile.am (BFD32_BACKENDS_CFILES): Remove peigen.c - (BFD64_BACKENDS): Add pepigen.c - Add rules to create peigen.c and pepigen.c from peXXigen.c. - - 2001-02-14 H.J. Lu - * libcoff-in.h (pe_tdata): Add members target_subsystem and - force_minimum_alignment. - - 2001-02-13 Kazu Hirata - * vms.c (vms_print_symbol): Remove unreachable code. - * rs6000-core.c: Fix formatting. - - 2001-02-13 David Mosberger - * peicode.h (coff_swap_filehdr_out) [COFF_IMAGE_WITH_PE]: Define - as _bfd_XXi_only_swap_filehdr_out. - (pe_mkobject) [PEI_FORCE_MINIMUM_ALIGNMENT]: Set - pe->force_minimum_alignment to TRUE. - (pe_mkobject) [PEI_TARGET_SUBSYSTEM]: Set pe->target_subsystem to - PEI_TARGET_SUBSYSTEM. - (pe_print_private_bfd_data): Call - _bfd_XX_print_private_bfd_data_common() instead of - _bfd_pe_print_private_bfd_data_common(). - (pe_bfd_copy_private_bfd_data): Call - _bfd_XX_bfd_copy_private_bfd_data_common() instead of - _bfd_pe_bfd_copy_private_bfd_data_common(). - (coff_bfd_copy_private_section_data): Define as - _bfd_XX_bfd_copy_private_section_data instead of - _bfd_pe_bfd_copy_private_section_data. - (coff_get_symbol_info): Define as _bfd_XX_get_symbol_info instead - of a _bfd_pe_get_symbol_info. - * peigen.c: Delete. - * peXXigen.c: Renamed from peigen.c. - (COFF_WITH_XX): Define this macro (will get expanded into - COFF_WITH_pep or COFF_WITH_pe, depending on whether this is being - compiled as peigen.c or pepigen.c. - [COFF_WITH_pep]: Include "coff/ia64.h" instead of "coff/i386.h" to - define the canonical PEP structures and definitions. - (_bfd_XXi_swap_aouthdr_out): If pe->force_minimum_alignment is in - effect, enforce minimum file and section alignments. If - extra->Subsystem is IMAGE_SUBSYSTEM_UNKNOWN, set it to - pe->target_subsystem (this defaults to IMAGE_SUBSYSTEM_UNKNOWN, - so, by default, this is a no-op). - * libpei.h: Rename COFF_WITH_PEP to COFF_WITH_pep. - (_bfd_XX_bfd_copy_private_bfd_data_common): Add macros to map - _bfd_XXfoo to _bfd_pepfoo if COFF_WIT_PEP is defined and to - _bfd_pefoo if it's not defined. Use these macros to define - coff swap macros. - * libcoff.h (pe_tdata): Add members target_subsystem and - force_minimum_alignment. - * efi-app-ia64.c (COFF_WITH_pep): Rename COFF_WITH_PEP to - COFF_WITH_pep. - (PEI_TARGET_SUBSYSTEM): Rename from PEI_DEFAULT_TARGET_SUBSYSTEM. - * configure.in (bfd_efi_app_ia64_vec): Use pepigen.lo instead of - peigen.lo. - * coff-ia64.c: Rename COFF_WITH_PEP to COFF_WITH_pep. - (AOUTSZ): Rename PEP64AOUTSZ and PEP64AOUTHDR to PEPAOUTSZ and - PEPAOUTHDR. - * Makefile.in (BFD64_BACKENDS): Mention pepigen.lo. - (BFD64_BACKENDS_CFILES): Mention pepigen.c - (peigen.c): Add rule to generate from peXXigen.c. - (pepigen.c): Ditto. - (pepigen.lo): List dependencies for pepigen.lo. - - 2001-02-11 H.J. Lu - * elflink.h (elf_bfd_final_link): Use file_align for SYMTAB - alignment. - - 2001-02-11 Maciej W. Rozycki - * elf32-mips.c (mips_elf_create_dynamic_relocation): Undo patch - from 2000-10-13. Do not add the symbol's value for R_MIPS_REL32 - relocations against dynsym symbols. - * elf32-mips.c (elf_mips_howto_table): Fix the comment on - the R_MIPS_26 relocation. - (mips_elf_calculate_relocation): Use (p + 4) instead of p for - the R_MIPS_26 relocation. - (mips_elf_perform_relocation): Fix the comment on the R_MIPS16_26 - relocation. - * elf64-mips.c (mips_elf64_howto_table_rel): Fix the comment on - the R_MIPS_26 relocation. - (mips_elf64_howto_table_rela): Likewise. - * elf32-mips.c (struct mips_elf_link_hash_entry): Added no_fn_stub - member to mark symbols that have non-CALL relocations against - them. - (mips_elf_link_hash_newfunc): Initialize no_fn_stub. - (mips_elf_calculate_relocation): Handle R_MIPS_CALL16 like - R_MIPS_GOT16. - (_bfd_mips_elf_check_relocs): Set no_fn_stub for a symbol if a - non-CALL relocation against it is encountered. - (_bfd_mips_elf_copy_indirect_symbol): Merge no_fn_stub as well. - (_bfd_mips_elf_adjust_dynamic_symbol): Only create a stub if - no_fn_stub is not set. - * elf32-mips.c (mips_elf_output_extsym): Get the output section - information from the real symbol for indirect ones. - Check no_fn_stub to find out if a symbol has a function stub - indeed. - - 2001-02-09 Jakub Jelinek - * elf64-sparc.c (sparc64_elf_copy_private_bfd_data): New function. - - 2001-02-09 Mark Kettenis - * elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32 - similar to R_SPARC_32. - * elf64-sparc.c (sparc64_elf_howto_table): Likewise. - - 2001-02-08 Richard Henderson - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness - before visibility. Locally defined protected symbols are not - dynamic. - - 2001-02-07 Jakub Jelinek - * elflink.h (is_global_symbol_definition): Rename to - is_global_data_symbol_definition and have it reject function - symbols. - (elf_link_is_defined_archive_symbol): Use renamed function. - - 2001-02-07 Todd Vierling - * libbfd-in.h (bfd_target_vector): Change extern array to pointer. - * libbfd.h (bfd_target_vector): Likewise. - * targets.c (bfd_target_vector): Rename to _bfd_target_vector and - make static; create pointer reference named bfd_target_vector. - (_bfd_target_vector_entries): Calculate this based on the array - typed _bfd_target_vector. - - 2001-02-06 H.J. Lu - * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Only hidden and - internal symbols are not dynamic. - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. - - 2001-02-06 Kazu Hirata - * elf-m10200.c: Fix formatting. - - 2001-02-01 Kazu Hirata - * elf-m10300.c: Fix formatting. - -2001-06-10 Philip Blundell - - * configure.in: Set version to 2.11.1. - * configure: Regenerate. - -2001-06-09 Philip Blundell - - * elf32-arm.h (elf32_arm_plt0_entry): Correct error in last - change. - (elf32_arm_plt_entry): Likewise. - -2001-06-07 Alan Modra - - * Most files: Update copyright notices. - -2001-05-29 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64. - (elf64_x86_64_relocate_section): Likewise. - -2001-05-28 Andreas Jaeger - - * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the - generic version since we want a hashsize of 4. - (elf_backend_size_info): Likewise. - -2001-05-28 Nicolas Pitre - - * elf32-arm.h: Fix PLT generation for big endian ARM. - -2001-05-28 Jeff Sturm - - * reloc.c: Add BFD_RELOC_SPARC_UA16 and BFD_RELOC_SPARC_UA64. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * elf32-sparc.c: Enable BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32 - and BFD_RELOC_SPARC_UA64 mapping - * elf64-sparc.c: Likewise. - -2001-05-23 Alan Modra - - Merge from mainline. - 2001-05-17 Alan Modra - * elf32-hppa.c (hppa_build_one_stub): Add an assert to check - plt.offset. - - 2001-05-16 Alan Modra - * section.c (asection): Add linker_has_input field. - (STD_SECTION): Adjust initialization to suit. - * ecoff.c (bfd_debug_section): Likewise. - * bfd-in2.h: Regenerate. - - 2001-05-07 Thiemo Seufer - * ecoff.c (bfd_debug_section): Fix initialization. - - 2001-05-12 Peter Targett - * cpu-arc.c (arch_info_struct): Add entry 'base' representing old - name for 'arc5' core versions. - (bfd_arc_arch): Make bfd_mach_arc_6 default. - * elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default - architecture. - (arc_elf_final_write_processing): Make bfd_mach_arc_6 default. - - 2001-05-08 Ian Lance Taylor - * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is - NULL or is not COFF. - (coff_i386_rtype_to_howto): Don't dump core if output section - owner is not COFF. - - 2001-04-13 Roger Sayle - * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable section - flag on pe-i386 targets. - - 2001-04-26 H.J. Lu - * elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is - valid. - - 2001-04-05 David Mosberger - * elf32-i386.c (elf_i386_fake_sections): Treat ".reloc" as an - ordinary "progbits" section. - -2001-05-04 Richard Henderson - - * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true. - -2001-04-30 Andreas Jaeger , Andreas Schwab - - * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for - R_X86_64_GOTPCREL, don't use assignments instead of comparisons. - -2001-04-27 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap - out handled entries. - (elf64_x86_64_finish_dynamic_symbol): Set up GOT entries. - (elf64_x86_64_relocate_section): Fix GOTPCREL calculation. - (elf64_x86_64_relocate_section): Merge entries for GOTPCREL and - GOT32. - -2001-04-30 Alan Modra - - * elf32-hppa.c (final_link_relocate): Branch to .+8 for - calls to undefined weak symbols. - -2001-04-19 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions. - (elf64_x86_64_plt_entry): Likewise. - (elf64_x86_64_finish_dynamic_sections): Fix PLT0 generation. - (elf64_x86_64_finish_dynamic_symbol): Fix PLT generation. - -2001-03-31 Philip Blundell - - From 2001-03-26 H.J. Lu - * elf32-gen.c (elf32_generic_link_add_symbols): New. Check - if there are any relocations for generic ELF. - (bfd_elf32_bfd_link_add_symbols): Defined to - elf32_generic_link_add_symbols. - * elf64-gen.c (elf64_generic_link_add_symbols): New. Check - if there are any relocations for generic ELF. - (bfd_elf64_bfd_link_add_symbols): Defined to - elf64_generic_link_add_symbols. - -2001-03-21 Alan Modra - - * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section - non-NULL before attempting to dereference. - -2001-03-20 Andreas Schwab - - * elf32-m68k.c (elf_m68k_relocate_section): Don't need the - relocation value when resolving a reference from a debugging - section. - -2001-03-16 Philip Blundell - - * configure: Regenerate. - -2001-03-16 Alan Modra - - * elf32-hppa.c (elf32_hppa_link_hash_entry): Add maybe_pic_call. - (hppa_link_hash_newfunc): Init it. - (hppa_type_of_stub): Only use non-PIC to PIC call stub if caller - section appears to be non-PIC. - (final_link_relocate): Likewise. - (elf32_hppa_adjust_dynamic_symbol): Set maybe_pic_call for any - possible candidate function, and set pic_call for those that will - only have a .plt entry for the PIC call stub. - (hppa_handle_PIC_calls): Set maybe_pic_call. - - * elf32-hppa.c: Correct field selector in stub comments. - (clobber_millicode_symbols): Formatting fix. - -2001-03-11 Philip Blundell - - * configure.in: Set version to 2.11. - - * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT - entries that could serve as a definition for a weak symbol. - -2001-03-07 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix handling of - some relocation values. - -2001-02-28 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_relocate_section): Add relocation - to addend. - -2001-02-26 Andreas Jaeger - - * elf64-x86-64.c (x86_64_elf_howto_table): Fix order of entries. - -2001-02-21 David Mosberger - - * cpu-ia64-opc.c (elf64_ia64_operands}: Fix typo: error string for - C8 said "1" instead of "8". Clarify error string for IMM22: - "signed integer" instead of just "integer". - -2001-02-20 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make - PLT entries that could serve as a definition for a weak symbol. - -2001-02-18 David O'Brien - - * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat - FreeBSD/i386-CURRENT differently until I can figure out the needed - corefile changes. - * configure: Regenerate. - * config.bfd: Recognize FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/arm, - FreeBSD/PowerPC, and FreeBSD/sparc64. - -2001-02-14 Philip Blundell - - From 2001-02-06 H.J. Lu - * bfd/peicode.h (coff_swap_filehdr_in): Remove the e_magic - checking. - (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and - external_PEI_IMAGE_hdr. - -2001-02-14 Bo Thorsen - - * elf64-x86-64.c: Small formatting fixes and rearrangements of code. - (elf64_86_64_size_info): Struct added to fix a problem - with the hashtable string entries. - (elf64_x86_64_adjust_dynamic_symbol): Add generation of .got.plt. - (elf64_x86_64_size_dynamic_sections): A FIXME removed. - (elf64_x86_64_size_dynamic_sections): Fix a dynamic entry and - remove the FIXME for this. - (elf64_x86_64_adjust_dynamic_symbol): Fix check for unneeded .plt - section. Also removed the FIXME for it. - (x86_64_elf_howto_table): Use bfd_elf_generic_reloc. - (ELF_DYNAMIC_INTERPRETER): Fix the name of the dynamic linker. - (elf64_x86_64_finish_dynamic_sections): Enable .got.plt writing. - -2001-02-14 Philip Blundell - - From 2001-02-08 H.J. Lu - * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_32 - relocation entries for weak definitions when building DSO with - -Bsymbolic. - -2001-02-13 Richard Henderson - - * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required - and not user provided. - -2001-02-13 Alan Modra - - * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If - $global$ referenced but not defined, set its value here. - -2001-02-09 Bo Thorsen - - * elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section - alignment to 3. - (elf64_x86_64_check_relocs): Write R_X86_64_GOTPCREL GOT entry - and relocation. - (elf64_x86_64_relocate_section): Fix formatting. - (elf64_x86_64_relocate_section): Fix addend for relocation of - R_X86_64_(8|16|32|PC8|PC16|PC32). - -Mon Feb 12 17:44:39 CET 2001 Jan Hubicka - - * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL. - -2001-02-10 Nick Clifton - - * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC - rel, it will be handled later on. - -2001-02-09 David Mosberger - - * elfxx-ia64.c (is_unwind_section_name): New function. Returns - true if section name is an unwind table section name. - (elfNN_ia64_additional_program_headers): Count each unwind section - separately. - (elfNN_ia64_modify_segment_map): Install one unwind program header - for each unwind separate section. Note: normally the linker - script merges the unwind sections that go into a single segment, - so this still generates at most one unwind program header per - segment. - - * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Accept any section - name for SHT_IA_64_UNWIND, not just .IA_64.unwind. - (elfNN_ia64_fake_sections): Mark sections with names that start - with .IA_64.unwind but not with .IA_64.unwind_info as an IA-64 - unwind section. - - * elfxx-ia64.c (elfNN_ia64_final_write_processing): New function. - Use it to make sh_info in unwind section point to the text section - it applies to. - -2001-02-07 Mark Elbrecht - - * coffgen.c (coff_find_nearest_line): If stabs info is successfully - found, do not attempt to find dwarf2 info before returning. - -2001-01-30 Alan Modra - - * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function. - (elf_backend_get_symbol_type): Define. - (elf64_hppa_object_p): Set architecture and machine from elf - header flags. - -2001-01-30 Curtis L. Janssen - - * elf64-alpha.c (elf64_alpha_find_nearest_line): Query dwarf2 - before mdebug. - -2001-01-26 Richard Henderson - - * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Return false - for non-default visibility. - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise, but - delete ugly macro and replace with pretty function. - -2001-01-25 Mark Elbrecht - - * coff-go32.c: Update copyright. - * coff-stgo32.c: Likewise. - * coff-go32.c (COFF_LONG_FILENAMES): Define. - * coff-stgo32.c (COFF_LONG_FILENAMES): Likewise. - * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Remove .bss entry. - * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. - -2001-01-25 Kazu Hirata - - * bfd-in2.h: Rebuild. - * libbfd.h: Likewise. - -2001-01-23 H.J. Lu - - * bfd-in2.h: Rebuild. - -2001-01-23 H.J. Lu - - * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_buf) - is NULL or PRIV(vms_rec) is outside of the buffer. - -2001-01-23 Kazu Hirata - - * coff64-rs6000.c: Fix formatting. - * coff-arm.c: Likewise. - * coffgen.c: Likewise. - * cofflink.c: Likewise. - * coff-mcore.c: Likewise. - * coff-mips.c: Likewise. - * coff-pmac.c: Likewise. - * coff-ppc.c: Likewise. - * coff-rs6000.c: Likewise. - * elf32.c: Likewise. - * elf32-fr30.c: Likewise. - * elf32-i370.c: Likewise. - * elf32-i860.c: Likewise. - * elf32-m32r.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-mcore.c: Likewise. - * elf32-ppc.c: Likewise. - * elf32-sh.c: Likewise. - * elf32-v850.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-sparc.c: Likewise. - * elflink.c: Likewise. - * elflink.h: Likewise. - * elf-m10200.c: Likewise. - * elf-m10300.c: Likewise. - * elfxx-ia64.c: Likewise. - - * aoutx.h: Fix formatting. - * bfd.c: Likewise. - * bfd-in2.h: Likewise. - * bfd-in.h: Likewise. - * cpu-i386.c: Likewise. - * cpu-m68hc11.c: Likewise. - * dwarf2.c: Likewise. - * elf64-x86-64.c: Likewise. - * format.c: Likewise. - * freebsd.h: Likewise. - * hash.c: Likewise. - * hp300hpux.c: Likewise. - * hppabsd-core.c: Likewise. - * hpux-core.c: Likewise. - -2001-01-22 Bo Thorsen - - * elf64-x86-64.c: Added PIC support for X86-64. - (elf64_x86_64_link_hash_newfunc): Function added. - (elf64_x86_64_link_hash_table_create): Likewise. - (elf64_x86_64_check_relocs): Likewise. - (elf64_x86_64_gc_mark_hook): Likewise. - (elf64_x86_64_gc_sweep_hook): Likewise. - (elf64_x86_64_adjust_dynamic_symbol): Likewise. - (elf64_x86_64_size_dynamic_sections): Likewise. - (elf64_x86_64_discard_copies): Likewise. - (elf64_x86_64_finish_dynamic_symbol): Likewise. - (elf64_x86_64_finish_dynamic_sections): Likewise. - (elf64_x86_64_relocate_section): Add relocation of PIC sections. - -2001-01-21 Maciej W. Rozycki - - * Makefile.am (install-data-local): Make use of $(DESTDIR). - * Makefile.in: Regenerate. - -2001-01-21 Kazu Hirata - - * coff-a29k.c: Fix formatting. - -2001-01-19 H.J. Lu - - * elf32-i386.c (elf_i386_check_relocs): Report files with bad - relocation section names. - (elf_i386_relocate_section): Report files with bad relocation - section names and return false. - -2001-01-17 Bo Thorsen - - * targets.c: Alphabetize list of xvecs. - -2001-01-14 Alan Modra - - * config.bfd: Add linux target variant for elfxx-hppa. - * configure.in: Recognize bfd_elf32_hppa_linux_vec and - bfd_elf64_hppa_linux_vec. - * configure: Regenerate. - * elf64-hppa.c: Include elf64-target.h again to support linux - target variant. - (elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux. - * elf32-hppa.c: Include elf32-target.h again to support linux - target variant. - (elf32_hppa_post_process_headers): New function. - (elf_backend_post_process_headers): Define. - * targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and - bfd_elf32_hppa_linux_vec. - - * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base, - and data_segment_base fields. - (elf32_hppa_link_hash_table_create ): Init them. - (elf32_hppa_check_relocs): Update comments. - (hppa_record_segment_addr): New function. - (elf32_hppa_relocate_section): Call it. - (final_link_relocate): Handle R_PARISC_SEGREL32. - (elf32_hppa_final_link): New function. - (bfd_elf32_bfd_final_link): Define to call it. - (hppa_unwind_entry_compare): New function. - * cache.c (bfd_open_file): Create files in write+read mode. - - * elf-hppa.h (elf_hppa_howto_table): Set bitsize value for - SEGREL32 and numerous other relocs. Change duplicate - R_PARISC_NONE relocs to R_PARISC_UNIMPLEMENTED. - - * opncls.c (bfd_fdopenr): Add parens like the comment says around - O_ACCMODE. - - * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Don't create - .plt entries for DT_INIT and DT_FINI. - (elf32_hppa_finish_dynamic_sections): Remove special handling of - DT_INIT and DT_FINI. - - * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use 16-bit - offsets for stub .plt access if wide mode. Check offset in range. - -2001-01-13 Nick Clifton - - * elf32-fr30.c (fr30_elf_howto_table): Remove spurious blank - line. - - * coffcode.h (coff_canonicalize_reloc): Remove spurious blank - line. - -2001-01-12 Alan Modra - - * configure.in ([bfd_elf64_x86_64_vec]): Set target64. - * configure: Regenerate. - -2001-01-11 Peter Targett - - * bfd-in2.h (bfd_architecture): Add bfd_mach_arc_5, - bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8 for ARC variants. - * cpu-arc.c (arch_info_struct): Add entries for variants. - (bfd_arc_arch) Set default to bfd_mach_arc_5. - (arc_get_mach) Don't assume machine names prefixed arc- before - testing. - * elf32-arc.c (arc_elf_object_p): Set machine number based on new - selections. - (arc_elf_final_write_processing) Likewise. - (ELF_MACHINE_CODE) Use EM_ARC. - -2001-01-10 Nick Clifton - - * coff-arm.c (LOCAL_LABEL_PREFIX): Change definition to "". - -2001-01-07 Philip Blundell - - * README: Replace `bug-gnu-utils@gnu.org' with - `bug-binutils@gnu.org'. - -2001-01-04 Kazu Hirata - - * som.c: Fix formatting. - -2001-01-03 Kazu Hirata - - * ecoffswap.h: Fix formatting. - * elf-bfd.h: Likewise. - * elfarm-nabi.c: Likewise. - * elfarm-oabi.c: Likewise. - * elfcode.h: Likewise. - * elfcore.h: Likewise. - * elflink.c: Likewise. - * elflink.h: Likewise. - * elfxx-ia64.c: Likewise. - * elfxx-target.h: Likewise. - * libbfd.c: Likewise - * linker.c: Likewise. - * lynx-core.c: Likewise. - -2001-01-02 Kazu Hirata - - * pc532-mach.c: Fix formatting. - * pe-arm.c: Likewise. - * pe-i386.c: Likewise. - * pe-mips.c: Likewise. - * pe-ppc.c: Likewise. - * pe-sh.c: Likewise. - * pei-mips.c: Likewise. - * pei-sh.c: Likewise. - * peicode.h: Likewise. - * ppcboot.c: Likewise. - * ptrace-core.c: Likewise. - -2001-01-01 Kazu Hirata - - * reloc.c: Fix formatting. - * riscix.c: Likewise. - * rs6000-core.c: Likewise. - * xcoff-target.h: Likewise. - -2000-12-29 Hans-Peter Nilsson - - * elfcode.h (elf_object_p): Also restore the bfd mach field on - error, by calling bfd_default_set_arch_mach with incoming - values. - -2000-12-26 Kazu Hirata - - * vaxnetbsd.c: Fix formatting. - * versados.c: Likewise. - * vms-gsd.c: Likewise. - * vms-hdr.c: Likewise. - * vms-misc.c: Likewise. - -2000-12-25 Alexandre Oliva - - * archive.c (coff_write_armap): Don't write more than symbol_count - `archive_member_file_ptr's. - -2000-12-25 Kazu Hirata - - * vms-tir.c: Fix formatting. - -2000-12-23 Kazu Hirata - - * vms.c: Fix formatting. - * vms.h: Likewise. - -2000-12-21 Santeri Paavolainen - - * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined. - - * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM. - - * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *) - arithmetic. - - * elf32-fr30.c: Add casts to avoid (void *) arithmetic. - - * coffcode.h (styp_to_sec_flags): Add empty statement after label. - -2000-12-21 Richard Sandiford - - * libbfd.c (bfd_get_bits): Added - (bfd_put_bits): Likewise - * bfd-in.h: Declared the above. - * bfd-in2.h: Regenerated. - -2000-12-20 Kazu Hirata - - * targets.c: Fix formatting. - * tekhex.c: Likewise. - * trad-core.c: Likewise. - -2000-12-19 Kazu Hirata - - * sco5-core.c: Fix formatting. - * section.c: Likewise. - * sparclinux.c: Likewise. - * sparclynx.c: Likewise. - * sparcnetbsd.c: Likewise. - * srec.c: Likewise. - * stabs.c: Likewise. - * stab-syms.c: Likewise. - * sunos.c: Likewise. - * syms.c: Likewise. - * sysdep.h: Likewise. - -2000-12-18 Nick Clifton - - * coff-arm.c (EXTRA_S_FLAGS): Only define if not already - defined. - * epoc-pe-arm.c (EXTRA_S_FLAGS): Define. - * epoc-pei-arm.c (EXTRA_S_FLAGS): Define. - -2000-12-18 Nick Clifton - - * vms-misc.c (_bfd_vms_get_record): Add default case to - file_format switch. - -2000-12-15 Miloslav Trmac - - * elfcore.h (elf_core_file_p): Move to the start of the program - headers before attempting to read them. - -2000-12-14 Kazu Hirata - - * peigen.c: Fix formatting. - * som.c: Likewise. - * som.h: Likewise. - -2000-12-13 Kazu Hirata - - * peigen.c: Fix formatting. - -2000-12-12 Jim Wilson - - * elfxx-ia64.c (get_dyn_sym_info): Cast %p argument to void *. - -2000-12-08 Mark Salter - - * binary.c (binary_set_section_contents): Ignore sections - with zero size. - -2000-12-12 Kazu Hirata - - * m68klinux.c: Fix formatting. - * m68knetbsd.c: Likewise. - * mipsbsd.c: Likewise. - * netbsd-core.c: Likewise. - * netbsd.h: Likewise. - * newsos3.c: Likewise. - * nlm32-alpha.c: Likewise. - * nlm32-i386.c: Likewise. - * nlm32-ppc.c: Likewise. - * nlm32-sparc.c: Likewise. - * nlmcode.h: Likewise. - * nlmswap.h: Likewise. - * nlm-target.h: Likewise. - * ns32knetbsd.c: Likewise. - -2000-12-10 Fred Fish - - * elflink.h (elf_link_output_extsym): Don't complain about undefined - symbols in shared objects if allow_shlib_undefined is true. - -2000-12-12 Nick Clifton - - * cpu-sh.c: Fix formattng. - * elf.c: Fix formattng. - * elf32-mips.c: Fix formattng. - * elf32-sh.c: Fix formattng. - * elf64-alpha.c: Fix formattng. - -2000-12-09 Nick Clifton - - * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass - dwarf2_find_line_info as last parameter to invocation of - _bfd_dwarf2_find_nearest_line. - * elf32-arm.h (elf32_arm_find_nearest_line): Pass - dwarf2_find_line_info as last parameter to invocation of - _bfd_dwarf2_find_nearest_line. - -2000-12-08 Mark Elbrecht - - * Makefile.am (BFD32_BACKENDS): Move dwarf2.lo from here... - (BFD_LIBS): ...to here. - (BFD32_BACKENDS_CFILES): Move dwarf2.c from here... - (BFD_LIBS_CFILES): ...to here. - * Makefile.in: Regenerate. - * configure.in: Remove dwarf.lo from the elf shell variable. - * configure: Regenerate. - * libcoff-in.h (coff_tdata): Add pointer dwarf2_find_line_info. - * libcoff.h: Regenerate. - * coffgen.c (coff_find_nearest_line): Call - _bfd_dwarf2_find_nearest_line. - * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add parameter. Update - accordingly. - (read_abbrevs): Likewise - (decode_line_info): Likewise. - (parse_comp_unit): Likewise. - (comp_unit_find_nearest_line): Likewise. - * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. - * libbfd.h: Regenerate. - * elf.c (_bfd_elf_find_nearest_line): Update call. - * elf-bfd.h (elf_obj_tdata): Change dwarf2_find_line_info to type PTR. - * dwarf2.c (concat_filename): Use IS_ABSOLUTE_PATH. - * coffcode.h (STYP_XCOFF_DEBUG, STYP_DEBUG_INFO): New macros. - (sec_to_styp_flags): Use them. Handle DWARF2 sections. - (styp_to_sec_flags): Handle DWARF2 sections. - * elf32-arm.h (elf32_arm_find_nearest_line): Add parameter to call - to _bfd_find_nearest_line. - * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Add parameter to - call to _bfd_find_nearest_line. - -2000-12-08 Kazu Hirata - - * coffgen.c: Fix formatting. - * elf-m10300.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-i960.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-mcore.c: Likewise. - * elf32-ppc.c: Likewise. - * elf32-sh.c: Likewise. - * elf32-sparc.c: Likewise. - * elf32-v850.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-hppa.c: Likewise. - * elf64-mips.c: Likewise. - * elf64-sparc.c: Likewise. - -2000-12-07 Kazu Hirata - - * elf32-ppc.c: Fix formatting. - * elf64-x86-64.c: Likewise. - -2000-12-06 Ulf Carlsson - - From Ralf Baechle - - * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit - BFDs containing no sections or empty .text, .data or .bss sections - to be merged, regardless of their flags. - -2000-12-06 Kazu Hirata - - * elf32-m32r.c: Fix formatting. - * elf32-m68hc11.c: Likewise. - * elf32-m68hc12.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-mcore.c: Likewise. - * elf32-pj.c: Likewise. - * elf32-ppc.c: Likewise. - -2000-12-05 Kazu Hirata - - * elf32-fr30.c: Fix formatting. - * elf32-hppa.c: Likewise. - * elf32-i370.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-i860.c: Likewise. - * elf32-i960.c: Likewise. - -2000-12-03 Kazu Hirata - - * elf32-arm.h: Fix formatting. - * elf32-avr.c: Likewise. - * elf32-cris.c: Likewise. - * elf32-d10v.c: Likewise. - * elf32-d30v.c: Likewise. - * elf-hppa.h: Likewise. - * elf-m10200.c: Likewise. - * elf-m10300.c: Likewise. - -2000-12-01 Chris Demetriou - - * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mips32 and - bfd_mach_mips32_4k. Update FIXME comment. - * archures.c (bfd_mach_mips32): New constant. - (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to - the latter, renumber it. - * bfd-in2.h (bfd_mach_mips32): New constant. - (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to - the latter, renumber it. - * cpu-mips.c (I_mips32): New constant. - (I_mips4K, I_mips32_4k): Rename the former to the latter. - (arch_info_struct): Add bfd_mach_mips32 entry, replace - bfd_mach_mips4K entry with bfd_mach_mips32_4k entry. - * elf32-mips.c (elf_mips_isa): Add E_MIPS_ARCH_32 case. - (elf_mips_mach): Likewise. Also, replace E_MIPS_MACH_MIPS32 - with E_MIPS_MACH_MIPS32_4K. - (_bfd_mips_elf_final_write_processing): Replace - bfd_mach_mips4K with bfd_mach_mips32_4k case, add - bfd_mach_mips32 case. - (_bfd_mips_elf_merge_private_bfd_data): Generalize ISA mixing - comparison with support for MIPS32. - (_bfd_mips_elf_print_private_bfd_data): Print ISA name for - MIPS32. - - * aoutx.h (NAME(aout,machine_type)): Add cases for - bfd_mach_mips5 and bfd_mach_mips64. - * archures.c (bfd_mach_mips5, bfd_mach_mips64): New constants. - * bfd-in2.h (bfd_mach_mips5, bfd_mach_mips64): Likewise. - * cpu_mips.c (I_mips5, I_mips64): New definitions. - (arch_info_struct): Add entries for bfd_mach_mips5 and - bfd_mach_mips64. - * elf32-mips.c (elf_mips_isa, elf_mips_mach, - _bfd_mips_elf_print_private_bfd_data): Add cases for - E_MIPS_ARCH_5 and E_MIPS_ARCH_64. - (_bfd_mips_elf_final_write_processing): Add cases for - bfd_mach_mips5 and bfd_mach_mips64. - - * bfd/aoutx.h (NAME(aout,machine_type)): Add a - bfd_mach_mips_sb1 case. - * bfd/archures.c (bfd_mach_mips_sb1): New constant. - * bfd/bfd-in2.h (bfd_mach_mips_sb1): New constant. - * bfd/cpu-mips.c (I_sb1): New constant. - (arch_info_struct): Add entry for bfd_mach_mips_sb1. - * bfd/elf32-mips.c (elf_mips_mach): Add case for - E_MIPS_MACH_SB1. - (_bfd_mips_elf_final_write_processing): Add case for - bfd_mach_mips_sb1. - -2000-12-01 Joel Sherrill - - * config.bfd (arm-*-rtems*, a29k-*rtems*): New targets. - (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. - (sparc*-*-rtems*): Switched from a.out to ELF. - -2000-11-30 Jan Hubicka - - * Makefile.am (BFD64_BACKENDS): Add elf64-x86-64.lo - BFD64_BACKENDS_CFILES): Add elf64-x86-64.c - (elf64-x86-64.lo): Add dependencies. - * archures.c (DESCRIPTION): Add bfd_mach_x86_64, - bfd_mach_x86_64_intel_syntax. - * elf.c (prep_headers): Use EM_x86_64 for 64bit output. - * config.bfd (x86_64): Add. - * configure.in: Add support for bfd_elf64_x86_64_vec. - * cpu-i386.c (bfd_x86_64_arch_intel_syntax, bfd_x86_64_arch): Add. - (bfd_i386_arch, i8086_ar): Link in. - * elf64-x86-64.c: New file. - * reloc.c (ENUMDOC): Add BFD_RELOC_X86_64*. - * targets.c (bfd_elf64_x86_64_vec): Add. - (bfd_target_vect): Add bfd_elf64_x86_64_vec. - -2000-11-30 Kazu Hirata - - * xcofflink.c: Fix formatting. - -2000-11-28 Kazu Hirata - - * aoutx.h: Fix formatting. - * bfd-in.h: Likewise. - * bfd-in2.h: Likewise. - * cache.c: Likewise. - * cisco-core.c: Likewise. - * coff64-rs6000.c: Likewise. - * coffcode.h: Likewise. - * coffswap.h: Likewise. - * corefile.c: Likewise. - * elf32-mips.c: Likewise. - -2000-11-27 Kazu Hirata - - * aout-adobe.c: Fix formatting. - * coff64-rs6000.c: Likewise. - * coffgen.c: Likewise. - * cofflink.c: Likewise. - -2000-11-27 Philip Blundell - - * libcoff-in.h (coff_tdata): Add `strings_written' flag. - (obj_coff_strings_written): New accessor macro for above. - * libcoff.h: Regenerate. - * cofflink.c (_bfd_coff_final_link): Say that we wrote the - strings. - * coffcode.h (coff_write_object_contents): No need to write out - the string table if it's already been done. - -2000-11-22 Philip Blundell - - * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to - weak undefined symbols. - -2000-11-24 Nick Clifton - - * archures.c (bfd_mach_arm_5TE): Define. - (bfd_mach_arm+XScale): Define. - * bfd-in2.h: Regenerate. - - * coff-arm.c (coff_arm_reloc_type_lookup): Accept - BFD_RELOC_ARM_PCREL_BLX. - - * coffcode.h (coff_set_flags): Set flags for 5t, 5te and - XScale machine numbers. - - * config.bfd (xscale-elf): Add target. - (xscale-coff): Add target. - - * cpu-arm.c: Add xscale machine name. - Add v5t, v5te and XScale machine numbers. - -2000-11-23 Kazu Hirata - - * aix386-core.c: Fix formatting. - -2000-11-22 Jim Wilson - - * coff-ia64.c (howto_table): Use EMPTY_HOWTO. - (in_reloc_p): Add ATTRIBUTE_UNUSED to unused parameters. - * cpu-ia64-opc.c (ins_rsvd, ext_rsvd, ins_const, ext_const): Likewise. - (ins_imms_scaled): Initialize sign_bit at function entry. - (elf64_ia64_operands): Add missing initializers. - * elfxx-ia64.c (elfNN_ia64_reloc, elfNN_ia64_reloc_type_lookup, - elfNN_ia64_info_to_howto, elfNN_ia64_fake_sections, - elfNN_ia64_add_symbol_hook, elfNN_ia64_is_local_label_name, - elfNN_ia64_local_hash_table_init, get_fptr, get_pltoff, - elfNN_ia64_adjust_dynamic_symbol): Add ATTRIBUTE_UNUSED for unused - parameters. - (elfNN_ia64_info_to_howto): Initialize free_relocs, free_contents, - and free_extsyms at function entry. - (elfNN_add_symbol_hook): Add unsigned cast to bfd_get_gp_size result. - (elfNN_ia64_create_dynamic_sections): Delete unused local h. - (get_got): Delete unused local srel. - (elfNN_ia64_check_relocs): Initialize dynrel_type when declared. - (elfNN_ia64_relocate_section): Delete unused local dynindx. - -2000-11-21 Kazu Hirata - - * coff-a29k.c: Fix formatting. - * coff-h8500.c: Likewise. - * coff-i960.c: Likewise. - * coff-ppc.c: Likewise. - * coff-rs6000.c: Likewise. - * coff-stgo32.c: Likewise. - * coff-tic54x.c: Likewise. - * coff-w65.c: Likewise. - * cpu-h8500.c: Likewise. - * cpu-hppa.c: Likewise. - * cpu-ns32k.c: Likewise. - * ecoff.c: Likewise. - * ecofflink.c: Likewise. - -2000-11-21 Nick Clifton - - * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and - remove possibility of infinite loop. - -2000-11-20 Kazu Hirata - - * aix386-core.c: Fix formatting. - * aout-adobe.c: Likewise. - * aout-arm.c: Likewise. - * aout-encap.c: Likewise. - * aout-ns32k.c: Likewise. - * aout-target.h: Likewise. - * aout-tic30.c: Likewise. - * aoutf1.h: Likewise. - * aoutx.h: Likewise. - * archive.c: Likewise. - * bfd-in.h: Likewise. - * bfd-in2.h: Likewise. - * bfd.c: Likewise. - * bout.c: Likewise. - -2000-11-17 H.J. Lu - - * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create - pltoff entries for DT_INIT and DT_FINI. - (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries. - (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI - entries. - -2000-11-16 Richard Henderson - - * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs. - (allocate_dynrel_entries): Likewise. - (elfNN_ia64_relocate_section): Likewise. Set REL addends correctly. - (set_pltoff_entry): Likewise. - (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB - (elfNN_ia64_reloc_type_lookup): Likewise. - (elfNN_ia64_install_value): Likewise. - (elfNN_ia64_relocate_section): Likewise. - * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove. - (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove. - -2000-11-16 Kazu Hirata - - * cpu-a29k.c: Fix formatting. - * cpu-alpha.c: Likewise. - * cpu-arm.c: Likewise. - * cpu-avr.c: Likewise. - * cpu-d10v.c: Likewise. - * cpu-h8500.c: Likewise. - * cpu-hppa.c: Likewise. - * cpu-i370.c: Likewise. - * cpu-i386.c: Likewise. - * cpu-i960.c: Likewise. - * cpu-ia64-opc.c: Likewise. - * cpu-ia64.c: Likewise. - * cpu-m32r.c: Likewise. - * cpu-m68hc11.c: Likewise. - * cpu-m68hc12.c: Likewise. - * cpu-m68k.c: Likewise. - * cpu-m88k.c: Likewise. - * cpu-mips.c: Likewise. - * cpu-ns32k.c: Likewise. - * cpu-pj.c: Likewise. - * cpu-powerpc.c: Likewise. - * cpu-sh.c: Likewise. - * cpu-sparc.c: Likewise. - * cpu-tic54x.c: Likewise. - * cpu-v850.c: Likewise. - * cpu-vax.c: Likewise. - * cpu-w65.c: Likewise. - * cpu-we32k.c: Likewise. - * cpu-z8k.c: Likewise. - * dwarf1.c: Likewise. - * dwarf2.c: Likewise. - -2000-11-15 Kazu Hirata - - * coff-arm.c: Fix formatting. - * coff-ppc.c: Likewise. - * coff-rs6000.c: Likewise. - * coff-sh.c: Likewise. - * coff-sparc.c: Likewise. - * coff-tic30.c: Likewise. - * coff-tic54x.c: Likewise. - * coff-tic80.c: Likewise. - * coff-w65.c: Likewise. - * coff-we32k.c: Likewise. - * coff-z8k.c: Likewise. - -2000-11-15 Richard Henderson - - * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc - section with the same ALLOC|LOAD flags as the source section. - -2000-11-14 Jakub Jelinek - - * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used - by STO_ALPHA constants. - -2000-11-14 Kazu Hirata - - * coff-pmac.c: Fix formatting. - * coff-ppc.c: Likewise. - -2000-11-13 H.J. Lu - - * elflink.h (elf_link_add_object_symbols): Also add indirect - symbols for common symbols with the default version. - -2000-11-09 Philip Blundell - - * section.c (STD_SECTION): Set gc_mark flag. - -2000-11-11 Kazu Hirata - - * coff-i960.c: Likewise. - * coff-m68k.c: Likewise. - * coff-m88k.c: Likewise. - * coff-mcore.c: Likewise. - * coff-mips.c: Likewise. - -2000-11-11 Bernd Schmidt - - * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs. - -2000-11-10 Kazu Hirata - - * coff-h8300.c: Fix formatting. - * coff-h8500.c: Likewise. - * coff-i386.c: Likewise. - * coff-i860.c: Likewise. - * coff-i960.c: Likewise. - * coff-ia64.c: Likewise. - -2000-11-09 Kazu Hirata - - * archive.c: Fix formatting. - * archures.c: Likewise. - -2000-11-07 Richard Henderson - - * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec. - Set it before bfd_elf64_bfd_final_link call. Use it after the call. - * section.c (bfd_set_section_contents): Call memcpy if - section->contents set and location not equal to contents plus offset. - -2000-11-08 Kazu Hirata - - * bfd-in.h: Fix formatting. - * bfd-in2.h: Likewise. - * bfd.c: Likewise. - * binary.c: Likewise. - * bout.c: Likewise. - * coff-a29k.c: Likewise. - * coff-alpha.c: Likewise. - * coff-apollo.c: Likewise. - * coff-aux.c: Likewise. - -2000-11-07 Kazu Hirata - - * aix386-core.c: Fix formatting. - * aoutf1.h: Likewise. - * aoutx.h: Likewise. - * archures.c: Likewise. - * armnetbsd.c: Likewise. - -2000-11-07 Alan Modra - - * coff-h8300.c (special): Adjust reloc address. - -2000-11-06 Steve Ellcey - - * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines - to differentiate elf32 and elf64 on ia64. - * bfd-in2.h: Regenerate. - * config.bfd: Add target for "ia64*-*-hpux*". - * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch. - * configure: Regenerate. - * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure. - * targets.c: Add bfd_target bfd_elf32_ia64_big_vec. - - * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects - from elfxx-ia64.c. Add depenency rules for making elf32-ia64.lo. - * Makefile.in: Regnerate. - * elf64-ia64.c: Deleted. - * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c. - -2000-11-06 Kazu Hirata - - * aout-adobe.c: Fix formatting. - * aout-arm.c: Likewise. - * aout-cris.c: Likewise. - * aout-encap.c: Likewise. - * aout-ns32k.c: Likewise. - * aout-target.h: Likewise. - * aout-tic30.c: Likewise. - -2000-11-05 Philip Blundell - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit - BFDs containing no sections to be merged, regardless of their flags. - -2000-11-04 Philip Blundell - - * elf32-arm.h (elf32_arm_relocate_section): Suppress error message - if a relocation for an undefined symbol also results in an - overflow. - -2000-11-06 Christopher Faylor - - * config.bfd: Add support for Sun Chorus. - -2000-11-05 David O'Brien - - * configure.in: Recognize alpha-*-freebsd*. - * configure: Regenerate. - -2000-11-02 Luciano Gemme - - * srec.c (CHUNK): Rename to DEFAULT_CHUNK. - (Chunk): New global variable set by a parameter in objcopy.c. - (S3Forced): New global variable set by a parameter in - objcopy.c. - (srec_set_section_contents): If S3Forced is true, always generate - S3 records. - (srec_write_section): Use 'Chunk' to limit maximum length of S - records. - -2000-11-02 Per Lundberg - - * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos. - * Makefile.in: Regenerate. - * bfd-in2.h: Regenerate. - * po/bfd.pot: Regenerate. - -2000-10-31 Philip Blundell - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle - EF_SOFT_FLOAT if it is defined. - -2000-10-27 Philip Blundell - - * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse - attempts to mix PIC code with non-PIC, just mark the output as - being position dependent. - (elf32_arm_merge_private_bfd_data): Likewise. Print an error - message for EF_SOFT_FLOAT mismatches. Display diagnostics for - all mismatches, not just the first one. - -2000-10-25 Chris Demetriou - - * ieee.c (ieee_archive_p): Plug one of many possible - memory leaks in error handling. - -2000-10-20 Jakub Jelinek - - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data, - elf32_sparc_object_p, elf32_sparc_final_write_processing): - Support v8plusb. - * elf64-sparc.c (sparc64_elf_merge_private_bfd_data, - sparc64_elf_object_p): Support v9b. - * archures.c: Declare v8plusb and v9b machines. - * bfd-in2.h: Ditto. - * cpu-sparc.c: Ditto. - -2000-10-16 Geoffrey Keating - - * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location - of a GOT reloc. - - * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro. - (SYMBOL_CALLS_LOCAL): New macro. - (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. - (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL. - (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. - (ppc_elf_relocate_section): Use flag variable to determine - whether the relocation refers to a local symbol. - Test whether a PLTREL24 reloc will produce a reloc by looking - to see whether a PLT entry was made. - -2000-10-14 Geoffrey Keating - - * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT - entries that could serve as a definition for a weak symbol. - -2000-10-13 Ulf Carlsson - - From Ralf Baechle - - * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument - local_p. Add symbol value only for non-R_MIPS_REL32 relocations - against local symbols. - (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01. - -2000-10-12 Alan Modra - - * section.c (struct sec): Add kept_section. - (struct bfd_comdat_info): Remove sec, we can use above. - (STD_SECTION): Add initializer. - (bfd_make_section_anyway): Init here too. - - * bfd-in2.h: Regenerate. - - * elflink.h (elf_link_add_object_symbols): Remove unnecessary - zeroing of `flags'. - (elf_link_input_bfd): Set all asection->symbol->value's here, and - fudge values for discarded link-once section symbols. - - * elf64-hppa.c: Include alloca-conf.h - -2000-10-11 Alan Modra - - * elf.c (swap_out_syms): Revert 2000-10-07 changes. - - * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg. - -2000-10-10 Alan Modra - - * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc. - -2000-10-10 Tom Rix - - * section.c (bfd_make_section_anyway): Release newsect ptr when - newsect->symbol fails to alloc. Use bfd_release instead of free. - -2000-10-09 Richard Henderson - - * elflink.h (size_dynamic_sections): Don't create various tags if - .dynstr is excluded from the link. Don't set first dynsym entry - if dynsymcount is zero. - (elf_bfd_final_link): Don't try to swap out dynamic syms if - .dynsym excluded from the link. Don't try to write any dynamic - sections excluded from the link. - - * elf.c (swap_out_syms): Handle global section symbols. - -2000-10-05 DJ Delorie - - * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs - * coffcode.h (coff_set_alignment_hook): read extended reloc count - (coff_write_relocs): write extended reloc count - (coff_write_object_contents): account for extended relocs - -2000-10-05 Jim Wilson - - * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags - field. - * elf.c (_bfd_elf_make_section_from_shdr): Call the - elf_backend_section_flags function. - * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion - code. - (elf64_ia64_section_flags): New function containing flag conversion - code. - (elf_backend_section_flags): Define to elf64_ia64_section_flags. - * elfxx-target.h (elf_backend_section_flags): Define. - (elfNN_bed): Initialize elf_backend_section_flags field. - -2000-10-02 Alan Modra - - * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to - _bfd_elf32_gc_record_vtable. Correct a comment. - -2000-10-01 Ulf Carlsson - - From Ralf Baechle - - * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld - produces binaries with got[1] = 0x80000001 to differenciate them - for the dynamic linker from the broken binaries produced by old - versions. - -2000-09-30 Petr Sorfa - - * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t. - (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t. - * configure.in: Add check for pxstatus_t and lwpxstatus_t. - * configure: Regenerate. - -2000-09-27 Hans-Peter Nilsson - - Define two bfd_targets for absence and presence of leading - underscore on symbols. Make sure to only link same kind. - * elf32-cris.c (cris_elf_object_p, - cris_elf_final_write_processing, cris_elf_print_private_bfd_data, - cris_elf_merge_private_bfd_data): New. - (elf_backend_object_p, elf_backend_final_write_processing, - bfd_elf32_bfd_print_private_bfd_data, - bfd_elf32_bfd_merge_private_bfd_data): Define. - : Include elf32-target.h twice with - different macro settings: - (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as - bfd_elf32_us_cris_vec. - (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris". - (elf_symbol_leading_char): First as 0, then '_'. - (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h. - * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs. - * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector. - * configure: Regenerate. - * targets.c: Declare bfd_elf32_us_cris_vec. - * po/bfd.pot: Regenerate. - -2000-09-29 Momchil Velikov - - * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for - R_ARM_THM_PC22 relocations. - -2000-09-29 NIIBE Yutaka - - * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath. - -2000-09-29 Momchil Velikov - - * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if - is has the SEC_HAS_CONTENTS flag set. - -2000-09-28 Örjan Friberg - Hans-Peter Nilsson - - * aout-cris.c (N_TXTADDR): Define. - -2000-09-28 John David Anglin - - * som.c: Include alloca-conf.h. - * Makefile.am: "make dep-am" - * Makefile.in: Regenerate. - -2000-09-27 Alan Modra - - * elf32-hppa.c (plt_stub): New. - (PLT_STUB_ENTRY): Define. - (elf32_hppa_link_hash_table): Change multi_subspace to packed - boolean. Add need_plt_stub, has_12bit_branch and has_17bit_branch. - (elf32_hppa_link_hash_table_create): Init to suit. - (elf32_hppa_check_relocs): Set has_12bit_branch and - has_17bit_branch as appropriate. - (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for - non-local functions. - (elf32_hppa_size_dynamic_sections): Correct setting of reltext. - Add space for plt_stub as needed. - (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global - functions at plt_stub. - (elf32_hppa_finish_dynamic_sections): Write plt_stub. - (elf32_hppa_create_dynamic_sections): Leave .plt executable. - - * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param. - * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. Use it instead - of fixed size, and if negative, disable handling of input sections - before stub section. Set up default stub group size depending - on detected branch relocs. - (hppa_build_one_stub): Use lrsel and rrsel for import stubs to - ensure different offsets from sym_value aren't rounded to - different 2k blocks. Use lrsel and rrsel for other stubs too for - consistency rather than necessity. - (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F. - (final_link_relocate): Likewise. - (elf32_hppa_relocate_section): Likewise. - - * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc. - (_bfd_elf_hppa_gen_reloc_type): Generate them. - (elf_hppa_final_link_relocate): Handle them. - (elf_hppa_relocate_insn): Likewise. - (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases. - -2000-09-26 Hans-Peter Nilsson - - * elfcode.h (elf_object_p): Preserve and clear abfd section - information. Restore at error. - -2000-09-26 Paul Sokolovsky - - * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory - is empty, make sure that its rva also 0. NT loader dislikes - having otherwise. - -2000-09-26 Steve Ellcey - - * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols - global by default. - -2000-09-21 Alan Modra - - * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in - currently unused RELATIVE_DYNAMIC_RELOCS code. - (hppa_discard_copies): Likewise. - (elf32_hppa_size_stubs): Size `input_list' array correctly. Correct - comments. Don't check non-code output sections for stub grouping. - -2000-09-20 Alan Modra - - * section.c (bfd_get_unique_section_name): Return NULL if - bfd_malloc fails. - -2000-09-19 Michael Sokolov - - * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0 - instruction sequence to actually work. - (elf_m68k_finish_dynamic_sections): Change the patch-in offset - accordingly. - -2000-09-18 Alexandre Oliva - - * elf32-sh.c (sh_elf_relocate_section): Use - _bfd_final_link_relocate to apply the relocation against a section - symbol, when doing relocatable links. - -2000-09-18 Alan Modra - - * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section - to id_sec. - (stub_hash_newfunc): Here too. - (hppa_add_stub): And here. - (elf32_hppa_link_hash_table): Remove stub_section_created, - reloc_section_created, first_init_sec and first_fini_sec. Add - stub_group. - (elf32_hppa_link_hash_table_create): Init to suit. - (hppa_get_stub_entry): Add support for grouping stub sections. - (hppa_add_stub): Likewise. Remove sec_count param and init/fini - section code. Index stub vars by section->id. - (elf32_hppa_size_stubs): Likewise. Remove duplicated function - exit paths. Zap allocation of above removed vars. Refine - link-once test. - - * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param. - * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. - (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table - rather than pointer to bfd_link_info. - (hppa_add_stub): Likewise. - (final_link_relocate): Likewise. - -2000-09-17 David Huggins-Daines - - (elf32_hppa_size_stubs): Don't try to build stubs for discarded - link-once sections. - -2000-09-16 Alexandre Oliva - - * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match - ld/emulparams/shelf.sh. - -2000-09-10 Michael Sokolov - - * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function. - * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration. - * bfd-in2.h: Regenerate. - -2000-09-15 Kenneth Block - - * bfd/elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs - LITUSE relocations incorrectly if -relax is specified on the ld - command line and the displacement field of the load or store - instruction is non-zero. (Patch by paul.winalski@compaq.com) - -2000-09-15 Alan Modra - - * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and - first_fini_sec here. - (elf32_hppa_size_stubs): Instead correctly find the first .init - and .fini section here. - -2000-09-15 David Huggins-Daines - - * elf32-hppa.c (clobber_millicode_symbols): New function. - (elf32_hppa_size_dynamic_sections): Call it. - -2000-09-14 Alan Modra - - * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call - packed. Add plabel, plt_abs packed booleans. - (hppa_link_hash_newfunc): Init new fields. - (PLABEL_PLT_ENTRY_SIZE): Define. - (hppa_stub_name): Use size_t len vars. - (hppa_add_stub): Likewise. - (elf32_hppa_build_stubs): Likewise. - (hppa_build_one_stub): Kill some compiler warnings. - (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs - if dynamic linking. Munge the local plt offsets into - local_got_refcounts. Set h->plabel for all global PLABELs. Use - size_t len vars. Add assert for plabel addend. - (elf32_hppa_gc_sweep_hook): Sweep local plt entries too. - (elf32_hppa_hide_symbol): New function. - (elf_backend_hide_symbol): Define. - (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries - with h->plabel set. Don't make plt entries to have dynamic syms - when they have been forced local. If plt entry is used by a - plabel, make it PLABEL_PLT_ENTRY_SIZE. - (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns. - Set up .plt offsets for local syms. - (elf32_hppa_relocate_section): Initialise plt entries for local - syms. Leave weak undefined plabels zero. Make global plabel - relocs against function symbol, and leave the addend zero. - Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs. - (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for - non-dynamic syms. Init extra plt for plabels. Use *ABS* DIR32 - relocs instead of SEGREL32 for dynamic got relocs. - (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry. - (elf_backend_got_header_size): Adjust. - (elf32_hppa_set_gp): Calculate an "ideal" LTP. - - * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define. - (hppa_type_of_stub): Use it instead of #if 0 - (hppa_discard_copies): Use it here too. - (elf32_hppa_size_dynamic_sections): And here. - - * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field. - (elf32_hppa_link_hash_table_create): And here. - (hppa_build_one_stub): And here. Instead keep track of stub - offset using _raw_size. - (elf32_hppa_size_stubs): Likewise. - (elf32_hppa_build_stubs): Likewise. - (hppa_size_one_stub): Likewise. Resize reloc section too. - - * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and - first_fini_sec handling. Don't search for reloc section or set - hplink->reloc_section_created here. - (elf32_hppa_size_stubs): Instead search for reloc sections, and - set reloc_section_created here. - (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT. - (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT - and DT_FINI. - (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI. - - * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)' - with `hplink->root.'. - (elf32_hppa_check_relocs): Likewise. - (elf32_hppa_gc_sweep_hook): Likewise. - (elf32_hppa_adjust_dynamic_symbol): Likewise. - (hppa_handle_PIC_calls): Likewise. - (elf32_hppa_size_dynamic_sections): Likewise. - (elf32_hppa_set_gp): Likewise. - (elf32_hppa_relocate_section): Likewise. - (elf32_hppa_finish_dynamic_symbol): Likewise. - (elf32_hppa_finish_dynamic_sections): Likewise. - - From David Huggins-Daines - * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for - defined weak symbols in shared links. - (final_link_relocate): Calls to defined weak symbols in shared - objects must go via import stubs, as the target might not be known - at link time. - -2000-09-14 Alexandre Oliva - - * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32, - R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE, - R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167. Replaced - the original entries with EMPTY_HOWTOs, and added new ones to fill - in the gap. - (sh_elf_info_to_howto): Make sure the new gap isn't used. - (sh_elf_relocate_section): Likewise. - -2000-09-13 Anders Norlander - - * cpu-mips.c (arch_info_struct): Add mips:4K - * bfd-in2.h (bfd_mach_mips4K): New define. - * archures.c: Add bfd_mach_mips4K to comment. - * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return - E_MIPS_ARCH_2 for bfd_mach_mips4K. - -2000-09-13 Marco Franzen - - * som.c (som_write_symbol_strings): Do not used fixed buffers, - use size_t as a counter. - (som_write_space_strings): Similarly. - -2000-09-12 Jason Eckhardt - - * elf32-i860.c (elf32_i860_relocate_pc26): New function - and prototype. - (elf32_i860_relocate_section): Invoke new function from here. - -2000-09-11 Michael Sokolov - - * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names - static. - -2000-09-10 Michael Sokolov - - * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for - target section name instead of dumping core when the target symbol is - undefined. - -2000-09-09 Kazu Hirata - - * riscix.c: Remove DEFUN. - -2000-09-08 Nick Clifton - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not - initialise flags in output bfd if the input bfd is the default - architecture with the default flags. - -2000-09-08 Kazu Hirata - - * archive.c: Fix formatting. - * coff-arm.c: Likewise. - * doc/chew.c: Likewise. - -2000-09-08 Alan Modra - - * section.c (bfd_get_unique_section_name): Put a dot before the - numeric suffix. - -2000-09-07 Kazu Hirata - - * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. - * elf.c: Fix formatting. - -2000-09-07 Alexandre Oliva - - * config.bfd (sh-*-linux*): Added. - * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. - * targets.c: Declare them. - * elf32-sh-lin.c: New file. - * Makefile.am: Compile it. - * elf32-sh.c: Don't override defines from elf32-sh-lin.c. - * configure, Makefile.in: Rebuilt. - -2000-09-06 Geoffrey Keating - - * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss - pseduo-section when determining where the TOC ends. - - * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to - output x_tvndx as it is only two bytes wide. - - * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute - reloc is 26 or 32 bits wide. - - * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant - for relocs that don't change anything. Also look at the full - 6 bits of bitsize. - -2000-09-06 Philip Blundell - - * config.bfd (arm*-*-uclinux*): New target. - -2000-09-06 Alexandre Oliva - - * configure: Rebuilt with new libtool.m4. - -2000-09-06 Alan Modra - - * section.c (bfd_get_unique_section_name): Avoid c++ reserved - word for variable name. - * bfd-in2.h: Regenerate. - -2000-09-05 Nick Clifton - - * config.in: Regenerate. - * libbfd.h: Regenerate. - * po/bfd.pot: Regenerate. - * doc/bfdint.texi: Remove CVS date string - it foils compares with - local versions. - -2000-09-05 Steven Johnson - - * cpu-powerpc.c (arch_info_struct): Added MPC860 Family entry. - -2000-09-05 Alan Modra - - Shared library and PIC support. - * elf32-hppa.c (PLT_ENTRY_SIZE): New. - (GOT_ENTRY_SIZE): New. - (ELF_DYNAMIC_INTERPRETER): New. - (STUB_SUFFIX): Define. - (LONG_BRANCH_PIC_IN_SHLIB): Define. - (RELATIVE_DYNAMIC_RELOCS): Define. - (enum elf32_hppa_stub_type): New. - (struct elf32_hppa_stub_hash_entry): Rename offset to - stub_offset. Add a number of new fields. - (struct elf32_hppa_link_hash_entry): New. - (struct elf32_hppa_link_hash_table): Add numerous fields. Remove - global_value. - (elf32_hppa_hash_table): Rename to hppa_link_hash_table. - (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup. - (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init - new fields. - (hppa_link_hash_newfunc): New function. - (elf32_hppa_link_hash_table_create): Use above function. Init new - fields. - (elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc - instead of addend, and remove sym_name from args. Don't use - symbol name for local syms, instead use sym index. - (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return - stub type rather than size. Pass in hash and handle import stub - case. Also pass in reloc instead of offset so we can calculate - PCREL22F and PCREL12F branches properly. - (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build - import and export stubs too. - (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle - import and export stub sizing. - (elf32_hppa_check_relocs): New function. - (elf32_hppa_adjust_dynamic_symbol): New function. - (hppa_discard_copies): New function. - (elf32_hppa_size_dynamic_sections): New function. - (elf_backend_size_dynamic_sections): Define. - (elf32_hppa_finish_dynamic_symbol): New function. - (elf_backend_finish_dynamic_symbol): Define. - (elf32_hppa_size_stubs): Stash params in link hash table, and move - some local vars into the link hash table too. For shared links, - trundle over function syms, generating export stubs. Handle - PCREL22F branches. Break out stub creation code from here.. - (hppa_add_stub): .. to here. New function. - (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't - call the bfd linker. Use elf_gp to record global pointer. - Calculate a value from sections if $global$ is missing. - (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link. - (elf32_hppa_gc_mark_hook): New function. - (elf_backend_gc_mark_hook): Define. - (elf32_hppa_gc_sweep_hook): New function. - (elf_backend_gc_sweep_hook): Define. - (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate. - Add rel to args, and remove howto, input_bfd, offset, addend, - sym_name as we can recalculate these locally. Handle calls to - dynamic objects, extra PIC relocs, PCREL22F branches. Change - handling of undefined weak syms. Check that stubs are in range. - Only look for import stubs on PCREL17F and PCREL22F relocs. Add - message on hitting a DPREL21L reloc that needs fixing. Subtract - off PC for PCREL14F. Break out code that does a stub lookup from - here.. - (hppa_get_stub_entry): ..to here. New function. - (elf32_hppa_relocate_insn): Merge into final_link_relocate. - (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic - relocs, etc. etc. - (elf32_hppa_finish_dynamic_sections): New function. - (elf_backend_finish_dynamic_sections): Define. - (elf_backend_final_write_processing) Define. - (hppa_handle_PIC_calls): New function. - (elf32_hppa_build_stubs): Call it. Pass link_info to - hppa_build_one_stub. - (elf32_hppa_create_dynamic_sections): New function - to create .plt and .got then set .plt flags correctly. - (elf_backend_create_dynamic_sections): Define. - (elf32_hppa_object_p): New function. - (elf_backend_object_p): Define. - (elf32_hppa_elf_get_symbol_type): New function. - (elf_backend_get_symbol_type): Define. - (elf_backend_can_gc_sections): Define. - (elf_backend_want_got_plt): Define. - (elf_backend_plt_alignment): Set to 2. - (elf_backend_plt_readonly): Define. - (elf_backend_want_plt_sym): Define. - (elf_backend_got_header_size): Reserve one entry. - - * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd. - (elf32_hppa_size_stubs): Pass in multi_subspace. - (elf32_hppa_set_gp): Declare. - - * section.c (SEC_HAS_GOT_REF): Define new flag for asection. - (bfd_get_unique_section_name): New function. - * bfd_in2.h: Regenerate. - - * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F. - (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc - comment. - - From David Huggins-Daines - * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning. - (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx. - (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has - been updated in finish_dynamic_symbol before modifying function - symbol. - - * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of - eight entries. Replace NULL with bfd_elf_generic_reloc. Add - R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F. - (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*. Add some - comments. Handle format == 12 for R_HPPA_PCREL_CALL. - (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F. - (elf_hppa_relocate_insn): Likewise. Reformat some comments. - (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32. - - From David Huggins-Daines - * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF - style of local labels as well. - -2000-09-03 Philip Blundell - - * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate - references to undefined symbols in debugging sections. - -2000-09-02 H.J. Lu - - * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, - BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, - BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH - section. - -2000-09-02 Jason Eckhardt - - * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro. - (elf32_i860_is_local_label_name): New function and prototype. - -2000-09-02 Nick Clifton - - * configure.in: Increase version number to 2.10.91. - * configure: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * po/bfd.pot: Regenerate. - -2000-09-02 Daniel Berlin - - * elf.c (_bfd_elf_make_section_from_shdr): Add - .gnu.linkobce.wi. to the list of debug section names. - -2000-09-02 Nick Clifton - - * dwarf2.c (find_debug_info): New function: Locate a section - containing dwarf2 debug information. - (bfd_dwarf2_find_nearest_line): Find all sections containing - debug information and include them in the stash. - -2000-09-01 Niibe Yutaka , Kaz Kojima , Alexandre Oliva - - * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT, - R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New. - (sh_reloc_map): Add new relocs. - (sh_elf_check_relocs, sh_elf_link_hash_newfunc, - sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol, - sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol, - sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New - functions. - (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define. - (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, - elf_sh_plt_entry_be, elf_sh_plt_entry_le, - elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): - New array constants. - (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry): - New variables. - (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, - elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset, - elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset, - elf_sh_plt_reloc_offset): Define. - (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry, - elf_sh_link_hash_table): New structs. - (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros. - (sh_elf_relocate_section, sh_elf_check_relocs): Handle new - relocation types. - (elf_backend_create_dynamic_sections, - bfd_elf32_bfd_link_hash_table_create, - elf_backend_adjust_dynamic_symbol, - elf_backend_size_dynamic_sections, - elf_backend_finish_dynamic_symbol, - elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, - elf_backend_plt_readonly, elf_backend_want_plt_sym, - elf_backend_got_header_size, elf_backend_plt_header_size): - Define. - * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, - BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC): - New relocs. - * bfd-in2.h, libbfd.h: Rebuilt. - -2000-09-01 Alan Modra - - * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27 - change. - -2000-08-31 J"orn Rennecke - - * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags - not initialized, set them to indicate the SH1 instruction set. - -2000-08-31 Alexandre Oliva - - * acinclude.m4: Include libtool and gettext macros from the - top level. - * aclocal.m4, configure: Rebuilt. - -2000-08-29 Michael Snyder - - * elf.c: Eliminate references to __sparcv9 macro; replace with - autoconf variables HAVE_PSINFO32_T etc. - * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, - HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. - * config.in: Ditto. - * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can - detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. - * aclocal.m4: Ditto. - * configure: Regenerate. - -2000-08-27 Alan Modra - - * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied - for any shared link, not just shared -Bsymbolic. - (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on - any shared link, and pass link info to it. - (elf_i386_size_dynamic_sections): Update comment. - (elf_i386_discard_copies): Modify to discard relocs for symbols - that have been forced local. - (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols - that have been forced local. - -2000-08-24 Denis Chertykov & Nick Clifton - - * elflink.h (elf_link_add_object_symbols): Allow common - symbols to have an alignment of 1 if explicitly requested, and - not overridden by other definitions. - -2000-08-22 Doug Kwan - - * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. - * coffcode.h (coff_set_flags): Add detection of w65 architecture. - -2000-08-22 H.J. Lu - - * elf-bfd.h (elf_link_hash_table): Add runpath. - - * bfd-in.h (bfd_elf_get_runpath_list): New prototype. - * bfd-in2.h: Rebuilt. - - * elf.c (_bfd_elf_link_hash_table_init): Initialize the - "runpath" field to NULL. - (bfd_elf_get_runpath_list): New function. - - * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and - DT_RUNPATH entries. - -2000-08-22 Alexandre Oliva - - * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W, - R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them - explicitly. Improve validation of r_type. - -2000-08-21 H.J. Lu - - * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the - dynamic allocated content space. Add a comment to remind us that - one day this ought to be fixed. - * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. - * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. - * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. - -2000-08-21 Jason Eckhardt - - * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate - field with the newly relocated value instead of adding it to the - existing immediate field. - (elf32_i860_relocate_splitn): Likewise. - (elf32_i860_relocate_highadj): Likewise. - -2000-08-16 Jason Eckhardt - - * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it - was previously just a stub). - -2000-08-16 Alexandre Oliva - - * elflink.c (_bfd_elf_create_got_section): Don't abort(). - Formatting fixes. - (_bfd_elf_create_dynamic_sections): Likewise. - -2000-08-16 Andrew Macleod - - * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address - for undefined symbols to be the beginning of the section. - - * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate - four extra entries at the beginning of the .rela.plt section. - (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt - section to account for the four reserved entries in the .plt section. - -2000-08-15 Geoffrey Keating - - * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0 - to the list of NOPs we recognize after a branch-and-link. - Use the ori NOP when one is needed. - - * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation - for large archives. - -2000-08-14 Jim Wilson - - * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle - EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP. - (elf64_ia64_print_private_bfd_data): Likewise. Also handle - EF_IA_64_ABSOLUTE. - -2000-08-11 Alexandre Oliva - - * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static. - -2000-08-10 Jason Eckhardt - - * elf32-i860.c (elf32_i860_relocate_section): New function. - (i860_final_link_relocate): New function. - (elf32_i860_relocate_splitn): New function. - (elf32_i860_relocate_pc16): New function. - (elf32_i860_relocate_highadj): New function. - (elf32_i860_howto): Minor adjustments to some relocations. - (elf_info_to_howto_rel): Define. - (elf_backend_relocate_section): Define. - -2000-08-10 Nick Clifton - - * elf32-arm.h: Fix formatting. - -2000-08-10 Bernd Schmidt - - * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static. - -2000-08-08 Jason Eckhardt - - * elf32-i860.c (elf32_i860_howto_table): Updated some fields. - -2000-08-07 Kazu Hirata - - * ieee.c (ieee_write_debug_part): Rewrite a comment. - * elf64-ia64.c: Fix a typo. - -2000-08-05 Jason Eckhardt - - * elf32-i860 (elf32_i860_howto_table): New structure. - (lookup_howto): New function. - (elf32_i860_reloc_type_lookup): New function. - (elf32_i860_info_to_howto_rela): New function. - (elf_code_to_howto_index): New structure. - (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela. - (bfd_elf32_bfd_reloc_type_lookup): Re-define as - elf32_i860_reloc_type_lookup. - -2000-08-04 Rodney Brown - - * som.c (struct fixup_format): Constify `format'. - (som_hppa_howto_table): Use SOM_HOWTO macro. - (try_prev_fixup, hppa_som_reloc): Decorate unused parameter. - (som_bfd_reloc_type_lookup): Likewise. - (compare_subspaces): Remove unused `count1', `count2'. - (som_begin_writing): Remove unused `total_reloc_size'. - (som_bfd_derive_misc_symbol_info): Decorate unused parameter. - (som_print_symbol, som_bfd_is_local_label_name): Likewise. - (som_set_reloc_info): Constify `cp'. Remove unused `addend'. - (som_find_nearest_line): Decorate unused parameter(s). - (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise. - (som_bfd_link_split_section): Likewise. - -2000-08-03 Nick Clifton - - * section.c: Restore backed out code. - * elf.c: Restore backed out code. - (copy_private_bfd_data): Fix bug preventing stipped dynamic - binaries from working. - * bfd-in2.h: Regenerate. - -2000-08-03 H.J. Lu - - * section.c: Back out the change made by Nick Clifton - on 2000-07-31. It breaks stripping dynamic - binaries. - * bfd-in2.h: Likewise. - * elf.c: Likewise. - -2000-08-03 Alexandre Oliva - - * elf32-sh.c (sh_elf_reloc_loop): Warning removal. - -2000-07-31 Jason Eckhardt - - * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860. - * bfd-in2.h, libbfd.h: Regenerate. - -2000-07-31 Nick Clifton - - * section.c (struct sec): Add new boolean field 'segment_mark'. - (STD_SECTION): Initialise new field to zero. - - * bfd-in2.h: Regenerate. - - * elf.c (copy_private_bfd_data): Reorganise section to segment - mapping to cope with moved sections requiring new segments, - and overlapping segments. - (SEGMENT_END): New macro: Return the end address of a segment. - (IS_CONTAINED_BY_VMA): New macro: Determine if a segment - contains a section by comparing their VMA addresses. - (IS_CONTAINED_BY_LMA): New macro: Determine if a segment - contains a section by comparing their LMA addresses. - (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a - section should be included in a segment. - (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment - follows another in memory. - (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two - segments overlap. - -2000-07-22 Jason Eckhardt - - * cpu-i860.c: Added comments. - - * elf32-i860.c (TARGET_LITTLE_SYM): Defined to - bfd_elf32_i860_little_vec. - (TARGET_LITTLE_NAME): Defined to "elf32-i860-little". - (ELF_MAXPAGESIZE): Changed to 4096. - - * targets.c (bfd_elf32_i860_little_vec): Declaration of - new target. - (bfd_target_vector): Added bfd_elf32_i860_little_vec. - - * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added - config for little endian elf32 i860. - (targ_defvec): Define for the new config above - as "bfd_elf32_i860_little_vec". - (targ_selvecs): Define for the new config above - as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec" - - * configure.in (bfd_elf32_i860_little_vec): Added recognition - of new target vec. - - * configure: Regenerated. - -2000-07-27 H.J. Lu - - * elflink.h (elf_merge_symbol): Take one more argument, - dt_needed, to indicate if the symbol comes from a DT_NEEDED - entry. Don't overide the existing weak definition if dt_needed - is true. - (elf_link_add_object_symbols): Pass dt_needed to - elf_merge_symbol (). - -2000-07-27 Nick Clifton - - * elflink.h (elf_link_size_reloc_section): Zeroes the section's - allocated contents. - -2000-07-25 Geoffrey Keating - - * configure.host (*-*-aix*): AIX has 'long long' always. - - * coff-rs6000.c (xcoff_write_one_armap_big): New procedure. - (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps. - (xcoff_write_archive_contents_big): Don't update the offset - of the symbol table, xcoff_write_armap will do it. - -2000-07-23 Ulf Carlsson - - * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead - of dynobj for SGI_COMPAT checks. - -2000-07-21 Michael Sokolov - - * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function. - * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration. - * bfd-in2.h: Regenerate. - -2000-07-21 Nick Clifton - - * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of - range symbol indices in relocs and issue an error message. - -2000-07-20 H.J. Lu - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check - info->new_dtags when setting DT_FLAGS_1. It will only be set - by the new linker options. It shouldn't break anything. - -2000-07-20 H.J. Lu - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1 - only if info->new_dtags is true. - -2000-07-20 H.J. Lu - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set - DT_RUNPATH and DT_FLAGS only if info->new_dtags is true. - -2000-07-20 Hans-Peter Nilsson - - * Makefile.am (ALL_MACHINES): Add cpu-cris.lo. - (ALL_MACHINES_CFILES): Add cpu-cris.c. - (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo. - (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c. - (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules. - * Makefile.in: Rebuild. - * aclocal.m4: Rebuild. - * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris. - * archures.c (enum bfd_architecture): Add bfd_arch_cris. - (bfd_cris_arch): Declare. - (bfd_archures_list): Add bfd_cris_arch. - * bfd-in2.h: Rebuild. - * config.bfd: (cris-*-*): New target. - * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors. - * configure: Rebuild. - * elf.c (prep_headers): Add bfd_arch_cris. - * libbfd.h: Rebuild. - * libaout.h (enum machine_type): Add M_CRIS. - * reloc.c: Add CRIS relocations. - * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare. - (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec. - * cpu-cris.c, aout-cris.c, elf32-cris.c: New files. - * po/POTFILES.in, po/bfd.pot: Regenerate. - -2000-07-19 H.J. Lu - - * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set - DF_TEXTREL if DT_TEXTREL is set. - * elf32-i370.c (i370_elf_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 (_bfd_mips_elf_size_dynamic_sections): Likewise. - * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. - * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. - * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. - * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. - * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. - * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also - set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if - DT_RPATH is set. - Set the DT_FLAGS and DT_FLAGS_1 entries if necessary. - -2000-07-19 H.J. Lu - - * bfd-in.h (bfd_elf_set_dt_needed_soname): New. - * bfd-in2.h: Rebuild. - - * elf-bfd.h (elf_obj_tdata): Add dt_soname. - (elf_dt_soname): New. - - * elf.c (bfd_elf_set_dt_needed_soname): New. - - * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED - entry if the shared object loaded by DT_NEEDED is used to - resolve the reference in a regular object. - -2000-07-19 H.J. Lu - - * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG, - DT_DEPAUDIT and DT_AUDIT as strings. - -2000-07-19 Nick Clifton - - * format.c: Fix formatting. - -2000-07-19 H.J. Lu - - * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM. - -2000-07-19 H.J. Lu - - * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW, - DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, - DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ, - DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1, - DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT, - DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT, - DT_FLAGS_1, DT_USED and DT_CHECKSUM. - -2000-07-18 Andrew Cagney - - * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move - renamed functions from here... - (assign_section_numbers): Use renamed functions. - (prep_headers): Use renamed functions. - - * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here. - * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update. - * bfd-in2.h: Regenerate. - -2000-07-18 Ulf Carlsson - - * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add - parenthesis in if statement. - -2000-07-17 Koundinya K - - Enable the support for Traditional MIPS. - * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand - return ict_none appropriately for traditional mips targets. - (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips. - (STUB_MOVE): Conditionalize for traditonal mips. - (STUB_LI16): Likewise. - (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making - room for RTPROC header. - (_bfd_mips_elf_modify_segment_map): For a normal mips executable set - the permission for the PT_DYNAMIC as read, write and execute. - (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING - for traditonal mips. - (_bfd_mips_elf_create_dynamic_sections): Add the symbol - _DYNAMIC_LINKING for traditonal mips. - (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP - in case of traditonal mips. - (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT - entry is required. For a function if PLT is not required then set the - corresponding hash table entry to 0. - (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for - traditonal mips. - (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a - shared object set the value to 0. - (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol - _DYNAMIC_LINKING for traditonal mips. - (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP - for traditonal mips. - -2000-07-15 H.J. Lu - - * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL. - -2000-07-12 Charles Wilson - - * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing - out a structure that is BFD_IN_MEMORY. - -2000-07-11 Alan Modra - - * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of - bfd pointer. Print section id instead of bfd pointer for local - syms. Prefix addend with `+' for global syms as well as local. - Correct calculation of name component lengths. - (elf64_hppa_check_relocs): Update call to get_dyn_name. - - From David Huggins-Daines - * elf-hppa.h (elf_hppa_relocate_section): Update calls here too. - * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings. - (elf64_hppa_modify_segment_map): Likewise. - -2000-07-11 Andrew Cagney - - * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA - addresses to be "naturally" sign extended. Return -1 if unknown. - * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration. - * bfd-in2.h: Regenerate. - -2000-07-11 Andrew Cagney - - * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32 - and ECOF_SIGNED_64 to list ways to extract an offset. - (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in, - ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out): - Update. - * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64. - * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32. - -2000-07-11 Andrew Cagney - - * elfcode.h (elf_object_p): Use bfd_set_start_address and not - bfd_get_start_address. - (elf_swap_ehdr_in): Sign extend e_entry when applicable. - (elf_swap_ehdr_out): Ditto. - -2000-07-10 Alexander Aganichev - - * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for - compatibility with older binutils. - -2000-07-10 Alan Modra - - * section.c (bfd_make_section_anyway): Start section_id at 0x10. - (STD_SECTION): Avoid negative ids, instead use 0 to 3. - - From Ryan Bradetich - * dwarf1.c (parse_die): Cure signed/unsigned char warnings. - (parse_line_table): Ditto. - (_bfd_dwarf1_find_nearest_line): Ditto. - * syms.c (cmpindexentry): Remove extra `*' from params. - -2000-07-09 Koundinya K - - * elf32-mips.c (sort_dynamic_relocs): New Function. - (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs - via qsort to sort the dynamic relocations in increasing r_symndx - value. - -2000-07-09 Alan Modra - - * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add - ATTRIBUTE_UNUSED to unused args. - (get_opd): Likewise. - (get_plt): Likewise. - (get_dlt): Likewise. - (get_stub): Likewise. - (elf64_hppa_adjust_dynamic_symbol): Likewise. - (elf64_hppa_link_output_symbol_hook): Likewise. - (elf64_hppa_check_relocs): Delete unused var. - (elf64_hppa_size_dynamic_sections): Likewise. - (elf64_hppa_finalize_opd): Likewise. - (elf64_hppa_finalize_dynreloc): Likewise. - (elf64_hppa_modify_segment_map): Likewise. - (elf64_hppa_finish_dynamic_sections): Likewise. - - * elf-hppa.h (elf_hppa_final_write_processing): Add - ATTRIBUTE_UNUSED to unused args. - (elf_hppa_final_link_relocate): Likewise. - (elf_hppa_record_segment_addrs): Add paretheses. - (elf_hppa_relocate_section): Constify dyn_name. - - From David Huggins-Daines - * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and - rearrange case statement so that it gets preferred to 32-bit ones. - - * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use - asection->id instead of address of asection structure. - (elf32_hppa_size_stubs): Likewise. - - * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section - for .init* and .fini*. - - * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers - and addends used in stub names to 32 bits. - (elf32_hppa_size_stubs): Likewise. - - * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend - twice for R_PARISC_GPREL64. Use bfd_put_32 for R_PARISC_PCREL32, - not bfd_put_64. Fix minor comment typo and formatting. - - Changes to create multiple linker stubs, positioned immediately - before the section where they are required. - * elf32-hppa.c: Don't include hppa_stubs.h. - (elf32_hppa_stub_hash_entry): Add a pointer to the stub section. - (elf32_hppa_stub_hash_table): Delete. - (elf32_hppa_link_hash_entry): Delete. - (elf32_hppa_link_hash_table): Use plain bfd_hash_table for - stub_hash_table, and store the struct here rather than a pointer. - Delete output_symbol_count. Add offset array. Change - global_value to a bfd_vma. - (elf32_hppa_stub_hash_lookup): Use table instead of table->root. - (elf32_hppa_stub_hash_traverse): Delete. - (elf32_hppa_name_of_stub): Delete. - (elf32_hppa_link_hash_lookup): Delete. - (elf32_hppa_link_hash_traverse): Delete. - (elf32_hppa_stub_hash_table_init): Delete. - (elf32_hppa_size_of_stub): Pass input section and offset rather - than location and calculate location here. Don't pass name as all - stubs are now the same size. - (elf32_hppa_stub_hash_newfunc): Init new fields. - (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table - too. - (elf32_hppa_bfd_final_link_relocate): Cast enums to int before - comparing against ints. Rewrite stub handling code. - (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned. - Case enums to int before comparing against ints. Remove - bfd_reloc_dangerous case. - (elf32_hppa_build_one_stub): Rewrite. - (elf32_hppa_size_one_stub): New function. - (elf32_hppa_build_stubs): Rewrite. - (elf32_hppa_size_stubs): Pass in linker call-back functions. - Rewrite stub-handling specific code. - - * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype. - - * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo. - - * hppa_stubs.h: Delete. - * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h - (elf32-hppa.lo): Remove hppa_stubs.h from dependencies. - * Makefile.in: Regenerate. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and - e_nlrsel. - - * libhppa.h (hppa_field_adjust): Correct e_nsel case. - - * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset - and section name for bfd_reloc_notsupported error message. - (elf32_hppa_bfd_final_link_relocate): Print reasons for returning - bfd_reloc_notsupported. - (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd. - - * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle - undefined weak symbols for all relocs. - (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch - offsets are relative to one past the delay slot. - (elf32_hppa_size_stubs): Account for reloc addend when calculating - branch destination. Put addend into stub name too. - (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and - adjust by 8 when deciding whether a linker stub is needed. Put - addend into stub name as for above. - - * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on - various args and vars. - (elf32_hppa_bfd_final_link_relocate): Here too. - (elf32_hppa_size_stubs): Rename index -> indx. Use e_indx for - inner block var to avoid shadowing. - - * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Make `field' arg - unsigned. - * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto. - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto. - (elf_hppa_fake_sections): Rename local var to avoid shadowing. - - * libhppa.h: Change practically all unsigned ints to plain ints. - Remove tests on gcc version. Instead use ATTRIBUTE_UNUSED for - prototypes. - - From Ryan Bradetich - * libhppa.h (hppa_opcode_type): New enum to replace #define's. - * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to - suit above. - From David Huggins-Daines - * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants - to the new OP_* ones. - - * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on - error exit. Bail out earlier on plabel relocs that we aren't - interested in. Don't tell elf32_hppa_stub_hash_lookup to copy - string, and then don't free our copy. - (elf32_hppa_build_one_stub): Make insn unsigned int. - - * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only - available with BL, not BE and BLE. - - * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example - code for elf arg relocs. - (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local - argument with elf_link_hash_entry h. Handle undefined weak - symbols. Move $global$ lookup from here... - (elf32_hppa_relocate_section): ...to here. Return correct error - message for non-handled relocs. - (elf32_hppa_size_of_stub): Correctly test branch range. Previous - wrong test was -0x3ffff to +0x40000. - - * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R, - R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches; - Handle them as such. - (elf_hppa_relocate_insn): Fix a typo. - - * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete. - (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, - assemble_17, assemble_21): Delete. - Supply defines for all 64 possible opcodes. - (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode - formats. Handle COMICLR. - (hppa_rebuild_insn): Delete bfd argument. Handle formats 10, -11, - -10, -16, 16, 22. - - * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite. - (elf32_hppa_bfd_final_link_relocate): Major rewrite. - (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls - to suit. - (elf32_hppa_size_stubs): Don't free stub_name twice. Read in all - the local syms - did this code get deleted accidentally? Ignore - undefined and undefweak syms. - - * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost - block. Use it instead of elf64_hppa_hash_table (info). - (elf_hppa_final_link_relocate): Use hppa_info instead of - elf64_hppa_hash_table (info). - - * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, - re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. - (hppa_rebuild_insn): Mask immediate bits here instead. - * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. - -2000-07-08 Alan Modra - - * section.c (struct sec): Add id field. Tidy comment formatting. - (bfd_make_section_anyway): Set id. - (STD_SECTION): Init id too. - Change CONST to const throughout. - * archures.c (bfd_arch_info): Tidy comment. - (bfd_arch_list): Change a CONST to const. - * libbfd-in.h: Tidy comments and replace CONST with const. - * elf-bfd.h: Likewise. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - * libcoff.h: Regenerate. - -2000-07-07 DJ Delorie - - * archive.c (_bfd_write_archive_contents): Add an informative - comment. - -2000-07-06 Kazu Hirata - - * srec.c: Fix formatting. - -2000-06-05 DJ Delorie - - * MAINTAINERS: new - -2000-07-04 Alexandre Oliva - - * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol - value of PC-relative offsets. - -2000-07-03 Jim Wilson - - * elf64-alpha.c (alpha_elf_size_info): New. - (elf_backend_size_info): Define to alpha_elf_size_info. - * elfcode.h (elf_size_info): Change hash bucket size to 4. - -2000-07-03 Ulf Carlsson - - * elf32-mips.c: Include elf32-target.h again for the traditional - MIPS targets. - -2000-07-03 Marek Michalkiewicz - - * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup): - Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings. - (avr_info_to_howto_rela): Likewise. - (elf32_avr_gc_mark_hook): Likewise. - (elf32_avr_gc_sweep_hook): Likewise. - (elf32_avr_relocate_section): Likewise. - -2000-07-03 Mark Elbrecht - - * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into - an external symbol for a non-shared, non-relocatable link. - -2000-07-03 Nick Clifton - - * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol - is an external symbol. - (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak - external symbol. - -2000-07-03 Kazu Hirata - - * reloc16.c: Fix formatting. - -2000-07-01 Koundinya K - - * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4* - to add a new target for traditional mips i.e - bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec. - * configure.in: Likewise. - * configure: Rebuild. - * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in - bfd_target_vector. - (bfd_elf32_tradlittlemips_vec): Likewise. - * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test - to see that elfNN_bed does not get redefined even if the target file - is included twice for a chip. See elf32-mips.c. - -2000-07-01 Alan Modra - - * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed - (CLEANFILES): Add DEPA. - * Makefile.in: Regenerate. - -2000-06-30 DJ Delorie - - * peicode.h (coff_swap_filehdr_in): can't use e_magic because we - can't assume the PE header is at 0x80. - -2000-06-29 Mark Elbrecht - - * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH. - -2000-06-28 Mark Elbrecht - - * go32stub.h: Update stub. - -2000-06-26 Marek Michalkiewicz - - * archures.c (bfd_mach_avr5): Define. - * bfd-in2.h (bfd_mach_avr5): Define. - * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to - bfd_mach_avr5, add bfd_mach_avr4. Update comments. - (compatible): Update comment. Add missing test. - * elf32-avr.c (avr_final_link_relocate): Support 8K wrap - for avr2 and avr4. Simplify 8K wrap code. - (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5. - (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5. - -2000-06-26 Kazu Hirata - - * coff-h8300.c: Fix formatting. - * cpu-h8300.c: Likewise. - -2000-06-24 Alexandre Oliva - - * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)' - for local symbols whose names are unknown. - -2000-06-22 Alan Modra - - * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we - find one. - * Makefile.in: Regenerate. - * doc/Makefile.in: Regenerate. - -2000-06-20 H.J. Lu - - * Makefile.am: Rebuild dependency. - * Makefile.in: Rebuild. - -2000-06-20 Maciej W. Rozycki - - * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function. - (elf_backend_copy_indirect_symbol): Map to the new function. - -2000-06-20 Alan Modra - - * archive.c (normalize): Correct pointer comparison when checking - for backslashes. - (bfd_bsd_truncate_arname): Likewise. - (bfd_gnu_truncate_arname): Likewise. - -2000-06-20 Ulf Carlsson - - * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual - sections elf_{text,data}_{section,symbol}. - * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove. - (_bfd_mips_elf_hide_symbol): New function. - (elf_backend_hide_symbol): Map to the new function. - (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD - definitions of mips_elf_{text,data}_{section,symbol}. - (mips_elf_local_relocation_p): Try to find the direct symbol - based on new check_forced argument. - (mips_elf_calculate_relocation): Use new version of - mips_elf_local_relocation_p. - (mips_elf_relocate_section): Likewise. - (_bfd_mips_elf_relocate_section): Likewise. - (mips_elf_sort_hash_table): Only assert that have enough GOT - space. - (mips_elf_got16_entry): Match all 32 bits to the existing GOT - entry if the relocation based on the new external argument. - (mips_elf_create_dynamic_relocation): Assert that we have a - section contents allocated where we can swap out the dynamic - relocations. - (mips_elf_calculate_relocation): Find the real hash-table entry - correctly by using h->root.root.type. Only create a dynamic - relocation entry if the symbol is defined in a shared library. - Create an external GOT entry for the GOT16 relocation if the - symbol was forced local. - (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a - dynamic index if the symbol was forced local. - -2000-06-20 Maciej W. Rozycki - - * elf32-mips.c: Fix typos in comments. - -2000-06-19 Mark Kettenis - - * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef - CORE_VERSION_1. - -2000-06-18 Stephane Carrez - - * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild. - * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS, - BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files. - * configure.in (bfd_elf32_m68hc12_vec): Recognize. - (bfd_elf32_m68hc11_vec): Likewise. - * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11. - Supports 68hc11 & 68hc12 at the same time. - * targets.c (bfd_elf32_m68hc12_vec): Declare and put in - bfd_target_vector. - (bfd_elf32_m68hc11_vec): Likewise. - * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11. - * archures.c (bfd_m68hc12_arch): Define and register in global list - (bfd_m68hc11_arch): Likewise. - * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8, - BFD_RELOC_M68HC11_3B): Define. - * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support. - * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support. - -2000-06-18 Ulf Carlsson - - * elf_bfd.h (struct elf_backend_data): Add info argument to - elf_backend_hide_symbol. - (_bfd_elf_link_hash_hide_symbol): Likewise. - * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise. - * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise. - * elflink.h (elf_link_add_object_symbols): Likewise. - (elf_link_assign_sym_version): Likewise. - -2000-06-18 H.J. Lu - - * coff-i386.c (coff_i386_reloc): Don't return in case of - output_bfd == (bfd *) NULL if COFF_WITH_PE is defined. - Compensate PE relocations when linking with non-PE object - files to generate a non-PE executable. - -2000-06-17 Ulf Carlsson - - * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write - GOT entries if we're doing a static link or -Bsymbolic link. - -2000-06-15 Ulf Carlsson - - * elflink.h (elf_link_adjust_relocs): Check for and call backend - specifific swap_reloc_{in,out} and swap_reloca_{in,out} if - available. - (elf_link_output_relocs): Likewise. - (elf_reloc_link_order): Likewise. - -2000-06-16 Nicholas Duffek - - * archures.c (enum bfd_architecture): #define constants for - PowerPc and RS6000 machine numbers. - * bfd-in2.h: Regenerate. - * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch - to bfd_arch_powerpc instead of bfd_arch_rs6000. Refer to PowerPc - and RS6000 machine numbers using #defined constants from - archures.c. - * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000 - machine numbers using #defined constants from archures.c. Add - entries for EC603e, 630, A35, RS64II, RS64III, 7400. Specify - 64-bit words in 620 entry. - * cpu-rs6000.c (arch_info_struct): Create with entries for RS1, - RSC, and RS2. - (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k). - -2000-06-16 Nicholas Duffek - - * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64. - * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field. - * libcoff.h (struct xcoff_tdata): Define xcoff64 field. - -2000-06-16 Nicholas Duffek - - * bfd-in.h (bfd_family_coff): Define. - * bfd-in2.h: Regenerate. - * coffgen.c (coff_count_linenumbers, coff_symbol_from, - coff_find_nearest_line): Check COFFness using bfd_family_coff() - instead of bfd_target_coff_flavour. - * cofflink.c (_bfd_coff_final_link): Likewise. - * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to - exclude XCOFF files. - * reloc.c (bfd_perform_relocation, bfd_install_relocation): - Likewise. - * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour. - * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour. - * xcofflink.c (XCOFF_XVECP): Delete. - (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol, - bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc, - bfd_xcoff_record_link_assignment, - bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with - check for bfd_target_xcoff_flavour. - -2000-06-16 Nicholas Duffek - - * rs6000-core.c: Support 64-bit core files, support pre-4.3 core - files on AIX 4.3. - (read_hdr): New function. - (rs6000coff_core_p): Store mstsave or __context64 struct instead - of trying to extract individual registers. Set abfd->arch_info - to match the architecture that created the core file. - (rs6000coff_get_section_contents): Delete. - * xcoff-target.h (rs6000coff_get_section_contents): Delete. - -2000-06-14 H.J. Lu - - * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec) - is NULL. - -2000-06-13 H.J. Lu - - * configure: Regenerate. - -2000-06-13 J"orn Rennecke - - * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of - armpei_little_vec. - -2000-06-08 David O'Brien - - * configure.in (VERSION): Update to show this is the CVS mainline. - -2000-06-07 Alan Modra - - * elf32-d10v.c: Include elf/d10v.h - (enum reloc_type): Delete. - * elf32-d30v.c: Include elf/d30v.h - (enum reloc_type): Delete. - - * Makefile.am: Run "make dep-am" to regenerate dependencies. - * Makefile.in: Regenerate. - - * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs. - (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and - move HOWTOs into elf_howto_table. - (R_386_standard, R_386_ext_offset): Define. - (R_386_ext, R_386_vt_offset, R_386_vt): Define. - (elf_i386_reloc_type_lookup): Modify calculation of index into - elf_howto_table since we've removed the padding. - (elf_i386_info_to_howto_rel): Likewise. - (elf_i386_relocate_section): Likewise. - -2000-06-06 Michael Snyder - - * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t. - -2000-06-05 H.J. Lu - - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag - an error when seeing an undefined symbol with hidden/internal - attribute. It is handled in *_relocate_section (). - -2000-06-05 H.J. Lu - - * elflink.h (elf_fix_symbol_flags): Follow the link for the - indirect symbol for the ELF_LINK_NON_ELF bit. - (elf_link_output_extsym): Don't output the indirect symbol even - if the ELF_LINK_NON_ELF bit is set. - -2000-06-01 J.T. Conklin - - * config.bfd (i[3456]86-*-netbsdelf*): New target. - (i[3456]86-*-netbsdaout*): New target. - (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs. - (i[3456]86-*-openbsd*): Likewise. - -2000-05-30 Andrew Cagney - - * trad-core.c: From hpux-core.c, include or - when possible. - -2000-05-31 Nick Clifton - - * opintl.h (_(String)): Explain why dgettext is used instead - of gettext. - -2000-05-31 Ulrich Drepper - - * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version - definitions. We must not assume they are sorted in the file - according to their index numbers. - -2000-05-31 Alan Modra - - * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field - selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and - R_PARISC_DIR17F are for absolute branches; Handle them as such. - -2000-05-30 Nick Clifton - - * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB, - 80960CA, 80960MC as valid machine names. - -2000-05-30 H.J. Lu - - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the - visibility bits if the symbol is undefined. Correctly handle - weak undefined symbols with hidden and internal attributes. - - * elflink.h (elf_link_add_object_symbols): Always turn the - symbol into local if it has the hidden or internal attribute. - -2000-05-29 Philip Blundell - - * ppcboot.c: Add packed attribute if compiling with GCC. - -2000-05-29 Anatoly Vorobey - - * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal. - -2000-05-26 Michael Snyder - - * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus, - elfcore_grok_psinfo): Add code to allow debugging a 32-bit - corefile on a 64-bit (Sparc Solaris) host. Also clean up - a few old comments. - -2000-05-26 Alan Modra - - * Makefile.am: Update dependencies with "make dep-am" - * Makefile.in: Regenerate. - - * sysdep.h (gettext, dgettext, dcgettext, textdomain, - bindtextdomain): Replace defines with those from intl/libgettext.h - to quieten gcc warnings. - -2000-05-26 Eli Zaretskii - - * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH. - - * archive.c (normalize, bfd_bsd_truncate_arname, - bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support - file names with backslashes. - - * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file - before opening it. - - * sysdep.h: Include filenames.h. - -2000-05-26 Alan Modra - - * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. - -2000-05-26 Jakub Jelinek - - * elf64-sparc.c (sparc64_elf_relax_section): New. - (sparc64_elf_relocate_section): Optimize tail call into branch always - if possible. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - (elf32_sparc_relax_section): New. - -2000-05-26 Jakub Jelinek - - * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters. - Remove unusued variables. - (sparc64_elf_relocate_section): Change r_symndx type to unsigned long. - (sparc64_elf_merge_private_bfd_data): Fix shared library case from - previous fix, so that shared libs really don't influence targets - extension mask and memory model. - -2000-05-23 H.J. Lu - - * elf64-alpha.c (elf64_alpha_relocate_section): Check - h->root.other not h->other. - * elf32-mips.c (mips_elf_calculate_relocation): Likewise. - - * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. - -2000-05-23 H.J. Lu - - * elf32-i386.c (elf_i386_relocate_section): Don't allow the - undefined symbol with the non-default visibility attributes. - * elf-hppa.h (elf_hppa_relocate_section): Likewise. - * elf32-arm.h (elf32_arm_relocate_section): Likewise. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mcore.c (mcore_elf_relocate_section): Likewise. - * elf32-mips.c (mips_elf_calculate_relocation): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. - * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - -2000-05-22 Richard Henderson - - * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI, - PCREL22, PCREL64I. Zero size of special relocs. - (elf64_ia64_reloc_type_lookup): Likewise. - (USE_BRL, oor_brl, oor_ip): New. - (elf64_ia64_relax_section): New. - (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I. - (elf64_ia64_install_value): Likewise, plus PCREL21BI. - (elf64_ia64_relocate_section): Likewise. - (bfd_elf64_bfd_relax_section): New. - * reloc.c (BFD_RELOC_IA64_PCREL21BI): New. - (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New. - * bfd-in2.h, libbfd.h: Regenerate. - -2000-05-22 Nick Clifton - - * configure.in : Add peigen.lo to MIPS PE targets. - * configure: Regenerate. - -2000-05-22 Momchil Velikov - - * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess - only if it is known for both input and output bfds. Separate - error message strings as in some languages, it may be necessary - to change more than one place in the string to change between - 'big' and 'little'. - - * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline - endianess checks, call _bfd_generic_verify_endian_match() instead. - - * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. - - * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise. - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify - endianess before checking bfd flavours. - -2000-05-22 H.J. Lu - - * elflink.h (elf_link_output_extsym): Clear the visibility - field for symbols not defined locally. - -2000-05-18 Alan Modra - - * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, - re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. - (hppa_rebuild_insn): Mask immediate bits here instead. - * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. - -2000-05-18 Momchil Velikov - - * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting - relocs for an executable, ensure that they are virtual addresses. - -2000-05-18 Jeffrey A Law (law@cygnus.com) - - * config.bfd (hppa*64*-*-hpux11*): New target triplet. - -2000-05-17 S. Bharadwaj Yadavalli - Rick Gorton - - * elflink.h: Add emitrelocations support: when enabled, relocation - information and relocation sections are put into final output - executables. If the emitrelocations flag is set, do the following: - (elf_bfd_final_link): Emit relocation sections. - (elf_link_input_bfd): Compute relocation section contents. - (elf_gc_sections): Don't clean relocation sections. - -2000-05-16 Catherine Moore - - * som.c (som_decode_symclass): Recognize weak symbols. - -2000-05-16 Szabolcs Szakacsits - - * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that - read idata section only from dataoff. - (pe_print_edata): Correctly check for valid eat_member. - -2000-05-16 J"orn Rennecke - - * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. - -2000-05-14 Philip Blundell - - * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets. - -2000-05-12 Alan Modra - - * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec - - * peigen.c (pe_print_idata): Look for .idata section and print - info even if data directory has zero entries. Read idata section - starting from dataoff, and adjust all data offsets to suit. Cast - all bfd_vma vars to unsigned long before passing to fprintf. - * peigen.c (pe_print_edata): Similarly, look for .edata section - and print info even if data directory has zero entries. Cast - all bfd_vma vars to unsigned long before passing to fprintf. - - From Szabolcs Szakacsits - * peigen.c (pe_print_idata): Use bfd_section_size rather than data - directory size which may be bogus. - * peigen.c (pe_print_edata): Similarly. - -2000-05-09 Alan Modra - - * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela - section is empty. - (copy_private_bfd_data): Allow for space possibly taken up by elf - headers when calculating segment physical address from lma. - -2000-05-08 Alan Modra - - * versados.c (versados_scan): Init stringlen and pass_2_done. - - * trad-core.c (trad_unix_core_file_p): Return - bfd_error_wrong_format rather than bfd_error_file_truncated. - - * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to - add_data_entry. DataDirectory virtual address is relative. - (pe_print_idata): Account for relative DataDirectory virtual - addresses. Don't trash datasize inside POWERPC_LE_PE code. - (pe_print_edata): Similarly. - - From Szabolcs Szakacsits - * peigen.c (dir_names): Add Delay Import Directory. - (pe_print_idata): Always search for bfd section containing - idata address rather than looking up section name. Print this - section name rather than .idata. - (pe_print_edata): Similarly. Also print some fields as %08lx. - (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as - Win32Version. - -2000-05-05 Clinton Popetz - - * xcoff.h: Rename to xcoff-target.h - * Makefile.am: Change all instances of xcoff.h to xcoff-target.h - * coff-rs6000.c: Ditto. - * coff64-rs6000.c: Ditto. - * coff-pmac.c: Ditto. - * Makefile.in: Regenerate. - -2000-05-05 Clinton Popetz - - * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): - Change U802TOC64MAGIC to U803XTOCMAGIC. - -2000-05-04 Michael Snyder - - * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1. - * bfd-in.h: Prototype bfd_elf_get_arch_size. - * bfd-in2.h: Prototype bfd_elf_get_arch_size. - -2000-05-04 Alan Modra - - * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma. - -2000-05-03 Martin v. Löwis - - * elflink.h (elf_link_add_object_symbols): Reset dynindx for - hidden and internal symbols. - (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with - visibility. - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not - assign a PLT or GOT entry to symbols with hidden and - internal visibility. - -2000-05-03 Mark Elbrecht - - * bfd/coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for - the .bss section. - * bfd/coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. - -2000-05-02 H.J. Lu - - * elf.c (prep_headers): Use ELFOSABI_NONE instead of - ELFOSABI_SYSV. - -2000-05-02 Alan Modra - - * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec. - * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate - dependencies. - * Makefile.in: Regenerate. - -2000-05-01 Jim Wilson - - * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo. - (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c. - (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo. - (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c. - * Makefile.in: Rebuild. - -2000-05-02 Alan Modra - - * config.bfd: Re-enable elf32-hppa. It now compiles, even if it - doesn't work very well. - - * elf-hppa.h (elf_hppa_internal_shdr): Define. - (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr. - Set hdr->s_type to 1 if ARCH_SIZE == 32. - (_bfd_elf_hppa_gen_reloc_type): Add prototype. - (elf_hppa_info_to_howto): Likewise. - (elf_hppa_info_to_howto_rel): Likewise. - (elf_hppa_reloc_type_lookup): Likewise. - (elf_hppa_is_local_label_name): Likewise. - (elf_hppa_fake_sections): Likewise. - (elf_hppa_final_write_processing): Likewise. - (elf_hppa_howto_table): Fully initialise all entries. - (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args. - (elf_hppa_info_to_howto): Likewise. - (elf_hppa_info_to_howto_rel): Likewise. - (elf_hppa_reloc_type_lookup): Likewise. - (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook, - elf_hppa_unmark_useless_dynamic_symbols, - elf_hppa_remark_useless_dynamic_symbols, - elf_hppa_record_segment_addrs, elf_hppa_final_link, - elf_hppa_relocate_section, elf_hppa_final_link_relocate, - elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until - elf32-hppa.c mess is cleaned up. - (elf_hppa_final_link_relocate): Make insn and r_type unsigned - int. Delete r_field. In case R_PARISC_PCREL21L, don't set - r_field then call hppa_field_adjust inline func with variable - r_field arg, instead call hppa_field_adjust with fixed arg. - In case R_PARISC_PCREL22F, don't set r_field. - (elf_hppa_relocate_insn): Change args and return type to unsigned - int. Call re_assemble_* funcs to do the work. - - * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when - sign extending. - - * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign - extending. - (sign_extend): Mask first before sign extending. - (low_sign_extend): Rewrite without condition expression. - (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16, - dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete. - (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, - assemble_17, assemble_21, sign_unext, low_sign_unext): Return - result as function return value rather than through pointer arg. - Accept unsigned int args, and return unsigned int. - (re_assemble_3): New. Combines function of dis_assemble_3 with - re-assembly of opcode and immediate. - (re_assemble_12): Likewise. - (re_assemble_16): Likewise. - (re_assemble_17): Likewise. - (re_assemble_21): Likewise. - (re_assemble_22): Likewise. - (hppa_field_adjust): Rewrite and document, paying attention to - size of types and signed/unsigned issues. - (get_opcode): Shift before masking. - (FDLW): Rename to FLDW. - (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt. - (hppa_rebuild_insn): Change args and return value to unsigned - int. Make use of re_assemble_*. Correct case 11. - - * dep-in.sed: Handle ../opcodes/. - * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h, - elf64-hppa.h, hppa_stubs.h, xcoff.h. - (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c. - Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo, - elfarm-nabi.lo dependencies outside of auto-dependency area. - Regenerate dependencies. - * Makefile.in: Regenerate. - - * configure.in (TRAD_HEADER): Test non-null before - AC_DEFINE_UNQUOTED. + * configure.in <64-bit configuration>: If using gcc, check and + emit error for egcs-1.1.2. * configure: Regenerate. - * reloc.c: Fix mis-spelling in comment. - -2000-05-01 Alan Modra - - * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. - * vms.c (vms_openr_next_archived_file): Return NULL. - -2000-04-28 Clinton Popetz - - * coffcode.h Copy changes mistakenly done to libcoff.h in - 4/24/2000 patch. - -2000-04-29 Andreas Jaeger - - * libbfd-in.h: Correctly check GCC version. - * bfd-in.h: Likewise. - * libhppa.h: Likewise. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - -2000-04-28 Clinton Popetz - - * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add - coffdu-rs6000.{lo,c}. - (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency - on xcoff.h - * Makefile.in: Regenerate. - * xcoff.h: New file. - * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c. - * coff-rs6000.c: Move all declarations and defines that are - common to the xcoff backends into xcoff.h - * coff64-rs6000.c: Ditto, - -2000-04-28 Clinton Popetz - - * coff-mips.c (mips_ecoff_backend_data): Add initialization of - _bfd_coff_force_symnames in strings and - _bfd_coff_debug_string_prefix_length to their default values. - * coff-sh.c: (bfd_coff_small_swap_table): Ditto. - -2000-04-28 Clinton Popetz - - * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of - _bfd_coff_force_symnames in strings and - _bfd_coff_debug_string_prefix_length to their default values. - -2000-04-27 Alan Modra - - * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL. - Check local_got_refcounts before dereferencing. - - * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL - before deciding we don't need R_PPC_PLT32 relocation. - (ppc_elf_gc_sweep_hook): Check local_got_refcounts before - dereferencing. - - * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment. - - * elf32-i386.c (elf_i386_check_relocs): Reference count .got and - .plt entries. - (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries. - (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries. - (elf_i386_relocate_section): Allow for .plt to go missing. - (elf_i386_finish_dynamic_symbol): Use same test to decide if we - can use a relative reloc for got as elf_i386_relocate_section. - (bfd_elf32_bfd_final_link): Define to use gc form of final link. - -2000-04-26 Clinton Popetz - - * config.bfd: Remove extraneous bfd_powerpc_64_arch. - -2000-04-24 Clinton Popetz - - * Makefile.am (coff64-rs6000.lo): New rule. - * Makefile.in: Regenerate. - * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data, - xcoff_is_local_label_name, xcoff_rtype2howto, - xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p, - xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap, - xcoff_write_archive_contents): No longer static, and prefix with _bfd_. - (NO_COFF_SYMBOLS): Define. - (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in, - xcoff64_swap_aux_out): New functions; handle xcoff symbol tables - internally. - (MINUS_ONE): New macro. - (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS - relocation. - (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, - coff_SWAP_aux_out): Map to the new functions. - * coff64-rs6000.c: New file. - * libcoff.h (bfd_coff_backend_data): Add new fields - _bfd_coff_force_symnames_in_strings and - _bfd_coff_debug_string_prefix_length. - (bfd_coff_force_symnames_in_strings, - bfd_coff_debug_string_prefix_length): New macros for above fields. - * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic. - Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead - of using coff_swap_sym_in directly. - (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64. - (coff_set_flags) Set magic for XCOFF64. - (coff_compute_section_file_positions): Add symbol name length to - string section length if bfd_coff_debug_string_prefix_length is - true. - (coff_write_object_contents): Don't do reloc overflow for XCOFF64. - (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of - using coff_swap_lineno_in directly. - (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings - and _bfd_coff_debug_string_prefix_length fields. - * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force - symbol names into strings table when - bfd_coff_force_symnames_in_strings is true. - * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR, - SET_RELOC_VADDR): New macros. - (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros. - (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C - code. - (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64 - changes within RS6000COFF_C specific code. - (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, - MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO. - * reloc.c (bfd_perform_relocation, bfd_install_relocation): - Extend existing hack on target name. - * xcofflink.c (XCOFF_XVECP): Extend existing hack on - target name. - * coff-tic54x.c (ticof): Keep up to date with new fields - in bfd_coff_backend_data. - * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define - targ_selvecs to include rs6000coff64_vec for rs6000. - * configure.in: Add rs6000coff64_vec case. - * cpu-powerpc.c: New bfd_arch_info_type. - -2000-04-24 Jeffrey A Law (law@cygnus.com) - - * config.bfd: Only disable elf32-hppa vectors, not all of the - BSD and OSF configuration support. Provide (disabled) clauses - for PA64 support. - * configure.in: Add clause for PA64 support. - * configure: Rebuilt. - - * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec. - (bfd_elf64_hppa_vec): Declare. - - * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo - (BFD64_BACKENDS_CFILES): Add elf64-hppa.c - (elf64-hppa.lo): Add dependencies. - * Makefile.in: Rebuilt. - - * elf64-hppa.c, elf64-hppa.h: New files with PA64 support. - -2000-04-24 Jason Eckhardt - - * libhppa.h (dis_assemble_16): New function. - (pa_arch): Added pa20w element. - -2000-04-24 Ulrich Drepper - - * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs, - bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and - bfd_elf64_slurp_reloc_table. - - * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New - definitions to get external names. - (elf_write_relocs): Renamed from write_relocs and make global. - (elf_slurp_reloc_table): Make global. - (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs. - - * archive.c (hpux_uid_gid_encode): New function. - (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is - defined and the ID is greater than 99999. - (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode - special uid/gid fields into 32 bit values. - -2000-04-21 Matthew Green - - * config.bfd: Add NetBSD/sparc64 support. - -Fri Apr 21 13:20:53 2000 Richard Henderson - David Mosberger - Timothy Wall - Jim Wilson - - * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo. - (ALL_MACHINES_CFILES): Add cpu-ia64.c. - (BFD64_BACKENDS): Add elf64-ia64.lo. - (BFD64_BACKENDS_CFILES): Add elf64-ia64.c. - (cpu-ia64.lo, elf64-ia64.lo): New rules. - * Makefile.in: Rebuild. - * archures.c (enum bfd_architecture): Add bfd_arch_ia64. - (bfd_ia64_arch): Declare. - (bfd_archures_list): Add bfd_ia64_arch. - * bfd-in2.h: Rebuild. - * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets. - * configure: Rebuild. - * configure.host: (ia64-*-linux*): New host. - * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec, - bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors. - * elf.c (prep_headers): Add bfd_arch_ia64. - * libbfd.h: Rebuild. - * reloc.c: Add IA-64 relocations. - * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec): - Declare. - (bfd_target_vect): Add bfd_elf64_ia64_little_vec. - * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files. - -2000-04-21 Richard Henderson - - * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section - contents when performing a partial link. - (bfd_elf_d30v_reloc_21): Likewise. + * doc/Makefile.am (install): Depend on install-info. + * doc/Makefile.in: Regenerate. -2000-04-20 H.J. Lu +2002-01-26 Egor Duda - * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 - patch to symbols defined by a shared object. - * elf32-ppc.c (ppc_elf_relocate_section): Similarly. + * elf.c (elfcore_grok_win32pstatus): Copy only as much information + as possible to avoid stack corruption. -2000-04-19 Michael Sokolov +2002-01-26 Richard Henderson - K&R compiler fixes. - * dwarf2.c (concat_filename): Avoid string literal concatenation. - * ieee.c (ieee_get_symtab): Don't initialise union in struct. + * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext + for non-allocated sections. -Mon Apr 17 19:14:36 2000 David Mosberger +2002-01-25 Mark Kettenis - * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo. - (BFD64_BACKENDS_CFILES): Mention coff-ia64.c - (coff-ia64.lo): Add dependency. - * Makefile.in: Regenerate. - * coff-ia64.c: New file. - * efi-app-ia32.c: Ditto. - * efi-app-ia64.c: Ditto. - * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC. - (coff_set_flags): Ditto. - (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC. - * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec. - * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec. - * configure: Regenerate. - * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro. - (PUT_OPTHDR_IMAGE_BASE): Ditto. - (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. - (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. - (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. - (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. - (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. - (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. - (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. - (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. - (GET_PDATA_ENTRY): Ditto. - * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read - data_start. Use above macros to read fields that are 64 bit wide for - COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits. - (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force - FileAlignment and SectionAlignment to minimum alignment if they - are zero. - (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set - Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM. - (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start. - Use above macros to write fields that are 64 bit wide for - COFF_WITH_PEP64. - (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64, - 5*4 otherwise. This should be right for IA-32 and IA-64, but may - be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded - value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print - begin address, end address, and unwind info address only. Use - GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to - print addresses. - (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and - HIGH3ADJ relocation names. - (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form. - * targets.c: Declare bfd_efi_app_ia32_vec and - bfd_efi_app_ia64_vec. - (bfd_target_vector): Mention bfd_efi_app_ia32_vec and - bfd_efi_app_ia64_vec. + * elf.c (elfcore_write_prstatus): Make sure we pass the address of + prstat.pr_reg even if it is a struct. -2000-04-17 Timothy Wall +2002-01-25 Steve Ellcey - * bfd-in2.h: Add prototypes for tic54x load page access. - * bfd-in.h: Regenerate. - * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown - in customized _set_arch_mach function. - * coffcode.h (coff_set_alignment_hook): Set section load page if - the appropriate macro is defined. - (write_object_contents): Read section load page. + * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. -2000-04-13 Alan Modra +2002-01-25 Philipp Thomas - * elf32-hppa.h: Update copyright date. + * coffgen.c (coff_print_symbol): Don't mark info message + for translation. - * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. - * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. +2002-01-25 Nick Clifton - * elf32-d30v.c (MAX32): Don't use LL suffix. - (MIN32): Define in terms of MAX32. - (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + * po/fr.po: Updated translation. + * po/es.po: Updated translation. - * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise - expression. +2002-01-25 Philipp Thomas - * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + * coff-alpha.c (alpha_relocate_section): Unify warning message + for GP relative relocations without GP defined. + * coff-mips.c (mips_relocate_section): Likewise. -2000-04-12 Alan Modra +2002-01-25 Alan Modra - * dep-in.sed: Match space before file name, not after. - * Makefile.am: Regenerate dependencies. - * Makefile.in: Regenerate. + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid + unsigned overflow when new_offset < old_offset. - * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield - case, allow address wrap-around stupidly removed 2000-03-17. Sign - extend without an if statement. +2002-01-24 Philipp Thomas -2000-04-11 Alan Modra + * bfd.c (_bfd_abort): Fix typo. - * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using - signed quantites. - * elf32-mips.c (gprel16_with_gp): Likewise. - * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range - here using -0x40000, not (int)0xfffc0000. - (elf32_hppa_size_of_stub): Likewise. +2002-01-23 Richard Henderson -2000-04-11 Timothy Wall + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress + plt entries for undefweak symbols. - * coff-tic54x.c: Now builds with all targets. - * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies. - * Makefile.in: Regenerate. - * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on - unitialized variable. +2002-01-23 Steve Ellcey -Fri Apr 7 15:56:57 2000 Andrew Cagney + * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to + DEFAULT_VECTOR. + (bfd_elf64_ia64_hpux_big_vec): Ditto. + (bfd_elf32_h8300_vec): Ditto. - * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add - --enable-build-warnings option. - * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. - * Makefile.in, configure: Re-generate. +2002-01-23 Alan Modra -2000-04-07 Nick Clifton + * elf64-ppc.c: Remove stale part of ABI comment. + (NO_OPD_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. + (ppc64_elf_relocate_section): Here too. + (build_one_stub): Don't point function syms at the stub. Instead, + hijack plt.offset. + (ppc64_elf_relocate_section): Check whether REL24 relocs should + really go to the stub. Make all dynamic relocs in opd against + locals. + (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of + plt.offset. - * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and - BFD_RELOC_THUMB_PCREL_BLX. +2002-01-22 Richard Henderson - * elf32-arm.h (elf32_arm_final_link_relocate): Handle - R_ARM_XPC25 and R_ARM_THM_PC22. + * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp. - * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of - R_ARM_XPC25 and R_ARM_THM_XPC22. - (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to - R_ARM_[XPC25|THM_XPC22]. +2002-01-22 Alan Modra - * elfarm-oabi.c: Define OLD_ARM_ABI and change include from - elf/arm-oabi.h to elf/arm.h + * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of + TOC_BASE_OFF adjustment. - * Makefile.am: Fix dependency for elfarm-oabi.c + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-01-22 John David Anglin + + * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new + host defines. + +2002-01-21 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : + Check for and emit error if sgot is NULL at this point. + +2002-01-21 Jason Thorpe + + * config.bfd (ia64*-*-netbsd*): New target. + +2002-01-21 Thomas Klausner + + * som.c (som_write_space_strings): Comment typo fix. + +2002-01-21 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and + is_func_descriptor fields. + (link_hash_newfunc): Init them. + (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a + dot are candidates for plt entries. When processing .opd relocs, + set function descriptor strings to point inside function code + string, and set new ppc_link_hash_entry fields. + (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs. + (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with + function descriptors. It's now done in.. + (func_desc_adjust): New. + (ppc64_elf_func_desc_adjust): New. + (define elf_backend_always_size_sections): Define. + (ppc64_elf_hide_symbol): New. + (define elf_backend_hide_symbol): Define. + (allocate_dynrelocs): Remove code looking up function descriptors + as that has been done earlier. + (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash + table. + (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking + up function descriptor. + (build_one_stub): Look up the function code sym. Check for + invalid plt offsets. + (ppc64_elf_relocate_section): Tweak calls to undefined weak syms. + Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs. + + * elf-bfd.h (elf_backend_data ): Add + boolean param. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Adjust call to + elf_backend_hide_symbol. + (elf_fix_symbol_flags): Likewise. + (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather + than bfd_alloc. + * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param. + Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + (clobber_millicode_symbols): Adjust to suit new hide_symbol. + * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param + and adjust to suit. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call + _bfd_elf_link_hash_hide_symbol rather than duplicating code. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - -2000-04-06 Michael Snyder - - * elfcore.h (elf_core_file_p): preserve value of tdata at entry, - and restore it on failure. Release newly allocated tdata on - failure. - -Fri Apr 7 11:33:47 2000 Jim Wilson - - * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size. - (decode_line_info): Set it. Report error if unit->line_offset is - equal to or larger than it. - -2000-04-07 Timothy Wall - - * targets.c: Added vecs for tic54x. - * reloc.c: Added relocs for tic54x. - * libbfd.h: Regenerated. - * configure: Add TI COFF vecs for tic54x. - * configure.in: Ditto. - * config.bfd (targ_cpu): Recognize new tic54x target. - * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling. - * bfd-in2.h: Add tic54x target and relocations. - * Makefile.am, Makefile.in: Add tic54x target. - * archures.c (bfd_archures_list): Add tic54x target. - * coff-tic54x.c: New. - * cpu-tic54x.c: New. - -2000-04-06 Michael Snyder - - * elfcore.h (elf_core_file_p): call backend_object_p which - thereby gets an opportunity to update the arch/machine type. - -2000-04-06 Timothy Wall - - * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage - class. Handle SEC_CLINK and SEC_BLOCK flags. - * section.c: Add SEC_CLINK and SEC_BLOCK flags. - * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags. - -2000-04-06 Nick Clifton +2002-01-18 Alan Modra - * elf32-arm.h (elf32_arm_set_private_flags): Only check for - EF_INTERWORK if this is an unknown EABI. - (elf32_arm_merge_private_bfd_data): Check EABI version - numbers. Only check EF_xxx flags if the EABI version number - is unknown. - (elf32_arm_check_private_bfd_data): Only check EF_xxx flags - if the EABI version number is unknown. - (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags - if the EABI version number is unknown. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a + dynamic function descriptor symbol, not the associated function + symbol. -Wed Apr 5 22:04:20 2000 J"orn Rennecke +2002-01-17 Eric Christopher - * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and - BFD_RELOC_SH_LOOP_END. - * elf32-sh.c (sh_elf_howto_tab): Change special_func to - sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore. - Add entries for R_SH_LOOP_START and R_SH_LOOP_END. - (sh_elf_reloc_loop): New function. - (sh_elf_reloc): No need to test for always-to-be-ignored relocs - any more. - (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}. - (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}. - * bfd-in2.h, libbfd.h: Regenerate. + * elf32-mips.c (mips_elf_calculate_relocation): Fix typo. -2000-04-04 Alan Modra +2002-01-17 Nick Clifton * po/bfd.pot: Regenerate. + * po/fr.po: Regenerate. + +2002-01-17 Alan Modra + + * elf-bfd.h (elf_backend_data ): + Remove "Elf_Internal_Shdr *" param. + (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto. + * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto. + * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto. + * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto. + * elf.c (_bfd_elf_section_from_bfd_section): Allow backend + function to override special sections. Remove hdr arg from + backend call, and don't loop. + +2002-01-16 Eric Christopher + + * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp + on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of + relocations requiring gp0 and gp. + +2002-01-16 Richard Earnshaw + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle + EF_ARM_VFP_FLOAT. + (elf32_arm_print_private_bfd_data): Likewise. + +2002-01-16 Nick Clifton + + * po/tr.po: Import new version. + +2002-01-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs. + (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc. + (ORI_R0_R0_0): Correct. + +2002-01-16 Alan Modra + + * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE + when plt_not_loaded. + * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to + clear .plt SEC_CODE here. Create .stub and correct .glink flags. + (PLT_INITIAL_ENTRY_SIZE): Set to 24. + (ppc64_elf_glink_code): Delete. + (PPC64_ELF_GLINK_SIZE): Delete. + (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11, + BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0, + ORI_R0_R0_0): Define. + (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define. + (struct ppc_link_hash_table): Add sstub and plt_overflow. + (ppc64_elf_link_hash_table_create): Init them. + (ppc64_elf_check_relocs ): Refcount .plt entry. + Don't copy to shared lib. + (ppc64_elf_check_relocs): Call bfd_set_error on errors. + (ppc64_elf_gc_sweep_hook ): Sweep plt refcount. + (allocate_dynrelocs ): Don't change function sym here. Make + room for .stub and .glink code. + (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for + DT_PPC64_GLINK. + (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call + bfd_elf64_bfd_final_link. + (bfd_elf64_bfd_final_link): Don't define. + (ppc64_elf_size_stubs): New. + (build_plt_stub): New. + (build_one_stub): New. + (ppc64_elf_build_stubs): New. + (ppc64_elf_relocate_section ): Remove assert. + (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs. + (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set + DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in + case output sections not separate. Adjust DT_RELASZ to not + include plt relocs. Set reserved got entry. Set got and plt + entry size. + (elf_backend_got_header_size): Set to 8. + * elf64-ppc.h: New file. + +2002-01-16 Alan Modra + + * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing + sections, use bfd_section_list_remove. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elflink.h (elf_link_add_object_symbols): When removing all + sections, use bfd_section_list_clear. - * Makefile.am: Remove extraneous mkdep comment. - (MKDEP): Use gcc -MM rather than mkdep. - (DEP): Quote when passing vars to sub-make. Add warning - message to end. - (DEP1): Rewrite for "gcc -MM". - (CLEANFILES): Add DEP2. - Update dependencies. - * Makefile.in: Regenerate. - -2000-04-03 Kevin Buettner - - * configure.in: Added corefile support for AIX 4.3. In particular, - AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when - compiling rs6000-core.c. - * configure: Regenerated. - -2000-04-03 H.J. Lu - - * cache.c (bfd_open_file): Unlink the output file only if - it has non-zero size. - -2000-04-01 Ken Block USG - - * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit - relative relocations for non-loaded sections in shared objects. - (elf64_alpha_check_relocs): Similarly. - -Mon Apr 3 13:37:15 2000 Hans-Peter Nilsson - - * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and - BFD_RELOC_16 to switch for extended relocs. - (MY_swap_ext_reloc_in): New. - (MY_swap_ext_reloc_out): New. - (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather - than NAME(aout,swap_ext_reloc_in) for extended relocs. - (NAME(aout,squirt_out_relocs)): Similarly use - MY_swap_ext_reloc_out. - (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined. - -2000-04-03 Kazu Hirata - - * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to - the R_PCRWORD_B case. - -2000-03-31 Thomas de Lellis - - * srec.c : Set CHUNK size to 16 bytes to prevent download failures - on some targets. - * ihex.c : Ditto. - -Wed Mar 30 15:28:00 2000 Donald Lindsay - - * elf32-m32r.c (m32r_elf_generic_reloc): new function. All - HOWTO references to bfd_elf_generic_reloc, that have - partial_inplace == true, now use the new function. The function - is based on the recent rewrite of m32r_elf_lo16_reloc(), and - extends its fixes to the R_M32R_{16,24,32} relocs. - The new logic in m32r_elf_lo16_reloc() has been removed, and - it instead calls the new routine to obtain that functionality. - -2000-03-27 Alan Modra - - * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook, - elf32_avr_check_relocs, avr_final_link_relocate, - elf32_avr_relocate_section, bfd_elf_avr_final_write_processing, - elf32_avr_object_p): Add prototypes. - (elf32_avr_gc_mark_hook): Add default for h->root.type. - (bfd_elf_avr_final_write_processing): Make static. - -2000-03-27 Denis Chertykov - - * cpu-avr.c: New file. BFD support routines for AVR architecture. - * archures.c (bfd_architecture): Add AVR architecture. - (bfd_archures_list): Add reference to AVR architecture info. - * elf.c (prep_headers): Handle bfd_arch_avr. - * reloc.c: Add various AVR relocation enums. - * targets.c (bfd_elf32_avr_vec): Declare and add to target vector - list. - * Makefile.am: Add support for AVR elf. - * configure.in: Likewise. - * config.bfd: Likewise. - * Makefile.in: Regenerate. - * configure: This too. - * bfd-in2.h: And this. - * libbfd.h: And this. - -2000-03-24 H.J. Lu - - * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype. - (elf64_alpha_find_reloc_at_ofs): Likewise. - -2000-03-17 Alan Modra - - * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield, - flag an overflow if the bitfield is outside -2**n to 2**n-1. The - allowable range used to be -2**(n-1) to 2**n-1. - * reloc.c (_bfd_relocate_contents): Same here. Also replace - "boolean overflow" with "bfd_reloc_status_type flag". - -2000-03-14 Doug Evans - - * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. - -2000-03-14 Kazu Hirata - - * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number - of shrinks properly, including the last reloc. - -2000-03-13 Kazu Hirata - - * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity - check for R_MOVL2. - -2000-03-11 Alan Modra - - * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on - a format mismatch rather than an "error" from bfd_read such as - bfd_error_file_truncated. - -2000-03-10 Geoff Keating - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper - sign-extension and big-endian compensation for - R_MIPS_64 even in ld -r. - -2000-03-10 Geoffrey Keating - - * elf32-mips.c (mips_elf_next_relocation): Rename from - mips_elf_next_lo16_relocation, and generalize to look - for any relocation type. - (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset. - (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16. - (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16. - (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2. - (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64. - (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32. - (bfd_elf32_bfd_reloc_type_lookup): Add new relocs. - (mips_rtype_to_howto): Likewise. - (mips_elf_calculate_relocation): Handle new relocs. - (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs - are paired. The addend for R_MIPS_GNU_REL16_S2 - is shifted right two bits. - -2000-03-10 Alan Modra - - * reloc.c (bfd_perform_relocation): Undo emacs formatting of - comment, and ensure it doesn't happen again. - (bfd_install_relocation): Same here. - (_bfd_relocate_contents): Don't bother assigning unused signmask - shift result. Fix typos in comments. - Remove trailing whitespace throughout file. - -2000-03-07 Doug Evans - - * reloc.c (reloc_howto_struct): Fix partial_inplace comment. - * bfd-in2.h: Rebuild. - -2000-03-06 Nick Clifton - - * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and - sym_ptr_ptr fields. - (SIZEOF_ILF_SYM_PTR_TABLE): Define. - (SIZEOF_ILF_STRINGS): Redefine. - (pe_ILF_make_a_symbol-reloc): New function. Creates a symbol - relative reloc, as opposed to a section relative reloc. - (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT - not C_LABEL. - Add length of symbol's prefix to string pointer. - Store a pointer to the symbol in the symbol pointer table. - (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7. - Initialise the symbol pointer table. - Store the hint in the Hint/Name table. - Make the jump reloc be symbol realtive, not section relative. - Create an import symbol for imported code. - -2000-03-06 Catherine Moore - - * elf.c (swap_out_syms): Check for null type_ptr. - -2000-03-01 Hans-Peter Nilsson - - * aout-target.h (MY(write_object_contents)): Remove unused - and unusable "#if CHOOSE_RELOC_SIZE". - * pc532-mach.c (MY(write_object_contents)): Ditto. - * netbsd.h (MY(write_object_contents)): Ditto. - * hp300hpux.c (MY(write_object_contents)): Ditto. - * freebsd.h (MY(write_object_contents)): Ditto. - * aout-tic30.c (tic30_aout_write_object_contents): Ditto. - -2000-02-29 H.J. Lu - - * peicode.h (jtab): Make it static. - - * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is - defined and COFF_IMAGE_WITH_PE is not defined. - (_bfd_sh_align_load_span): Defined as sh_align_load_span if - COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined. - -2000-03-01 Nick Clifton - - * coff-arm.c (bfd_arm_process_before_allocation): Make - 'symndx' signed to prevent compile time warning. - - * coff-mcore.c: Remove unused prototype for pe_object_p. - - * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static - functions that are not used when COFF_IMAGE_WITH_PE is - defined. - (struct sh_opcode): Change type of 'flags' field to unsigned - long so that it can hold the USESAS flag. - - * coffcode.h (styp_to_sec_flags): Initialise 'target_name'. - - * elf-m10300.c (mn10300_elf_relax_section): Initialise - 'sym_sec'. - - * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function - parameters. - Remove unusued variables and code. - (elf_backend_add_symbol_hook): Fix prototype. - - * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and - 'srelgot'. - - * elf32-mcore.c (mcore_elf_relocate_section): Initialise - 'oldinst'. - - * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function - parameters. - Remove unusued variables and code. - (elf_backend_add_symbol_hook): Fix prototype. - - * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'. - - * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED - to unused function parameter. - - * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function - parameters. - Use EMPTY_HOWTO to initialise empty howto slots. - Remove unused variables. - - * peicode.h (pe_ILF_build_a_bfd): Initialise id6. - -2000-03-01 H.J. Lu - - * aoutx.h (aout_link_input_section_std): Pass "true" to - the undefined_symbol callback. - (aout_link_input_section_ext): Likewise. - * bout.c (get_value): Likewise. - * coff-a29k.c (coff_a29k_relocate_section): Likewise. - * coff-alpha.c (alpha_ecoff_get_relocated_section_conten): - Likewise. - (alpha_relocate_section): Likewise. - * coff-arm.c (coff_arm_relocate_section): Likewise. - * coff-i960.c (coff_i960_relocate_section): Likewise. - * coff-mcore.c (coff_mcore_relocate_section): Likewise. - * coff-mips.c (mips_relocate_section): Likewise. - * coff-ppc.c (coff_ppc_relocate_section): Likewise. - * coff-sh.c (sh_relocate_section): Likewise. - * coff-tic80.c (coff_tic80_relocate_section): Likewise. - * cofflink.c (_bfd_coff_generic_relocate_section): Likewise. - * elf-m10200.c (mn10200_elf_relocate_section): Likewise. - * elf-m10300.c (mn10300_elf_relocate_section): Likewise. - * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. - * elf32-fr30.c (fr30_elf_relocate_section): Likewise. - * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m32r.c (m32r_elf_relocate_section): Likewise. - * elf32-mcore.c (mcore_elf_relocate_section): Likewise. - * elf32-sh.c (sh_elf_relocate_section): Likewise. - * elf32-v850.c (v850_elf_relocate_section): Likewise. - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. - * elflink.h (elf_link_output_extsym): Likewise. - * pe-mips.c (coff_pe_mips_relocate_section): Likewise. - * reloc.c (bfd_generic_get_relocated_section_conten): Likewise. - * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise. - - * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the - undefined_symbol callback when building shared library with - -Bsymbolic and undefined symbols are allowed. Otherwise, pass - "true". - * elf32-arm.h (elf32_arm_relocate_section): Likewise. - * elf32-i386.c (elf_i386_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mips.c (mips_elf_calculate_relocation): Likewise. - (elf32_mips_get_relocated_section_content): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - -2000-02-28 Nick Clifton - - * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects. - * Makefile.in: Regenerate. - - * configure.in: Add support for mips and sh pe vectors. - * configure: regenerate. - - * config.bfd: Add support for arm-wince, mips-pe and sh-pe - targets. - - * targets.c: Add mips and sh pe vectors. - - * libpei.h (coff_final_link_postscript): Only define if not - already defined. - - * coffcode.h: Add support for WinCE magic numbers. - - * peigen.c (pe_print_reloc): Update comment and rearrange - appending of newline character. - - * peicode.h: Add support for Image Library Format. - (pe_ILF_vars): Structure containing data used by ILF code. - (pe_ILF_make_a_section): New function. Create a section based - on ILF data. - (pe_ILF_make_a_reloc): New function. Create a reloc based on - ILF data. - (pe_ILF_make_a_symbol): New function. Create a symbol based - on ILF data. - (pe_ILF_save_relocs): New function. Store the relocs created - by pe_ILF_make_a_reloc in a section. - (pe_ILF_build_a_bfd): New function. Create a BFD describing - an ILF object. - (pe_ILF_object_p): New function. Return a bfd_target pointer - for an ILF object. - (pe_bfd_object_p): If an ILF object is detected call - pe_ILF_object_p on it. - - * coff-arm.c: Add support for WinCE relocs which are different - from normal ARM COFF relocs. - * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target. - - * coff-sh.c: Add support for sh-pe target. - * pe-sh.c: New file. Support code for sh-pe target. - * pei-sh.c: New file. Support code for sh-pe target. - - * pe-mips.c: New file. Support code for mips-pe target. - * pei-mips.c: New file. Support code for mips-pe target. - -2000-02-27 Jakub Jelinek - - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump - architecture if the object causing the bump is dynamic. - * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise, - and also don't it for memory ordering. - (sparc64_elf_write_relocs): Take src_rela out of the loop. - -2000-02-27 Ian Lance Taylor - - * dwarf2.c (read_abbrevs): Use _raw_size directly rather than - calling bfd_get_section_size_before_reloc. - (decode_line_info): Likewise. - (_bfd_dwarf2_find_nearest_line): Likewise. - -2000-02-27 Eli Zaretskii +2002-01-15 Nick Clifton - * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the - name of the libtool directory. - * Makefile.in: Rebuild. + * po/sv.po: New file: Swedish translation. + * configure.in (ALL_LINGUAS): Add sv. + * configure: Regenerate. -Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) +2002-01-15 Jakub Jelinek - * som.c (SOM_HOWTO): Define. - (som_hppa_howto_table): Use it. + * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change. + * elf.c (merge_sections_remove_hook): New function. + (_bfd_elf_merge_sections): Pass it as 3rd argument to + _bfd_merge_sections. + * libbfd-in.h (_bfd_merge_sections): Add 3rd argument. + * libbfd.h: Rebuilt. + * merge.c (_bfd_merge_sections): Add remove_hook argument. + Call remove_hook if a SEC_EXCLUDE section is encountered. -2000-02-25 Alexandre Oliva +2002-01-15 Nick Clifton - * config.bfd: Enable 64 bit support for GNU/Linux/sparc. + * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'. + (xstormy16_reloc_map): Initialise new field with correct howto + table. + (xstormy16_reloc_type_lookup): Use 'table' field to locate correct + howto entry. - * config.bfd: Enable 64 bit support for Solaris7+/sparc. +2002-01-10 Michael Snyder -2000-02-24 Catherine Moore + * elf.c (elfcore_write_prstatus): Use long instead of pid_t; + (elfcore_write_pstatus): Use long instead of pid_t; + * elf-bfd.h: Change prototypes to use long instead of pid_t; - * som.c (som_misc_symbol_info): Add field - secondary_def. - (som_bfd_derive_misc_symbol_info): Initialize - secondary_def. - (som_build_and_write_symbol_table): Keep track - of secondary_def field. - (som_slurp_symbol_table): Set BSF_WEAK symbol flag - if secondary_def field is set. - (som_bfd_ar_write_symbol_stuff): Initialize - secondary_def. +2002-01-09 Jason Thorpe -2000-02-23 Stephane Carrez + * elf.c: Update copyright years. + (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO + and NT_NETBSDCORE_FIRSTMACH. Improve a comment. - * dwarf2.c (read_address): Read 16-bits addresses. - (parse_comp_unit): Accept addr_size == 2. +2002-01-08 Michael Snyder -2000-02-23 Alan Modra + Add capability to write corefile note sections, for gdb. + * elf.c (elfcore_write_note): New function. + (elfcore_write_prpsinfo): New function. + (elfcore_write_prstatus): New function. + (elfcore_write_pstatus): New function. + (elfcore_write_prfpreg): New function. + (elfcore_write_prxfpreg): New function. + * elf-bfd.h: Add prototypes for above functions. - * bfd-in.h: Update copyright date. +2002-01-08 Alexandre Oliva -2000-02-23 Linas Vepstas + * elf.c (elf_fake_sections): Propagate errors from + elf_backend_fake_section. - * cpu-i370.c: New file. - * elf32-i370.c: New file. - * archures.c (enum bfd_architecture): Add bfd_arch_i370. - (bfd_i370_arch): New. - (bfd_archures_list): Add bfd_i370_arch. - * elf.c (prep_headers): Add bfd_arch_i370. - * Makefile.am: Add support for IBM 370 elf. - * config.bfd: Likewise. - * configure.in: Likewise. - * libbfd.h (bfd_reloc_code_real_names): Likewise. - * reloc.c (bfd_reloc_code_type): Likewise. - * targets.c: Likewise. +2002-01-07 Jason Thorpe + * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c. + (elf32-sh-nbsd.lo): New rule. * Makefile.in: Regenerate. + * config.bfd (sh*le-*-netbsdelf*): New target. + (sh*-*-netbsdelf*): New target. + * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*. + (bfd_elf32_shnbsd_vec): New vector. + (bfd_elf32_shlnbsd_vec): New vector. * configure: Regenerate. - * bfd-in2.h: Regenerate. - -2000-02-22 Ian Lance Taylor - - * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for - invalid relocation types, and change them to R_386_NONE. - -2000-02-22 H.J. Lu + * elf32-sh-nbsd.c: New file. + * targets.c: Update copyright years. + (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and + bfd_elf32_shnbsd_vec. - * elflink.h (elf_link_add_object_symbols): If a version symbol is - not defined, don't add a second ELF_VER_CHR. +2002-01-07 Aldy Hernandez - * elflink.h (elf_bfd_final_link): Call output_extsym for global - symbols converted to local symbols even when stripping all - symbols. - (elf_link_output_extsym): Process global symbols converted to - local symbols even if they are being stripped. + * coff-rs6000.c (READ20): Use bfd_scan_vma. -2000-02-21 Alan Modra +2002-01-07 Geoffrey Keating - * archures.c (bfd_octets_per_byte): Return unsigned int. - (bfd_arch_mach_octets_per_byte): Ditto. - * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned - comparison warning. - * section.c (bfd_get_section_size_before_reloc): Quell signed - vs. unsigned comparison warning. - (bfd_get_section_size_after_reloc): Same here. Fix parentheses too. - * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27 - change. What was I thinking? - * bfd-in2.h: Regenerate. - - * elflink.h (elf_gc_sweep): Skip non-elf input bfds. - (elf_gc_sections): Same here. - (elf_gc_common_finalize_got_offsets): And here. - -2000-02-21 Ian Lance Taylor - - ELF HPPA doesn't work at present; remove it until it does. - * config.bfd: Comment out setting targ_defvec to - bfd_elf32_hppa_vec. - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Remove elf32-hppa.lo. - (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c. - (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h. - * Makefile.in: Rebuild. - * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec. - -2000-02-18 Geoff Keating - - * coffcode.h (coff_set_arch_mach_hook): Use free(), because there - is no bfd_free(). Revert bfd_free part of previous change. - -2000-02-18 Geoff Keating - - * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size - arrays. - (coff_compute_section_file_positions): Use bfd_free to pair - bfd_malloc. - (coff_write_object_contents): Likewise. + * elflink.h (elf_link_input_bfd): Don't ask for the merged offset + of a symbol in a section that will be deleted. - * coff-rs6000.c (xcoff_howto_table_16): New variable. - (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs. +2002-01-07 Nick Clifton -2000-02-18 Ulrich Drepper - - * coff-rs6000.c (XCOFFARMAGBIG): New macro. - (xcoff_ar_file_hdr_big): New structure. - (SIZEOF_AR_FILE_HDR_BIG): New macro. - (xcoff_ar_hdr_big): New structure. - (SIZEOF_AR_HDR_BIG): New macro. - (xcoff_big_format_p): New macro. - (xcoff_ardata_big): New macro. - (arch_xhdr_big): New macro. - (xcoff_slurp_armap): Handle large archives. - (xcoff_archive_p): Detect large archives. - (xcoff_read_ar_hdr): Handle large archives. - (xcoff_openr_next_archived_file): Handle large archives. - (xcoff_generic_stat_arch_elt): Handle large archives. - (xcoff_write_armap_old): Rename from xcoff_write_armap. - (xcoff_write_armap_big): New function. - (xcoff_write_armap): New function, dispatch to _old or _big. - (xcoff_write_archive_contents_old): Rename from - xcoff_write_archive_contents. - (xcoff_write_archive_contents_big): New function. - (xcoff_write_archive_contents): New function, dispatch to _old or - _big. - -2000-02-18 Richard Henderson - - * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect - and hide_symbol members. - (elf_link_hash_copy_indirect): Remove. - (elf_link_hash_hide_symbol): Remove. - (struct elf_backend_data): Add elf_backend_copy_indirect_symbol - and elf_backend_hide_symbol. - (_bfd_elf_link_hash_copy_indirect): Declare. - (_bfd_elf_link_hash_hide_symbol): Declare. - * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument. - (_bfd_elf_link_hash_hide_symbol): Likewise. - (_bfd_elf_link_hash_table_init): Don't init killed members. - * elflink.h (elf_link_add_object_symbols): Use the bed function - pointers not elf_link_hash_{copy_indirect,hide_symbol}. - (elf_link_assign_sym_version): Likewise. - * elfxx-target.h (elf_backend_copy_indirect_symbol): Default. - (elf_backend_hide_symbol): Likewise. - (elfNN_bed): Update for new members. - -2000-02-17 Kevin Buettner - - * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD, - STACK_END_ADDR): Define for new core file format. - (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines - for handling the vagaries of the various core file structures used - by AIX over the years. - (rs6000coff_core_p, rs6000coff_core_file_matches_executable, - Rs6kCorData): Use above defines to adapt code to use AIX 4.3's - core_dumpx structure. - -Thu Feb 17 00:04:48 2000 J"orn Rennecke + * po/es.po: New file: Spanish translation. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. - * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros. - (bfd_mach_sh3_dsp): Likewise. - (bfd_mach_sh4): Reinstate. - (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750. +2002-01-06 Steve Ellcey + + * elfxx-ia64.c (is_unwind_section_name): Add target vector as + argument so we can handle HP-UX specially. + (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name. + (elfNN_hpux_backend_section_from_bfd_section): New for support + of SHN_IA_64_ANSI_COMMON. + (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON. + (is_unwind_section_name): Add special HP-UX support. + (elfNN_ia64_section_from_shdr): Add support for more sections. + (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and + add support for more sections. + (elfNN_ia64_additional_program_headers): Modify + is_unwind_section_name call. + (elfNN_ia64_modify_segment_map): Remove assumption that there is + only one unwind section in segment. + +2002-01-06 Alan Modra + + * syms.c (_bfd_generic_make_empty_symbol): New function. + * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as + _bfd_generic_make_empty_symbol. + * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. - * coff-sh.c (struct sh_opcode): flags is no longer short. - (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros. - (sh_opcode41, sh_opcode42): Integrate as sh_opcode41. - (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes. - (sh_opcode41, sh_opcode4, sh_opcode80): Likewise. - (sh_opcodes): No longer const. - (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays. - (sh_insn_uses_reg): Check for USESAS and USESR8. - (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS. - (_bfd_sh_align_load_span): Return early for SH4. - Modify sh_opcodes lookup table for sh-dsp / sh3-dsp. - Take into account that field b of a parallel processing insn - could be mistaken for a separate insn. - * cpu-sh.c (arch_info_struct): New array elements for - sh2, sh-dsp and sh3-dsp. - Reinstate element for sh4. - (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros. - (SH4_NEXT): Reinstate. - (SH3_NEXT, SH3E_NEXT): Adjust. - * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare. - * elf32-sh.c (sh_elf_set_private_flags): New function. - (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise. - (sh_elf_merge_private_data): New function. - (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define. - (bfd_elf32_bfd_copy_private_bfd_data): Define. - (bfd_elf32_bfd_merge_private_bfd_data): Change to - sh_elf_merge_private_data. - -2000-02-13 Richard Henderson - - * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and - hide_symbol members. - (elf_link_hash_copy_indirect): New. - (elf_link_hash_hide_symbol): New. - * elflink.h (elf_link_add_object_symbols): Break out copy from - indirect new new symbol to elf.c. - (elf_link_assign_sym_version): Break out privatization of - non-exported symbol to elf.c. - * elf.c (_bfd_elf_link_hash_copy_indirect): New. - (_bfd_elf_link_hash_hide_symbol): New. - (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol. - -2000-02-13 Ian Lance Taylor - - * section.c (_bfd_strip_section_from_output): Add info parameter. - If it passed as non-NULL, use it to check whether any input BFD - has an input section which uses this output section. Change all - callers. - * bfd-in2.h: Rebuild. - - * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and - bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of - 1999-11-29. - * bfd-in2.h: Rebuild. - -2000-02-10 Timothy Wall - - * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to - allow final modifications of swapped-in symbol. - (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST. - * coffcode.h (coff_write_relocs): Use macro - SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether - symbol index should be set to -1. - -Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) - - * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG, - USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros. - * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes. - * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg, - sh_insns_uses_or_sets_freg): New functions. - * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros. - * (sh_insns_conflict): Use new functions and new macros to - detect conflicts when two instructions both set same integer registers, - both set same fp register, and both set special register. - -2000-02-09 Timothy Wall - - * coffgen.c (coff_real_object_p): Set arch/mach info prior to - swapping in sections, so that the swapping routines have access to - the arch/mach info. - -2000-02-08 Mark Elbrecht - - * coff-go32.c: Update comment. Update copyright. - -2000-01-27 Thomas de Lellis - - * syms.c (bfd_decode_symclass) - Two new class characters were added - 'V' and 'v'. The - meaning of 'W' is now restricted to just weak non-object - symbols. This allows differentiation between, for example, - weak functions vs weak objects. nm for example now dumps: - 'W' = weak global - 'w' = weak unresolved - 'V' = weak global object - 'v' = weak unresolved object - - (bfd_is_undefined_symclass): New function. Return true if the - given symbol class represents and undefined/unresolved symbol. - - (bfd_symbol_info): Use bfd_is_undefined_symclass to check for - unresolved symbols. - - * bfd-in2.h: Add prototype for bfd_is_undefined_symbol(). - - * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the - STT_ARM_16BIT flag set, but it is not attached to a data object - return STT_ARM_16BIT so that it will be treated as code by the - disassembler. - -2000-01-27 Alan Modra - - * coff-i386.c (i3coff_object_p): Remove prototype. - Update copyright. - - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const - to name. Update copyright. - - * trad-core.c (trad_unix_core_file_p): Cast core_regsec - assignment to avoid warning. Update copyright. - -2000-01-24 Robert Lipe (robertl@sco.com) - - * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc - instead of using GNU C extension. - -2000-01-21 Nick Clifton - - * libbfd.c (bfd_read): Do not attempt to get a negativly sized - amount from a bfd_in_memory structure. - (bfd_seek): Do not allow seeks past the end of a bfd_in_memory - structure. - -2000-01-14 Nick Clifton - - * linker.c (default_indirect_link_order): oops - fix incorrectly - applied patch from Tim Wall. - -2000-01-13 Timothy Wall (twall@tiac.net> - - * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx - = scnhsz, filhsz, relsz, aoutsz, etc) - - * coffswap.h: Ditto. - -2000-01-13 Nick Clifton - - * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to - interwork thumb to arm stub. - -2000-01-13 Timothy Wall (twall@tiac.net> - - * archures.c (bfd_octets_per_byte): New function: Return - target byte size. - (bfd_arch_mach_octets_per_byte): New function: Return target - byte size. - - * section.c: Distinguish between octets and bytes for usage of - _cooked_size, _raw_size, and output_offset. Clarify - description of bfd_set_section_contents. - + * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function. + (hppabsd_core_get_symtab_upper_bound): Don't define. + (hppabsd_core_get_symtab): Likewise. + (hppabsd_core_print_symbol): Likewise. + (hppabsd_core_get_symbol_info): Likewise. + (hppabsd_core_bfd_is_local_label_name): Likewise. + (hppabsd_core_get_lineno): Likewise. + (hppabsd_core_find_nearest_line): Likewise. + (hppabsd_core_bfd_make_debug_symbol): Likewise. + (hppabsd_core_read_minisymbols): Likewise. + (hppabsd_core_minisymbol_to_symbol): Likewise. + (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). + Formatting fixes. + * hpux-core.c: Similarly. + * irix-core.c: Similarly. + * osf-core.c: Similarly. + * sco5-core.c: Similarly. + * binary.c (binary_make_empty_symbol): Remove function, define as + _bfd_generic_make_empty_symbol. + * ihex.c (ihex_make_empty_symbol): Likewise. + * mmo.c (mmo_make_empty_symbol): Likewise. + * ppcboot.c (ppcboot_make_empty_symbol): Likewise. + * srec.c (srec_make_empty_symbol): Likewise. + * versados.c (versados_make_empty_symbol): Likewise. + * vms.c (_bfd_vms_make_empty_symbol): Remove. + (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. + * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol + rather than _bfd_vms_make_empty_symbol. + * vms-misc.c (new_symbol): Likewise. + +2002-01-05 Alan Modra + + * section.c (bfd_section_init): Remove unnecessary initialisations. + (bfd_section_list_clear): New function. + (bfd_section_list_remove, bfd_section_list_insert): New macros. + (_bfd_strip_section_from_output): Use them. + * coffcode.h (coff_set_alignment_hook): Likewise. + * elf32-mips.c (_bfd_mips_elf_final_link): Likewise. + * elf64-mips.c (mips_elf64_final_link): Likewise. + * elf64-mmix.c (mmix_elf_final_link): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. * bfd-in2.h: Regenerate. - * coffgen.c: Indicate that the offset parameter is in bytes, not - octets. - - * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte - where appropriate to get the octet offset when calling - bfd_set_section_contents. - (bfd_coff_reloc_link_order): Ditto. - - * linker.c (bfd_generic_reloc_link_order): Ditto. - (_bfd_default_link_order): Ditto. - - * reloc.c (bfd_perform_relocation): Distinguish between octets - and bytes. Use octets when indexing into octet data; use bytes - when calculating target addresses. - (bfd_install_relocation): Ditto. - - * srec.c (srec_write_section): Ditto. - -2000-01-13 Nick Clifton + * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway + rather than doing our own section handling. Clean up after errors + with bfd_release and bfd_section_list_clear. Handle unexpected + flags. + * aoutf1.h (sunos4_core_file_p): Likewise. + * aix386-core.c (aix386_core_file_p): Likewise. + * cisco-core.c (cisco_core_file_validate): Likewise. + * ptrace-core.c (ptrace_unix_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + + * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors + with bfd_release and bfd_section_list_clear. + * hpux-core.c (hpux_core_core_file_p): Likewise. + * irix-core.c (irix_core_core_file_p): Likewise. + * lynx-core.c (lynx_core_file_p): Likewise. + * osf-core.c (osf_core_core_file_p): Likewise. + * rs6000-core.c (rs6000coff_core_p): Likewise. + * sco5-core.c (sco5_core_file_p): Likewise. + + * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform + sign extension adjustments without conditionals. + +2002-01-04 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if + CIE at .eh_frame start is removed due to no FDEs referencing it. + +2002-01-04 Jason Thorpe + + * config.bfd (x86_64-*-netbsd*): New target. + * configure.in (x86_64-*-netbsd*): Set COREFILE + to netbsd-core.lo. + * configure: Regenerated. - * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from - 3 to 2. This allows 4 byte sized sections, which is necessary for - dlltool to build functioning DLLs. +2002-01-03 Tom Rix -2000-01-10 Philip Blundell + * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering + for recent bfd_make_section_anyway change. - * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu. - (arm*-*-conix*): New target. +2002-01-03 Nick Clifton -2000-01-10 Egor Duda + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_THM_PC11 reloc. - * config.bfd: Include elf32_i386 vector to target list for cygwin - and mingw. +2002-01-02 Nick Clifton - * config.in: Undefine HAVE_WIN32_PSTATUS_T. - * configure.in: Test for structure win32_pstatus_t in - + * configure.in (LINGUAS): Add ja. * configure: Regenerate. + * po/ja.po: Import from translation project's web site. - * elf.c (elfcore_grok_win32pstatus): New function: process - win32_pstatus_t notes in elf core file. - (elfcore_grok_note): Detect win32_pstatus notes. - -2000-01-03 Martin v. Loewis +2002-01-02 Nick Clifton - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol - visibility. - * elflink.h (elf_link_add_object_symbols): Combine visibilities. - * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility. + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error + messages to ease translation into other languages. -For older changes see ChangeLog-9899 +For older changes see ChangeLog-0001 Local Variables: mode: change-log diff --git a/contrib/binutils/bfd/ChangeLog-0001 b/contrib/binutils/bfd/ChangeLog-0001 new file mode 100644 index 0000000..3000c03 --- /dev/null +++ b/contrib/binutils/bfd/ChangeLog-0001 @@ -0,0 +1,9592 @@ +2001-12-31 Jakub Jelinek + + * elflink.h (elf_bfd_final_link): Check if dynobj is not NULL + before looking for .eh_frame_hdr section. + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If + .eh_frame_hdr section is being stripped from output, don't do + anything. + +2001-12-27 Tom Rix + + * coff-rs6000.c (xcoff_generate_rtinit): Clean data_buffer alloc/free. + * coff64-rs6000.c (xcoff64_generate_rtinit): Same. + (xcoff_write_archive_contents_big): Rewrite. + (xcoff_write_armap_big): Rewrite. + (xcoff_write_one_armap_big): Delete. + * libxcoff.h : Clean up. + +2001-12-21 Tom Rix + + * xcofflink.c (bfd_xcoff_link_generate_rtinit): New function. + Interface to linker for generation of __rtinit. + * libxcoff.h (struct xcoff_backend_data_rec): Add new ops to xcoff + backend to generate special linker symbol __rtinit. + * coff-rs6000.c (bfd_xcoff_backend_data, bfd_pmac_xcoff_backend_data) + : Add new rtinit ops + * coff64-rs6000.c (bfd_xcoff_aix5_backend_data, + bfd_xcoff_backend_data): Same. + * bfd-in.h: Add bfd_xcoff_link_generate_rtinit. + * bfd-in2.h : Regenerate. + +2001-12-21 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for + R_SPARC_DISP32. Support R_SPARC_PLT32. + (sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32. + (elf32_sparc_check_relocs): Handle R_SPARC_PLT32. + (elf32_sparc_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for + R_SPARC_DISP32. Support R_SPARC_PLT32 and R_SPARC_PLT64. + (sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL + and BFD_RELOC_SPARC_PLT32. + (sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64. + (sparc64_elf_relocate_section): Likewise. + * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32. + * bfd-in2.h, libbfd.h: Rebuilt. + +2001-12-20 Tom Rix + + * coffcode.h (coff_compute_section_file_positions): Add special AIX + loader alignment of text section. + +2001-12-20 Jason Thorpe + + * config.bfd (mips-dec-netbsd*): Delete alias for mips*el-*-netbsd*. + + * config.bfd (arm-*-netbsdelf*): Add target. + * configure.in: Include netbsd-core.lo for native arm-*-netbsd*. + * configure: Regenerate. + +2001-12-20 Alan Modra + + * elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL, + as can happen with a core file, before dereferencing. + +2001-12-19 Michael Snyder + + * elf32-i386.c (elf_i386_grok_psinfo): Fix copy-and-paste error: + target is i386 (not mips), and size of descdata is 124 (not 128). + +2001-12-19 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): If new_size + is 0, temporarily grow it to minimal CIE size. + (_bfd_elf_write_section_eh_frame): If input .eh_frame section would + end up empty, build a fake minimal CIE. + +2001-12-19 Steve Ellcey + + * config.bfd (bfd_elf32_ia64_hpux_big_vec): New vector for + ia64*-*-hpux* target. + (bfd_elf64_ia64_hpux_big_vec): Likewise. + * targets.c: Ditto. + * configure.in: Ditto. + * configure: Regenerate + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Replace use of + alloca with bfd_malloc. + (get_local_sym_hash): Likewise. + (elfNN_hpux_post_process_headers): New function. + #include elfNN-target.h again with values for IA64 HP-UX vector. + +2001-12-18 Michael Snyder + + * elf.c (assign_file_positions_for_segments): Don't sort PT_NOTE + sections of corefiles. Also it makes no sense to sort if count == 1. + +2001-12-18 H.J. Lu + + * elf.c (_bfd_elf_copy_private_bfd_data): Also copy GP. + +2001-12-18 H.J. Lu + + * elf.c (_bfd_elf_copy_private_bfd_data): Update comments. + +2001-12-18 H.J. Lu + + * elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype. + (_bfd_mips_elf_copy_private_bfd_data): Removed. + + * elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in + the ELF header. + + * elf32-i370.c (??_elf_copy_private_bfd_data): Removed. + (bfd_elf??_bfd_copy_private_bfd_data): Removed. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sparc.c: Likewise. + * elfxx-ia64.c: Likewise. + + * elf64-mips.c (bfd_elf64_bfd_copy_private_bfd_data): Removed. + + * elfxx-target.h (bfd_elfNN_bfd_copy_private_bfd_data): Defined + to _bfd_elf_copy_private_bfd_data. + +2001-12-18 Martin Schwidefsky + + * elf32-s390 (elf_s390_check_relocs): Pass addend to + gc_record_vtentry. + * elf64-s390 (elf_s390_check_relocs): Likewise. + Fix by Andreas Jaeger . + +2001-12-18 Jason Thorpe + + * configure.host: Correctly match all NetBSD/mips + hosts. + +2001-12-18 matthew green + + * config.bfd (m68*-*-netbsdelf*): New target. + (m68*-*-netbsd): Also include bfd_elf32_m68k_vec. + (m68*-*-netbsdaout*): New alias for m68*-*-netbsd. + +2001-12-18 Jakub Jelinek + + * elflink.h (size_dynamic_sections): Skip anonymous version tag. + (elf_link_assign_sym_version): Don't count anonymous version tag. + +2001-12-18 Jakub Jelinek + + * elf-eh-frame.c (struct cie): Add make_lsda_relative. + (struct eh_cie_fde): Add lsda_encoding, lsda_offset, + make_lsda_relative. + (read_value, write_value): New. + (_bfd_elf_discard_section_eh_frame): Inicialize + lsda_encoding, lsda_offset and make_lsda_relative. + (_bfd_elf_eh_frame_section_offset): If make_lsda_relative, + request no dynamic reloc for LSDA field of FDE. + (_bfd_elf_write_section_eh_frame): Handle make_lsda_relative. + If a non-DW_EH_PE_absptr value is 0, don't adjust it by base + or pcrel. Fix address computation for DW_EH_PE_pcrel relocs. + Update LSDA field if LSDA encoding is DW_EH_PE_pcrel, because + . might have changed due to deleted FDE or CIEs. + +2001-12-18 Jakub Jelinek + + * elf-strtab.c (struct elf_strtab_hash_entry): Add u.next. + (last_eq): Remove. + (_bfd_elf_strtab_finalize): Don't use a hash table for last + character chains, instead use an array. + +2001-12-18 Jason Thorpe + + * elf.c (elfcore_netbsd_get_lwpid): New function. + (elfcore_grok_netbsd_procinfo): New function. + (elfcore_grok_netbsd_note): New function. + (elfcore_read_notes): Call elfcore_grok_netbsd_note to process + NetBSD ELF core file notes. + +2001-12-18 Alan Modra + + * elfcode.h (struct bfd_preserve): New. + (elf_object_p): Replace preserved_* vars with instance of above. + Save and restore arch_info pointer rather than arch, mach so that + more cases can be restored. Save and restore new section_tail, + section_htab structure, and init appropriately. Move "rest of + section header" code so that i_shdrp needs no NULL initialisation. + Free old section_htab on success. + * elfcore.h (elf_core_file_p): Likewise. + +2001-12-17 Tom Rix + + * coffcode.h (sec_to_styp_flags): Add STYP_EXCEPT and STYP_TYPCHK for + xcoff. + +2001-12-17 Jakub Jelinek + + * elf-bfd.h (elf_discarded_section): Define. + * elflink.h (elf_link_input_bfd): Use it. + (elf_reloc_symbol_deleted_p): Likewise. + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't warn about + overflows for pc relative relocs against discarded sections. + +2001-12-17 Thiemo Seufer + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Formatting. + * elf64-mips.c: Add most of the fixes and tweaks done in elf32-mips.c + over the last months. Add some code for mips16 handling. + (mips_elf64_check_mips16_stubs): New function. + (mips_elf64_stub_section_p): Likewise. + (mips_elf64_calculate_relocation): Change interface to support mips16. + (mips_elf64_perform_relocation): Likewise. + +2001-12-17 Alan Modra + + Support for more than 64k ELF sections. + * elf-bfd.h (elf_size_info ): Add shndx param. + (bfd_elf32_swap_symbol_in): Likewise. + (bfd_elf32_swap_symbol_out): Likewise. + (bfd_elf64_swap_symbol_in): Likewise. + (bfd_elf64_swap_symbol_out): Likewise. + (elf_reloc_cookie): Add locsym_shndx field. Make locsyms a PTR. + (elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and + symtab_shndx_section. + (elf_numsections): Define. + (elf_symtab_shndx): Define. + * elf.c (setup_group): Use elf_numsections rather than header e_shnum. + (bfd_elf_find_section): Likewise. + (bfd_section_from_elf_index): Likewise. + (bfd_section_from_shdr): Likewise. Handle SHT_SYMTAB_SHNDX. + (bfd_section_from_r_symndx): Read symbol shndx extension, and + translate st_shndx for > SHN_HIRESERVE. + (assign_section_numbers): Skip reserved sections. Assign + symtab_shndx_section and elf_numsections. Exclude reserved + sections from e_shnum. Set up symtab_shndx_hdr. + (_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr. + (map_sections_to_segments): Don't map eh_frame_hdr unless required. + (assign_file_positions_except_relocs): Use elf_numsections rather + than header e_shnum. Skip reserved sections and symtab_shndx_section. + (prep_headers): Set name for symtab_shndx_hdr. + (_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections. + (_bfd_elf_write_object_contents): Likewise. Skip reserved sections. + (_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section + first. Use elf_section_data if available. Use elf_numsections. + Start scan at index 1. + (copy_private_bfd_data ): Comment fixes. + (MAP_ONESYMTAB): Define above SHN_HIOS. + (MAP_DYNSYMTAB): Likewise. + (MAP_STRTAB): Likewise. + (MAP_SHSTRTAB): Likewise. + (MAP_SYM_SHNDX): New define. + (_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section. + (swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too. + * elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx + extension. + (elf_swap_symbol_out): Likewise. + (elf_object_p): Set elf_numsections, and use instead of e_shnum. + Initialialise reserved elf_elfsections to point at shdr[0]. Remove + redundant bfd_release calls. + (elf_slurp_symbol_table): Read symbol shndx extension, and use with + elf_swap_symbol_in. Translate st_shndx for > SHN_HIRESERVE too. + * elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx + extension, and use with elf_swap_symbol_in. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. Also translate st_shndx + for elf sections > SHN_HIRESERVE. + (NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out + call. + (struct elf_final_link_info): Add locsym_shndx and symshndxbuf. + (elf_bfd_final_link): Allocate the above, and tidy code allocating + other buffers. Use elf_numsections instead of e_shnum. Adjust + elf_swap_symbol_out calls. + (elf_link_output_sym): Swap out symbol shndx extension too. + (elf_link_flush_output_syms): And flush them to disk. + (elf_link_output_extsym): Use SHN_BAD. Adjust elf_swap_symbol_out + calls. + (elf_gc_mark): Read symbol shndx extension, and use with + elf_swap_symbol_in. + (elf_link_input_bfd): Likewise, Translate st_shndx for elf sections + > SHN_HIRESERVE too. Use SHN_BAD. + (elf_reloc_symbol_deleted_p): Use symbol shndx extensions with + elf_swap_symbol_in. Translate st_shndx > SHN_HIRESERVE too. + (elf_bfd_discard_info): Read symbol shndx extension. Don't attempt + to continue after a bfd error. + * elf-m10200.c (mn10200_elf_relax_section): Only read local syms. + Stash them immediately to symtab_hdr->contents rather than later + in multiple places. Clean up afterwards. Read symbol shndx + extension, and use with swap_symbol_in. Translate SHN_UNDEF, + SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd + sections too. Remove dead code. + (mn10200_elf_relax_delete_bytes): Use symbol shndx extension + when swapping in symbols. Tidy code adjusting global syms. + Don't swap in global syms. + (mn10200_elf_symbol_address_p): Likewise. Remove extsyms param. + (mn10200_elf_get_relocated_section_contents): Read symbol shndx + extension, and use with swap_symbol_in. Rename "size" -> "amt" + to maximize code in common with other files. Translate st_shndx + for > SHN_HIRESERVE too. Remove dead code. + * elf-m10300.c (mn10300_elf_relax_section): Only read local syms. + Stash them immediately to symtab_hdr->contents rather than later + in multiple places. Clean up afterwards. Read symbol shndx + extension, and use with swap_symbol_in. Remove dead code. + (mn10300_elf_relax_delete_bytes): As for elf-m10200.c. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx + extension, and use with swap_symbol_in. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to + bfd_elf32_swap_symbol_out. + * elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate + elf sections > SHN_HIRESERVE too. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read + local syms. Read symbol shndx extension, and use with swap_symbol_in. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Use + elf_numsections rather than header e_shnum. + * elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. Only read local + symbols. + * elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to + hold section index. Use elf_numsections rather than e_shnum. + Rename "index" -> "indx" to avoid shadowing warning. + (v850_elf_add_symbol_hook): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Only read local syms. + Read symbol shndx extension, and use with swap_symbol_in. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + Translate SHN_COMMON and elf sections > SHN_HIRESERVE too. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + (elfNN_ia64_aix_add_symbol_hook): Use elf_numsections. + + * elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks + before calling bfd_section_from_elf_index on local syms. + * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. + * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. + * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. + * elf64-mips.c (mips_elf64_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + +2001-12-17 Alan Modra + + Hash bfd sections for fast lookup and create. + * bfd.c (struct _bfd): Add section_htab, section_tail. + * libbfd-in.h (_bfd_delete_bfd): Declare. + (bfd_section_hash_newfunc): Declare. + * opncls.c (_bfd_new_bfd): Free memory on failure. Init + section_htab and section_tail. + (_bfd_delete_bfd): New function. + (bfd_openr): Use it. + (bfd_fdopenr): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openw): Likewise. + (bfd_close): Likewise. + (bfd_close_all_done): Likewise. + (bfd_release): Comment. + * section.c (struct section_hash_entry): New. + (bfd_section_hash_newfunc): New function. + (section_hash_lookup): Define. + (bfd_section_init): New function, split out from + bfd_make_section_anyway. + (bfd_get_section_by_name): Lookup via hash table. + (bfd_get_unique_section_name): Likewise. + (bfd_make_section_old_way): Rewrite to use hash table. + (bfd_make_section_anyway): Likewise. + (bfd_make_section): Likewise. Return NULL for attempts to make + BFD_{ABS,COM,UND,IND}_SECTION_NAME. + (_bfd_strip_section_from_output): Adjust section_tail if needed. + * configure.in: Bump bfd version. + * configure: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2001-12-15 Thiemo Seufer + + * elf64-mips.c (mips_elf64_link_hash_entry): New link hash. + (mips_elf64_high): New Function. + (mips_elf64_higher): Likewise. + (mips_elf64_highest): Likewise. + (mips_elf64_info_to_howto_rel): Likewise. + (mips_elf64_info_to_howto_rela): Likewise. + (mips_elf64_write_rel): Likewise. + (mips_elf64_write_rela): Likewise. + (mips_elf64_link_hash_newfunc): Likewise. + (mips_elf64_hi16_reloc): Likewise. + (mips_elf64_higher_reloc): Likewise. + (mips_elf64_highest_reloc): Likewise. + (mips_elf64_gprel16_reloc): Likewise. + (mips_elf64_gprel16_reloca): Likewise. + (mips_elf64_literal_reloc): Likewise. + (mips_elf64_gprel32_reloc): Likewise. + (mips_elf64_shift6_reloc): Likewise. + (mips_elf64_got16_reloc): Likewise. + (mips_elf64_assign_gp): Likewise. + (mips_elf64_final_gp): Likewise. + (gprel16_with_gp): Likewise. + (mips_elf64_additional_program_headers): Likewise. + (mips_elf64_link_hash_table_create): Likewise. + (mips_elf64_got_offset_from_index): Likewise. + (_mips_elf64_got_info): Likewise. + (mips_elf64_sign_extend): Likewise. + (mips_elf64_overflow_p): Likewise. + (mips_elf64_global_got_index): Likewise. + (mips_elf64_sort_hash_table_f): Likewise. + (mips_elf64_sort_hash_table): Likewise. + (mips_elf64_swap_msym_out): Likewise. + (mips_elf64_create_local_got_entry): Likewise. + (mips_elf64_local_got_index): Likewise. + (mips_elf64_got_page): Likewise. + (mips_elf64_got16_entry): Likewise. + (mips_elf64_local_relocation_p): Likewise. + (mips_elf64_next_relocation): Likewise. + (mips_elf64_create_dynamic_relocation): Likewise. + (mips_elf64_calculate_relocation): Likewise. + (mips_elf64_obtain_contents): Likewise. + (mips_elf64_perform_relocation): Likewise. + (mips_elf64_relocate_section): Likewise. + (mips_elf64_create_dynamic_sections): Likewise. + (mips_elf64_adjust_dynamic_symbol): Likewise. + (mips_elf64_always_size_sections): Likewise. + (mips_elf64_size_dynamic_sections): Likewise. + (mips_elf64_finish_dynamic_symbol): Likewise. + (mips_elf64_finish_dynamic_sections): Likewise. + (mips_elf64_gc_mark_hook): Likewise. + (mips_elf64_gc_sweep_hook): Likewise. + (mips_elf64_create_got_section): Likewise. + (mips_elf64_record_global_got_symbol): Likewise. + (mips_elf64_create_msym_section): Likewise. + (mips_elf64_allocate_dynamic_relocations): Likewise. + (mips_elf64_check_relocs): Likewise. + (mips_elf64_output_extsym): Likewise. + (mips_elf64_swap_gptab_in): Likewise. + (mips_elf64_swap_gptab_out): Likewise. + (gptab_compare): Likewise. + (mips_elf64_final_link): Likewise. + (prev_reloc_addend): Remenber addend of previous parts of a combined + reloc. + (ELF_MIPS_GP_OFFSET): New define. + (STUB_LW,STUB_MOVE,STUB_JALR,STUB_LI16): Likewise. + (MIPS_FUNCTION_STUB_SIZE): Likewise. + (mips_elf64_howto_rel): Fix HOWTO defines. + (mips_elf64_howto_rela): Likewise. + (mips_elf64_swap_reloca_out): Fix signedness. + (mips_elf64_be_swap_reloc_in): Use ELF64* instead of ELF32*. + (mips_elf64_be_swap_reloca_in): Likewise. + (mips_elf64_be_swap_reloc_out): Likewise. Preserve extended type info. + (mips_elf64_be_swap_reloca_out): Likewise. + +2001-12-15 Jakub Jelinek + + * elf-bfd.h (_bfd_elf_maybe_strip_eh_frame_hdr): New prototype. + * elf-eh-frame.c (struct eh_frame_hdr_info): Add strip. + (_bfd_elf_discard_section_eh_frame): Don't create .eh_frame_hdr + sec_info here. Free ehbuf. + (_bfd_elf_discard_section_eh_frame_hdr): Don't size the section + if hdr_info->strip. + (_bfd_elf_maybe_strip_eh_frame_hdr): New. + * elflink.h (size_dynamic_sections): Call it. + +2001-12-14 Alan Modra + + * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. + +2001-12-13 Jakub Jelinek + + * elf-bfd.h (enum elf_link_info_type): New. + (struct bfd_elf_section_data): Remove stab_info and merge_info + fields, add sec_info and sec_info_type. + (struct elf_obj_tdata): Add eh_frame_hdr field. + (_bfd_elf_discard_section_eh_frame): New prototype. + (_bfd_elf_discard_section_eh_frame_hdr): Likewise. + (_bfd_elf_eh_frame_section_offset): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_write_section_eh_frame_hdr): Likewise. + * Makefile.am (BFD32_BACKENDS): Add elf-eh-frame.lo. + (BFD32_BACKENDS_CFILES): Add elf-eh-frame.c. + (elf-eh-frame.lo): New. + * Makefile.in: Rebuilt. + * configure.in (elf): Add elf-eh-frame.lo. + * configure: Rebuilt. + * elf.c (_bfd_elf_print_private_bfd_data): Support PT_GNU_EH_FRAME. + (map_sections_to_segments): Create PT_GNU_EH_FRAME if requested. + (get_program_header_size): Take into account PT_GNU_EH_FRAME + segment. + (_bfd_elf_rela_local_sym): Use sec_info_type and sec_info. + (_bfd_elf_rel_local_sym): Likewise. + (_bfd_elf_section_offset): Likewise. Call + _bfd_elf_eh_frame_section_offset too. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Use sec_info_type and + sec_info. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf-eh-frame.c: New file. + * elflink.h (elf_link_add_object_symbols): Don't optimize SHF_MERGE + .stab sections. Set sec_info_type, use sec_info instead + of merge_info and stab_info. + (elf_link_create_dynamic_sections): Create .eh_frame_hdr section + if --eh-frame-hdr. + (elf_bfd_final_link): Write .eh_frame_hdr section. + (elf_link_sec_merge_syms): Use sec_info_type and sec_info. + (elf_link_input_bfd): Likewise. + Call _bfd_elf_write_section_eh_frame to write .eh_frame sections. + (elf_bfd_discard_info): Add output_bfd argument. + Call _bfd_elf_discard_section_eh_frame and + _bfd_elf_discard_section_eh_frame_hdr. + (elf_section_ignore_discarded_relocs): Use sec_info_type, not section + names. + * bfd-in.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Adjust + prototypes. + * bfd-in2.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Likewise. + +2001-12-12 Richard Henderson + + * syms.c (_bfd_generic_read_minisymbols): Early return for + no symbols. Patch from FreeBSD folk; exact origin unknown. + +2001-12-11 Alan Modra + + * elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum + and e_shstrndx if out of range. + (elf_object_p): Read extended values for e_shnum and e_shstrndx + from the first section header. Allocate space in elf_elfsections + for reserved sections and set to NULLs. + (elf_write_shdrs_and_ehdr): Set overflow fields in first section + header. Skip reserved sections in elf_elfsections. Remove + duplicate size calculation. + +2001-12-07 Geoffrey Keating + Richard Henderson + Corinna Vinschen + + * Makefile.am: Add support for xstormy16. + * archures.c: Add support for xstormy16. + * config.bfd: Add support for xstormy16. + * configure.in: Add support for xstormy16. + * reloc.c: Add support for xstormy16. + * targets.c: Add support for xstormy16. + * cpu-xstormy16.c: New file. + * elf32-xstormy16.c: New file. + * Makefile.in: Regenerated. + * bfd-in2.h: Regenerated. + * configure: Regenerated. + * libbfd.h: Regenerated. + +2001-12-07 Nick Clifton + + * elf.c (assign_file_positions_for_segments): Combine sentance + fragments into a single sentance in order to permit better + translation into foreign languages. + +2001-12-07 Jim Blandy + + * elf32-s390.c (elf32_s390_grok_prstatus): New function. + (elf_backend_grok_prstatus): Define. + +2001-12-07 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Revert + 2001-09-14 change. + +2001-12-07 Jakub Jelinek + + * elf.c (_bfd_elf_rela_local_sym): Only call + _bfd_merged_section_offset if merge_info is non-NULL. + (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New. + * elf-bfd.h (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New + prototypes. + * elf32-arm.h (elf32_arm_final_link_relocate): Use + _bfd_elf_section_offset. + (elf32_arm_relocate_section): Use _bfd_elf_rel_local_sym. + * elf32-i386.c (elf_i386_relocate_section): Use + _bfd_elf_section_offset and _bfd_elf_rel_local_sym. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Use + _bfd_elf_section_offset. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_create_dynamic_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. + +2001-12-07 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Don't do anything if + already forced local. + +2001-12-05 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Combine + fragmented sentence parts into a whole sentence to permit + better translation into foreign languages. + +2001-12-06 Hans-Peter Nilsson + + * configure: Regenerate. + * Makefile.in: Regenerate. + +2001-12-05 Thiemo Seufer + + * Makefile.am: split up BFD_LIBS like statements in BFD32_LIBS and + BFD64_LIBS, make the latter depending on the availability of BFD64. + Add archive64.c source file. + * archive64.c: New file implementing bfd_elf64_archive_slurp_armap + and bfd_elf64_archive_write_armap, code from elf64-mips.c + * archive.c (bfd_slurp_armap): Add ELF64 archive support. + * config.bfd (mips*-*-irix6*): Allow with BFD64 only. + (mips64*el-*-linux*): Likewise. + (mips*el-*-linux*): Likewise. Reorder entries. + * configure.in (bfd_libs): Define in dependency of BFD64 and + AC_SUBST it. + * elf64-mips.c (mips_elf64_slurp_armap): Remove, use + bfd_elf64_archive_slurp_armap instead. + (mips_elf64_write_armap): Remove, use bfd_elf64_archive_write_armap + instead. + +2001-12-04 Thiemo Seufer + + * config.bfd: Remove trailing blanks. + * elf32-mips.c (gprel16_with_gp): Remove superfluous casts. + +2001-12-04 Alexandre Oliva + + * elf32-d10v.c (elf_d10v_howto_table): Adjust bit-size of + R_D10V_10_PCREL_L, R_D10V_10_PCREL_R, R_D10V_18, + R_D10V_18_PCREL. Check 10_PCREL relocations as signed. + Disable pointless overflow checking of NONE and 32. + +2001-12-04 Alan Modra + + * reloc.c (bfd_install_relocation): Correct reloc address test. + (bfd_perform_relocation): Formatting fix. + * bfd-in2.h: Regenerate for 2001-12-02 reloc.c change. + +2001-12-03 Nick Clifton + + * configure.in (LINGUAS): Add tr. + * configure: Regenerate. + * po/tr.po: Import from translation project's web site. + +2001-12-03 Alan Modra + + * elf32-hppa.c (hppa_get_stub_entry): Remove debug message that + happens to trigger on undefined symbols. + (final_link_relocate): Return bfd_reloc_undefined for undefined + stubs. + (elf32_hppa_relocate_section): Don't say we can't handle a reloc + if we have already warned about an undefined symbol. + +2001-12-02 Thiemo Seufer + + * elf32-mips.c (NEWABI_P): New define. + (USE_REL): Remove, replaced by + (elf_backend_may_use_rel_p): New define. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_mips_howto_table): Rename to elf_mips_howto_table_rel. + Fix some relocation definitions. + (elf_mips_howto_table_rela): New RELA relocation definitions for + NewABI support. + (mips32_64bit_reloc): Use the renamed elf_mips_howto_table_rel. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (mips_rtype_to_howto): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_object_p): Typo. + (elf_backend_sign_extend_vma): Reordered together with many other + defines nearby to resemble the order of declaration in the header + file. + +2001-12-02 Thiemo Seufer + + * coff-mips.c (mips_bfd_reloc_type_lookup): Replace + BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16. + * pe-mips.c (mips_bfd_reloc_type_lookup): Likewise. + * elf32-mips.c (mips_reloc_map): Likewise. Replace + BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32. + * elf64-mips.c (mips_reloc_map): Likewise. + * reloc.c (BFD_RELOC_MIPS_GPREL): Remove. + (BFD_RELOC_MIPS_GPREL32): Remove. + +2001-11-30 H.J. Lu + + * elflink.h (elf_add_default_symbol): New. + (elf_link_add_object_symbols): Call elf_add_default_symbol () + to create an indirect symbol from the default for the symbol + with the default version if needed. + +2001-11-29 "Peter.Schauer" + + * elf.c (elfcore_grok_prstatus): Do not overwite the core signal + if it has already been set by another thread. + +2001-11-28 Jakub Jelinek + + * elf64-alpha.c (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Defined. + (elf64_alpha_relocate_section): Translate local_got_entries + for STT_SECTION symbol to SHF_MERGE section the first time + we see it. + * elfxx-ia64.c (struct elfNN_ia64_local_hash_entry): Add + sec_merge_done. + (get_local_sym_hash): New, extracted from get_dyn_sym_info. + (get_dyn_sym_info): Use it. + (elfNN_ia64_relocate_section): Translate local dyn entries + for STT_SECTION symbol to SHF_MERGE section the first time + we see it. + +2001-11-27 H.J. Lu + + * elflink.h (elf_bfd_discard_info): Skip if the input bfd isn't + ELF. + +2001-11-26 Jeffrey A Law (law@cygnus.com) + + * stabs.c (_bfd_discard_section_stabs): Use PARAMS in function + prototypes. + +2001-11-24 Alan Modra + + * elf32-hppa.c (elf32_hppa_size_stubs): Decrease default stub + group sizes to accommodate c++. + +2001-11-23 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't clear + relocations in non-alloced sections against global symbols + defined in shared library being built. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2001-11-23 Jakub Jelinek + + * elf.c (_bfd_elf_rela_local_sym): New. + * elflink.h (elf_link_input_bfd): Don't consider empty + merged sections as removed in relocation tests. + * elf-bfd.h (_bfd_elf_rela_local_sym): Add prototype. + * elf32-i386.c (elf_i386_relocate_section): Handle relocs + against STT_SECTION symbol of SHF_MERGE section. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Call + _bfd_elf_rela_local_sym. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_final_link_relocate): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise for + !partial_inplace relocs. Handle relocs against STT_SECTION + symbol of SHF_MERGE for partial_inplace relocs. + +2001-11-21 Nick Clifton + + * po/Make-in (distclean): Move SRC-POTFILES.in and + BLD-POTFILES.in to maintainer-clean target. + +2001-11-21 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Test r_symndx rather + than sym_sec->output_section to detect relocs against discarded + sections. + +2001-11-19 H.J. Lu + + * elflink.h (elf_link_input_bfd): Assert r_symndx != 0 when + discarding relocations. + +2001-11-19 Nick Clifton + + * section.c (bfd_is_const_section): New macro. Return true if the + given seciton is one of the special, constant, sections. + * bfd-in2.h: Regenerate. + * coffgen.c (coff_count_linenumbers): Use bfd_is_const_section. + (coff_write_native_symbol): Use bfd_is_const_section. + +2001-11-19 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Dec dynstr refcount. + + * elf32-hppa.c (elf32_hppa_size_stubs): Don't consider undefined + millicode syms as candidates for import stubs. + + * elf32-hppa.c (PLABEL_PLT_ENTRY_SIZE): Delete. + (allocate_PIC_calls): Rename to allocate_plt_static. + (allocate_dynrelocs): Move most of code handling .plt entries to.. + (allocate_plt_static): ..here. Don't drop plabel entries. + +2001-11-19 Hans-Peter Nilsson + + * mmo.c: Adjust documentation tags to use texinfo 4 features. + +2001-11-16 Nick Clifton + + * section.c (bfd_is_const_section): New macro. Return true if the + section pointer refers to one of the special, constant sections. + * bfd-in2.h: Regenerate. + + * coffgen.c (coff_count_linenumbers): Only update the line number + count in non-special sections. + (coff_write_native_symbol): Only update the line number file + position in non-special sections. + +2001-11-15 Daniel Jacobowitz + + * elflink.h (elf_reloc_symbol_deleted_p): Catch all relocs against + local syms from discarded sections. Update comment. + +2001-11-15 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h (elf_link_input_bfd): Complain about all relocs + against local syms from discarded sections. K&R fixes. + (elf_reloc_symbol_deleted_p): Don't try to swap in external syms. + K&R fixes. + +2001-11-15 Alexandre Oliva + + * elf64-sparc.c (sparc64_elf_relocate_section): Disregard + overflows in the .stab section. + +2001-11-14 Daniel Jacobowitz + + * bfd-in.h (bfd_elf32_discard_info): Add prototype. + (bfd_elf64_discard_info): Likewise. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct elf_reloc_cookie): New. + (struct elf_backend_data): Add elf_backend_discard_info, + elf_backend_ignore_discarded_relocs, and elf_backend_write_section. + (_bfd_elf32_reloc_symbol_deleted_p): Add prototype. + (_bfd_elf64_reloc_symbol_deleted_p): Likewise. + * elf32-mips.c (_bfd_elf32_mips_discard_info): New. + (_bfd_elf32_mips_ignore_discarded_relocs): New. + (_bfd_elf32_mips_write_section): New. + (elf_backend_discard_info): Define. + (elf_backend_ignore_discarded_relocs): Define. + (elf_backend_write_section): Define. + * elfcode.h (elf_bfd_discard_info): Define. + (elf_reloc_symbol_deleted_p): Define. + * elflink.h (elf_link_input_bfd): Check + elf_section_ignore_discarded_relocs. Call + bed->elf_backend_write_section if available. + (elf_reloc_symbol_deleted_p): New. + (elf_bfd_discard_info): New. + (elf_section_ignore_discarded_relocs): New. + * elfxx-target.h (elf_backend_discard_info): Define. + (elf_backend_ignore_discarded_relocs): Define. + (elf_backend_write_section): Define. + (elfNN_bed): Add elf_backend_discard_info, + elf_backend_ignore_discarded_relocs, and + elf_backend_write_section. + * libbfd-in.h (_bfd_discard_section_stabs): Add prototype. + * libbfd.h: Regenerate. + * stabs.c (_bfd_discard_section_stabs): New. + +2001-11-14 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc" + scheme to get rid of an ugly complicated test. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + +2001-11-14 Andreas Jaeger + + * cpu-i386.c (bfd_x86_64_arch_intel_syntax,bfd_x86_64_arch): Use + x86-64 for display. + +2001-11-14 Jakub Jelinek + + * dwarf2.c (struct line_head) [total_length]: Change type to + bfd_vma. + (struct dwarf2_debug): Add dwarf_str_buffer and dwarf_str_size. + (struct comp_unit): Add stash and offset_size. + (read_8_bytes): Return bfd_vma. + (read_indirect_string): New. + (read_attribute): Handle DW_FORM_strp. + (decode_line_info): Support 64-bit DWARF format. + (_bfd_dwarf2_find_nearest_line): Likewise. + (parse_comp_unit): Set offset_size and stash. + +2001-11-13 Keith Walker + + * dwarf2.c (read_attribute_value): New function to handle + DW_FORM_indirect. + (read_attribute): Use it. + +2001-11-13 Geoffrey Keating + + * dwarf2.c (decode_line_info): Properly deal with unknown standard + opcodes. + +2001-11-13 John Marshall + Alan Modra + + * section.c (bfd_make_section_anyway): Don't increment section_id + and the BFD's section_count if adding the section failed. + * vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway + change. + +2001-11-12 Orjan Friberg + + * elf32-cris.c (cris_elf_grok_prstatus): Adjust values to match new + core dump format. + +2001-11-11 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Call + _bfd_elf_strtab_size instead of _bfd_stringtab_size. + + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Change + dynstr type to `struct elf_strtab_hash *'. + +2001-11-11 Hans-Peter Nilsson + + * elf-strtab.c (_bfd_elf_strtab_finalize): Make first variable i + size_t. Rename second i to j. + +2001-11-10 Jeffrey A Law (law@cygnus.com) + + * binary.c: Include safe-ctype.h after bfd.h and sysdep.h. + +2001-11-10 Alan Modra + + * elf32-arm.h (elf32_arm_final_link_relocate): Don't copy STN_UNDEF + relocs into shared libs. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf.c (bfd_section_from_r_symndx): New function. + * elf-bfd.h (LOCAL_SYM_CACHE_SIZE): Define. + (struct sym_sec_cache): New. + (bfd_section_from_r_symndx): Declare. + (struct bfd_elf_section_data): Change local_dynrel type to PTR. + * elflink.h (elf_link_input_bfd): Don't test for removed linkonce + relocs when relocatable. Don't zero entire reloc, just zero the + addend and sym. + * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add sym_sec. + (elf32_hppa_link_hash_table_create): Init it. + (elf32_hppa_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf32_hppa_gc_sweep_hook): Update for local_dynrel change. + (allocate_dynrelocs): Warning fix. + (elf32_hppa_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf32_hppa_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf32-i386.c (struct elf_i386_link_hash_table): Add sym_sec. + (elf_i386_link_hash_table_create): Init it. + (elf_i386_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_i386_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_i386_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_i386_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf32-s390.c (struct elf_s390_link_hash_table): Add sym_sec. + (elf_s390_link_hash_table_create): Init it. + (elf_s390_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_s390_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_s390_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_s390_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf64-ppc.c (struct ppc_link_hash_table): Add sym_sec. + (ppc64_link_hash_table_create): Init it. + (ppc64_elf_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (ppc64_elf_gc_sweep_hook): Update for local_dynrel change. + (allocate_dynrelocs): Call the correct record_dynamic_dymbol + function. Warning fix. + (ppc64_elf_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (ppc64_elf_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf64-s390.c (struct elf_s390_link_hash_table): Add sym_sec. + (elf_s390_link_hash_table_create): Init it. + (elf_s390_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_s390_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_s390_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_s390_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + +2001-11-08 Martin Schwidefsky + + * elf32-s390: Major rework that introduces all recent changes to + the s390 backends. Get a closer match to elf32-i386. + (elf_s390_relocate_section): Make use of dynamic section short-cuts. + Localise vars, and delay setting. Better error reporting, replace + BFD_ASSERT with abort. Check ELF_LINK_HASH_DEF_DYNAMIC to see if a + symbol is not defined in the regular object file and tread the weak + definition as the normal one. Don't discard relocs for undefweak or + undefined symbols and check !DEF_REGULAR as well as DEF_DYNAMIC in + test for avoided copy relocs. Reinstate fudge for unresolved relocs + in debugging sections. + (elf32_s390_adjust_dynamic_symbol): Handle nocopyreloc. Don't do copy + reloc processing for weakdefs. Remove redundant casts and aborts. + Delay setting of vars until needed. Move creation of dynamic symbols + and allocation of .plt and .rela.plt to allocate_dynrelocs. Replace + BFD_ASSERT with abort. Discard .plt entries for everything with + plt.refcount <= 0. + (elf_s390_check_relocs): Don't allocate space for dynamic relocs, + .got or .relgot here but do it in allocate_dynrelocs. Reference count + possible .plt and .got entries. Don't test input section SEC_READONLY + here to try to avoid copy relocs, and keep dyn_relocs regardless of + ELF_LINK_NON_GOT_REF. Don't set DF_TEXTREL here. Delay setting of + variables until needed. Remove separate switch stmt for creating .got + section. Initialise local_got_refcounts to 0. Cache pointer to + "sreloc" section in elf_section_data. Tweak condition under which .got + created. Report files with bad relocation section names. + (elf_s390_finish_dynamic_symbol): Don't copy relocs for symbols that + have been forced local. Use same test to decide if we can use a + relative reloc for got as elf_s390_relocate_section. Expand SHN_UNDEF + comment. Move expressions out of function calls. Replace BFD_ASSERT + with abort. + (elf_s390_finish_dynamic_sections): Migrate common code out of switch + statement. Replace BFD_ASSERT with abort. + (elf_s390_size_dynamic_sections): Call readonly_dynrelocs. Rename "i" + to "ibfd". Allocate space for local dyn relocs. Use DF_TEXTREL flag + instead of looking up section names for DT_TEXTREL. Replace + BFD_ASSERT with abort. Zero out the dynamic allocated content space. + Add a comment to remind us that one day this ought to be fixed. + (struct elf_s390_link_hash_entry): Rename "root" to "elf". + (struct elf_s390_link_hash_table): Likewise. + (elf_s390_link_hash_newfunc): Rename to link_hash_newfunc and get + rid of unnecessary casts. + (struct elf_s390_dyn_relocs): Add "sec", and "pc_count" fields. + Remove "section" field. + (elf_s390_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + Reference count possible .plt entries. Don't deallocate .got and + .relgot space here. + (struct elf_s390_pcrel_relocs_copied): Rename to elf_s390_dyn_relocs. + Update comment. + (struct elf_s390_link_hash_entry): Rename pcrel_relocs_copied to + dyn_relocs. + (elf_s390_discard_copies): Delete. + (elf_s390_link_hash_traverse): Delete. + (bfd_elf32_bfd_final_link): Delete. (ie. use regular final link + rather than gc variety). + (struct elf_s390_link_hash_table): Add sgot, sgotplt, srelgot, splt, + srelplt, sdynbss, srelbss fields. + (elf_s390_link_hash_table_create): Init them. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (allocate_dynrelocs): New function. + (create_got_section): New function. + (elf_backend_can_refcount): Define. + (elf_backend_copy_indirect_symbol): Define. + (elf_s390_copy_indirect_symbol): New function. + (elf_s390_create_dynamic_sections): New function. + (readonly_dynrelocs): New function. + * elf64-s390.c: Likewise. + +2001-11-07 Jakub Jelinek + + * Makefile.am (BFD32_BACKENDS): Add elf-strtab.lo. + (BFD32_BACKENDS_CFILES): Add elf-strtab.c. + (elf-strtab.lo): Add rule. + * Makefile.in: Rebuilt. + * configure.in (elf): Add elf-strtab.lo. + * configure: Rebuilt. + * elf-bfd.h (elf_strtab_hash): Forward declare. + (struct elf_link_hash_table): Change dynstr type to + struct elf_strtab_hash *. + (struct elf_obj_tdata): Change strtab_ptr type to + struct elf_strtab_hash *. + (_bfd_elf_strtab_init, _bfd_elf_strtab_free, _bfd_elf_strtab_add, + _bfd_elf_strtab_addref, _bfd_elf_strtab_delref, + _bfd_elf_strtab_clear_all_refs, _bfd_elf_strtab_size, + _bfd_elf_strtab_offset, _bfd_elf_strtab_emit, + _bfd_elf_strtab_finalize): New prototypes. + * elf-strtab.c: New file. + * elflink.h (elf_link_add_object_symbols): Use _bfd_elf_strtab_add + and _bfd_elf_strtab_size instead of _bfd_stringtab calls. + Call _bfd_elf_strtab_delref if DT_NEEDED entry is not needed or + when forcing dynamic symbol to local. + (elf_link_create_dynamic_sections): Call + _bfd_elf_strtab_init instead of elf_stringtab_init. + (elf_link_record_local_dynamic_symbol): Likewise, change + dynstr type. Use _bfd_elf_strtab functions instead of + _bfd_stringtab calls. + (size_dynamic_sections): Use _bfd_elf_strtab functions instead of + _bfd_stringtab calls. For DT_RUNPATH and Verdaux vda_name fields, + call _bfd_elf_strtab_addref. Call elf_finalize_dynstr. + (elf_adjust_dynstr_offsets, elf_finalize_dynstr): New functions. + (elf_fix_symbol_flags): Call _bfd_elf_strtab_delref when forcing + dynamic symbol to local. + (elf_link_assign_sym_version): Likewise. + (elf_bfd_final_link): Call _bfd_elf_strtab_emit instead of + _bfd_stringtab_emit. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Change dynstr + type. Call _bfd_elf_strtab functions instead of + _bfd_stringtab functions. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + * elf.c (_bfd_elf_init_reloc_shdr): Likewise. + (elf_fake_sections): Likewise. + (assign_section_numbers): Call _bfd_elf_strtab_clear_all_refs + on shstrtab hash table, call _bfd_elf_strtab_addref on each section + name in the output. Call _bfd_elf_strtab_finalize and + use _bfd_elf_strtab_offset to finalize sh_name section header fields. + (_bfd_elf_compute_section_file_positions): Use _bfd_elf_strtab_size + instead of _bfd_stringtab_size. + (prep_headers): Change shstrtab type. + Use _bfd_elf_strtab calls instead of _bfd_stringtab calls. + +2001-11-07 Alan Modra + + * elflink.h (elf_link_input_bfd ): Fix + bad symtab segfault. Formatting and warning fixes. Improve + error message for internationalisation. + +2001-11-06 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Complain about relocs against + discarded sections. + +2001-11-03 Alan Modra + + * elfxx-target.h (elfNN_bed): Correct want_got_sym, want_dynbss order. + +2001-11-02 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Don't create + dynamic relocation for symbols defined in regular objects when + creating executables. + +2001-11-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add "fr". + * configure: Regenerate. + * po/fr.po: New file. + + * coffgen.c (coff_object_p): Add comment to H.J.'s recent patch. + +2001-11-02 John David Anglin + + * som.c (setup_sections): Initialize subspace_sections. + +2001-11-02 H.J. Lu (hjl@gnu.org) + + * coffgen.c (coff_object_p): Return 0 if the header is too big. + +2001-11-02 Hans-Peter Nilsson + + * elfcore.h (elf_core_file_p): Preserve and clear abfd section + information. Save bfd arch and mach values. Restore on error. + +2001-11-02 Alan Modra + + * elf32-hppa.c (hppa_handle_PIC_calls): Rename to mark_PIC_calls. + (allocate_PIC_calls): New function. + (allocate_dynrelocs): Don't allocate pic_call plt entries here. + (elf32_hppa_size_dynamic_sections): Call allocate_PIC_calls. + (elf32_hppa_finish_dynamic_symbol): Remove dead code. + +2001-11-02 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_grok_prstatus): New function. + (cris_elf_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + +2001-11-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct branch + prediction bits. + +2001-10-31 Chris Demetriou + + * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative + relocations properly. + +2001-10-31 H.J. Lu + + * elflink.h (elf_link_output_extsym): Don't clear the visibility + field for relocateable. + +2001-11-01 Alan Modra + + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count + .plt relocs in DT_RELASZ. + +2001-10-29 NIIBE Yutaka + + * config.bfd: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu + targets. + +2001-10-31 Nick Clifton + + * targets.c: Fix typo: bfd_mmo_mmix_vec => bfd_mmo_vec. + +2001-10-30 Hans-Peter Nilsson + + * Makefile.am (ALL_MACHINES): Add cpu-mmix.lo. + (BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo. + (BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c. + Regenerate dependencies. + * configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors. + * config.bfd: [BFD64] (mmix-*-*): New case. + * cpu-mmix.c, mmo.c, elf64-mmix.c: New files. + * archures.c (enum bfd_architecture): Add bfd_arch_mmix. + (bfd_mmix_arch): Declare. + (bfd_archures_list): Add bfd_mmix_arch. + * targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour. + (bfd_elf64_mmix_vec, bfd_mmo_vec): Declare. + (bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and + bfd_mmo_mmix_vec. + * reloc.c: Add MMIX relocations. + * bfd.c (struct _bfd, tdata): Add mmo_data. + * Makefile.in: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Rebuild. + +2001-10-30 Richard Earnshaw (rearnsha@arm.com) + + * elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the + p_paddr of the segment that contains it. + (copy_private_bfd_data): If the LMA for a segment is known, use it + for matching sections to segments. + (assign_file_positions_for_segments): Use the LMA when adjusting + for inter-section alignment padding. + +2001-10-29 Kazu Hirata + + * README: Fix a typo. + +2001-10-24 Richard Henderson + + * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy + timestamp to time_t for ctime. + +2001-10-24 Hans-Peter Nilsson + + * elf32-cris.c (cris_reloc_type_lookup): Change loop to use + unsigned, increasing index. + +2001-10-23 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Check + m != NULL before accessing it. + +2001-10-23 Alan Modra + + * elflink.h (elf_link_input_bfd): Zero the reloc instead of doing + bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup + doesn't accept BFD_RELOC_* on some targets, eg. hppa. + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (allocate_dynrelocs): Always allocate .got relocs if shared. + (elf32_hppa_relocate_section): Output them too. Similarly + consolidate .plt reloc code, and no longer initialise .plt + when a reloc is output. + (elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries + when no reloc is output. + + From Herbert Xu + * elf32-hppa.c (final_link_relocate): Call bfd_set_error for + unreachable branches. + +2001-10-22 H.J. Lu + + * configure.in (WIN32LIBADD): Use -L../libiberty for + mips*-*-linux*. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty + if shared library is enabled only for Linux hosts. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * configure.in (WIN32LIBADD): Check if PICFLAG is defined in + ../libiberty/Makefile instead of $enable_shared. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * elf32-cris.c (cris_reloc_type_lookup): Use int for index. Cover + index 0. + +2001-10-20 H.J. Lu + + * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty + if shared library is enabled. + * configure: Rebuild. + +2001-10-20 H.J. Lu + + * elf32-cris.c (cris_reloc_type_lookup): Allow index 0. + +2001-10-19 H.J. Lu + + * elfcode.h (elf_object_p): Don't clear D_PAGED if the section + size is empty. + +2001-10-18 H.J. Lu + + * elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + +2001-10-18 Jakub Jelinek + + * section.c (_bfd_strip_section_from_output): Don't count + SEC_EXCLUDE sections as references. Set SEC_EXCLUDE. + +2001-10-17 Alan Modra + + * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to + Elf_Internal_Shdr.contents now that it's no longer a PTR. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elf.c (setup_group): Warning fixes. + * elflink.h (elf_link_sort_relocs): Likewise. + * pdp11.c (slurp_reloc_table): Likewise. + +2001-10-16 Jeff Holcomb + + * elflink.h (elf_link_sort_relocs): Remove unnecessary pointer + casts. + +2001-10-15 H.J. Lu + + * elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE + for relocations against discarded link-once section. + +2001-10-15 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Report some detail on + bfd_reloc_outofrange and similar errors. + + * elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type + rather than ind->weakdef. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + +2001-10-15 Alan Modra + H.J. Lu + + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc + counts for aliases instead of aborting. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset + to -1 for non-function symbols. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to + plt.offset instead of plt.refcount when setting to -1. + +2001-10-12 Nick Clifton + + * elf32-arm.h (elf32_arm_relocate_section): Treat R_ARM_THM_PC22 + like R_ARM_PC24. Include reloc number in error message about + unresolvable relocs. + +2001-10-10 Jakub Jelinek + + * elflink.h (elf_link_sort_cmp2): Don't mix PLT and non-PLT + relocations against the same symbol in .rel{,a}.dyn section. + +2001-10-10 Kazu Hirata + + * aout-encap.c: Fix comment typos. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bout.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coff-mips.c: Likewise. + * ecoff.c: Likewise. + * elf32-m32r.c: Likewise. + * libcoff-in.h: Likewise. + * libecoff.h: Likewise. + * libxcoff.h: Likewise. + * nlm32-i386.c: Likewise. + * pdp11.c: Likewise. + * section.c: Likewise. + * som.c: Likewise. + * som.h: Likewise. + * bfd-in2.h: Regenerate. + * libcoff.h: Likewise. + +2001-10-10 Alan Modra + + * elf.c (elf_map_symbols): Don't create new section symbols; Use + existing section syms. Update comments. + (copy_private_bfd_data): Formatting fixes. + (elfcore_grok_win32pstatus): Likewise. + (swap_out_syms): Likewise. Remove unnecessary level of braces. + +2001-10-09 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Rename "group" to + "group_name". + (elf_group_name): Define. + (elf_next_in_group): Define. + * elf.c: Make use of elf_group_name and elf_next_in_group throughout. + (setup_group): Don't use sec->lineno for SHT_GROUP section to store + first member section; Instead use elf_next_in_group. + (bfd_section_from_shdr): Likewise. + (set_group_contents): Likewise. Use elf_section_syms, not sec->symbol. + +2001-10-09 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Add "group" and + "next_in_group". Fix gp and gp_size comments. + * elf.c (union elf_internal_group): New. + (setup_group): New function. + (_bfd_elf_make_section_from_shdr): Set BFD flags for SHT_GROUP. + Call setup_group for SHF_GROUP sections. + (bfd_section_from_shdr): Build a BFD section for SHT_GROUP. + (elf_fake_sections): Set header type for SEC_GROUP, and header + flags for sections in a group. + (set_group_contents): New function. + (_bfd_elf_compute_section_file_positions): Call it. + (assign_section_numbers): Set sh_link for SHT_GROUP. + + * elflink.h (gc_mark_hook): Handle section groups. + * elfxx-target.h: Add SEC_GROUP to applicable_flags. + * section.c (SEC_GROUP): Define. + (struct sec): Comment fixes. + * bfd-in2.h: Regenerate. + + * elf.c (bfd_elf_print_symbol): Formatting fix; migrate expression + out of function args. + (_bfd_elf_canonicalize_reloc): Similarly. + (_bfd_elf_get_symtab): Here too. + (_bfd_elf_canonicalize_dynamic_symtab): And here. + * elfcode.h (elf_slurp_symbol_table): Don't recalculate size for + bfd_bread, and remove unnecessary cast. + +2001-10-08 Aldy Hernandez + + * bfd/config.bfd (targ_cpu): Add arm9e-*-elf. + +2001-10-06 Stephane Carrez + + * dwarf2.c (comp_unit_find_nearest_line): Check for end of + compilation unit. + +2001-10-06 Alan Modra + + * bfd.c (bfd_assert): Report bfd version. + (_bfd_abort): Likewise. + + * elflink.h (elf_link_input_bfd): Don't zero discarded link-once + section sym values. Instead replace any relocs against them with + relocs against STN_UNDEF, which has a zero value. + + * elf32-arc.c (elf_arc_howto_table): Set partial_inplace for all + relocs. + +2001-10-05 Jeff Law + + * som.h (som_exec_data): New field "version_id". + * som.c (som_object_setup): Record the version_id if it + exists. + (som_prep_headers): Do not initialize version_id here. + (som_finish_writing): Initialize version_id here. + +2000-10-05 Thiemo Seufer + + * elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos + according to the MIPS/SGI ELF64 ABI Draft. + (mips_elf_sort_hash_table): Typo. + +2001-10-04 Alan Modra + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Comment typo. + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after + copying flags if this is a weakdef. + +2001-10-04 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better + packing. + + * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset + to 1 rather than 0 to avoid confusing copy_indirect_symbol. + (mips_elf_sort_hash_table_f): Compare got.offset against 1. + + * Makefile.am (BFD_H_DEPS): Add symcat.h. Ensure everything + depends on $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS), not just those + backends we configure. Run "make dep-am". + (install-data-local): Install symcat.h. + * dep-in.sed: Remove symcat.h from dependencies. + * Makefile.in: Regenerate. + +2001-10-03 Vassili Karpov + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Handle nocopyreloc. + +2001-10-03 Thiemo Seufer + + * elf64-mips.c (elf_backend_may_use_rela_p): New define. + (elf_backend_default_use_rela_p): New define. + +2001-10-03 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Fix typos in last + change. + + * configure.in (AC_OUTPUT ): Remove version.h. + * configure: Regenerate. + * Makefile.am (BFD_H_FILES): Add version.h. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using + elf_backend_copy_indirect_symbol so that backend has a chance to + copy other necessary fields. + * elf-bfd.h (struct elf_backend_data): Update description of + elf_backend_copy_indirect_symbol. + * elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after + copying flags if this is a weakdef. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + (elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather + than bfd_link_hash_lookup. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't do copy + reloc processing for weakdefs. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + +2001-10-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Use a local var and cast + result of ELF64_R_TYPE to enum before using in a switch. + (ppc64_elf_gc_mark_hook): Likewise. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_reloc_type_class): Likewise. + +2001-10-02 Alan Modra + + * version.h: New file. + * bfd-in.h: (BFD_VERSION): Substitute bfd_version. + (BFD_VERSION_DATE): Define. + (BFD_VERSION_STRING): Define. + * configure.in: AC_SUBST bfd_version, bfd_version_date and + bfd_version_string. + (AC_OUTPUT ): Depend on version.h. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * bfd-in.h: Include "symcat.h". + (CONCAT4): Redefine as for old CAT4. + * aout-arm.c: Use equivalent CONCAT* macro in place of CAT* macros. + Add warning regarding whitespace. + * aout-cris.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-sparcle.c: Likewise. + * aout-tic30.c: Likewise. + * aout0.c: Likewise. + * armnetbsd.c: Likewise. + * demo64.c: Likewise. + * elf-bfd.h: Likewise. + * gen-aout.c: Likewise. + * host-aout.c: Likewise. + * hp300bsd.c: Likewise. + * hp300hpux.c: Likewise. + * i386aout.c: Likewise. + * i386bsd.c: Likewise. + * i386dynix.c: Likewise. + * i386freebsd.c: Likewise. + * i386linux.c: Likewise. + * i386lynx.c: Likewise. + * i386mach3.c: Likewise. + * i386netbsd.c: Likewise. + * libaout.h: Likewise. + * m68k4knetbsd.c: Likewise. + * m68klinux.c: Likewise. + * m68klynx.c: Likewise. + * m68knetbsd.c: Likewise. + * m88kmach3.c: Likewise. + * mipsbsd.c: Likewise. + * newsos3.c: Likewise. + * ns32knetbsd.c: Likewise. + * pc532-mach.c: Likewise. + * pdp11.c: Likewise. + * riscix.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * sparcnetbsd.c: Likewise. + * sunos.c: Likewise. + * targets.c: Likewise. + * vaxnetbsd.c: Likewise. + * vms-hdr.c: Likewise. + +2001-10-01 Alan Modra + + * bfd-in.h: Remove comments regarding generated files. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + +2001-09-30 kaz Kojima + Hans-Peter Nilsson + + * elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make + partial_inplace, matching assembler output. Set src_mask to + all ones. + (sh_elf_relocate_section): Delete misplaced comment. + For relocatable linking against section symbol, call + _bfd_relocate_contents for partial_inplace relocs and adjust + rel->r_addend for others. + : Fetch partial_inplace addend with + bfd_get_32, not at rel->r_addend. + +2001-09-30 Alan Modra + + * elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to + the old dir refcount, so we indirectly set them to init_refcount. + Short-circuit asserts when we've just verified they are true. + +2001-09-29 Alan Modra + + * section.c (struct sec): Remove kept_section. + (STD_SECTION): Remove kept_section initialisation. + (bfd_make_section_anyway): Here too. + * ecoff.c (bfd_debug_section): Remove kept_section initialisation. + * cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section. + * elflink.h (elf_link_input_bfd): Set discarded link-once section + symbols to zero, and remove all code involved with kept_section + and tracking section symbol values. + * bfd-in2.h: Regenerate. + * configure.in: Bump version number. + * configure: Regenerate. + +2001-09-29 Alan Modra + + * elf64-ppc.c (struct ppc_dyn_relocs): New. + (IS_ABSOLUTE_RELOC): Define. + (struct ppc_link_hash_entry): New. + (struct ppc_link_hash_table): New. + (ppc_hash_table): Define. + (link_hash_newfunc): New function. + (ppc64_elf_link_hash_table_create): New function. + (create_got_section): New function. + (ppc64_elf_create_dynamic_sections): Call create_got_section. Stash + pointers to our dynamic sections in hash table. + (ppc64_elf_copy_indirect_symbol): New function. + (ppc64_elf_check_relocs): Remove DEBUG code. Use short-cuts to + dynamic sections. Localise vars. Modify code for refcounts + starting from zero. Don't allocate here, or force symbols dynamic. + Don't copy all relocs if shared, select ones we need. Add code + to track possible copy relocs for non-shared link. + (ppc64_elf_gc_mark_hook): Update comment. + (ppc64_elf_gc_sweep_hook): Sweep dynrelocs too. + (ppc64_elf_adjust_dynamic_symbol): Remove DEBUG code. Rewrite .plt + code for reference counting garbage collection. Don't create .plt + entries for functions that don't comply with ABI naming convention, + and don't allocate .plt space here. Use short-cuts to dynamic + sections. If possible, keep dynamic relocations instead of using + copy relocs. Remove confused comments. + (ppc_adjust_dynindx): Delete. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (allocate_dynrelocs): New function. + (readonly_dynrelocs): New function. + (ppc64_elf_size_dynamic_sections): Rewrite. Allocate local .got + space here, and call allocate_dynrelocs to allocate space for + global .plt, .got and reloc sections. Use short-cuts to dynamic + sections. Call readonly_dynrelocs to determine whether we need + DT_TEXTREL. Don't generate section symbols here, the generic + ELF linker code does it for us. + (ppc64_elf_final_link): Call regular ELF backend linker rather than + gc variety, since we do our own .got handling. + (ppc64_elf_relocate_section): Remove DEBUG code. Make use of + dynamic section short-cuts. Localise vars, and delay setting. + Handle unknown relocs in main switch statement. Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. Test ELF_ST_VISIBILITY + before allowing an undefined sym in a shared lib. Do R_*_DS tests + after main switch, when we've set addend. Do non-addend insn + tweaks before main swithc. Ignore input_section->vma when + calculating reloc offsets as it's always zero. Rewrite dynamic + reloc handling. Consolidate R_*_HA handling. Handle more relocs. + (ppc64_elf_finish_dynamic_symbol): Remove DEBUG code. Make use + of dynamic section short-cuts. Reorganise .plt handling code. + Remove confused comments. Take note of ELF_LINK_FORCED_LOCAL. + Move expressions out of swap_reloca_out function calls. + (ppc64_elf_reloc_type_class): New function. + (ppc64_elf_info_to_howto): Move common expression to local var. + (ppc64_elf_finish_dynamic_sections): Remove DEBUG code. Make use + of dynamic section short-cuts. Don't fiddle with section syms + here as the ELF linker does it for us. + (elf_backend_can_refcount): Define. + (bfd_elf64_bfd_link_hash_table_create): Define. + (elf_backend_copy_indirect_symbol): Define. + (elf_backend_reloc_type_class): Define. + (elf_backend_*, bfd_elf64_bfd_* defines): Sort. + +2001-09-29 Alan Modra + + * elf-bfd.h (struct elf_link_local_dynamic_entry): Add init_refcount. + (struct elf_backend_data): Add can_refcount. + * elf.c (_bfd_elf_link_hash_newfunc): Get rid of a few casts. Set + got.refcount and plt.refcount from init_refcount. + (_bfd_elf_link_hash_table_init): Set up init_refcount. + (_bfd_elf_link_hash_copy_indirect): Reference got/plt.refcount + rather than got/plt.offset, and test for <= 0 rather than -1. + * elflink.h (size_dynamic_sections): Set init_refcount to -1. + * elfxx-target.h (elf_backend_can_refcount): Define. + (elfNN_bed): Init can_refcount. + * linker.c (_bfd_link_hash_newfunc): Get rid of a few casts. + (_bfd_generic_link_hash_newfunc): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-hppa.c (elf32_hppa_check_relocs): Modify for refcounts + starting from zero. + (elf32_hppa_copy_indirect_symbol): Make static to agree with + prototype. + (elf_backend_can_refcount): Define. + * elf32-i386.c (elf_i386_check_relocs): Modify for refcounts + starting from zero. + (allocate_dynrelocs): Set plt/got.offset rather than *.refcount. + (elf_i386_finish_dynamic_symbol): Expand SHN_UNDEF comment. + (elf_i386_finish_dynamic_sections): Use local var so line < 80 chars. + (elf_backend_can_refcount): Define. + (elf_i386_copy_indirect_symbol): Make static to agree with + prototype. Formatting fix. + * elf32-m68k.c (elf_m68k_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-ppc.c (ppc_elf_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-s390.c (elf_s390_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf64-s390.c (elf_s390_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + + * som.c (som_write_symbol_strings): Cast current_offset in + bfd_seek call to match param type. + +2001-09-28 J. Brobecker + + * som.c (som_write_symbol_strings): Fix incorrect type of + current_offset to match the function definition. Fixes a build + failure on HPUX-11.00. + +2001-09-28 Richard Henderson + + * elfxx-target.h [section_flags]: Add SEC_ARCH_BIT_0, SEC_SMALL_DATA, + SEC_MERGE, SEC_STRINGS. + + * section.c (SEC_ARCH_BIT_0): New; replace unused SEC_BALIGN. + * bfd-in2.h: Rebuild. + +2001-09-28 Alan Modra + + * elf64-x86-64.c (elf64_x86_64_reloc_type_lookup): Don't map bfd + reloc code using x86_64_reloc_map. + + * elf32-hppa.c (elf32_hppa_check_relocs): Update comment since we + no longer allocate here. Localise some vars to blocks where they + are used. + (elf32_hppa_adjust_dynamic_symbol): Correct a comment. Delay + setting of vars until needed. + (allocate_dynrelocs): Don't create a .plt entry without a reloc + when symbol visibilty makes a function local. + (elf32_hppa_finish_dynamic_symbol): Move expressions out of + swap_reloca_out function calls. + (elf32_hppa_relocate_section): Likewies. Comment typo fix. + (elf32_hppa_finish_dynamic_sections): Migrate common code out of + switch statement. + + * elf32-i386.c (elf_i386_check_relocs): Update comment since we + no longer allocate here. Localise some vars to blocks where they + are used. Remove separate switch stmt for creating .got sec. + (elf_i386_adjust_dynamic_symbol): Correct a comment. Remove + redundant casts and aborts. Delay setting of vars until needed. + (allocate_dynrelocs): Remove redundant casts and aborts. + (elf_i386_size_dynamic_sections): Move comment. + (elf_i386_finish_dynamic_symbol): Move expressions out of function + calls. + (elf_i386_relocate_section): Likewise. Comment typo fix. + (elf_i386_finish_dynamic_sections): Migrate common code out of + switch statement. + (elf_backend_* defines): Sort. + + * elf32-i386.c (allocate_dynrelocs): Don't create a .plt entry + without a reloc when symbol visibilty makes a function local. + +2001-09-27 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix detection of + conflicting float flags. + +2001-09-26 Alan Modra + + * elf32-i386 (elf_i386_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define. + (struct elf_i386_link_hash_entry): Rename "root" to "elf". + (struct elf_i386_link_hash_table): Likewise. + (link_hash_newfunc): Get rid of unnecessary casts. + (elf_i386_link_hash_table_create): Likewise. + (elf_i386_check_relocs): Initialise local_got_refcounts to 0. + Don't test input section SEC_READONLY here to try to avoid copy + relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF. + (elf_i386_adjust_dynamic_symbol): Check output section SEC_READONLY + here to properly test whether we need copy relocs. Do so for weak + syms too. + + * elf32-hppa (elf32_hppa_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define. + (struct elf32_hppa_link_hash_table): Rename "root" to "elf". + (stub_hash_newfunc): Get rid of unnecessary casts. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_check_relocs): Initialise local_got_refcounts to 0. + Don't test input section SEC_READONLY here to try to avoid copy + relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF. + (elf32_hppa_adjust_dynamic_symbol): Check output section SEC_READONLY + here to properly test whether we need copy relocs. Do so for weak + syms too. + +2001-09-26 Alan Modra + + * bfd.c (_bfd_default_error_handlerl): Define using VPARAMS, + VA_OPEN, VA_FIXEDARG, VA_CLOSE. + (bfd_archive_filename): Cast bfd_malloc arg to the correct size. + +2001-09-25 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_build_plt): Fix .plt[32768+] slot + computation. + +2001-09-25 H.J. Lu + + * bfd-in2.h: Regenerated. + +2001-09-25 Alan Modra + + * elf32-i386.c: Add comment re linker function names and ordering. + (elf_i386_link_hash_newfunc): Rename to link_hash_newfunc. + (elf_i386_grok_prstatus): Move before linker functions. + (elf_i386_grok_psinfo): Likewise. + (elf_i386_fake_sections): Move so that functions are ordered. + (elf_i386_reloc_type_class): Likewise. Comment function purpose. + +2001-09-25 Alan Modra + + * elf32-hppa.c: Rename occurrences of "hplink" to "htab" + throughout file. + + * elf32-hppa.c: (LONG_BRANCH_PIC_IN_SHLIB): Delete. Remove all + code handling this option. + (LONG_BRANCH_VIA_PLT): Likewise. + (RELATIVE_DYNRELOCS): Define as zero. + (struct elf32_hppa_dyn_reloc_entry): Add "sec", and + "pc_count" fields. Remove "section" field. + (elf32_hppa_link_hash_entry): Rename reloc_entries to dyn_relocs. + (elf32_hppa_check_relocs): Don't allocate space for dynamic + relocs here. Instead, record all needed dynamic relocs via + dyn_relocs and local_dynrel. Cache pointer to "sreloc" section + in elf_section_data. + (elf32_hppa_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + (allocate_plt_and_got_and_discard_relocs): Rename to + allocate_dynrelocs. Allocate rather than discarding dyn relocs. + (readonly_dynrelocs): New function. + (elf32_hppa_size_dynamic_sections): Mark output_bfd unused. + Call readonly_dynrelocs to determine need for DT_TEXTREL. + Rename "i" to "ibfd". Allocate space for local dyn relocs. + (elf32_hppa_relocate_section): Make use of cached sreloc. + (elf32_hppa_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2001-09-25 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Add "local_dynrel" + and "sreloc" fields. + * elf32-i386.c (struct elf_i386_dyn_relocs): Add "sec", and + "pc_count" fields. Remove "section" field. + (elf_i386_check_relocs): Don't set DF_TEXTREL here. Don't + allocate space for dynamic relocs here. Instead, record all + needed dynamic relocs via dyn_relocs and local_dynrel. Cache + pointer to "sreloc" section in elf_section_data. + (elf_i386_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + (allocate_plt_and_got_and_discard_relocs): Rename to + allocate_dynrelocs. Allocate rather than discarding dyn relocs. + (readonly_dynrelocs): New function. + (elf_i386_size_dynamic_sections): Call readonly_dynrelocs. + Rename "i" to "ibfd". Allocate space for local dyn relocs. + (elf_i386_relocate_section): Make use of cached sreloc. + +2001-09-24 Alan Modra + + * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire + reloc rather than just the type. + (_bfd_elf_reloc_type_class): Likewise. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + * elf32-arm.h (elf32_arm_reloc_type_class): Likewise. + * elf32-cris.c (elf_cris_reloc_type_class): Likewise. + * elf32-i386.c (elf_i386_reloc_type_class): Likewise. + * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise. + * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise. + * elf32-s390.c (elf_s390_reloc_type_class): Likewise. + * elf32-sh.c (sh_elf_reloc_type_class): Likewise. + * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise. + * elf64-s390.c (elf_s390_reloc_type_class): Likewise. + * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise. + * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise. + * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise. + * elflink.h: Formatting fixes. + (elf_link_sort_relocs): Make "count" and "size" bfd_size_type. + Call bfd_zmalloc rather than calloc. Remove unnecessary cast of + o->contents to PTR. Update call to elf_backend_reloc_type_class. + +2001-09-22 John Reiser + + * elfcode.h (elf_object_p): Allow for no section header at all in + non-ET_REL files. Honor 0 for e_shnum, e_shstrndx, e_shoff. + +2001-09-21 Nick Clifton + + * elfxx-ia64.c: Fix compile time warning messages. + * coff-mcore.c: Fix compile time warning messages. + * coff-ppc.c: Fix compile time warning messages. + * coffcode.h: Fix compile time warning messages. + * elf32-mips.c: Fix compile time warning messages. + * elf64-alpha.c: Fix compile time warning messages. + * libbfd.c: Fix compile time warning messages. + * bfd-in2.h: Regenerate. + +2001-09-21 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * aoutx.h: Formatting fixes. + * merge.c (_bfd_merged_section_offset): Break line at 80 chars. + + * linker.c: Replace bfd_get_filename with bfd_archive_filename + in error message. + +2001-09-21 Alan Modra + + * bfd.c (bfd_archive_filename): New function. + * bfd-in2.h: Regenerate. + * aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename + in error messages where the bfd is an input bfd. + * aout-cris.c: Likewise. + * coff-arm.c: Likewise. + * coff-mcore.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * ecofflink.c: Likewise. + * elf-hppa.h: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-gen.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-gen.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * libbfd.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peicode.h: Likewise. + * srec.c: Likewise. + * xcofflink.c: Likewise. + + * elf32-arm.h: Make _bfd_error_handler calls K&R compatible. + + * elflink.c (_bfd_elf_create_linker_section): Better grammar for + error message. + + * coff-mcore.c (coff_mcore_relocate_section): Internalionalise + error message. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types. + Consolidate error messages, and split long messages to two lines. + +2001-09-20 John Reiser + + * elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic + and info->allow_shlib_undefined. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + +2001-09-18 Bruno Haible + + * aoutx.h: Include "safe-ctype.h" instead of . + (aout_link_write_symbols): Use ISDIGIT instead of isdigit. + * archive.c: Include "safe-ctype.h" instead of . + (_bfd_generic_read_ar_hdr_mag): Use ISDIGIT instead of isdigit. + * archures.c: Include "safe-ctype.h" instead of . + (bfd_default_scan): Use ISDIGIT instead of isdigit. + * bfd.c: Include "safe-ctype.h" instead of . + (bfd_scan_vma): Use ISXDIGIT/ISDIGIT/ISLOWER instead of + isxdigit/isdigit/islower. + * binary.c: Include "safe-ctype.h" instead of . + (mangle_name): Use ISALNUM instead of isalnum. + * cpu-v850.c: Include "safe-ctype.h" instead of . + (scan): Use ISDIGIT instead of isdigit. + * hosts/alphavms.h: Don't include . + * ieee.c: Include "safe-ctype.h" instead of . + (ieee_object_p): Use TOUPPER instead of toupper. + * ihex.c: Include "safe-ctype.h" instead of . + (ihex_bad_byte): Use ISPRINT instead of isprint. + * merge.c: Don't include . + * oasys.c: Include "safe-ctype.h" instead of . + (oasys_write_sections): Use ISDIGIT instead of isdigit. + * pdp11.c: Include "safe-ctype.h" instead of . + (aout_link_write_symbols): Use ISDIGIT instead of isdigit. + * ppcboot.c: Include "safe-ctype.h" instead of . + (mangle_name): Use ISALNUM instead of isalnum. + * som.c: Include "safe-ctype.h" instead of . + (som_set_reloc_info): Use ISUPPER/ISLOWER/ISDIGIT instead of + isupper/islower/isdigit. + (som_decode_symclass): Use TOUPPER instead of toupper. + * srec.c: Include "safe-ctype.h" instead of . + (srec_bad_byte): Use ISPRINT instead of isprint. + (srec_scan): Use ISSPACE instead of isspace. + * stabs.c: Include "safe-ctype.h" instead of . + (_bfd_link_section_stabs): Use ISDIGIT instead of isdigit. + * syms.c: Include "safe-ctype.h" + (islower, toupper): Remove macro definitions. + (bfd_decode_symclass): Use TOUPPER instead of toupper. + * vms-gsd.c: Don't include . + * vms-hdr.c: Include "safe-ctype.h" instead of . + (_bfd_vms_write_hdr): Use ISLOWER/TOUPPER instead of + islower/toupper. + * vms-tir.c: Don't include . + +2001-09-18 Alan Modra + + * libbfd.c (bfd_bread): New function replacing bfd_read without + redundant params. Allow reads up to (size_t) -2 in length. + (bfd_bwrite): Similarly for bfd_write. + (real_read): Return a size_t. + (bfd_read): Call bfd_bread. + (bfd_write): Call bfd_bwrite. + (warn_deprecated): New function to annoy everybody. + (bfd_get_file_window): Don't call bfd_set_error unnecessarily. + * bfd-in.h (bfd_bread, bfd_bwrite, warn_deprecated): Declare. + (bfd_read, bfd_write): Define as macro. + * aix386-core.c: Replace calls to bfd_read with bfd_bread, and + likewise for bfd_write. Ensure function args are correct size by + using casts or local vars. In some cases, remove unnecessary + casts. Formatting fixes, in some cases removing a large expression + from function args by using a local var. Replace CONST with const. + Modify variable types to avoid warings. Use casts to avoid + warnings when using negative numbers in unsigned expressions. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-cris.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * archures.c: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * cache.c: Likewise. + * cisco-core.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-z8k.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coffswap.h: Likewise. + * corefile.c: Likewise. + * cpu-arc.c: Likewise. + * cpu-h8300.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-ia64-opc.c: Likewise. + * cpu-ns32k.c: Likewise. + * cpu-pdp11.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-z8k.c: Likewise. + * dwarf1.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * ecoffswap.h: Likewise. + * elf-bfd.h: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arc.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-gen.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-openrisc.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-lin.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfarm-nabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * format.c: Likewise. + * hash.c: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386aout.c: Likewise. + * i386dynix.c: Likewise. + * i386linux.c: Likewise. + * i386lynx.c: Likewise. + * i386mach3.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise. + * libbfd.c: Likewise. + * libcoff-in.h: Likewise. + * libecoff.h: Likewise. + * libieee.h: Likewise. + * libnlm.h: Likewise. + * libpei.h: Likewise. + * libxcoff.h: Likewise. + * linker.c: Likewise. + * lynx-core.c: Likewise. + * m68klinux.c: Likewise. + * merge.c: Likewise. + * mipsbsd.c: Likewise. + * netbsd-core.c: Likewise. + * nlm.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * ns32k.h: Likewise. + * oasys.c: Likewise. + * opncls.c: Likewise. + * osf-core.c: Likewise. + * pc532-mach.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * peicode.h: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * reloc.c: Likewise. + * reloc16.c: Likewise. + * riscix.c: Likewise. + * rs6000-core.c: Likewise. + * sco5-core.c: Likewise. + * section.c: Likewise. + * som.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * targets.c: Likewise. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-misc.c: Likewise. + * vms-tir.c: Likewise. + * vms.c: Likewise. + * vms.h: Likewise. + * xcofflink.c: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * bfd.c (struct _bfd): Make "where" and "origin" unsigned. + * bfd-in.h (file_ptr): Change from a long int to a bfd_signed_vma. + (ufile_ptr): Define. + (bfd_tell): Return a ufile_ptr. + * libbfd.c (bfd_tell): Likewise. + (bfd_seek): Use bfd_size_type locals. Don't call bfd_set_error + unnecessarily. + * aix386-core.c: Test != 0 for bfd_seek errors rather than < 0. + * aoutf1.h: Likewise. + * som.c: Likewise. + * cache.c (bfd_cache_lookup_worker): Guard against abfd->where + larger than unsigned long can represent. + + * libbfd.c (bfd_malloc): Take a bfd_size_type arg. Error if + size overflows size_t. + (bfd_realloc): Likewise. + (bfd_zmalloc): Likewise. + * opncls.c (bfd_alloc): Likewise. + (bfd_zalloc): Likewise. + * libbfd-in.h (bfd_malloc, bfd_realloc, bfd_zmalloc): Update. + (bfd_alloc, bfd_zalloc): Update. + + * libbfd.c (bfd_get_8): Mask with 0xff in case char is more than + 8 bits. + (bfd_get_signed_8): Likewise. + (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8, + H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8, + H_GET_64, H_GET_32, H_GET_16, H_GET_8, + H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Define and use. + * libaout.h: Likewise define and use here. + * aout-adobe.c: Use H_GET_* and H_PUT_* macros. + * aout-arm.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * bout.c: Likewise. + * coff-alpha.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mips.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-z8k.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coffswap.h: Likewise. + * ecoff.c: Likewise. + * ecoffswap.h: Likewise. + * elf.c: Likewise. + * elf32-mips.c: Likewise. + * elf64-mips.c: Likewise. + * hp300hpux.c: Likewise. + * i386dynix.c: Likewise. + * i386lynx.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * libpei.h: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * peicode.h: Likewise. + * riscix.c: Likewise. + * sunos.c: Likewise. + * xcofflink.c: Likewise. + * elfcode.h: (put_word, get_word, put_signed_word, get_signed_word): + Rename to H_PUT_WORD, H_GET_WORD, H_PUT_SIGNED_WORD, H_GET_SIGNED_WORD. + * coff-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Don't define. Use + equivalent H_PUT_* macro instead. + (GETWORD, GETHALF, GETBYTE): Similarly. + * coff64-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Likewise. + (GETWORD, GETHALF, GETBYTE): Likewise. + * coffswap.h (PUTWORD, PUTHALF, PUTBYTE): Likewise. + + * bfd-in.h (struct orl): Change "pos" to a union. + * archive.c (_bfd_compute_and_write_armap): Use it instead of casts. + (bsd_write_armap): Here too. + (coff_write_armap): And here. + * coff-rs6000.c (xcoff_write_armap_old): And here. + (xcoff_write_one_armap_big): And here. + (xcoff_write_armap_big): And here. + * ecoff.c (_bfd_ecoff_write_armap): And here. + * elf64-mips.c (mips_elf64_write_armap): And here. + + * aoutf1.h (sunos_set_arch_mach): Make "mach" param an enum. + * elf-m10300.c (elf_mn10300_mach): Return an unsigned long. + * elf32-h8300.c (elf32_h8_mach): Likewise. + * elf32-mips.c (elf_mips_mach): Likewise. + * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. + + * aix386-core.c (aix386_core_file_p): Remove redundant bfd_release + calls. + (aix386_core_vec): Typo fix. + + * aout-arm.c: Include libaout.h and aout/aout64.h after N_TXTADDR + etc. to avoid redefined macro warning. + (MY(put_reloc)): Use bfd_vma for "value" rather than long. + (MY(fix_pcrel_26)): Likewise. + * aout-ns32k.c (MY(put_reloc)): Likewise. + * aout-cris.c (MY(swap_ext_reloc_out)): Likewise for r_addend. + * aoutx.h (NAME(aout,swap_ext_reloc_out)): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise for my_offset. + + * aout-encap.c: Include "file", not for binutils headers. + (encap_object_p): Half baked attempt to fix compile errors in + code dealing with "magic". + + * aout-ns32k.c: Include "file", not for binutils headers. + (_bfd_ns32k_relocate_contents): get_data and put_data manipulate + bfd_vma's rather than longs. + * cpu-ns32k.c (ns32k_sign_extend): Delete. + (_bfd_ns32k_get_displacement): Return a bfd_vma, don't pass in offset. + (_bfd_ns32k_get_immediate): Likewise. Add code for 8 byte values, + remove case 3. + (_bfd_ns32k_put_displacement): Accept a bfd_vma, don't pass in offset. + Use unsigned comparisons. + (bfd_ns32k_put_immediate): Likewise, and add code for 8 byte values. + (do_ns32k_reloc): get_data and put_data operate on bfd_vma's. + (_bfd_do_ns32k_reloc_contents): Likewise. + * ns32k.h (_bfd_ns32k_get_displacement): Update prototype. + (_bfd_ns32k_get_immediate): Likewise. + (_bfd_ns32k_put_displacement): Likewise. + (_bfd_ns32k_put_immediate): Likewise. + (bfd_reloc_status_type): Likewise. + + * aoutx.h (NAME(aout,find_nearest_line)): Rename 'p' to 'colon' + to avoid shadowing. + * pdp11.c (NAME(aout,find_nearest_line)): Likewise. + * coff-h8300.c (h8300_reloc16_extra_cases): Remove shadowing "value". + * coff-ppc.c (enum ref_category): Rename "data" to "tocdata" to + avoid shadowing. + (record_toc): Use a bfd_signed_vma for our_toc_offset. + * coffcode.h (coff_write_relocs): Rename "i" to avoid shadowing. + * elf.c (bfd_elf_get_bfd_needed_list): Rename "link" var to avoid + shadow warning. + (_bfd_elfcore_strndup): Likewise for "dup". + * elf32-cris.c (cris_elf_relocate_section): "symname" instead of + "name" to avoid shadowing. + * elf32-hppa.c (elf32_hppa_relocate_section): Remove duplicate + definition of "off". + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Remove duplicate + definition of "s". + (_bfd_mips_elf_final_link): Rename "i" to "j". Remove duplicate + "secpp". + * elf64-x86-64.c (elf64_x86_64_relocate_section): Rename inner "indx" + to avoid shadowing. + * elflink.h (elf_link_add_object_symbols): Rename "link" to "shlink" + to avoid shadowing. + (elf_link_input_bfd): Likewise. + (elf_bfd_final_link): Remove duplicate innermost "off" var. + * oasys.c (oasys_write_data): Rename innermost "p" to "sym". + * reloc16.c (bfd_coff_reloc16_relax_section): Rename "i" param to + "input_section". + * som.c (som_prep_for_fixups): Rename inner "i" to "j". + * sunos.c (sunos_add_dynamic_symbols): Localise "s" var. + (sunos_write_dynamic_symbol): Remove unused vars. + * syms.c (_bfd_stab_section_find_nearest_line): Remove duplicate + innermost "directory_name" and "file_name" vars. + * tekhex.c (first_phase): Rename local var "type" to "stype". + (tekhex_write_object_contents): Rename innermost "s" to "sym". + * vms-gsd.c (vms_secflag_by_name): Change "size" param to "hassize", + doing comparison at caller. + (vms_esecflag_by_name): Likewise. + * vms-tir.c (etir_sto): Rename innermost "psect" to "psect1". + * xcofflink.c (xcoff_link_input_bfd): Delete duplicate innermost "o". + (xcoff_write_global_symbol): Rename "p" param to "inf". + + * cisco-core.c: Add missing prototypes. + (cisco_core_file_failing_command): Add ATTRIBUTE_UNUSED. + (cisco_core_file_failing_signal): Likewise. + (cisco_core_file_matches_executable_p): Likewise. + * hpux-core.c (hpux_core_core_file_failing_signal): Likewise. + * netbsd-core.c (netbsd_core_file_matches_executable_p): Likewise. + * osf-core.c (osf_core_core_file_matches_executable_p): Likewise. + * sco5-core.c (sco5_core_file_matches_executable_p): Likewise. + + * coff-arm.c (coff_arm_link_hash_table): Use bfd_size_type for + thumb_glue_size and arm_glue_size. + * elf32-arm.h (elf32_arm_link_hash_table): Likewise here. + + * coff64-rs6000.c: Group prototypes together. + + * coffcode.h (coff_set_arch_mach): Add ATTRIBUTE_UNUSED. + (buy_and_read): Remove "seek" param. Change "size" to bfd_size_type. + + * cpu-arc.c: Add missing prototypes. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-z8k.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-i370.c: Likewise. + * hpux-core.c: Likewise. + * versados.c: Likewise. + + * cpu-h8300.c (bfd_default_scan_num_mach): Don't declare. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-z8k.c: Likewise. + + * cpu-ia64-opc.c: Correct comment. + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove unused var. + + * elf-bfd.h (elf_size_info): Change count param of write_out_phdrs + to unsigned. + (bfd_elf32_write_out_phdrs): Likewise. + (bfd_elf64_write_out_phdrs): Likewise. + (elf_linker_section_pointers): Change addend to bfd_vma. + (_bfd_elf_find_pointer_linker_section): Likewise. + (_bfd_elfcore_make_pseudosection): Change size param to size_t and + filepos to unsigned file_ptr. + (_bfd_elfcore_strndup): Change max param to size_t. + * elf.c (_bfd_elfcore_make_pseudosection): As above. + (_bfd_elfcore_strndup): Likewise. + (_bfd_elf_find_pointer_linker_section): Likewise. + + * elf-hppa.h (elf_hppa_relocate_insn): Return an int, and change + insn and sym_value to ints. + + * elf.c (elf_read): Make "offset" param a file_ptr, "size" a + bfd_size_type. + (elfcore_read_notes): Likewise. + + * elf32-arm.h (elf32_arm_final_link_relocate): Change sym_flags + param from unsigned char to int. + (elf32_arm_relocate_section): If USE_REL, cast "rel" appropriately + for info_to_howto call. + (add_dynamic_entry): Define macro. + (elf32_arm_size_dynamic_sections): Use add_dynamic_entry. + + * elf32-cris.c (add_dynamic_entry): Define macro. + (elf_cris_size_dynamic_sections): Use add_dynamic_entry. + + * elf32-h8300.c (elf32_h8_final_write_processing): Make static. + (elf32_h8_object_p): Likewise. + (elf32_h8_merge_private_bfd_data): Likewise. + (elf32_h8_relax_section): Cast gap to int so signed comparisons work. + + * elf32-hppa.c (add_dynamic_entry): Define macro. + (elf32_hppa_size_dynamic_sections): Use it. + * elf32-i370.c (add_dynamic_entry): Define macro. + (i370_elf_size_dynamic_sections): Use it. + (i370_noop): Make static. + * elf32-i386.c (add_dynamic_entry): Define macro. + (elf_i386_size_dynamic_sections): Use it. + * elf32-m68k.c (add_dynamic_entry): Define macro. + (elf_m68k_size_dynamic_sections): Use it. + * elf32-ppc.c (add_dynamic_entry): Define macro. + (ppc_elf_size_dynamic_sections): Use it. + * elf32-s390.c (add_dynamic_entry): Define macro. + (elf_s390_size_dynamic_sections): Use it. + * elf64-alpha.c (add_dynamic_entry): Define macro. + (elf64_alpha_size_dynamic_sections): Use it. + * elf64-hppa.c (add_dynamic_entry): Define macro. + (elf64_hppa_size_dynamic_sections): Use it. + * elf64-ppc.c (add_dynamic_entry): Define macro. + (ppc64_elf_size_dynamic_sections): Use it. + * elf64-s390.c (add_dynamic_entry): Define macro. + (elf_s390_size_dynamic_sections): Use it. + * elf64-sparc.c (add_dynamic_entry): Define macro. + (sparc64_elf_size_dynamic_sections): Use it. + * elf64-x86-64.c (add_dynamic_entry): Define macro. + (elf64_x86_64_size_dynamic_sections): Use it. + * elfxx-ia64.c (add_dynamic_entry): Define macro. + (elfNN_ia64_size_dynamic_sections): Use it. + + * elf32-v850.c (SEXT24): Modify to avoid signed/unsigned warning. + (v850_elf_perform_relocation): Make "r_type" param unsigned. + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Just return + false if the first malloc fails rather than going via error_return. + + * elf64-sparc.c (sparc64_elf_plt_entry_offset): Use a bfd_vma for + "index" param. + (sparc64_elf_plt_ptr_offset): Likewise, and for "max" param too. + + * elflink.h (elf_link_input_bfd): s/ingored/ignored/ in error message. + + * elfxx-ia64.c (global_sym_index): Return a long. + + * ieee.c (get_symbol): Use int rather than char param. + (ieee_slurp_sections): Move "section" var to inner blocks. + (copy_expression): Don't init "value" to zero or worry about + clearing to zero after using. + (ieee_write_debug_part): Rename "output_buffer" to "obuff" to avoid + shadowing. + + * ihex.c (ihex_write_record): Make "count" var a size_t, "addr" an + unsigned int. + + * libbfd-in.h (BFD_ALIGN): Add cast to avoid signed/unsigned warning. + (bfd_write_bigendian_4byte_int): Pass an unsigned int value param. + + * mipsbsd.c (mips_fix_jmp_addr): Add "error_message" param. + + * pc532-mach.c (MYNSX): Delete. + (ns32kaout_bfd_reloc_type_lookup): Define prototype without MYNSX. + (write_object_contents): Correct prototype. + + * peicode.h (pe_ILF_build_a_bfd): Use an unsigned int param rather + than unsigned short. + + * section.c (bfd_set_section_contents): Remove redundant + "offset < 0" test. Check that "count" doesn't overflow size_t. + (bfd_get_section_contents): Likewise. + + * som.c (som_fixup_formats): Add missing braces. + (som_reloc_addend): Pass a bfd_vma for "addend". + + * srec.c (srec_write_record): Pass "type" as an unsigned int. + (srec_write_symbols): Remove an unnecessary var. + + * targets.c (_bfd_target_vector): Sort entries. Sort externs + to match. + * configure.in: Sort to match. Bump version number. + * configure: Regenerate. + + * tekhex.c (move_section_contents): Assert offset == 0. + + * versados.c (new_symbol_string): Constify arg. + (process_esd): Use bfd_und_section_ptr rather than &bfd_und_section. + (versados_get_symbol_info): Make static. + (versados_print_symbol): Likewise. + (versados_get_reloc_upper_bound): Likewise. + (versados_canonicalize_reloc): Likewise. + +2001-09-18 Nick Clifton + + * elflink.h (elf_link_input_bfd): Fix typo in error message. + +2001-09-17 H.J. Lu + + * dwarf1.c (parse_die): Take a new arg for the end of the + section. Return false if die is beyond the section. + (parse_functions_in_unit): Pass the end of the section to + parse_die (). + (_bfd_dwarf1_find_nearest_line): Likewise. + +2001-09-14 Michael Rauch + + * elf32-sparc.c (elf32_sparc_relocate_section): Treat R_SPARC_UA32 + just like R_SPARC_32. + +2001-09-14 Kevin Lo + + * configure.bfd: Add arm-openbsd target. + +2001-09-14 Thiemo Seufer + + * config.bfd: Change machine triplets from mips*el*-* to mips*el-*. + Add support for mips64. + +2001-09-13 Alexandre Oliva + + * elf32-openrisc.c (ELF_MACHINE_ALT1): Define as EM_OPENRISC_OLD. + +2001-09-12 Alexandre Oliva + + * elf.c (prep_headers): Get the machine code from the elf + backend data. + * elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200. + * elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. + * elf-arc.c (arc_elf_final_write_processing): Don't override + e_machine, it's now properly set in prep_headers. + * elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and + EM_AVR_OLD. + (ELF_MACHINE_ALT1): Define to EM_AVR_OLD. + * elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V. + * elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V. + * elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30. + * elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R. + * elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD. + * elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850. + +2001-09-11 Richard Henderson + + * elf64-alpha.c (elf64_alpha_section_flags): New. + (elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL. + +2001-09-11 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Do not + apply HINT relocations against dynamic symbols. + +2001-09-11 H.J. Lu + + * linker.c (link_action): Change COMMON_ROW\defw from CREF to COM. + +2001-09-09 Richard Henderson + + * elf64-alpha.c: Delete all unused ERIC_neverdef and rth_notdef code. + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Nop out gpdisp + following a call to a near function. + +2001-09-08 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Soft fail + relocation errors. Fail gp-relative relocations against + dynamic symbols. + +2001-09-08 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR + as well as DEF_DYNAMIC in test for avoided copy relocs. + (allocate_plt_and_got_and_discard_relocs): Likewise. + * elf32-hppa.c (elf_i386_relocate_section): Likewise. + (allocate_plt_and_got_and_discard_relocs): Likewise. + +2001-09-07 Thiemo Seufer + + * elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling + of R_MIPS_PC16. + +2001-09-06 Thiemo Seufer + + * elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO + definitions. + (mips_elf64_howto_table_rel): Likewise. + +2001-09-05 Tom Rix + + * xcofflink.c (bfd_xcoff_import_symbol): Handle import file XMC_XO + and syscall symbols. + (write_global_symbol) : Same. + (bfd_xcoff_export_symbol): Remove unused syscall param. + * libxcoff.h: Change prototype of bfd_xcoff_export symbol and + bfd_xcoff_import_symbol. + * bfd-in.h: Same. + * bfd-in2.h : Regenerate. + +2001-09-04 Richard Henderson + + * elf64-alpha.c (SKIP_HOWTO): New. + (elf64_alpha_howto_table): Use it to remove dead ECOFF relocs. + Fix sizes of 16-bit mem format relocs. + (elf64_alpha_reloc_map): Update to match. + (elf64_alpha_relax_with_lituse): Use GPREL16 as appropriate. + (elf64_alpha_relax_without_lituse): Likewise. + (elf64_alpha_check_relocs): Handle GPREL16. + (elf64_alpha_relocate_section): Likewise. + * reloc.c (BFD_RELOC_ALPHA_USER_*): Remove. + (BFD_RELOC_ALPHA_GPREL_HI16, BFD_RELOC_ALPHA_GPREL_LO16): New. + * bfd-in2.h, libbfd.h: Rebuild. + +2001-09-04 Jeff Law + + * elf32-h8300.c (elf32_h8_relax_section): New function. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + (bfd_elf32_bfd_relax_section): Define. + (bfd_elf32_bfd_get_relocated_section_contents): Likewise. + + * elf32-h8300.c (special): New function. + (h8_elf_howto_table): Use it for SPECIAL_FUNCTION field in + all relocations. + (elf32_h8_final_link_relocate): Treat R_H8_DIR24A8 like 32bit + relocations. Fix problems with the true 24bit reloc R_H8_DIR24R8. + Fix minor problems with 8bit and 16bit PC relative relocations. + +2001-09-01 Andreas Jaeger + + * vms-tir.c: Add missing prototypes. + * vms-hdr.c: Likewise. + * vms-gsd.c: Likewise. + * vms-misc.c: Likewise. + +2001-08-31 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename + with bad relocation. + +2001-08-31 Eric Christopher + Jason Eckhardt + + * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32, + mips32_4k and mips64. + * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, + bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. + * bfd/cpu-mips.c: Ditto. + * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. + * bfd/bfd-in2.h: Regenerate. + +2001-08-31 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory + value into R_ALPHA_RELATIVE's addend. + (elf64_alpha_finish_dynamic_symbol): Likewise. + +2001-08-31 Nick Clifton + + * elf32-arm.h (elf32_arm_relocate_section): Do not rightshift + recomputed addend during relocatable link if not USE_REL. + + * elflink.h (elf_gc_propagate_vtable_entries_used): Fix off-by-one + error. + +2001-08-30 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Revert the last + 2 changes. + (_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic + relocations for weak definitions. + +2001-08-30 H.J. Lu + + * Makefile.am (BFD32_BACKENDS): Add elf32-h8300.lo. + (BFD32_BACKENDS_CFILES): Add elf32-h8300.c. + * Makefile.in: Rebuild. + +2001-08-30 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Don't create + dynamic relocation for undefined weak symbols when creating + executables. Check h->root.root.type, instead of h->root.type. + +2001-08-29 Joel Sherrill + + * config.bfd (i[3456]86-*-rtems*, m68*-*-rtems*): Change + default from coff to elf. + +2001-08-29 Jeff Law + + * elf32-h8300.c (h8_elf_howto_table): Add new PC relative + relocations. + (h8_reloc_map): Similarly. + (elf32_h8_final_link_relocate): Remove incorrect overflow tests. + Add support for PC relative relocations. + + * elf32-h8300.c: Put all prototypes together. + (elf32_h8_info_to_howto): Parameter elf_reloc is used. + (elf32_h8_final_link_relocate): New function for linker. + (elf32_h8_relocate_section): Similarly. + (elf_backend_relocate_section): Define. + + * cpu-h8300.c (h8300_scan, compatible): Prototype. + (h8300_scan): Handle architecture:machine encodings typically + found in linker scripts. + * elf.c (prep_headers): Do not try to do H8 machine recognition + here. + * elf32-h8300.c: Add some missing prototypes. + (elf32_h8_mach, elf32_h8_final_write_processing): New functions. + (elf32_h8_object_p): Similarly. + +2001-08-29 Tom Rix + + * xcofflink.c (xcoff_link_add_symbols): Fix XTY_LD symbol that + does not follow a XTY_SD. + +2001-08-29 Alan Modra + + * targmatch.sed: Delete case statements. + * config.bfd : Select 64 bit xcoff for + aix4.3 and above. + +2001-08-29 J"orn Rennecke + + * Makefile.am (elf32-h8300.lo): New target. + * config.bfd (h8300*-*-elf): New case. + * configure.in (bfd_elf32_h8300_vec): New case. + * elf.c (prep_headers): Add case for bfd_arch_h8300. + * reloc.c (BFD_RELOC_H8_DIR16A8): New relocation. + (BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8): Likewise. + (BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16): Likewise. + * targets.c (bfd_target bfd_elf32_h8300_vec): New extern declaration. + * elf32-h8300.c: New file. + * Makefile.in, bfd-in2.h, libbfd.h, configure: Regenerated. + +2001-08-28 Nick Clifton + + * sparclynx.c: Add missing prototypes. + * coff-mcore.c: Add missing prototypes. + * elf32-pj.c: Add missing prototypes. + * nlm32-sparc.c: Add missing prototypes. + * oasys.c: Add missing prototypes. + * pdp11.c: Add missing prototypes. + * pe-mips.c: Add missing prototypes. + * riscix.c: Add missing prototypes. + +2001-08-27 Daniel Jacobowitz + + * elf32-i386.c: Add missing prototypes. + * elf32-ppc.c: Likewise. + * elf32-sh-lin.c: Likewise. + * elfarm-nabi.c: Likewise. + +2001-08-27 Daniel Jacobowitz + + * elf32-i386.c (elf_i386_grok_prstatus): New function. + (elf_i386_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elf32-ppc.c (ppc_elf_grok_prstatus): New function. + (ppc_elf_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elf32-sh-lin.c (elf32_shlin_grok_prstatus): New function. + (elf32_shlin_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): New function. + (elf32_arm_nabi_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + +2001-08-27 H.J. Lu + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more + sanity check. + (mips_elf_calculate_relocation): Create dynamic relocation for + symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR + bit is not set. + +2001-08-27 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype. + (_bfd_mips_elf_copy_indirect_symbol): Likewise. + (_bfd_elf32_mips_grok_prstatus): Likewise. + (_bfd_elf32_mips_grok_psinfo): Likewise. + (_bfd_mips_elf_hide_symbol): Make it static and cast to + `struct mips_elf_link_hash_entry *'. + (_bfd_mips_elf_copy_indirect_symbol): Make it static. + +2001-08-27 Nick Clifton + + * mipsbsd.c: Add missing prototypes. + * hp300hpux.c: Add missing prototypes. + * i386aout.c: Add missing prototypes. + * i386lynx.c: Add missing prototypes. + * i386mach3.c: Add missing prototypes. + * i386msdos.c: Add missing prototypes. + * i386os9k.c: Add missing prototypes. + +2001-08-27 Linus Nordberg + Torbjorn Granlund + Staffan Ulfberg + Alan Modra + + * config.bfd: Add powerpc64 target. Add powerpc64 vectors to + targ64_selvecs for 32 bit powerpc targets. + * Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ppc.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in: Add elf64_powerpc vecs. + * configure: Regenerate. + * cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit. + * elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target. + * targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec. + * elf64-ppc.c: New file. + * reloc.c: Add powerpc64 relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2001-08-27 Andreas Schwab + + * elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_m68k_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2001-08-27 Andreas Jaeger + + * elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (ppc_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-26 Andreas Jaeger + + * elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_cris_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is + against read-only section. + (elf_backend_reloc_type_class): Define. + (sh_elf_reloc_type_class): New. + (sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + + * elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_arm_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-25 Andreas Jaeger + + * oasys.c: Add missing prototypes. + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused + attribute for parameter. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + + * versados.c (get_4): Make static. + (get_10): Make static. + Add missing prototypes. + (process_esd): Fix call to versados_new_symbol. + +2001-08-25 Nick Clifton + + * coff-a29k.c: Add missing prototypes. + * coff-apollo.c: Add missing prototypes. + * coff-arm.c: Add missing prototypes. + * coff-i860.c: Add missing prototypes. + * coff-rs6000.c: Add missing prototypes. + * coff-tic80.c: Add missing prototypes. + * elf-m10200.c: Add missing prototypes. + * elf-m10300.c: Add missing prototypes. + * elf32-arm.h: Add missing prototypes. + * elf32-d10v.c: Add missing prototypes. + * elf32-m32r.c: Add missing prototypes. + * elf32-mcore.c: Add missing prototypes. + * elf32-openrisc.c: Add missing prototypes. + * elf32-sh.c: Add missing prototypes. + * elf32-sparc.c: Add missing prototypes. + * elf32-v850.c: Add missing prototypes. + * elfarm-nabi.c: Add missing prototypes. + * elfarm-oabi.c: Add missing prototypes. + +2001-08-25 Thiemo Seufer + + * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for + E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64 + +2001-08-24 H.J. Lu + + * elf.c (_bfd_elf_merge_sections): Fail if not using an ELF + hash structure. + +2001-08-24 Nick Clifton + + * elf-bfd.h (elf_hash_table): Revert definition. + (is_elf_hash_table): New macro. + * elflink.h (elf_link_add_object_symbols): Test + is_elf_hash_table before accessing ELF only fields in hash + structure. + (elf_link_create_dynamic_sections): Fail if not using an ELF + hash structure. + (elf_add_dynamic_entry): Fail if not using an ELF hash + structure. + (elf_link_record_local_dynamic_symbol): Fail if not using an + ELF hash structure. + (size_dynamic_sections): Fail if not using an ELF hash + structure. + (elf_adjust_dynamic_symbol): Fail if not using an ELF + hash structure. + (elf_bfd_final_link): Fail if not using an ELF hash + structure. + +2001-08-24 H.J. Lu + + * elf-bfd.h (elf_hash_table): Return NULL if the linker hash + table is not an ELF linker hash table. + + * elf.c (_bfd_elf_link_hash_table_init): Set the linker hash + table type to bfd_link_elf_hash_table. + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Revert + the last change. + + * linker.c (_bfd_link_hash_table_init): Set the linker hash + table type to bfd_link_generic_hash_table. + +2001-08-24 Alexandre Oliva + + * bfd.c (bfd_alt_mach_code): New function. + * bfd-in2.h: Rebuilt. + +2001-08-24 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relocate_section): Test the right + `type' field in the hash entry when deciding whether to follow a + link. + +2001-08-24 Jakub Jelinek + + * elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not + last. + (elf_link_sort_relocs): Adjust accordingly. + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag. + (elf64_alpha_check_relocs): Set it if section this reloc is against + is read-only. Set DF_TEXTREL if a RELATIVE reloc is needed against + read-only section. + (elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation + is is against read-only section. + (elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't + check section names. + (elf64_alpha_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-24 Thiemo Seufer + + * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca() + by bfd_malloc(). + +2001-08-23 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if + the reloc is against read-only section. + (elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead + of looking up section names for DT_TEXTREL. + (elf64_x86_64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-23 H.J. Lu + + * syms.c (bfd_print_symbol_vandf): Add abfd to arg. + * bfd-in2.h (bfd_print_symbol_vandf): Regenerated. + + * aoutx.h (NAME(aout,print_symbol)): Pass abfd to + bfd_print_symbol_vandf. + * coffgen.c (coff_print_symbol): Likewise. + * elf.c (bfd_elf_print_symbol): Likewise. + * ieee.c (ieee_print_symbol): Likewise. + * nlmcode.h (nlm_print_symbol): Likewise. + * oasys.c (oasys_print_symbol): Likewise. + * pdp11.c (NAME(aout,print_symbol)): Likewise. + * som.c (som_print_symbol): Likewise. + * srec.c (srec_print_symbol): Likewise. + * tekhex.c (tekhex_print_symbol): Likewise. + * versados.c (versados_print_symbol): Likewise. + * vms.c (vms_print_symbol): Likewise. + + * elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma + with bfd_fprintf_vma. + (bfd_elf_print_symbol): Likewise. + * syms.c (bfd_print_symbol_vandf): Likewise. + +2001-08-23 Nick Clifton + + * aoutf1.h (sunos_write_object_contents): Silence compile time + warning. + * libaout.h (N_SET_DYNAMIC): Silence compile time warning. + + * bout.c: Add missing function prototypes. Fix formatting. + * coff-z8k.c: Add missing function prototypes. Fix formatting. + * coff-w65.c: Add missing function prototypes. Fix formatting. + * coff-h8500.c: Add missing function prototypes. Fix formatting. + * coff-h8300.c: Add missing function prototypes. Fix formatting. + * coff-tic54x.c: Add missing function prototypes. Fix formatting. + * coff-tic30.c: Add missing function prototypes. Fix formatting. + * coff-m68k.c: Add missing function prototypes. Fix formatting. + * coff-rs6000.c: Add missing function prototypes. Fix formatting. + * coff-sh.c: Add missing function prototypes. Fix formatting. + +2001-08-23 Jakub Jelinek + + * elf-bfd.h (enum elf_reloc_type_class): New. + (struct elf_backend_data): Add elf_backend_reloc_type_class. + (_bfd_elf_reloc_type_class): New. + * elfxx-target.h (elf_backend_reloc_type_class): Define. + (elfNN_bed): Add elf_backend_reloc_type_class. + * elf.c (_bfd_elf_reloc_type_class): New. + * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_i386_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_sparc_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (sparc64_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. + (elfNN_ia64_hash_table_create): Clear ia64_info. + (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only + section. + (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag + instead of looking up section names for DT_TEXTREL. + (elfNN_ia64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. + (struct elf_link_sort_rela): New. + (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. + (elf_bfd_final_link): Call elf_link_sort_relocs. + Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if + necessary. + +2001-08-23 Nick Clifton + + * configure.in (x86-bsdi): No corefile support. + * configure: Regenerate. + +2001-08-22 Nick Clifton + + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add missing + comma. + +2001-08-21 Mark Elbrecht + + * coff-go32.c: Make DWARF2 sections use an alignment of 0. Set + the alignment of dwarf2 linkonce sections to 0. + * coff-sto32.c: Likewise. + +2001-08-20 Andreas Jaeger + + * coff-sparc.c: Add missing prototypes. + * elf32-s390.c: Likewise. + * elf32-i960.c: Likewise. + * aout-target.h: Likewise. + +2001-08-20 H.J. Lu + + * elf-bfd.h (elf_obj_tdata): Add num_section_syms. + (elf_num_section_syms): New for num_section_syms. + + * elf.c (elf_map_symbols): Set num_section_syms. + (_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for + the section symbol index. + +2001-08-20 Nick Clifton + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Never + select the generic has table creator. All elf backends need elf + specific fields in the hash table. + +2001-08-20 Alan Modra + + * archive.c (offsetof): Remove define. + * elf.c: Likewise. + * oasys.c: Likewise + * sysdep.h (offsetof): Define. + +2001-08-17 Alan Modra + + * bfd.c (bfd_get_gp_size): Return an unsigned int. + (bfd_set_gp_size): Make param unsigned. + * bfd-in2.h: Regenerate. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather + than calling bfd_get_gp_size. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise. + +2001-08-17 Alan Modra + + * linker.c (default_fill_link_order): Handle four byte fill value. + +2001-08-17 Alan Modra + + * elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing + prototype. + * nlm32-alpha.c (nlm_alpha_write_external): Fix warning. + + * elf64-mips.c (UNUSED_RELOC): Define. + (mips_elf64_howto_table_rel): Use it. + (mips_elf64_howto_table_rela): Here too. + (mips_elf64_write_relocs): Fix signed/unsigned warning. + + * coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED to + silence warning. + * coffgen.c (coff_print_symbol): Fix warnings. + (coff_find_nearest_line): Likewise. + * cofflink.c (_bfd_coff_link_input_bfd): Likewise. + * coff-alpha.c (alpha_convert_external_reloc): Likewise. + * format.c (bfd_check_format_matches): Likewise. + (bfd_set_format): Likewise. + * coff-ia64.c: Add missing prototypes. + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend + signed to silence warnings. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_find_reloc_at_ofs): Fix warnings. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_final_link): Likewise. + (elf64_alpha_relax_section): Remove redundant assign to info.gotent. + (elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args. + (elf64_alpha_size_got_sections): Likewise. + * elfxx-ia64.c: Add missing prototypes. + (elfNN_ia64_relocate_section): Fix warning. + (elfNN_ia64_unwind_entry_compare): Make params const. + +2001-08-17 Alan Modra + + * config.bfd (targ64_selvecs): New. + : Use it here instead of ineffectual #ifdef. + + * bfd-in.h (BFD_VERSION): Remove wrong comment. + (BFD_DEFAULT_TARGET_SIZE): New. + (BFD_ARCH_SIZE): Comment. + * configure.in (target_size): New. Set instead of target64 in + selvecs case statement. Set target64 from it. + (bfd_default_target_size): New. Set from taget_size. AC_SUBST. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + +2001-08-17 Alan Modra + + * bfd.c (enum bfd_error): Add bfd_error_wrong_object_format. + (bfd_errmsgs): Add corresponding message. + * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when + finding an archive that contains different format object files. + Return bfd_error_wrong_object_format for this case. + * format.c: Formatting fixes. s/CONST/const/. + (bfd_check_format_matches): Accept archives that give + bfd_error_wrong_object_format if no full match is found. Tidy + code handling matching_vector. Don't return a pointer to freed + memory in `matching'. Handle ambiguous matches as for partial + archive matches. + * bfd-in2.h: Regenerate. + +2001-08-15 Alan Modra + + * libieee.h (common_header_type): Add last_byte field. + + * ieee.c: Add missing prototypes. Some format fixes. + (struct output_buffer_struct): Move for availability to prototypes. + (ieee_part_after): New function. + (ieee_slurp_debug): Use it here. + (ieee_seek): Pass in ieee_data_struct rather than bfd. Use + ieee_part_after to set last_byte to one past end of current part. + Update callers. + (ieee_pos): Pass in ieee_data_struct rather than bfd. + Update callers. + (parse_expression): Don't go beyond the end of the current part. + (ieee_slurp_external_symbols): Correct type passed to read_2bytes. + (ieee_get_symtab_upper_bound, ieee_get_symtab, + ieee_get_symbol_info, ieee_print_symbol, ieee_new_section_hook, + ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, block, + ieee_set_section_contents, ieee_write_object_contents, + ieee_make_empty_symbol): Make static. + (ieee_archive_p): Correct comments regarding bfd_read. + (ieee_object_p): Similarly. + (ieee_mkobject): Move it. Clear output_ptr_start, output_ptr, + output_ptr_end, input_ptr_start, input_ptr, input_ptr_end, + input_bfd, output_bfd, output_buffer. + (do_as_repeat): Write out ieee_set_current_pc_enum value as for + do_with_relocs, ie. as a symbol for relocatable files. + (ieee_vec): Add comments showing functions referenced by macros. + +2001-08-14 Nick Clifton + + * aout-tic30.c: Add missing prototypes. Fix formatting. + * aout-ns32k.c: Add missing prototypes. Fix formatting. + * peXXigen.c: Add missining prototypes. Fix formatting. + * aout-adobe.c: Add missining prototypes. Fix formatting. + +2001-08-13 Nick Clifton + + * elf32-v850.c: Add missing function prototypes. + Fix some formatting. + + * cpu-v850.c: Add missing function prototype. + Fix some formatting. + +2001-08-11 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new fields + 'elf_backend_sprintf_vma' and 'elf_backend_fprintf_vma'. + (bfd_elf_sprintf_vma): Rename function prototype to + '_bfd_elf_sprintf_vma'. + (bfd_elf_fprintf_vma): Rename function prototype to + '_bfd_elf_fprintf_vma'. + * bfd.c (bfd_sprintf_vma): Do not invoke bfd_elf_sprintf_vma + directly, instead indirect via the elf_backend_data structure. + (bfd_fprintf_vma): Do not invoke bfd_elf_fprintf_vma directly, + instead indirect via the elf_backend_data structure. + * elf.c (bfd_elf_sprintf_vma): Rename to _bfd_elf_sprintf_vma. + (bfd_elf_fprintf_vma): Rename to _bfd_elf_fprintf_vma. + * elfxx-target.h (elf_backend_sprintf_vma): Initialise if not + already defined. + (elf_backend_fprintf_vma): Initialise if not already defined. + (struct elf_backend_data): Initialise the + elf_backend_sprintf_vma and elf_backend_fprintf_vma fields. + +2001-08-10 Andreas Jaeger + + * elf64-sparc.c: Add missing prototypes. + * elf32-cris.c: Likewise. + * elf32-i370.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-s390.c: Likewise. + +2001-08-10 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static. + Add prototypes where needed. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Fix a typo in the last change. + (bfd_fprintf_vma): Likewise. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Don't return void. + (bfd_fprintf_vma): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * elf.c (bfd_elf_sprintf_vma): Add ATTRIBUTE_UNUSED to quiet + warning if not BFD64. Add braces so emacs auto format works. + (bfd_elf_fprintf_vma): Likewise. + + * libxcoff.h (struct xcoff_backend_data_rec): Constify src param + of _xcoff_swap_ld*. + * coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external + param to agree with libxcoff.h. + (xcoff_swap_ldhdr_out): Likewise. + (xcoff_swap_ldsym_in): Likewise. + (xcoff_swap_ldsym_out): Likewise. + (xcoff_swap_ldrel_in): Likewise. + (xcoff_swap_ldrel_out): Likewise. + (xcoff_create_csect_from_smclas): Likewise. + * coff64-rs6000.c: Add missing prototypes. + (xcoff64_swap_ldhdr_in): Modify type of external param to agree + with libxcoff.h. + (xcoff64_swap_ldhdr_out): Likewise. + (xcoff64_swap_ldsym_in): Likewise. + (xcoff64_swap_ldsym_out): Likewise. + (xcoff64_swap_ldrel_in): Likewise. + (xcoff64_swap_ldrel_out): Likewise. + (xcoff64_ppc_relocate_section): Make static. + (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_sizeof_headers): Likewise. + (xcoff64_is_lineno_count_overflow): Likewise. + (xcoff64_is_reloc_count_overflow): Likewise. + (xcoff64_loader_symbol_offset): Likewise. + (xcoff64_loader_reloc_offset): Likewise. + * elf64-gen.c: Add missing prototypes. + +2001-08-09 H.J. Lu + + * elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_elf_sprintf_vma, bfd_elf_fprintf_vma): Moved + to ... + * elf-bfd.h: Here. + * bfd-in2.h: Regenerated. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_sprintf_vma): New prototype. + (bfd_fprintf_vma): Likewise. + (bfd_elf_sprintf_vma): Likewise. + (bfd_elf_fprintf_vma): Likewise. + (bfd_printf_vma): New. Defined with bfd_fprintf_vma. + * bfd-in2.h: Regenerated. + + * bfd.c (bfd_sprintf_vma): New. Defined. + (bfd_fprintf_vma): Likewise. + + * elf.c (bfd_elf_sprintf_vma): New. Defined. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 Alan Modra + + * coff-rs6000.c: Add missing prototypes. + (xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset): Make static. + * dwarf1.c: Add missing prototypes. + * dwarf2.c: Add missing prototypes. + (struct abbrev_info): Move definition. + (struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise. + * elf.c: Add missing prototypes. + * elf32-gen.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-ppc.c: Likewise. + (ppc_elf_sort_rela): Use PTR instead of "void *". + * elflink.h: Add missing prototypes. Formatting fixes. + * merge.c: Add missing prototypes. + (last4_eq): Use PTR instead of "void *". + (last_eq): Likewise. + * syms.c: Add missing prototypes. + +2001-08-09 Nick Clifton + + * bfd.c: Fix formatting. + * bfd-in2.h: Regenerate. + +2001-08-09 Nick Clifton + + * elf32-arc.c (R_ARC_B22_PCREL): Change 'partial_inplace' to + true (this target uses REL relocations) and 'pcrel_offset' to + false (the PC is implied, not stored in the offset). + +2001-08-08 Alan Modra + + 1999-10-19 Linus Nordberg + * elf-bfd.h (struct elf_backend_data): Add want_got_sym. + * elfxx-target.h (elf_backend_want_got_sym): Define. + (elfNN_bed): Add elf_backend_want_got_sym. + * elflink.c (_bfd_elf_create_got_section): Define + _GLOBAL_OFFSET_TABLE_ only if bed->want_got_sym. + +2001-08-08 Alexandre Oliva + + * dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms. + (find_rela_addend): New function. + (parse_comp_unit): Call it to find the abbrev offset addend. + (_bfd_dwarf2_find_nearest_line): Initialize and maintain the new + members of dwarf2_debug as debugging information is read. + +2001-08-07 Nick Clifton + + * coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff + targets as well as sh-pe. + +2001-08-03 Ben Harris + + * elf32-arm.h (elf32_arm_final_link_relocate): Include offset of + reloc from start of section when computing value for R_ARM_REL32 + reloc. + +2001-08-03 Alan Modra + + From H.J. Lu + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't + keep relocs for undefined syms if there are no dynamic sections in + executable. + * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. + +2001-08-02 Paul Sokolovsky + + * cofflink.c (coff_link_check_ar_symbols): also search for + __imp__symbol as well as _symbol. + * linker.c (_bfd_generic_link_add_archive_symbols): also + search for __imp__symbol as well as _symbol. + +2001-08-01 Adam Nemet + + * elf.c (elf_sort_sections): Return zero only as the last step. + +2001-08-01 Nick Clifton + + * config.bfd (arm-vxworks): Change name of define from VXWORKS to + ARM_COFF_BUGFIX. + (arm-epoc-pe): Define ARM_COFF_BUGFIX. + coff-arm.c (coff_arm_relocate_section): Replace VXWORKS with + ARM_COFF_BUGFIX. + +2001-07-30 Rainer Orth + + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Changed return type + to match corresponding bfd_coff_backend data member. + +2001-07-24 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate + +2001-07-15 H.J. Lu + + * Makefile.am (po/SRC-POTFILES.in): Use tmp.src instead of tmp. + (po/BLD-POTFILES.in): Use tmp.bld instead of tmp. + * Makefile.in: Regenerate. + +2001-07-11 H.J. Lu + + * elf64-alpha.c (elf64_alpha_check_relocs): Set the ALLOC|LOAD + flags when creating the reloc section if the ALLOC flag in the + source section is set. + +2001-07-11 Steve Ellcey + + * reloc.c (bfd_reloc_code_type): Add IA64 relocs + BFD_RELOC_IA64_LTOFF_FPTR32MSB and BFD_RELOC_IA64_LTOFF_FPTR32LSB + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elfxx-ia64.c (ia64_howto_table): Define how to handle + new relocations. + (elfNN_ia64_reloc_type_lookup): Handle new relocations. + (elfNN_ia64_check_relocs): Likewise. + (elfNN_ia64_install_value): Likewise. + (elfNN_ia64_relocate_section): Likewise. + +2001-07-11 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove support for + R_SPARC_UA64. + (elf32_sparc_check_relocs): Likewise. + Only create .rela section for alloced sections in shared libraries. + (elf32_sparc_relocate_section): Likewise. + Remove redundant check. + Optimize unaligned reloc usage. + * elf64-sparc.c (sparc64_elf_relocate_section): Remove redundant + check. + +2001-07-11 H.J. Lu + + * elf64-alpha.c (elf64_alpha_check_relocs): Only use the same + ALLOC|LOAD flags as the source section for debugging sections + when creating the reloc section. + +2001-07-05 Jim Wilson + + * linker.c (_bfd_generic_link_add_one_symbol, case BIG): Use + the section of the bigger symbol. + + * syms.c (bfd_is_local_label): Return false if BSF_SECTION_SYM. + +2001-07-05 Nick Clifton + + * peicode.h (coff_swap_scnhdr_in): For sections containing + uninitialised data, only set their size to s_paddr if this does + not reset their size to zero. MS's latest compilers will set + s_paddr to zero. + +2001-07-04 H.J. Lu + + * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): + Handle bfd_mach_mips4400, bfd_mach_mips4600 and + bfd_mach_mips5000. + +2001-07-03 Mark Elbrecht + + * bfd.c (bfd_get_sign_extend_vma): Support DJGPP COFF targets. + + * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols from + sections being discarded. + +2001-06-30 Alan Modra + + * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directly + instead of _bfd_elfcore_section_from_phdr. + * elf-bfd.h (_bfd_elfcore_section_from_phdr): Remove. + * elf.c (_bfd_elfcore_section_from_phdr): Remove. + (_bfd_elfcore_make_pseudosection): Expedite tail-call. + (elfcore_grok_prstatus): Likewise. + (elfcore_grok_lwpstatus): Likewise. + (bfd_get_elf_phdr_upper_bound): Likewise. + (elfcore_make_note_pseudosection): Formatting. + (_bfd_elfcore_strndup): Formatting. + * elf32-mips.c (mips_elf_sym_is_global): Formatting. + (_bfd_elf32_mips_grok_prstatus): Expedite tail-call. + +2001-06-29 Daniel Jacobowitz + + * elf-bfd.h: Add prototypes for _bfd_elfcore_make_pseudosection + and _bfd_elfcore_strndup. + (struct elf_backend_data): Add elf_backend_grok_prstatus + and elf_backend_grok_psinfo. + * elf.c (_bfd_elfcore_make_pseudosection): New function. + (elfcore_grok_prstatus): Use it. + (elfcore_make_note_pseudosection): Likewise. + (elfcore_strndup): Rename to... + (_bfd_elfcore_strndup): Here, and make global. + (elfcore_grok_psinfo): Use _bfd_elfcore_strndup. + (elfcore_grok_note): Call elf_backend_grok_prstatus + and elf_backend_grok_psinfo if available. + * elf32-mips.c (_bfd_elf32_mips_grok_prstatus): New function. + (_bfd_elf32_mips_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + * elfxx-target.h (elf_backend_grok_prstatus): Default to NULL. + (elf_backend_grok_psinfo): Likewise. + (elfNN_bed): Include elf_backend_grok_prstatus and + elf_backend_grok_psinfo. + +2001-06-29 H.J. Lu + + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if + hplink->sgot is NULL before filling GOT. Check if hplink->splt + is NULL before filling PLT. + +2001-06-29 Alan Modra + + * elflink.h (elf_link_output_extsym): Revert 1999-04-10. + +2001-06-27 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Don't make syms dynamic + here.. + (elf32_hppa_adjust_dynamic_symbol): ..nor here.. + (allocate_plt_and_got_and_discard_relocs): .. instead do so here + after gc has run. + + * elf32-hppa.c (RELATIVE_DYNAMIC_RELOCS): Delete. + (IS_ABSOLUTE_RELOC): Define. + (elf32_hppa_link_hash_entry): Always include reloc_entries field. + (hppa_link_hash_newfunc): Always init it. + (elf32_hppa_check_relocs): Mark symbols as ELF_LINK_NON_GOT_REF to + create COPY relocs only when the reloc is in a read-only section. + Instead, allocate space for a dynamic reloc to reference the + library symbol directly. Keep track of space we allocate using + relocs_entries. + (hppa_discard_copies): Delete, and move code to.. + (allocate_plt_and_got): ..here. Rename to + allocate_plt_and_got_and_discard_relocs. Remove unneeded dynamic + relocs for non-shared link. + (elf32_hppa_size_dynamic_sections): Update calls to above. + (elf32_hppa_relocate_section): Write out the dynamic relocs used + in lieu of COPY relocs. + + * elf32-i386.c (elf_i386_check_relocs): Don't make syms dynamic + here.. + (elf_i386_adjust_dynamic_symbol): ..nor here.. + (allocate_plt_and_got_and_discard_relocs): .. instead do so here + after gc has run. + (elf_i386_size_dynamic_sections): Fix a comment. + (elf_i386_relocate_section ): Rearrange code + involved in writing reloc out. + +2001-06-25 Alan Modra + + * elf32-i386.c (elf_i386_check_relocs ): + Ensure syms are dynamic if we might be emitting a reloc. + (allocate_plt_and_got_and_discard_relocs): Don't discard relocs + for undefweak or undefined syms.. + (elf_i386_relocate_section ): .. and emit. + + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard + relocs without ELF_LINK_HASH_DEF_DYNAMIC set. + (elf_i386_relocate_section ): Remove + redundant bfd_link_hash_defined, bfd_link_hash_defweak test. + +2001-06-24 H.J. Lu + + * cpu-i960.c (scan_960_mach): Don't modify const char *. Use + strncasecmp/strcasecmp instead of strncmp/strcmp. + +2001-06-23 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section ): + Check ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined + in the regular object file and treat the weak definition as + the normal one. + +2001-06-23 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section ): Tighten + unresolved_reloc test to exclude cases where we use "relocation" + before setting it to point into the .got. Reinstate fudge for + unresolved relocs in debugging sections. + + * elf32-i386.c (elf_i386_relocate_section): Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. + + * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Rename to + elf_i386_dyn_relocs. Update comment. + (struct elf_i386_link_hash_entry): Rename pcrel_relocs_copied to + dyn_relocs. + (elf_i386_adjust_dynamic_symbol): Remove a BFD_ASSERT, change + others to aborts. + (allocate_plt_and_got_and_discard_relocs): Replace BFD_ASSERT with + abort. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. Tidy R_386_GOT32 and error + handling code. + + Avoid creating COPY relocs if possible. + * elf32-i386.c (elf_i386_check_relocs): Tweak condition under + which .got created. Mark symbols used by R_386_32 and R_386_PC32 + relocs as ELF_LINK_NON_GOT_REF to create COPY relocs only when the + reloc is in a read-only section. Instead, allocate space for a + dynamic reloc to reference the library symbol directly. Keep + track of space we allocate using pcrel_relocs_copied. + (discard_copies): Delete, and move code to .. + (allocate_plt_and_got): ..here. Rename to + allocate_plt_and_got_and_discard_relocs. Remove unneeded dynamic + relocs for non-shared link. + (elf_i386_size_dynamic_sections): Update calls to above functions. + (elf_i386_relocate_section): Write out the dynamic relocs. Add + more ugly logic to avoid "unresolvable relocation" error. Use + htab shortcut in place of elf_hash_table macro. + (elf_i386_finish_dynamic_sections): Allow that dynamic .got may + not always be created now. + +2001-06-20 Bo Thorsen + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of + shared libraries. + +2001-06-18 Thiemo Seufer + + * configure.host (mips64-*-linux): Reformat. + +2001-06-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always + allocate local .got space. Use shortcuts from hash table for .got + and .plt rather than comparing section names. + (elf32_hppa_check_relocs): Use local_plt_refcounts var rather than + adjusting index into local_got_refcounts to document what we are + really doing. + (elf32_hppa_relocate_section): Similarly for local_plt_offsets. + Tidy .got and .plt error checking. + +2001-06-20 Catherine Moore + + * elf-bfd.h (struct elf_backend_data): + elf_backend_emit_relocs: New field: Function for emitting + relocs. + elf_backend_count_relocs: New field: Function for determining + the number of relocs to be emitted. + * elfxx-target.h: Provide default (NULL) values for + elf_backend_emit_relocs and elf_backend_count_relocs. + * elflink.h (elf_link_size_reloc_section): Make the hash table + big enough to hold the relocs counted by either reloc_count or + o->reloc_count. + (elf_bfd_final_link) emit_relocs: New boolean, set if relocs + should be emitted, either because of a command line option + stored in the info structure or because the target provides a + special reloc emitting function. + If the target provides a reloc counting function use it, + unless performing a relocatable link or emitting all relocs. + Also set the SEC_RELOC flag on any output section which will + contain relocs. + (elf_link_input_bfd): emit_relocs: New boolean, set if relocs + should be emitted, either because of a command line option + stored in the info structure or because the target provides a + special reloc emitting function. + If the target provides a reloc emitting function, use it, + unless performing a relocatable link or emitting all relocs. + +2001-06-20 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Always + allocate local .got space. + +2001-06-19 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of + dynamic symbols. + +2001-06-18 Hans-Peter Nilsson + + * elflink.h (struct elf_assign_sym_version_info): Remove member + export_dynamic. All users changed to use info member. + NAME(bfd_elf,size_dynamic_sections)): Remove parameter + export_dynamic, instead use member in parameter info. + * bfd-in.h (bfd_elf32_size_dynamic_sections, + bfd_elf64_size_dynamic_sections): Update prototype. + * bfd-in2.h: Regenerate. + +2001-06-18 H.J. Lu + + * elflink.h (elf_info_failed): Add a new field, verdefs. + (NAME(bfd_elf,size_dynamic_sections): Pass verdefs to + elf_export_symbol. + (elf_export_symbol): Check eif->verdefs to decide if a symbol + should be exported. + +2001-06-17 H.J. Lu + + * elf32-mips.c (mips_elf_link_hash_entry): Add a new field, + readonly_reloc, to record if a relocation in the .rel.dyn + section is against a read-only section. + (mips_elf_link_hash_newfunc): Initialize the readonly_reloc + field to false. + (_bfd_mips_elf_check_relocs): Record if there is a relocation + in the .rel.dyn section against a read-only section by setting + DF_TEXTREL or readonly_reloc. + (_bfd_mips_elf_copy_indirect_symbol): Copy readonly_reloc if + it is true. + (_bfd_mips_elf_adjust_dynamic_symbol): Record DF_TEXTREL if + there is a relocation in the .rel.dyn section against a + read-only section. + (_bfd_mips_elf_size_dynamic_sections): Set DT_TEXTREL if + DF_TEXTREL is set. + +2001-06-12 Nick Clifton + + * coffcode.h (styp_flags_to_sec_flags): Change to a boolean + function. Move flagword result into parameter list. Remove + comment about setting bfd_error_handler to intercept failure + results. + * coffgen.c (make_a_section_from_file): Examine result of + calling bfd_coff_styp_to_sec_flags and pass a failure back to + caller. + * ecoff.h (styp_flags_to_sec_flags): Change to a boolean + function. Move flagword result into parameter list. + * libcoff.h: Regenerate. + * libecoff.h: Regenerate. + +2001-06-13 Nick Clifton + + * aoutx.h (adjust_z_magic): Only pad the tesxt section if the data + section is going to follow it. + +2001-06-12 Catherine Moore + + * elflink.h (elf_gc_propagate_vtable_entries): Replace FILE_ALIGN + with the file_align entry from elf_backend_data. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_record_vtentry): Likewise. + +2001-06-10 Alan Modra + + * elflink.h: Whitespace changes. + (elf_link_read_relocs_from_section): Use "unsigned int" iterator + rather than "unsigned char". + (elf_link_output_relocs): Likewise. + (elf_link_input_bfd): Likewise. + (elf_reloc_link_order): LIkewise. + * elf.c: s/CONST/const/. Whitespace changes. + * elf32-mips.c: Formatting fix. + + * Makefile.am (SOURCE_HFILES): Include xcoff-target.h, remove xcoff.h. + * Makefile.in: Regenerate. + * po/Make-in: Remove trailing tab. + +2001-06-09 Philip Blundell + + * elf32-arm.h (elf32_arm_plt0_entry): Correct error in last + change. + (elf32_arm_plt_entry): Likewise. + +2001-06-08 H.J. Lu + + * elf.c (swap_out_syms): Keep names for global section symbols. + +2001-06-07 H.J. Lu + + * config.bfd: Put back ecoff for Linux/mips. Firmwares on some + MIPS-based machines need it. + +2001-06-07 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_object_p): Set the bad symtab + for SGI only. + + * config.bfd: Remove ecoff from Linux/mips. + +2001-06-07 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an + assertion. + (elf64_x86_64_check_relocs): Fix VTENTRY relocation; set an + alignment of 8 for .rela sections; handle further relocations. + +2001-06-06 Christian Groessler + + * coff-z8k.c: Fix formatting. + Fix howtos: howto->size was always 1. + +2001-06-05 Thiemo Seufer + + * configure.host (mips64*-*-linux*): Define. + +2001-06-05 Alan Modra + + * elf32-i386.c (elf_i386_discard_copies): Rename to + discard_copies, and use elf_link_hash_entry arg rather than + elf_i386_link_hash_entry. + (elf_i386_link_hash_traverse): Delete. + (elf_i386_size_dynamic_sections): Adjust call to discard_copies. + Tidy sizing of dynamic sections. + (elf_i386_check_relocs ): Reference count + possible .plt entries. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_adjust_dynamic_symbol): Discard .plt entries for + everything with plt.refcount <= 0. + + * elf32-i386.c (elf_i386_check_relocs): Don't allocate .got and + .relgot space here. + (elf_i386_gc_sweep_hook): ..and no need to deallocate here.. + (elf_i386_adjust_dynamic_symbol): ..and don't allocate .plt and + .rel.plt here.. + (allocate_plt_and_got): ..instead do it all here. New function. + (elf_i386_size_dynamic_sections): Allocate local .got space and + call allocate_plt_and_got. No need to zap .relgot if not dynamic. + (bfd_elf32_bfd_final_link): Delete. (ie. use regular final link + rather than gc variety). + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf_i386_relocate_section): Use it here and correct handling of + R_386_GOT32. Provide section and offset for "unresolvable + relocation" error message. + (elf_i386_finish_dynamic_symbol): Correct handling of R_386_GOT32. + + * elf32-i386.c (struct elf_i386_link_hash_table): Add sgot, + sgotplt, srelgot, splt, srelplt, sdynbss, srelbss fields. + (elf_i386_link_hash_table_create): Init them. + (create_got_section): New function. + (elf_i386_create_dynamic_sections): New function. + (elf_backend_create_dynamic_sections): Set to above. + (elf_i386_check_relocs): Use shortcuts from hash table rather than + calling bfd_get_section_by_name. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + + * elf32-hppa.c (allocate_plt_and_got): Skip indirect and warning syms. + +2001-06-02 H.J. Lu + + * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX + and ELFOSABI_HPUX. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + +2001-06-02 H.J. Lu + + * aout-cris.c (MACHTYPE_OK): New. Defined. + +2001-06-02 Hans-Peter Nilsson + + * section.c (_bfd_strip_section_from_output): Handle NULL + output_section. + +2001-06-02 H.J. Lu + + * config.bfd (powerpc-*-aix*, powerpc-*-beos*, rs6000-*-*): Add + rs6000coff64_vec only if BFD64 is defined. + (powerpc64-*-aix*): Enable only if BFD64 is defined. + +2001-06-02 H.J. Lu + + * coff-ia64.c (ia64coff_object_p): Rewrite with + external_PEI_DOS_hdr and external_PEI_IMAGE_hdr. + +2001-06-01 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8 + relocation, small reformatting. + +2001-05-29 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64. + (elf64_x86_64_relocate_section): Likewise. + +2001-05-30 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for + millicode. Don't allocate .got and .rela.got space here.. + (elf32_hppa_gc_sweep_hook): ..and no need to deallocate here.. + (elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and + .rela.plt here.. + (hppa_handle_PIC_calls): ..nor here.. + (allocate_plt_and_got): ..instead do it all here. New function. + (elf32_hppa_size_dynamic_sections): Allocate local .got space and + call allocate_plt_and_got. No need to zap .got if not dynamic. + (elf32_hppa_final_link): Call regular bfd_final_link instead of + gc_common_final_link. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf32_hppa_relocate_section): Use it here. + (elf32_hppa_finish_dynamic_symbol): Remove superfluous test of + dynamic_sections_created. + (hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym. + +2001-05-28 Andreas Jaeger + + * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the + generic version since we want a hashsize of 4. + (elf_backend_size_info): Likewise. + +2001-05-28 Thiemo Seufer + + * elflink.h (elf_link_size_reloc_section): Use bfd_zmalloc instead of + a zeroing loop. + (elf_link_output_relocs): Handle MIPS ELF64 relocations correctly. + (elf_link_input_bfd): Likewise. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Typo. Handle MIPS ELF64 + relocations correctly. + +2001-05-28 Nicolas Pitre + + * elf32-arm.h: fix PLT generation for big endian ARM + +2001-05-28 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries + for symbols forced local that need plabels. + (elf32_hppa_adjust_dynamic_symbol): Don't allocate space in + .plt.rela for local syms if non-shared. + (hppa_build_one_stub): Mask lsb of plt.offset. + (elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set. + (clobber_millicode_symbols): Correct comment. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + +2001-05-28 Jeff Sturm + + * reloc.c: Add BFD_RELOC_SPARC_UA16 and BFD_RELOC_SPARC_UA64. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-sparc.c: Enable BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32 + and BFD_RELOC_SPARC_UA64 mapping + * elf64-sparc.c: Likewise. + +2001-05-25 H.J. Lu + + * Makefile.am (BFD32_BACKENDS): Remove coff-pmac.lo. + (BFD32_BACKENDS_CFILES): Remove coff-pmac.c. + (coff-rs6000.lo): Remove the old dependency. + * Makefile.in: Rebuild. + + * configure.in (pmac_xcoff_vec): Replace coff-pmac.lo with + coff-rs6000.lo. + +2001-05-25 H.J. Lu + + * coff-rs6000.c (rs6000coff_vec): Use rs6000coff_core_p, + rs6000coff_core_file_matches_executable_p, + rs6000coff_core_file_failing_command and + rs6000coff_core_file_failing_signal only if AIX_CORE is + defined. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + +2001-05-25 Timothy Wall + + * elfxx-ia64.c (allocate_dynrel_entries): Don't allocate an entry + for __GLOB_DATA_PTR on AIX5. Clean up some relocation bugs. + +2001-05-25 H.J. Lu + + * bfd-in2.h: Regenerated. + * libcoff.h: Likewise. + +2001-05-25 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow + undefined millicode syms in shared libs. + (hppa_build_one_stub): Turn BFD_ASSERTs into aborts. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + +2001-05-24 Tom Rix + + * Makefile.am coff-pmac bfd now defined in coff-rs6000.c + xcoff-target.h not used to define rs6000 or ppc bfd. + * Makefile.in same + + * bfd-in.h : (struct lineno_cache_entry) promote element "offset" + to 64 bit. + + * coff-rs6000.c : Many changes for 64 bit support. Move common + 32/64 code to xcofflink.c. Explictly define the rs6000coff_vec + and pmac_xcoff_vec + + * coff64-rs6000.c : Many changes for 64 bit support. 64 bit + linker now supported. Explictly define the rs6000coff64_vec. + + * coffcode.h : (coff_set_arch_mach_hook) xcoff 64 bit support + (coff_print_aux) same + (coff_write_object_contents) same + (coff_slurp_line_table) same + + * coffgen.c : (coff_fix_symbol_name) formatting + (coff_mangle_symbols) xcoff 64 bit support + (coff_write_symbol) same + (coff_write_alien_symbol) same + (coff_write_native_symbol) same + (coff_write_symbols) same + (coff_get_symbol_info) same + (bfd_coff_get_syment) same + (coff_print_symbol) same + + * config.bfd : add powerpc64-*-aix* target + + * libcoff-in.h : formatting + + * libcoff.h : move xcoff extern declarations to libxcoff.h + + * libxcoff.h : New file + + * xcofflink.c : Many changes for xcoff64 support. Move common + structures to include/coff/xcoff.h. Move specific structure to + backends coff-rs6000.c and coff64-rs6000.c. Use new backend + functions, defined in libxcoff.h, to isolate 32/64 dependencies. + + (bfd_xcoff_size_dynamic_sections) : special __rtinit symbol for + aix4.2+ -binitfini. + + (xcoff_build_ldsyms) : handle special __rtinit symbol. + +2001-05-23 Alexandre Oliva + + * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo + s/ENTIRES/ENTRIES/. + +2001-05-23 Thiemo Seufer + + * reloc.c (bfd_reloc_code_real): Add MIPS ELF64 relocations. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + + * aoutx.h (aout_@var{size}_machine_type): Add MIPS r12k support. + * archures.c (bfd_mach_mips12000): Define. + * cpu-mips.c (arch_info_struct): Add MIPS r12k support. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Add MIPS r12k + support. + (_bfd_mips_elf_size_dynamic_sections): Use official bfd typedef. + * bfd-in2.h: Regenerate. + * elfxx-target.h: Do not redefine bfd_elfNN_bfd_make_debug_symbol. + +2001-05-23 kaz Kojima + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry, + elf_sh_plt_entry_be, elf_sh_plt_entry, elf_sh_pic_plt_entry_be, + elf_sh_pic_plt_entry): New PLT code, that does not use r2, since + that is used by GCC. + +2001-05-23 Nick Clifton + + * elf-bfd.h (NUM_SHDR_ENTRIES): New macro: compute the number + of entries in a structured section. + * elf.c: Use new macro. + * elf32-i386.c: Use new macro. + * elf32-mips.c: Use new macro. + * elf64-alpha.c: Use new macro. + * elf64-sparc.c: Use new macro. + * elfcode.h: Use new macro. + * elflink.h: Use new macro. + +2001-05-23 Nick Clifton + + * bfdint.texi: Replace -oformat with --oformat. + +2001-05-21 Andreas Jaeger + + * dwarf2.c (decode_line_info): Fix error message. + (read_abbrevs): Fix test for offset as suggested by Alan Modra and + adjust error message. + +2001-05-18 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Revert the last + change. + +2001-05-17 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Temporarily set + ELF_LINK_FORCED_LOCAL to suit 2001-04-30 change. + (hppa_build_one_stub): Add an assert to check plt.offset. + +2001-05-17 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the + version definition to basename of the output filename. + +2001-05-17 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Set DT_NEEDED to + basename of the bfd filename. + +2001-05-16 Alan Modra + + * section.c (asection): Add linker_has_input field. + (STD_SECTION): Adjust initialization to suit. + * ecoff.c (bfd_debug_section): Likewise. + * bfd-in2.h: Regenerate. + +2001-05-15 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Don't relax + negative 32-bit operands to 16 operands when the operand is + going to be zero-extended by the modified opcode. + +2001-05-12 Peter Targett + + * cpu-arc.c (arch_info_struct): Add entry 'base' representing old + name for 'arc5' core versions. + (bfd_arc_arch): Make bfd_mach_arc_6 default. + + * elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default + architecture. + (arc_elf_final_write_processing): Make bfd_mach_arc_6 default. + +2001-05-11 Jakub Jelinek + + * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind + sections as well. + (elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO + to .gnu.linkonce.t.FOO text section. + +2001-05-11 Jakub Jelinek + + * merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix + fields, change sec into secinfo. + (struct sec_merge_info): Add chain, remove last fields. + (struct sec_merge_sec_info): Add next, sec, psecinfo fields. + (sec_merge_hash_lookup): If lookup could not use a string only + because it has bad alignment, mark the old string for deletion. + (sec_merge_add): Add secinfo argument. Don't compute entry's + position, instead record the section. + (sec_merge_emit): Update for the sec into secinfo change in + struct sec_merge_hash_entry. + (_bfd_merge_section): Only record the section for merging, defer + putting strings into the hash table. + (cmplengthentry, last4_eq, last_eq, record_section, merge_strings, + _bfd_merge_sections): New functions. + (_bfd_merged_section_offset): Update for the sec_merge_hash_entry + changes. + * libbfd-in.h (_bfd_merge_sections): Add prototype. + (_bfd_nolink_bfd_merge_sections): Define. + * libbfd.h: Likewise. + (bfd_generic_merge_sections): Add prototype. + * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections. + (struct bfd_target): Likewise. + * bfd.c (bfd_merge_sections): Define. + * bfd-in2.h: Rebuilt. + * elf.c (_bfd_elf_merge_sections): New function. + * elf-bfd.h (_bfd_elf_merge_sections): Add prototype. + * elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define. + * reloc.c (bfd_generic_merge_sections): New function. + * vms.c (vms_bfd_merge_sections): New function. + * aout-adobe.c (aout_32_bfd_merge_sections): Define. + * aout-target.h (MY_bfd_merge_sections): Define. + * aout-tic30.c (MY_bfd_merge_sections): Define. + * binary.c (binary_bfd_merge_sections): Define. + * bout.c (b_out_bfd_merge_sections): Define. + * coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define. + * coffcode.c (coff_bfd_merge_sections): Define. + * coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define. + * i386msdos.c (msdos_bfd_merge_sections): Define. + * i386os9k.c (os9k_bfd_merge_sections): Define. + * ieee.c (ieee_bfd_merge_sections): Define. + * ihex.c (ihex_bfd_merge_sections): Define. + * nlm-target.h (nlm_bfd_merge_sections): Define. + * oasys.c (oasys_bfd_merge_sections): Define. + * ppcboot.c (ppcboot_bfd_merge_sections): Define. + * som.c (som_bfd_merge_sections): Define. + * srec.c (srec_bfd_merge_sections): Define. + * tekhex.c (tekhex_bfd_merge_sections): Define. + * versados.c (versados_bfd_merge_sections): Define. + * xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define. + +2001-05-11 Nick Clifton + + * dwarf1.c (_bfd_dwarf1_find_nearest_line): Change type of 'addr' + to be unsigned long, in order to match its use. + +2001-05-10 H.J. Lu + + * linker.c (_bfd_generic_link_add_one_symbol): Check loop on + indirect symbols. + +2001-05-09 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate + versymhdr->sh_size bytes for extversym instead of hdr->sh_size. + Remove the unused veriable `dynver'. + +2001-05-08 Ian Lance Taylor + + * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is + NULL or is not COFF. + (coff_i386_rtype_to_howto): Don't dump core if output section + owner is not COFF. + +2001-05-07 Thiemo Seufer + + * ecoff.c (bfd_debug_section): Fix initialization. + * elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it + is always a positive integer. Cast away sign mismatch. + * elf32-mips.c: Fix misleading comment and typo. + (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use + correct data type. + * elflink.c: Fix typo. + (_bfd_elf_create_dynamic_sections): Remove superfluous initialization. + * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch. + +2001-05-04 Richard Henderson + + * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true. + +2001-05-04 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Set + EF_ARM_HASENTRY if the start address is set. + +2001-05-03 Nick Clifton + + * targets.c (_bfd_target_vector_entries): Compute value based on + the size of the _bfd_target_vector and not bfd_target_vector. + +2001-05-03 H.J. Lu + + * elfcode.h: Include "libiberty.h". + + * elflink.h (elf_link_add_object_symbols): Set + elf_dt_name (abfd) to basename of the bfd filename. + (NAME(bfd_elf,size_dynamic_sections)): Set vn_file to basename + of the bfd filename. + +2001-05-03 Andreas Jaeger + + * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute. + (elf_generic_info_to_howto_rel): Likewise. + * coff-alpha.c (reloc_nil): Likewise. + (alpha_ecoff_bad_format_hook): Likewise. + (alpha_adjust_reloc_out): Likewise. + (alpha_bfd_reloc_type_lookup): Likewise. + (alpha_convert_external_reloc): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_nil): Likewise. + (elf64_alpha_reloc_bad): Likewise. + (elf64_alpha_reloc_gpdisp): Likewise. + (elf64_alpha_bfd_reloc_type_lookup): Likewise. + (elf64_alpha_info_to_howto): Likewise. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_create_got_section): Likewise. + (elf64_alpha_is_local_label_name): Likewise. + (elf64_alpha_merge_ind_symbols): Likewise. + * elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise. + (mips_elf64_get_reloc_upper_bound): Likewise. + * nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise. + (nlm_alpha_get_public_offset): Likewise. + +2001-05-02 Johan Rydberg + + * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain + about overflow in R_OPENRISC_LO_16_IN_INSN and + R_OPENRISC_HI_16_IN_INSN.Index: bfd/elf32-openrisc.c + +2001-04-30 H.J. Lu + + * elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1 + only for ELF_LINK_FORCED_LOCAL. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. + + * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL + if the symbol has hidden or internal visibility. + +2001-04-30 Alan Modra + + * elf32-hppa.c (final_link_relocate): Branch to .+8 for + calls to undefined weak symbols. + +2001-04-30 Andreas Jaeger , Andreas Schwab + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for + R_X86_64_GOTPCREL, don't use assignments instead of comparisons. + +2001-04-27 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap + out handled entries. + (elf64_x86_64_finish_dynamic_symbol): Set up GOT entries. + (elf64_x86_64_relocate_section): Fix GOTPCREL calculation. + (elf64_x86_64_relocate_section): Merge entries for GOTPCREL and + GOT32. + +2001-04-27 Sean McNeil + + * config.bfd: Add arm-vxworks target. + * coff-arm (coff_arm_relocate_section): Add in symbol value to + addend (fro VXworks targets). + +2001-04-26 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is + valid. + +2001-04-25 Frank Ch. Eigler + + * bfd-in.h (bfd_cache_close): Declare newly exported function. + * bfd-in2.h: Regenerated. + +2001-04-24 Jakub Jelinek + + * merge.c (struct sec_merge_hash_entry): Add alignment field. + (struct sec_merge_hash): Remove alignment_power. + (sec_merge_hash_newfunc): Clear alignment. + (sec_merge_hash_lookup): Pass alignment as argument. + Use hashp->root.next, not hashp->next to walk the hash chain. + If a string already in the hashtable does not have required + alignment, create a new hashtable entry. + (sec_merge_init): Remove alignment_power argument. + (sec_merge_add): Add alignment argument. + (sec_merge_emit): Alignment is now a per-entity thing, not per + section. + (_bfd_merge_section): Sanity check even non-SEC_STRINGS sections + for proper alignment. + Pass alignment information to sec_merge_add. + +2001-04-24 Christian Groessler + + * coff-z8k.c (extra_case): added handler for R_DISP7, R_CALLR + and R_REL16 reloc types; accept odd values for R_REL16 type + +2001-04-24 Johan Rydberg + + * cpu-openrisc.c: New file. + * elf32-openrisc.c: Likewise. + + * Makefile.am (ALL_MACHINES): Add cpu-openrisc.lo. + (ALL_MACHINES_CFILES): Add cpu-openrisc.c. + (BFD32_BACKENDS): Add elf32-openrisc.lo. + (BFD32_BACKENDS_CFILES): Add elf32-openrisc.c. + (cpu-openrisc.lo, elf32-openrisc.lo): New rules. + * Makefile.in: Regenerated. + * config.bfd: (openrisc-*-elf): New target. + * configure.in (bfd_elf32_openrisc_vec): New vector. + * configure: Regenerated. + * libbfd.h: Regenerated. + * bfd-in2.h: Regenerated. + * reloc.c: Add OpenRISC relocations. + * targets.c (bfd_elf32_openrisc_vec): Declare. + (bfd_target_vect): Add bfd_elf32_openrisc_vec. + * archures.c (enum bfd_architecture): Add bfd_arch_openrisc. + (bfd_openrisc_arch): Declare. + (bfd_archures_list): Add bfd_openrisc_arch. + * elf.c (prep_headers): Add bfd_arch_openrisc. + +2001-04-23 Bo Thorsen + + * elf64-x86-64.c: Add c++ vtable hack. + Small whitespace and comment changes. + +2001-04-19 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions. + (elf64_x86_64_plt_entry): Likewise. + (elf64_x86_64_finish_dynamic_sections): Fix PLT0 generation. + (elf64_x86_64_finish_dynamic_symbol): Fix PLT generation. + +2001-04-17 Hans-Peter Nilsson + + * elf32-cris.c: Tweak comments related to dynamic linking. + (cris_elf_relocate_section): When not creating shared object, fill + in the .got table for any symbol not in the dynamic symbol table. + (elf_cris_finish_dynamic_symbol): When not creating shared object, + only emit a .got.rela reloc if the symbol is in the dynamic symbol + table. + (cris_elf_check_relocs): Use variable r_type in all places rather + than the original expression. Add default case in switch for + reloc types. + (elf_cris_size_dynamic_sections): Iterate over + elf_cris_discard_excess_program_dynamics when not creating shared + library. + (elf_cris_discard_excess_dso_dynamics): Renamed from + elf_cris_discard_copies. Correct typo, s/Rel/Rela/. + (elf_cris_discard_excess_program_dynamics): New. + +2001-04-14 Mark Elbrecht + + * coffcode.h (coff_write_object_contents): Use + bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out. + +2001-04-14 H.J. Lu + + * bfd-in2.h: Regenerate. + +2001-04-14 Jakub Jelinek + + * section.c (STD_SECTION): Add entsize. + +2001-04-13 H.J. Lu + + * section.c (SEC_MERGE): Define new flag for merging. + (SEC_STRINGS): Likewise. + (entsize): New field. + +2001-04-13 Roger Sayle + + * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable section + flag on pe-i386 targets. + +2001-04-13 Jakub Jelinek + + * libbfd-in.h (_bfd_merge_section): New. + (_bfd_write_merged_section): New. + (_bfd_merged_section_offset): New. + * libbfd.h: Rebuilt. + * linker.c (_bfd_generic_link_output_symbols): Handle + discard_sec_merge. + * aoutx.h (aout_link_write_symbols): Likewise. + * pdp11.c (aout_link_write_symbols): Likewise. + * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. + (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE + sections. + (elf_link_sec_merge_syms): New. + (elf_link_input_bfd): Call _bfd_merged_section_offset + and _bfd_write_merged_section. + Handle discard_sec_merge. + * elf-bfd.h (struct elf_link_hash_table): Add merge_info + field. + (struct bfd_elf_section_data): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and + SEC_STRINGS section flags and entsize from their ELF counterparts. + (_bfd_elf_link_hash_table_init): Initialize merge_info. + (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize + from their BFD counterparts. + * merge.c: New file. + * Makefile.am: Add strtab.lo. + * Makefile.in: Rebuilt. + +2001-04-09 Hans-Peter Nilsson + + * elflink.h (elf_fix_symbol_flags): For non-default visibilities, + only hide symbols marked STV_INTERNAL or STV_HIDDEN. + +2001-04-05 Steven J. Hill + + * config.bfd (mips*el*-*-linux-gnu*): Use traditional little + endian MIPS ELF target. + * config.bfd (mips*-*-linux-gnu*): Use traditional big endian + MIPS ELF target. + + * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + * configure: Regenerated. + + * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and + little endian targets. + (mips_elf_sym_is_global): Handle traditional targets. + + * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + + * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec + and bfd_elf64_tradlittlemips_vec. + +2001-04-05 David Mosberger + + * elf32-i386.c (elf_i386_fake_sections): Treat ".reloc" as an + ordinary "progbits" section. + +2001-04-04 Alan Modra + + * elflink.h (elf_fix_symbol_flags): Call elf_backend_hide_symbol + when -Bsymbolic causes a symbol to no longer need a .plt entry. + +2001-04-03 David Mosberger + + * efi-app-ia32.c (ALIGN_SECTIONS_IN_FILE): Deleted. + +2001-03-30 H.J. Lu + + * efi-app-ia32.c (PEI_TARGET_SUBSYSTEM): Rename from ... + (PEI_DEFAULT_TARGET_SUBSYSTEM): This. + +2001-03-26 H.J. Lu + + * elf32-gen.c (elf32_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf32_bfd_link_add_symbols): Defined to + elf32_generic_link_add_symbols. + * elf64-gen.c (elf64_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf64_bfd_link_add_symbols): Defined to + elf64_generic_link_add_symbols. + +2001-03-23 Nick Clifton + + * Makefile.am (BUILD_CFILES): New variable: List of C source + files created in build directory. + (BUILD_HFILES): New variable: List of header files created in + build directory. + (POTFILES): Delete. + (po/POTFILES.in): Replace rule with empty entry. + (po/SRC-POTFILES.in): New rule: Create a list of source files + in the source directory. + (po/BLD-POTFILES.in): New rule: Create a list of source files + in the build directory. + (MOSTLYCLEAN): Do not delete source files created in build + directory. + * Makefile.in: Regenerate. + * configure.in: Insert SRC-POTFILES.in and BLD-POTFILES.in + into po/Makefile. + * configure: Regenerate. + + * po/Make-in: Replace occurrences of POTFILES with SRC-POTFILES + and BLD_POTFILES. + Add .. to the search path when building bfd.pot. + Delete POTFILES when performing distclean. + Add comment describing why distclean is broken in maintainer mode. + * po/POTFILES.in: Delete. + * po/SRC-POTFILES.in: New file. + * po/BLD-POTFILES.in: New file. + * po/bfd.pot: Regenerate. + +2001-03-22 Hans-Peter Nilsson + + * elf32-cris.c: Shlib and PIC support. PCREL tweaks. + (elf_cris_discard_copies, elf_cris_adjust_gotplt_to_got, + elf_cris_try_fold_plt_to_got, elf_cris_link_hash_newfunc, + elf_cris_link_hash_table_create, elf_cris_adjust_dynamic_symbol, + elf_cris_size_dynamic_sections, elf_cris_finish_dynamic_symbol, + elf_cris_finish_dynamic_sections,elf_cris_hide_symbol): New + functions. + (cris_elf_howto_table) : Correct comments. Set pcrel_offset to false. + : + New HOWTO members for new relocs. + (cris_reloc_map): Map new relocs. + (ELF_DYNAMIC_INTERPRETER): Define. + (PLT_ENTRY_SIZE): Define. + (elf_cris_plt0_entry, elf_cris_plt_entry, elf_cris_pic_plt0_entry, + elf_cris_pic_plt_entry): New, PLT templates. + (struct elf_cris_pcrel_relocs_copied, struct + elf_cris_link_hash_entry, struct elf_cris_link_hash_table): New. + (elf_cris_link_hash_traverse, elf_cris_hash_table): Define. + (cris_final_link_relocate): Check that 16-bit GOT relocs have + positive values. Adjust PCREL relocs to be relative to location + after relocation. + (cris_elf_relocate_section): Handle relocations to dynamic + objects. Handle new relocations. Call error handler when seeing + non-PIC relocation for read-only sections while generating shared + object. + (cris_elf_check_relocs): Set reference counts for GOT and PLT + entries. + (bfd_elf32_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, + elf_backend_create_dynamic_sections, bfd_elf32_bfd_final_link, + elf_backend_hide_symbol, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + + * reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT, + BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE, + BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT, + BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT, + BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL, + BFD_RELOC_CRIS_32_PLT_PCREL): New relocs. + * bfd-in2.h, libbfd.h: Regenerate. + +2001-03-21 Diego Novillo + + (_bfd_mips_elf_relocate_section): Give a better error message when + a relocation is not recognized. + +2001-03-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section + non-NULL before attempting to dereference. + +2001-03-20 H.J. Lu + + * configure.in: Remove the redundent AC_ARG_PROGRAM. + * configure: Rebuild. + +2001-03-20 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Don't need the + relocation value when resolving a reference from a debugging + section. + +2001-03-16 Scott Thomason + + * coff64-rs6000.c (xcoff64_swap_sym_out): Fix syntax errors. + (xcoff64_swap_sym_out): Fix syntax errors. + +2001-03-16 Richard Sandiford + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix warning. + +2001-03-15 Alan Modra + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Add maybe_pic_call. + (hppa_link_hash_newfunc): Init it. + (hppa_type_of_stub): Only use non-PIC to PIC call stub if caller + section appears to be non-PIC. + (final_link_relocate): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Set maybe_pic_call for any + possible candidate function, and set pic_call for those that will + only have a .plt entry for the PIC call stub. + (hppa_handle_PIC_calls): Set maybe_pic_call. + +2001-03-12 DJ Delorie + + * elf32-sh.c (sh_elf_relocate_section): Only relocation + R_SH_DIR8WP* relocs if they're against external symbols, else + they're just for relaxing. Validate the reloc values. + +2001-03-12 Stefan Geuken + + * binary.c (bfd_external_binary_architecture): Declare. + (binary_object_p): If bfd_external_binary_architecture is defined, + set the architecture to this string. + +2001-03-11 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2001-03-08 Nick Clifton + + * Most files: Update copyright notices using Perl script created + by Kevin Buettner . + +2001-03-07 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Conditionalise + prior patch on ! defined OLD_ARM_ABI. + +2001-03-07 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix handling of + some relocation values. + +2001-03-06 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Clear bit zero + of offset in BLX(1) instruction. + * coff-arm.c (coff_arm_relocate_section): Clear bit zero of + offset in BLX(1) instruction. + Fix formatting. + +2001-03-06 Nick Clifton + + * coff-arm.c (coff_arm_reloc_type_lookup): Add + BFD_RELOC_THUMB_PCREL_BLX. + +2001-03-06 Igor Shevlyakov + + * archures.c (bfd_default_scan): Add Coldfire CPUs. + * bfd-in2.h: Regenerate. + * cpu-m68k.c: Add Coldfire CPUs for arch table. + * ieee.c (ieee_write_processor): Set proper id for + Coldfire CPUs. + +2001-03-01 D.J. Barrow + + * configure.in: Add s390 target. + * configure: Regenerate. + +2001-02-28 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add relocation + to addend. + +2001-02-28 Philip Blundell + + * elf32-arm.h: Update mentions of renamed EF_xx constants. + (elf32_arm_print_private_bfd_data): Handle ARM EABI version 2. + +2001-02-27 H.J. Lu + + * aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if + abfd->tdata.aout_data == NULL. + +2001-02-27 Alan Modra + + * elf32-hppa.c: Correct field selector in stub comments. + (clobber_millicode_symbols): Formatting fix. + + * configure.in: Bump version to 2.11.90. + * configure: Regenerate. + * Makefile.am (CFILES): Rename to SOURCE_CFILES. + (CFILES): $SOURCE_CFILES + generated C files. + (POTFILES): Include $HFILES not $SOURCE_HFILES. + Run "make dep-am" + * Makefile.in: Regenerate. + * doc/Makefile.in: This too. + +2001-02-26 Timothy Wall + + * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Remove obsolete + comments. + +2001-02-26 Nick Clifton + + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Tidy + up, replacing multiple if statements with a switch. + (handle_COMDAT): New function. + +2001-02-26 H.J. Lu + + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Issue + a warning for section flags we do not handle instead of + aborting. + +2001-02-26 Andreas Jaeger + + * elf64-x86-64.c (x86_64_elf_howto_table): Fix order of entries. + +2001-02-22 Timothy Wall + + * config.bfd (targ_cpu): Add vectors for ia64-*-aix* (aka Monterey). + * configure.in: Add objects for elf64_ia64_aix vectors. + * configure: Regenerated. + * configure.host: Recognize ia64-*-aix*. + * elfxx-ia64.c: Add hooks for ELF64 on AIX5. Define new vectors + for AIX. AIX5 requires most relocations to be dynamic (*all* + binaries are somewhat similar to shared libraries). + * targets.c: Add elf64_ia64_aix vectors. + +2001-02-21 David Mosberger + + * cpu-ia64-opc.c (elf64_ia64_operands}: Fix typo: error string for + C8 said "1" instead of "8". Clarify error string for IMM22: + "signed integer" instead of just "integer". + +2001-02-20 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make + PLT entries that could serve as a definition for a weak symbol. + +2001-02-19 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise. + +2001-02-18 David O'Brien + + * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat + FreeBSD/i386-CURRENT differently until I can figure out the needed + corefile changes. + * configure: Regenerate. + * config.bfd: Recognize FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/arm, + FreeBSD/PowerPC, and FreeBSD/sparc64. + +2001-02-18 lars brinkhoff + + * Makefile.am: Add PDP-11 a.out target. + * config.bfd: Likewise. + * configure.in: Likewise. + * targets.c: Likewise. + * archures.c: Likewise. + * bfd-in2.h: Likewise. Add PDP-11 relocations. + * libbfd.h: Add PDP-11 relocations. + * reloc.c: Likewise. + * cpu-pdp11.c: New file. + * pdp11.c: New file. + + * libaout.h (GET_WORD) [ARCH_SIZE==16]: Define. + (GET_SWORD) [ARCH_SIZE==16]: Likewise. + (GET_SWORD) [ARCH_SIZE==16]: Likewise. + (PUT_WORD) [ARCH_SIZE==16]: Likewise. + (GET_MAGIC): New macro. + (PUT_MAGIC): Likewise. + * aout-target.h (MY(object_p)): Use GET_MAGIC to read magic word. + +2001-02-18 Jim Kingdon + + * irix-core.c (irix_core_core_file_p): Set the architecture (GDB + multiarch needs it). + +2001-02-18 H.J. Lu + + * elflink.h (elf_link_input_bfd): Ignore invalid section symbol + index. + +2001-02-18 Kazu Hirata + + * vms-misc.c: Fix formatting. + +2001-02-16 Kazu Hirata + + * vms.c: Fix formatting. + +2001-02-14 H.J. Lu + + * elf.c (elf_find_function): New function. + (_bfd_elf_find_nearest_line): Call elf_find_function () to find + the file name and function name. + +2001-02-14 Nick Clifton + + * ecoff.c (bfd_debug_section): Update to initialise new fields in + asection structure. + + * Makefile.am (BFD32_BACKENDS_CFILES): Remove peigen.c + (BFD64_BACKENDS): Add pepigen.c + Add rules to create peigen.c and pepigen.c from peXXigen.c. + + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2001-02-14 H.J. Lu + + * libcoff-in.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + +2001-02-14 Bo Thorsen + + * elf64-x86-64.c: Small formatting fixes and rearrangements of code. + (elf64_86_64_size_info): Struct added to fix a problem + with the hashtable string entries. + (elf64_x86_64_adjust_dynamic_symbol): Add generation of .got.plt. + (elf64_x86_64_size_dynamic_sections): A FIXME removed. + (elf64_x86_64_size_dynamic_sections): Fix a dynamic entry and + remove the FIXME for this. + (elf64_x86_64_adjust_dynamic_symbol): Fix check for unneeded .plt + section. Also removed the FIXME for it. + (x86_64_elf_howto_table): Use bfd_elf_generic_reloc. + (ELF_DYNAMIC_INTERPRETER): Fix the name of the dynamic linker. + (elf64_x86_64_finish_dynamic_sections): Enable .got.plt writing. + +2001-02-13 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required + and not user provided. + +2001-02-13 Kazu Hirata + + * vms.c (vms_print_symbol): Remove unreachable code. + + * rs6000-core.c: Fix formatting. + +2001-02-13 David Mosberger + + * peicode.h (coff_swap_filehdr_out) [COFF_IMAGE_WITH_PE]: Define + as _bfd_XXi_only_swap_filehdr_out. + (pe_mkobject) [PEI_FORCE_MINIMUM_ALIGNMENT]: Set + pe->force_minimum_alignment to TRUE. + (pe_mkobject) [PEI_TARGET_SUBSYSTEM]: Set pe->target_subsystem to + PEI_TARGET_SUBSYSTEM. + (pe_print_private_bfd_data): Call + _bfd_XX_print_private_bfd_data_common() instead of + _bfd_pe_print_private_bfd_data_common(). + (pe_bfd_copy_private_bfd_data): Call + _bfd_XX_bfd_copy_private_bfd_data_common() instead of + _bfd_pe_bfd_copy_private_bfd_data_common(). + (coff_bfd_copy_private_section_data): Define as + _bfd_XX_bfd_copy_private_section_data instead of + _bfd_pe_bfd_copy_private_section_data. + (coff_get_symbol_info): Define as _bfd_XX_get_symbol_info instead + of a _bfd_pe_get_symbol_info. + + * peigen.c: Delete. + + * peXXigen.c: Renamed from peigen.c. + (COFF_WITH_XX): Define this macro (will get expanded into + COFF_WITH_pep or COFF_WITH_pe, depending on whether this is being + compiled as peigen.c or pepigen.c. + [COFF_WITH_pep]: Include "coff/ia64.h" instead of "coff/i386.h" to + define the canonical PEP structures and definitions. + (_bfd_XXi_swap_aouthdr_out): If pe->force_minimum_alignment is in + effect, enforce minimum file and section alignments. If + extra->Subsystem is IMAGE_SUBSYSTEM_UNKNOWN, set it to + pe->target_subsystem (this defaults to IMAGE_SUBSYSTEM_UNKNOWN, + so, by default, this is a no-op). + + * libpei.h: Rename COFF_WITH_PEP to COFF_WITH_pep. + (_bfd_XX_bfd_copy_private_bfd_data_common): Add macros to map + _bfd_XXfoo to _bfd_pepfoo if COFF_WIT_PEP is defined and to + _bfd_pefoo if it's not defined. Use these macros to define + coff swap macros. + + * libcoff.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + + * efi-app-ia64.c (COFF_WITH_pep): Rename COFF_WITH_PEP to + COFF_WITH_pep. + (PEI_TARGET_SUBSYSTEM): Rename from PEI_DEFAULT_TARGET_SUBSYSTEM. + + * configure.in (bfd_efi_app_ia64_vec): Use pepigen.lo instead of + peigen.lo. + + * coff-ia64.c: Rename COFF_WITH_PEP to COFF_WITH_pep. + (AOUTSZ): Rename PEP64AOUTSZ and PEP64AOUTHDR to PEPAOUTSZ and + PEPAOUTHDR. + + * Makefile.in (BFD64_BACKENDS): Mention pepigen.lo. + (BFD64_BACKENDS_CFILES): Mention pepigen.c + (peigen.c): Add rule to generate from peXXigen.c. + (pepigen.c): Ditto. + (pepigen.lo): List dependencies for pepigen.lo. + +2001-02-13 Alan Modra + + * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If + $global$ referenced but not defined, set its value here. + +2001-02-09 Bo Thorsen + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section + alignment to 3. + (elf64_x86_64_check_relocs): Write R_X86_64_GOTPCREL GOT entry + and relocation. + (elf64_x86_64_relocate_section): Fix formatting. + (elf64_x86_64_relocate_section): Fix addend for relocation of + R_X86_64_(8|16|32|PC8|PC16|PC32). + +2001-02-12 Jan Hubicka + + * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL. + +2001-02-11 H.J. Lu + + * elflink.h (elf_bfd_final_link): Use file_align for SYMTAB + alignment. + +2001-02-11 Maciej W. Rozycki + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Undo patch + from 2000-10-13. Do not add the symbol's value for R_MIPS_REL32 + relocations against dynsym symbols. + + * elf32-mips.c (elf_mips_howto_table): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf_calculate_relocation): Use (p + 4) instead of p for + the R_MIPS_26 relocation. + (mips_elf_perform_relocation): Fix the comment on the R_MIPS16_26 + relocation. + * elf64-mips.c (mips_elf64_howto_table_rel): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf64_howto_table_rela): Likewise. + + * elf32-mips.c (struct mips_elf_link_hash_entry): Added no_fn_stub + member to mark symbols that have non-CALL relocations against + them. + (mips_elf_link_hash_newfunc): Initialize no_fn_stub. + (mips_elf_calculate_relocation): Handle R_MIPS_CALL16 like + R_MIPS_GOT16. + (_bfd_mips_elf_check_relocs): Set no_fn_stub for a symbol if a + non-CALL relocation against it is encountered. + (_bfd_mips_elf_copy_indirect_symbol): Merge no_fn_stub as well. + (_bfd_mips_elf_adjust_dynamic_symbol): Only create a stub if + no_fn_stub is not set. + + * elf32-mips.c (mips_elf_output_extsym): Get the output section + information from the real symbol for indirect ones. + Check no_fn_stub to find out if a symbol has a function stub + indeed. + +2001-02-11 Michael Sokolov + + * Makefile.am (stamp-lib): ranlib the libbfd.a in the build directory. + * Makefile.in: Regenerate. + +2001-02-09 David Mosberger + + * elfxx-ia64.c (is_unwind_section_name): New function. Returns + true if section name is an unwind table section name. + (elfNN_ia64_additional_program_headers): Count each unwind section + separately. + (elfNN_ia64_modify_segment_map): Install one unwind program header + for each unwind separate section. Note: normally the linker + script merges the unwind sections that go into a single segment, + so this still generates at most one unwind program header per + segment. + + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Accept any section + name for SHT_IA_64_UNWIND, not just .IA_64.unwind. + (elfNN_ia64_fake_sections): Mark sections with names that start + with .IA_64.unwind but not with .IA_64.unwind_info as an IA-64 + unwind section. + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): New function. + Use it to make sh_info in unwind section point to the text section + it applies to. + +2001-02-09 Martin Schwidefsky + + * Makefile.am: Add linux target for S/390. + * archures.c: Likewise. + * bfd-in2.h: Likewise. + * config.bfd: Likewise. + * configure.in: Likewise. + * elf.c: Likewise. + * libbfd.h: Likewise. + * targets.c: Likewise. + * cpu-s390.c: New file. + * elf32-s390.c: New file. + * elf64-s390.c: New file. + +2001-02-09 Nick Clifton + + * peigen.c (_bfd_pe_get_symbol_info): Suppress addition of + ImageBase. This has already been done by coff_swap_hdr_in. + +2001-02-09 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_copy_private_bfd_data): New function. + +2001-02-09 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_check_relocs): Don't trust reloc_count. + (sparc64_elf_relocate_section): Likewise. + +2001-02-09 Mark Kettenis + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32 + similar to R_SPARC_32. + * elf64-sparc.c (sparc64_elf_howto_table): Likewise. + +2001-02-08 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_PC32 + relocation entries for weak definitions when building DSO with + -Bsymbolic. + +2001-02-08 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness + before visibility. Locally defined protected symbols are not + dynamic. + +2001-02-08 Geoffrey Keating + + * config.bfd: Enable coff64 for rs6000-*. Patch from + . + +2001-02-07 Mark Elbrecht + + * coffgen.c (coff_find_nearest_line): If stabs info is successfully + found, do not attempt to find dwarf2 info before returning. + +2001-02-07 Jakub Jelinek + + * elflink.h (is_global_symbol_definition): Rename to + is_global_data_symbol_definition and have it reject function + symbols. + (elf_link_is_defined_archive_symbol): Use renamed function. + +2001-02-07 Todd Vierling + + * libbfd-in.h (bfd_target_vector): Change extern array to pointer. + * libbfd.h (bfd_target_vector): Likewise. + * targets.c (bfd_target_vector): Rename to _bfd_target_vector and + make static; create pointer reference named bfd_target_vector. + (_bfd_target_vector_entries): Calculate this based on the array + typed _bfd_target_vector. + +2001-02-06 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Only hidden and + internal symbols are not dynamic. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + +2001-02-06 Nick Clifton + + * Makefile.am (BFD64_BACKENDS_CFILES): Remove elf64-ia64.c, so + that it will not be pulled into the list of files that make up + po/POTFILES.in. + * Makefile.in: Regenerate. + * po/bfd.pot: Regenerate. + +2001-02-06 H.J. Lu + + * peicode.h (coff_swap_filehdr_in): Remove the e_magic + checking. + (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and + external_PEI_IMAGE_hdr. + +2001-02-06 Kazu Hirata + + * elf-m10200.c: Fix formatting. + +2001-02-04 Nick Clifton + + * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC + rel, it will be handled later on. + +2001-02-02 Fred Fish + + * Makefile.in: Fix typo. + +2001-02-01 Kazu Hirata + + * elf-m10300.c: Fix formatting. + +2001-01-30 Alan Modra + + * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf64_hppa_object_p): Set architecture and machine from elf + header flags. + +2001-01-30 Curtis L. Janssen + + * elf64-alpha.c (elf64_alpha_find_nearest_line): Query dwarf2 + before mdebug. + +2001-01-26 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Return false + for non-default visibility. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise, but + delete ugly macro and replace with pretty function. + +2001-01-25 Mark Elbrecht + + * coff-go32.c: Update copyright. + * coff-stgo32.c: Likewise. + * coff-go32.c (COFF_LONG_FILENAMES): Define. + * coff-stgo32.c (COFF_LONG_FILENAMES): Likewise. + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Remove .bss entry. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2001-01-25 Kazu Hirata + + * bfd-in2.h: Rebuild. + * libbfd.h: Likewise. + +2001-01-23 H.J. Lu + + * bfd-in2.h: Rebuild. + +2001-01-23 H.J. Lu + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_buf) + is NULL or PRIV(vms_rec) is outside of the buffer. + +2001-01-23 Kazu Hirata + + * coff64-rs6000.c: Fix formatting. + * coff-arm.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-pmac.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * elf32.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sparc.c: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elfxx-ia64.c: Likewise. + + * aoutx.h: Fix formatting. + * bfd.c: Likewise. + * bfd-in2.h: Likewise. + * bfd-in.h: Likewise. + * cpu-i386.c: Likewise. + * cpu-m68hc11.c: Likewise. + * dwarf2.c: Likewise. + * elf64-x86-64.c: Likewise. + * format.c: Likewise. + * freebsd.h: Likewise. + * hash.c: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + +2001-01-22 Bo Thorsen + + * elf64-x86-64.c: Added PIC support for X86-64. + (elf64_x86_64_link_hash_newfunc): Function added. + (elf64_x86_64_link_hash_table_create): Likewise. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_gc_mark_hook): Likewise. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_discard_copies): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_finish_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Add relocation of PIC sections. + +2001-01-21 Maciej W. Rozycki + + * Makefile.am (install-data-local): Make use of $(DESTDIR). + * Makefile.in: Regenerate. + +2001-01-21 Kazu Hirata + + * coff-a29k.c: Fix formatting. + +2001-01-19 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Report files with bad + relocation section names. + (elf_i386_relocate_section): Report files with bad relocation + section names and return false. + +2001-01-17 Bo Thorsen + + * targets.c: Alphabetize list of xvecs. + +2001-01-14 Alan Modra + + * config.bfd: Add linux target variant for elfxx-hppa. + * configure.in: Recognize bfd_elf32_hppa_linux_vec and + bfd_elf64_hppa_linux_vec. + * configure: Regenerate. + * elf64-hppa.c: Include elf64-target.h again to support linux + target variant. + (elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux. + * elf32-hppa.c: Include elf32-target.h again to support linux + target variant. + (elf32_hppa_post_process_headers): New function. + (elf_backend_post_process_headers): Define. + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and + bfd_elf32_hppa_linux_vec. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base, + and data_segment_base fields. + (elf32_hppa_link_hash_table_create ): Init them. + (elf32_hppa_check_relocs): Update comments. + (hppa_record_segment_addr): New function. + (elf32_hppa_relocate_section): Call it. + (final_link_relocate): Handle R_PARISC_SEGREL32. + (elf32_hppa_final_link): New function. + (bfd_elf32_bfd_final_link): Define to call it. + (hppa_unwind_entry_compare): New function. + * cache.c (bfd_open_file): Create files in write+read mode. + + * elf-hppa.h (elf_hppa_howto_table): Set bitsize value for + SEGREL32 and numerous other relocs. Change duplicate + R_PARISC_NONE relocs to R_PARISC_UNIMPLEMENTED. + + * opncls.c (bfd_fdopenr): Add parens like the comment says around + O_ACCMODE. + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Don't create + .plt entries for DT_INIT and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Remove special handling of + DT_INIT and DT_FINI. + + * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use 16-bit + offsets for stub .plt access if wide mode. Check offset in range. + +2001-01-13 Nick Clifton + + * elf32-fr30.c (fr30_elf_howto_table): Remove spurious blank + line. + + * coffcode.h (coff_canonicalize_reloc): Remove spurious blank + line. + +2001-01-12 Alan Modra + + * configure.in ([bfd_elf64_x86_64_vec]): Set target64. + * configure: Regenerate. + +2001-01-11 Peter Targett + + * bfd-in2.h (bfd_architecture): Add bfd_mach_arc_5, + bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8 for ARC variants. + * cpu-arc.c (arch_info_struct): Add entries for variants. + (bfd_arc_arch) Set default to bfd_mach_arc_5. + (arc_get_mach) Don't assume machine names prefixed arc- before + testing. + * elf32-arc.c (arc_elf_object_p): Set machine number based on new + selections. + (arc_elf_final_write_processing) Likewise. + (ELF_MACHINE_CODE) Use EM_ARC. + +2001-01-10 Nick Clifton + + * coff-arm.c (LOCAL_LABEL_PREFIX): Change definition to "". + +2001-01-07 Philip Blundell + + * README: Replace `bug-gnu-utils@gnu.org' with + `bug-binutils@gnu.org'. + +2001-01-04 Kazu Hirata + + * som.c: Fix formatting. + +2001-01-03 Kazu Hirata + + * ecoffswap.h: Fix formatting. + * elf-bfd.h: Likewise. + * elfarm-nabi.c: Likewise. + * elfarm-oabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * libbfd.c: Likewise + * linker.c: Likewise. + * lynx-core.c: Likewise. + +2001-01-02 Kazu Hirata + + * pc532-mach.c: Fix formatting. + * pe-arm.c: Likewise. + * pe-i386.c: Likewise. + * pe-mips.c: Likewise. + * pe-ppc.c: Likewise. + * pe-sh.c: Likewise. + * pei-mips.c: Likewise. + * pei-sh.c: Likewise. + * peicode.h: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + +2001-01-01 Kazu Hirata + + * reloc.c: Fix formatting. + * riscix.c: Likewise. + * rs6000-core.c: Likewise. + * xcoff-target.h: Likewise. + +2000-12-29 Hans-Peter Nilsson + + * elfcode.h (elf_object_p): Also restore the bfd mach field on + error, by calling bfd_default_set_arch_mach with incoming + values. + +2000-12-26 Kazu Hirata + + * vaxnetbsd.c: Fix formatting. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-misc.c: Likewise. + +2000-12-25 Alexandre Oliva + + * archive.c (coff_write_armap): Don't write more than symbol_count + `archive_member_file_ptr's. + +2000-12-25 Kazu Hirata + + * vms-tir.c: Fix formatting. + +2000-12-23 Kazu Hirata + + * vms.c: Fix formatting. + * vms.h: Likewise. + +2000-12-21 Santeri Paavolainen + + * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined. + + * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM. + + * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *) + arithmetic. + + * elf32-fr30.c: Add casts to avoid (void *) arithmetic. + + * coffcode.h (styp_to_sec_flags): Add empty statement after label. + +2000-12-21 Richard Sandiford + + * libbfd.c (bfd_get_bits): Added + (bfd_put_bits): Likewise + * bfd-in.h: Declared the above. + * bfd-in2.h: Regenerated. + +2000-12-20 Kazu Hirata + + * targets.c: Fix formatting. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + +2000-12-19 Kazu Hirata + + * sco5-core.c: Fix formatting. + * section.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * sparcnetbsd.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * stab-syms.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * sysdep.h: Likewise. + +2000-12-18 Nick Clifton + + * coff-arm.c (EXTRA_S_FLAGS): Only define if not already + defined. + * epoc-pe-arm.c (EXTRA_S_FLAGS): Define. + * epoc-pei-arm.c (EXTRA_S_FLAGS): Define. + +2000-12-18 Nick Clifton + + * vms-misc.c (_bfd_vms_get_record): Add default case to + file_format switch. + +2000-12-15 Miloslav Trmac + + * elfcore.h (elf_core_file_p): Move to the start of the program + headers before attempting to read them. + +2000-12-14 Kazu Hirata + + * peigen.c: Fix formatting. + * som.c: Likewise. + * som.h: Likewise. + +2000-12-13 Kazu Hirata + + * peigen.c: Fix formatting. + +2000-12-12 Jim Wilson + + * elfxx-ia64.c (get_dyn_sym_info): Cast %p argument to void *. + +2000-12-08 Mark Salter + + * binary.c (binary_set_section_contents): Ignore sections + with zero size. + +2000-12-12 Kazu Hirata + + * m68klinux.c: Fix formatting. + * m68knetbsd.c: Likewise. + * mipsbsd.c: Likewise. + * netbsd-core.c: Likewise. + * netbsd.h: Likewise. + * newsos3.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * nlm-target.h: Likewise. + * ns32knetbsd.c: Likewise. + +2000-12-10 Fred Fish + + * elflink.h (elf_link_output_extsym): Don't complain about undefined + symbols in shared objects if allow_shlib_undefined is true. + +2000-12-12 Nick Clifton + + * cpu-sh.c: Fix formattng. + * elf.c: Fix formattng. + * elf32-mips.c: Fix formattng. + * elf32-sh.c: Fix formattng. + * elf64-alpha.c: Fix formattng. + +2000-12-09 Nick Clifton + + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + * elf32-arm.h (elf32_arm_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + +2000-12-08 Mark Elbrecht + + * Makefile.am (BFD32_BACKENDS): Move dwarf2.lo from here... + (BFD_LIBS): ...to here. + (BFD32_BACKENDS_CFILES): Move dwarf2.c from here... + (BFD_LIBS_CFILES): ...to here. + * Makefile.in: Regenerate. + * configure.in: Remove dwarf.lo from the elf shell variable. + * configure: Regenerate. + * libcoff-in.h (coff_tdata): Add pointer dwarf2_find_line_info. + * libcoff.h: Regenerate. + * coffgen.c (coff_find_nearest_line): Call + _bfd_dwarf2_find_nearest_line. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add parameter. Update + accordingly. + (read_abbrevs): Likewise + (decode_line_info): Likewise. + (parse_comp_unit): Likewise. + (comp_unit_find_nearest_line): Likewise. + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. + * libbfd.h: Regenerate. + * elf.c (_bfd_elf_find_nearest_line): Update call. + * elf-bfd.h (elf_obj_tdata): Change dwarf2_find_line_info to type PTR. + * dwarf2.c (concat_filename): Use IS_ABSOLUTE_PATH. + * coffcode.h (STYP_XCOFF_DEBUG, STYP_DEBUG_INFO): New macros. + (sec_to_styp_flags): Use them. Handle DWARF2 sections. + (styp_to_sec_flags): Handle DWARF2 sections. + * elf32-arm.h (elf32_arm_find_nearest_line): Add parameter to call + to _bfd_find_nearest_line. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Add parameter to + call to _bfd_find_nearest_line. + +2000-12-08 Kazu Hirata + + * coffgen.c: Fix formatting. + * elf-m10300.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-sparc.c: Likewise. + +2000-12-07 Kazu Hirata + + * elf32-ppc.c: Fix formatting. + * elf64-x86-64.c: Likewise. + +2000-12-06 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit + BFDs containing no sections or empty .text, .data or .bss sections + to be merged, regardless of their flags. + +2000-12-06 Kazu Hirata + + * elf32-m32r.c: Fix formatting. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + +2000-12-05 Kazu Hirata + + * elf32-fr30.c: Fix formatting. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + +2000-12-03 Kazu Hirata + + * elf32-arm.h: Fix formatting. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-d30v.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + +2000-12-01 Chris Demetriou + + * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mips32 and + bfd_mach_mips32_4k. Update FIXME comment. + * archures.c (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * bfd-in2.h (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * cpu-mips.c (I_mips32): New constant. + (I_mips4K, I_mips32_4k): Rename the former to the latter. + (arch_info_struct): Add bfd_mach_mips32 entry, replace + bfd_mach_mips4K entry with bfd_mach_mips32_4k entry. + * elf32-mips.c (elf_mips_isa): Add E_MIPS_ARCH_32 case. + (elf_mips_mach): Likewise. Also, replace E_MIPS_MACH_MIPS32 + with E_MIPS_MACH_MIPS32_4K. + (_bfd_mips_elf_final_write_processing): Replace + bfd_mach_mips4K with bfd_mach_mips32_4k case, add + bfd_mach_mips32 case. + (_bfd_mips_elf_merge_private_bfd_data): Generalize ISA mixing + comparison with support for MIPS32. + (_bfd_mips_elf_print_private_bfd_data): Print ISA name for + MIPS32. + + * aoutx.h (NAME(aout,machine_type)): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + * archures.c (bfd_mach_mips5, bfd_mach_mips64): New constants. + * bfd-in2.h (bfd_mach_mips5, bfd_mach_mips64): Likewise. + * cpu_mips.c (I_mips5, I_mips64): New definitions. + (arch_info_struct): Add entries for bfd_mach_mips5 and + bfd_mach_mips64. + * elf32-mips.c (elf_mips_isa, elf_mips_mach, + _bfd_mips_elf_print_private_bfd_data): Add cases for + E_MIPS_ARCH_5 and E_MIPS_ARCH_64. + (_bfd_mips_elf_final_write_processing): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + + * aoutx.h (NAME(aout,machine_type)): Add a + bfd_mach_mips_sb1 case. + * archures.c (bfd_mach_mips_sb1): New constant. + * bfd-in2.h (bfd_mach_mips_sb1): New constant. + * cpu-mips.c (I_sb1): New constant. + (arch_info_struct): Add entry for bfd_mach_mips_sb1. + * elf32-mips.c (elf_mips_mach): Add case for + E_MIPS_MACH_SB1. + (_bfd_mips_elf_final_write_processing): Add case for + bfd_mach_mips_sb1. + +2000-12-01 Joel Sherrill + + * config.bfd (arm-*-rtems*, a29k-*rtems*): New targets. + (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. + (sparc*-*-rtems*): Switched from a.out to ELF. + +2000-11-30 Jan Hubicka + + * Makefile.am (BFD64_BACKENDS): Add elf64-x86-64.lo + BFD64_BACKENDS_CFILES): Add elf64-x86-64.c + (elf64-x86-64.lo): Add dependencies. + * archures.c (DESCRIPTION): Add bfd_mach_x86_64, + bfd_mach_x86_64_intel_syntax. + * elf.c (prep_headers): Use EM_x86_64 for 64bit output. + * config.bfd (x86_64): Add. + * configure.in: Add support for bfd_elf64_x86_64_vec. + * cpu-i386.c (bfd_x86_64_arch_intel_syntax, bfd_x86_64_arch): Add. + (bfd_i386_arch, i8086_ar): Link in. + * elf64-x86-64.c: New file. + * reloc.c (ENUMDOC): Add BFD_RELOC_X86_64*. + * targets.c (bfd_elf64_x86_64_vec): Add. + (bfd_target_vect): Add bfd_elf64_x86_64_vec. + +2000-11-30 Kazu Hirata + + * xcofflink.c: Fix formatting. + +2000-11-28 Kazu Hirata + + * aoutx.h: Fix formatting. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * cache.c: Likewise. + * cisco-core.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffswap.h: Likewise. + * corefile.c: Likewise. + * elf32-mips.c: Likewise. + +2000-11-27 Kazu Hirata + + * aout-adobe.c: Fix formatting. + * coff64-rs6000.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + +2000-11-27 Philip Blundell + + * libcoff-in.h (coff_tdata): Add `strings_written' flag. + (obj_coff_strings_written): New accessor macro for above. + * libcoff.h: Regenerate. + * cofflink.c (_bfd_coff_final_link): Say that we wrote the + strings. + * coffcode.h (coff_write_object_contents): No need to write out + the string table if it's already been done. + +2000-11-22 Philip Blundell + + * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to + weak undefined symbols. + +2000-11-24 Nick Clifton + + * archures.c (bfd_mach_arm_5TE): Define. + (bfd_mach_arm+XScale): Define. + * bfd-in2.h: Regenerate. + + * coff-arm.c (coff_arm_reloc_type_lookup): Accept + BFD_RELOC_ARM_PCREL_BLX. + + * coffcode.h (coff_set_flags): Set flags for 5t, 5te and + XScale machine numbers. + + * config.bfd (xscale-elf): Add target. + (xscale-coff): Add target. + + * cpu-arm.c: Add xscale machine name. + Add v5t, v5te and XScale machine numbers. + +2000-11-23 Kazu Hirata + + * aix386-core.c: Fix formatting. + +2000-11-22 Jim Wilson + + * coff-ia64.c (howto_table): Use EMPTY_HOWTO. + (in_reloc_p): Add ATTRIBUTE_UNUSED to unused parameters. + * cpu-ia64-opc.c (ins_rsvd, ext_rsvd, ins_const, ext_const): Likewise. + (ins_imms_scaled): Initialize sign_bit at function entry. + (elf64_ia64_operands): Add missing initializers. + * elfxx-ia64.c (elfNN_ia64_reloc, elfNN_ia64_reloc_type_lookup, + elfNN_ia64_info_to_howto, elfNN_ia64_fake_sections, + elfNN_ia64_add_symbol_hook, elfNN_ia64_is_local_label_name, + elfNN_ia64_local_hash_table_init, get_fptr, get_pltoff, + elfNN_ia64_adjust_dynamic_symbol): Add ATTRIBUTE_UNUSED for unused + parameters. + (elfNN_ia64_info_to_howto): Initialize free_relocs, free_contents, + and free_extsyms at function entry. + (elfNN_add_symbol_hook): Add unsigned cast to bfd_get_gp_size result. + (elfNN_ia64_create_dynamic_sections): Delete unused local h. + (get_got): Delete unused local srel. + (elfNN_ia64_check_relocs): Initialize dynrel_type when declared. + (elfNN_ia64_relocate_section): Delete unused local dynindx. + +2000-11-21 Kazu Hirata + + * coff-a29k.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i960.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-w65.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + +2000-11-21 Nick Clifton + + * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and + remove possibility of infinite loop. + +2000-11-20 Kazu Hirata + + * aix386-core.c: Fix formatting. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + +2000-11-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create + pltoff entries for DT_INIT and DT_FINI. + (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries. + (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI + entries. + +2000-11-16 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relocate_section): Likewise. Set REL addends correctly. + (set_pltoff_entry): Likewise. + (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB + (elfNN_ia64_reloc_type_lookup): Likewise. + (elfNN_ia64_install_value): Likewise. + (elfNN_ia64_relocate_section): Likewise. + * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove. + (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove. + +2000-11-16 Kazu Hirata + + * cpu-a29k.c: Fix formatting. + * cpu-alpha.c: Likewise. + * cpu-arm.c: Likewise. + * cpu-avr.c: Likewise. + * cpu-d10v.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-i370.c: Likewise. + * cpu-i386.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-ia64-opc.c: Likewise. + * cpu-ia64.c: Likewise. + * cpu-m32r.c: Likewise. + * cpu-m68hc11.c: Likewise. + * cpu-m68hc12.c: Likewise. + * cpu-m68k.c: Likewise. + * cpu-m88k.c: Likewise. + * cpu-mips.c: Likewise. + * cpu-ns32k.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-powerpc.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-sparc.c: Likewise. + * cpu-tic54x.c: Likewise. + * cpu-v850.c: Likewise. + * cpu-vax.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-we32k.c: Likewise. + * cpu-z8k.c: Likewise. + * dwarf1.c: Likewise. + * dwarf2.c: Likewise. + +2000-11-15 Kazu Hirata + + * coff-arm.c: Fix formatting. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-we32k.c: Likewise. + * coff-z8k.c: Likewise. + +2000-11-15 Richard Henderson + + * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc + section with the same ALLOC|LOAD flags as the source section. + +2000-11-14 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used + by STO_ALPHA constants. + +2000-11-14 Kazu Hirata + + * coff-pmac.c: Fix formatting. + * coff-ppc.c: Likewise. + +2000-11-13 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Also add indirect + symbols for common symbols with the default version. + +2000-11-09 Philip Blundell + + * section.c (STD_SECTION): Set gc_mark flag. + +2000-11-11 Kazu Hirata + + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + +2000-11-11 Bernd Schmidt + + * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs. + +2000-11-10 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + +2000-11-09 Kazu Hirata + + * archive.c: Fix formatting. + * archures.c: Likewise. + +2000-11-07 Richard Henderson + + * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec. + Set it before bfd_elf64_bfd_final_link call. Use it after the call. + * section.c (bfd_set_section_contents): Call memcpy if + section->contents set and location not equal to contents plus offset. + +2000-11-08 Kazu Hirata + + * bfd-in.h: Fix formatting. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-apollo.c: Likewise. + * coff-aux.c: Likewise. + +2000-11-07 Kazu Hirata + + * aix386-core.c: Fix formatting. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archures.c: Likewise. + * armnetbsd.c: Likewise. + +2000-11-07 Alan Modra + + * coff-h8300.c (special): Adjust reloc address. + +2000-11-06 Steve Ellcey + + * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines + to differentiate elf32 and elf64 on ia64. + * bfd-in2.h: Regenerate. + * config.bfd: Add target for "ia64*-*-hpux*". + * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch. + * configure: Regenerate. + * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure. + * targets.c: Add bfd_target bfd_elf32_ia64_big_vec. + + * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects + from elfxx-ia64.c. Add depenency rules for making elf32-ia64.lo. + * Makefile.in: Regnerate. + * elf64-ia64.c: Deleted. + * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c. + +2000-11-06 Kazu Hirata + + * aout-adobe.c: Fix formatting. + * aout-arm.c: Likewise. + * aout-cris.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + +2000-11-05 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit + BFDs containing no sections to be merged, regardless of their flags. + +2000-11-04 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Suppress error message + if a relocation for an undefined symbol also results in an + overflow. + +2000-11-06 Christopher Faylor + + * config.bfd: Add support for Sun Chorus. + +2000-11-05 David O'Brien + + * configure.in: Recognize alpha-*-freebsd*. + * configure: Regenerate. + +2000-11-02 Luciano Gemme + + * srec.c (CHUNK): Rename to DEFAULT_CHUNK. + (Chunk): New global variable set by a parameter in objcopy.c. + (S3Forced): New global variable set by a parameter in + objcopy.c. + (srec_set_section_contents): If S3Forced is true, always generate + S3 records. + (srec_write_section): Use 'Chunk' to limit maximum length of S + records. + +2000-11-02 Per Lundberg + + * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * po/bfd.pot: Regenerate. + +2000-10-31 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle + EF_SOFT_FLOAT if it is defined. + +2000-10-27 Philip Blundell + + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse + attempts to mix PIC code with non-PIC, just mark the output as + being position dependent. + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for + all mismatches, not just the first one. + +2000-10-25 Chris Demetriou + + * ieee.c (ieee_archive_p): Plug one of many possible + memory leaks in error handling. + +2000-10-20 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data, + elf32_sparc_object_p, elf32_sparc_final_write_processing): + Support v8plusb. + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data, + sparc64_elf_object_p): Support v9b. + * archures.c: Declare v8plusb and v9b machines. + * bfd-in2.h: Ditto. + * cpu-sparc.c: Ditto. + +2000-10-16 Geoffrey Keating + + * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location + of a GOT reloc. + + * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro. + (SYMBOL_CALLS_LOCAL): New macro. + (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. + (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_relocate_section): Use flag variable to determine + whether the relocation refers to a local symbol. + Test whether a PLTREL24 reloc will produce a reloc by looking + to see whether a PLT entry was made. + +2000-10-14 Geoffrey Keating + + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2000-10-13 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument + local_p. Add symbol value only for non-R_MIPS_REL32 relocations + against local symbols. + (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01. + +2000-10-12 Alan Modra + + * section.c (struct sec): Add kept_section. + (struct bfd_comdat_info): Remove sec, we can use above. + (STD_SECTION): Add initializer. + (bfd_make_section_anyway): Init here too. + + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_add_object_symbols): Remove unnecessary + zeroing of `flags'. + (elf_link_input_bfd): Set all asection->symbol->value's here, and + fudge values for discarded link-once section symbols. + + * elf64-hppa.c: Include alloca-conf.h + +2000-10-11 Alan Modra + + * elf.c (swap_out_syms): Revert 2000-10-07 changes. + + * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg. + +2000-10-10 Alan Modra + + * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc. + +2000-10-10 Tom Rix + + * section.c (bfd_make_section_anyway): Release newsect ptr when + newsect->symbol fails to alloc. Use bfd_release instead of free. + +2000-10-09 Richard Henderson + + * elflink.h (size_dynamic_sections): Don't create various tags if + .dynstr is excluded from the link. Don't set first dynsym entry + if dynsymcount is zero. + (elf_bfd_final_link): Don't try to swap out dynamic syms if + .dynsym excluded from the link. Don't try to write any dynamic + sections excluded from the link. + + * elf.c (swap_out_syms): Handle global section symbols. + +2000-10-05 DJ Delorie + + * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs + * coffcode.h (coff_set_alignment_hook): read extended reloc count + (coff_write_relocs): write extended reloc count + (coff_write_object_contents): account for extended relocs + +2000-10-05 Jim Wilson + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags + field. + * elf.c (_bfd_elf_make_section_from_shdr): Call the + elf_backend_section_flags function. + * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion + code. + (elf64_ia64_section_flags): New function containing flag conversion + code. + (elf_backend_section_flags): Define to elf64_ia64_section_flags. + * elfxx-target.h (elf_backend_section_flags): Define. + (elfNN_bed): Initialize elf_backend_section_flags field. + +2000-10-02 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to + _bfd_elf32_gc_record_vtable. Correct a comment. + +2000-10-01 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld + produces binaries with got[1] = 0x80000001 to differenciate them + for the dynamic linker from the broken binaries produced by old + versions. + +2000-09-30 Petr Sorfa + + * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t. + (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t. + * configure.in: Add check for pxstatus_t and lwpxstatus_t. + * configure: Regenerate. + +2000-09-27 Hans-Peter Nilsson + + Define two bfd_targets for absence and presence of leading + underscore on symbols. Make sure to only link same kind. + * elf32-cris.c (cris_elf_object_p, + cris_elf_final_write_processing, cris_elf_print_private_bfd_data, + cris_elf_merge_private_bfd_data): New. + (elf_backend_object_p, elf_backend_final_write_processing, + bfd_elf32_bfd_print_private_bfd_data, + bfd_elf32_bfd_merge_private_bfd_data): Define. + : Include elf32-target.h twice with + different macro settings: + (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as + bfd_elf32_us_cris_vec. + (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris". + (elf_symbol_leading_char): First as 0, then '_'. + (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h. + * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector. + * configure: Regenerate. + * targets.c: Declare bfd_elf32_us_cris_vec. + * po/bfd.pot: Regenerate. + +2000-09-29 Momchil Velikov + + * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for + R_ARM_THM_PC22 relocations. + +2000-09-29 NIIBE Yutaka + + * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath. + +2000-09-29 Momchil Velikov + + * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if + is has the SEC_HAS_CONTENTS flag set. + +2000-09-28 Örjan Friberg + Hans-Peter Nilsson + + * aout-cris.c (N_TXTADDR): Define. + +2000-09-28 John David Anglin + + * som.c: Include alloca-conf.h. + * Makefile.am: "make dep-am" + * Makefile.in: Regenerate. + +2000-09-27 Alan Modra + + * elf32-hppa.c (plt_stub): New. + (PLT_STUB_ENTRY): Define. + (elf32_hppa_link_hash_table): Change multi_subspace to packed + boolean. Add need_plt_stub, has_12bit_branch and has_17bit_branch. + (elf32_hppa_link_hash_table_create): Init to suit. + (elf32_hppa_check_relocs): Set has_12bit_branch and + has_17bit_branch as appropriate. + (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for + non-local functions. + (elf32_hppa_size_dynamic_sections): Correct setting of reltext. + Add space for plt_stub as needed. + (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global + functions at plt_stub. + (elf32_hppa_finish_dynamic_sections): Write plt_stub. + (elf32_hppa_create_dynamic_sections): Leave .plt executable. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. Use it instead + of fixed size, and if negative, disable handling of input sections + before stub section. Set up default stub group size depending + on detected branch relocs. + (hppa_build_one_stub): Use lrsel and rrsel for import stubs to + ensure different offsets from sym_value aren't rounded to + different 2k blocks. Use lrsel and rrsel for other stubs too for + consistency rather than necessity. + (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F. + (final_link_relocate): Likewise. + (elf32_hppa_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc. + (_bfd_elf_hppa_gen_reloc_type): Generate them. + (elf_hppa_final_link_relocate): Handle them. + (elf_hppa_relocate_insn): Likewise. + (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases. + +2000-09-26 Hans-Peter Nilsson + + * elfcode.h (elf_object_p): Preserve and clear abfd section + information. Restore at error. + +2000-09-26 Paul Sokolovsky + + * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory + is empty, make sure that its rva also 0. NT loader dislikes + having otherwise. + +2000-09-26 Steve Ellcey + + * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols + global by default. + +2000-09-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in + currently unused RELATIVE_DYNAMIC_RELOCS code. + (hppa_discard_copies): Likewise. + (elf32_hppa_size_stubs): Size `input_list' array correctly. Correct + comments. Don't check non-code output sections for stub grouping. + +2000-09-20 Alan Modra + + * section.c (bfd_get_unique_section_name): Return NULL if + bfd_malloc fails. + +2000-09-19 Michael Sokolov + + * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0 + instruction sequence to actually work. + (elf_m68k_finish_dynamic_sections): Change the patch-in offset + accordingly. + +2000-09-18 Alexandre Oliva + + * elf32-sh.c (sh_elf_relocate_section): Use + _bfd_final_link_relocate to apply the relocation against a section + symbol, when doing relocatable links. + +2000-09-18 Alan Modra + + * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section + to id_sec. + (stub_hash_newfunc): Here too. + (hppa_add_stub): And here. + (elf32_hppa_link_hash_table): Remove stub_section_created, + reloc_section_created, first_init_sec and first_fini_sec. Add + stub_group. + (elf32_hppa_link_hash_table_create): Init to suit. + (hppa_get_stub_entry): Add support for grouping stub sections. + (hppa_add_stub): Likewise. Remove sec_count param and init/fini + section code. Index stub vars by section->id. + (elf32_hppa_size_stubs): Likewise. Remove duplicated function + exit paths. Zap allocation of above removed vars. Refine + link-once test. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table + rather than pointer to bfd_link_info. + (hppa_add_stub): Likewise. + (final_link_relocate): Likewise. + +2000-09-17 David Huggins-Daines + + (elf32_hppa_size_stubs): Don't try to build stubs for discarded + link-once sections. + +2000-09-16 Alexandre Oliva + + * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match + ld/emulparams/shelf.sh. + +2000-09-10 Michael Sokolov + + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-09-15 Kenneth Block + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs + LITUSE relocations incorrectly if -relax is specified on the ld + command line and the displacement field of the load or store + instruction is non-zero. (Patch by paul.winalski@compaq.com) + +2000-09-15 Alan Modra + + * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and + first_fini_sec here. + (elf32_hppa_size_stubs): Instead correctly find the first .init + and .fini section here. + +2000-09-15 David Huggins-Daines + + * elf32-hppa.c (clobber_millicode_symbols): New function. + (elf32_hppa_size_dynamic_sections): Call it. + +2000-09-14 Alan Modra + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call + packed. Add plabel, plt_abs packed booleans. + (hppa_link_hash_newfunc): Init new fields. + (PLABEL_PLT_ENTRY_SIZE): Define. + (hppa_stub_name): Use size_t len vars. + (hppa_add_stub): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_build_one_stub): Kill some compiler warnings. + (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs + if dynamic linking. Munge the local plt offsets into + local_got_refcounts. Set h->plabel for all global PLABELs. Use + size_t len vars. Add assert for plabel addend. + (elf32_hppa_gc_sweep_hook): Sweep local plt entries too. + (elf32_hppa_hide_symbol): New function. + (elf_backend_hide_symbol): Define. + (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries + with h->plabel set. Don't make plt entries to have dynamic syms + when they have been forced local. If plt entry is used by a + plabel, make it PLABEL_PLT_ENTRY_SIZE. + (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns. + Set up .plt offsets for local syms. + (elf32_hppa_relocate_section): Initialise plt entries for local + syms. Leave weak undefined plabels zero. Make global plabel + relocs against function symbol, and leave the addend zero. + Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for + non-dynamic syms. Init extra plt for plabels. Use *ABS* DIR32 + relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry. + (elf_backend_got_header_size): Adjust. + (elf32_hppa_set_gp): Calculate an "ideal" LTP. + + * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define. + (hppa_type_of_stub): Use it instead of #if 0 + (hppa_discard_copies): Use it here too. + (elf32_hppa_size_dynamic_sections): And here. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field. + (elf32_hppa_link_hash_table_create): And here. + (hppa_build_one_stub): And here. Instead keep track of stub + offset using _raw_size. + (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_size_one_stub): Likewise. Resize reloc section too. + + * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and + first_fini_sec handling. Don't search for reloc section or set + hplink->reloc_section_created here. + (elf32_hppa_size_stubs): Instead search for reloc sections, and + set reloc_section_created here. + (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT. + (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT + and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI. + + * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)' + with `hplink->root.'. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_gc_sweep_hook): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (hppa_handle_PIC_calls): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_set_gp): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + + From David Huggins-Daines + * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for + defined weak symbols in shared links. + (final_link_relocate): Calls to defined weak symbols in shared + objects must go via import stubs, as the target might not be known + at link time. + +2000-09-14 Alexandre Oliva + + * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32, + R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE, + R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167. Replaced + the original entries with EMPTY_HOWTOs, and added new ones to fill + in the gap. + (sh_elf_info_to_howto): Make sure the new gap isn't used. + (sh_elf_relocate_section): Likewise. + +2000-09-13 Anders Norlander + + * cpu-mips.c (arch_info_struct): Add mips:4K + * bfd-in2.h (bfd_mach_mips4K): New define. + * archures.c: Add bfd_mach_mips4K to comment. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return + E_MIPS_ARCH_2 for bfd_mach_mips4K. + +2000-09-13 Marco Franzen + + * som.c (som_write_symbol_strings): Do not used fixed buffers, + use size_t as a counter. + (som_write_space_strings): Similarly. + +2000-09-12 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc26): New function + and prototype. + (elf32_i860_relocate_section): Invoke new function from here. + +2000-09-11 Michael Sokolov + + * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names + static. + +2000-09-10 Michael Sokolov + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for + target section name instead of dumping core when the target symbol is + undefined. + +2000-09-09 Kazu Hirata + + * riscix.c: Remove DEFUN. + +2000-09-08 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not + initialise flags in output bfd if the input bfd is the default + architecture with the default flags. + +2000-09-08 Kazu Hirata + + * archive.c: Fix formatting. + * coff-arm.c: Likewise. + * doc/chew.c: Likewise. + +2000-09-08 Alan Modra + + * section.c (bfd_get_unique_section_name): Put a dot before the + numeric suffix. + +2000-09-07 Kazu Hirata + + * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. + * elf.c: Fix formatting. + +2000-09-07 Alexandre Oliva + + * config.bfd (sh-*-linux*): Added. + * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. + * targets.c: Declare them. + * elf32-sh-lin.c: New file. + * Makefile.am: Compile it. + * elf32-sh.c: Don't override defines from elf32-sh-lin.c. + * configure, Makefile.in: Rebuilt. + +2000-09-06 Geoffrey Keating + + * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss + pseduo-section when determining where the TOC ends. + + * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to + output x_tvndx as it is only two bytes wide. + + * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute + reloc is 26 or 32 bits wide. + + * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant + for relocs that don't change anything. Also look at the full + 6 bits of bitsize. + +2000-09-06 Philip Blundell + + * config.bfd (arm*-*-uclinux*): New target. + +2000-09-06 Alexandre Oliva + + * configure: Rebuilt with new libtool.m4. + +2000-09-06 Alan Modra + + * section.c (bfd_get_unique_section_name): Avoid c++ reserved + word for variable name. + * bfd-in2.h: Regenerate. + +2000-09-05 Nick Clifton + + * config.in: Regenerate. + * libbfd.h: Regenerate. + * po/bfd.pot: Regenerate. + * doc/bfdint.texi: Remove CVS date string - it foils compares with + local versions. + +2000-09-05 Steven Johnson + + * cpu-powerpc.c (arch_info_struct): Added MPC860 Family entry. + +2000-09-05 Alan Modra + + Shared library and PIC support. + * elf32-hppa.c (PLT_ENTRY_SIZE): New. + (GOT_ENTRY_SIZE): New. + (ELF_DYNAMIC_INTERPRETER): New. + (STUB_SUFFIX): Define. + (LONG_BRANCH_PIC_IN_SHLIB): Define. + (RELATIVE_DYNAMIC_RELOCS): Define. + (enum elf32_hppa_stub_type): New. + (struct elf32_hppa_stub_hash_entry): Rename offset to + stub_offset. Add a number of new fields. + (struct elf32_hppa_link_hash_entry): New. + (struct elf32_hppa_link_hash_table): Add numerous fields. Remove + global_value. + (elf32_hppa_hash_table): Rename to hppa_link_hash_table. + (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup. + (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init + new fields. + (hppa_link_hash_newfunc): New function. + (elf32_hppa_link_hash_table_create): Use above function. Init new + fields. + (elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc + instead of addend, and remove sym_name from args. Don't use + symbol name for local syms, instead use sym index. + (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return + stub type rather than size. Pass in hash and handle import stub + case. Also pass in reloc instead of offset so we can calculate + PCREL22F and PCREL12F branches properly. + (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build + import and export stubs too. + (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle + import and export stub sizing. + (elf32_hppa_check_relocs): New function. + (elf32_hppa_adjust_dynamic_symbol): New function. + (hppa_discard_copies): New function. + (elf32_hppa_size_dynamic_sections): New function. + (elf_backend_size_dynamic_sections): Define. + (elf32_hppa_finish_dynamic_symbol): New function. + (elf_backend_finish_dynamic_symbol): Define. + (elf32_hppa_size_stubs): Stash params in link hash table, and move + some local vars into the link hash table too. For shared links, + trundle over function syms, generating export stubs. Handle + PCREL22F branches. Break out stub creation code from here.. + (hppa_add_stub): .. to here. New function. + (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't + call the bfd linker. Use elf_gp to record global pointer. + Calculate a value from sections if $global$ is missing. + (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link. + (elf32_hppa_gc_mark_hook): New function. + (elf_backend_gc_mark_hook): Define. + (elf32_hppa_gc_sweep_hook): New function. + (elf_backend_gc_sweep_hook): Define. + (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate. + Add rel to args, and remove howto, input_bfd, offset, addend, + sym_name as we can recalculate these locally. Handle calls to + dynamic objects, extra PIC relocs, PCREL22F branches. Change + handling of undefined weak syms. Check that stubs are in range. + Only look for import stubs on PCREL17F and PCREL22F relocs. Add + message on hitting a DPREL21L reloc that needs fixing. Subtract + off PC for PCREL14F. Break out code that does a stub lookup from + here.. + (hppa_get_stub_entry): ..to here. New function. + (elf32_hppa_relocate_insn): Merge into final_link_relocate. + (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic + relocs, etc. etc. + (elf32_hppa_finish_dynamic_sections): New function. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_final_write_processing) Define. + (hppa_handle_PIC_calls): New function. + (elf32_hppa_build_stubs): Call it. Pass link_info to + hppa_build_one_stub. + (elf32_hppa_create_dynamic_sections): New function + to create .plt and .got then set .plt flags correctly. + (elf_backend_create_dynamic_sections): Define. + (elf32_hppa_object_p): New function. + (elf_backend_object_p): Define. + (elf32_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf_backend_can_gc_sections): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_plt_alignment): Set to 2. + (elf_backend_plt_readonly): Define. + (elf_backend_want_plt_sym): Define. + (elf_backend_got_header_size): Reserve one entry. + + * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd. + (elf32_hppa_size_stubs): Pass in multi_subspace. + (elf32_hppa_set_gp): Declare. + + * section.c (SEC_HAS_GOT_REF): Define new flag for asection. + (bfd_get_unique_section_name): New function. + * bfd-in2.h: Regenerate. + + * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F. + (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc + comment. + + From David Huggins-Daines + * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning. + (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx. + (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has + been updated in finish_dynamic_symbol before modifying function + symbol. + + * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of + eight entries. Replace NULL with bfd_elf_generic_reloc. Add + R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F. + (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*. Add some + comments. Handle format == 12 for R_HPPA_PCREL_CALL. + (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F. + (elf_hppa_relocate_insn): Likewise. Reformat some comments. + (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32. + + From David Huggins-Daines + * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF + style of local labels as well. + +2000-09-03 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate + references to undefined symbols in debugging sections. + +2000-09-02 H.J. Lu + + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, + BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH + section. + +2000-09-02 Jason Eckhardt + + * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro. + (elf32_i860_is_local_label_name): New function and prototype. + +2000-09-02 Nick Clifton + + * configure.in: Increase version number to 2.10.91. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/bfd.pot: Regenerate. + +2000-09-02 Daniel Berlin + + * elf.c (_bfd_elf_make_section_from_shdr): Add + .gnu.linkobce.wi. to the list of debug section names. + +2000-09-02 Nick Clifton + + * dwarf2.c (find_debug_info): New function: Locate a section + containing dwarf2 debug information. + (bfd_dwarf2_find_nearest_line): Find all sections containing + debug information and include them in the stash. + +2000-09-01 Niibe Yutaka , Kaz Kojima , Alexandre Oliva + + * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT, + R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New. + (sh_reloc_map): Add new relocs. + (sh_elf_check_relocs, sh_elf_link_hash_newfunc, + sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol, + sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol, + sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New + functions. + (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define. + (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, + elf_sh_plt_entry_be, elf_sh_plt_entry_le, + elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): + New array constants. + (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry): + New variables. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, + elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset, + elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset, + elf_sh_plt_reloc_offset): Define. + (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry, + elf_sh_link_hash_table): New structs. + (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros. + (sh_elf_relocate_section, sh_elf_check_relocs): Handle new + relocation types. + (elf_backend_create_dynamic_sections, + bfd_elf32_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC): + New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + +2000-09-01 Alan Modra + + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27 + change. + +2000-08-31 J"orn Rennecke + + * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags + not initialized, set them to indicate the SH1 instruction set. + +2000-08-31 Alexandre Oliva + + * acinclude.m4: Include libtool and gettext macros from the + top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-29 Michael Snyder + + * elf.c: Eliminate references to __sparcv9 macro; replace with + autoconf variables HAVE_PSINFO32_T etc. + * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, + HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. + * config.in: Ditto. + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can + detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. + * aclocal.m4: Ditto. + * configure: Regenerate. + +2000-08-27 Alan Modra + + * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied + for any shared link, not just shared -Bsymbolic. + (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on + any shared link, and pass link info to it. + (elf_i386_size_dynamic_sections): Update comment. + (elf_i386_discard_copies): Modify to discard relocs for symbols + that have been forced local. + (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols + that have been forced local. + +2000-08-24 Denis Chertykov & Nick Clifton + + * elflink.h (elf_link_add_object_symbols): Allow common + symbols to have an alignment of 1 if explicitly requested, and + not overridden by other definitions. + +2000-08-22 Doug Kwan + + * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. + * coffcode.h (coff_set_flags): Add detection of w65 architecture. + +2000-08-22 H.J. Lu + + * elf-bfd.h (elf_link_hash_table): Add runpath. + + * bfd-in.h (bfd_elf_get_runpath_list): New prototype. + * bfd-in2.h: Rebuilt. + + * elf.c (_bfd_elf_link_hash_table_init): Initialize the + "runpath" field to NULL. + (bfd_elf_get_runpath_list): New function. + + * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and + DT_RUNPATH entries. + +2000-08-22 Alexandre Oliva + + * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W, + R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them + explicitly. Improve validation of r_type. + +2000-08-21 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the + dynamic allocated content space. Add a comment to remind us that + one day this ought to be fixed. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + +2000-08-21 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate + field with the newly relocated value instead of adding it to the + existing immediate field. + (elf32_i860_relocate_splitn): Likewise. + (elf32_i860_relocate_highadj): Likewise. + +2000-08-16 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it + was previously just a stub). + +2000-08-16 Alexandre Oliva + + * elflink.c (_bfd_elf_create_got_section): Don't abort(). + Formatting fixes. + (_bfd_elf_create_dynamic_sections): Likewise. + +2000-08-16 Andrew Macleod + + * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address + for undefined symbols to be the beginning of the section. + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate + four extra entries at the beginning of the .rela.plt section. + (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt + section to account for the four reserved entries in the .plt section. + +2000-08-15 Geoffrey Keating + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0 + to the list of NOPs we recognize after a branch-and-link. + Use the ori NOP when one is needed. + + * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation + for large archives. + +2000-08-14 Jim Wilson + + * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle + EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP. + (elf64_ia64_print_private_bfd_data): Likewise. Also handle + EF_IA_64_ABSOLUTE. + +2000-08-11 Alexandre Oliva + + * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static. + +2000-08-10 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_section): New function. + (i860_final_link_relocate): New function. + (elf32_i860_relocate_splitn): New function. + (elf32_i860_relocate_pc16): New function. + (elf32_i860_relocate_highadj): New function. + (elf32_i860_howto): Minor adjustments to some relocations. + (elf_info_to_howto_rel): Define. + (elf_backend_relocate_section): Define. + +2000-08-10 Nick Clifton + + * elf32-arm.h: Fix formatting. + +2000-08-10 Bernd Schmidt + + * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static. + +2000-08-08 Jason Eckhardt + + * elf32-i860.c (elf32_i860_howto_table): Updated some fields. + +2000-08-07 Kazu Hirata + + * ieee.c (ieee_write_debug_part): Rewrite a comment. + * elf64-ia64.c: Fix a typo. + +2000-08-05 Jason Eckhardt + + * elf32-i860.c (elf32_i860_howto_table): New structure. + (lookup_howto): New function. + (elf32_i860_reloc_type_lookup): New function. + (elf32_i860_info_to_howto_rela): New function. + (elf_code_to_howto_index): New structure. + (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela. + (bfd_elf32_bfd_reloc_type_lookup): Re-define as + elf32_i860_reloc_type_lookup. + +2000-08-04 Rodney Brown + + * som.c (struct fixup_format): Constify `format'. + (som_hppa_howto_table): Use SOM_HOWTO macro. + (try_prev_fixup, hppa_som_reloc): Decorate unused parameter. + (som_bfd_reloc_type_lookup): Likewise. + (compare_subspaces): Remove unused `count1', `count2'. + (som_begin_writing): Remove unused `total_reloc_size'. + (som_bfd_derive_misc_symbol_info): Decorate unused parameter. + (som_print_symbol, som_bfd_is_local_label_name): Likewise. + (som_set_reloc_info): Constify `cp'. Remove unused `addend'. + (som_find_nearest_line): Decorate unused parameter(s). + (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise. + (som_bfd_link_split_section): Likewise. + +2000-08-03 Nick Clifton + + * section.c: Restore backed out code. + * elf.c: Restore backed out code. + (copy_private_bfd_data): Fix bug preventing stipped dynamic + binaries from working. + * bfd-in2.h: Regenerate. + +2000-08-03 H.J. Lu + + * section.c: Back out the change made by Nick Clifton + on 2000-07-31. It breaks stripping dynamic + binaries. + * bfd-in2.h: Likewise. + * elf.c: Likewise. + +2000-08-03 Alexandre Oliva + + * elf32-sh.c (sh_elf_reloc_loop): Warning removal. + +2000-07-31 Jason Eckhardt + + * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-07-31 Nick Clifton + + * section.c (struct sec): Add new boolean field 'segment_mark'. + (STD_SECTION): Initialise new field to zero. + + * bfd-in2.h: Regenerate. + + * elf.c (copy_private_bfd_data): Reorganise section to segment + mapping to cope with moved sections requiring new segments, + and overlapping segments. + (SEGMENT_END): New macro: Return the end address of a segment. + (IS_CONTAINED_BY_VMA): New macro: Determine if a segment + contains a section by comparing their VMA addresses. + (IS_CONTAINED_BY_LMA): New macro: Determine if a segment + contains a section by comparing their LMA addresses. + (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a + section should be included in a segment. + (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment + follows another in memory. + (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two + segments overlap. + +2000-07-22 Jason Eckhardt + + * cpu-i860.c: Added comments. + + * elf32-i860.c (TARGET_LITTLE_SYM): Defined to + bfd_elf32_i860_little_vec. + (TARGET_LITTLE_NAME): Defined to "elf32-i860-little". + (ELF_MAXPAGESIZE): Changed to 4096. + + * targets.c (bfd_elf32_i860_little_vec): Declaration of + new target. + (bfd_target_vector): Added bfd_elf32_i860_little_vec. + + * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added + config for little endian elf32 i860. + (targ_defvec): Define for the new config above + as "bfd_elf32_i860_little_vec". + (targ_selvecs): Define for the new config above + as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec" + + * configure.in (bfd_elf32_i860_little_vec): Added recognition + of new target vec. + + * configure: Regenerated. + +2000-07-27 H.J. Lu + + * elflink.h (elf_merge_symbol): Take one more argument, + dt_needed, to indicate if the symbol comes from a DT_NEEDED + entry. Don't overide the existing weak definition if dt_needed + is true. + (elf_link_add_object_symbols): Pass dt_needed to + elf_merge_symbol (). + +2000-07-27 Nick Clifton + + * elflink.h (elf_link_size_reloc_section): Zeroes the section's + allocated contents. + +2000-07-25 Geoffrey Keating + + * configure.host (*-*-aix*): AIX has 'long long' always. + + * coff-rs6000.c (xcoff_write_one_armap_big): New procedure. + (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps. + (xcoff_write_archive_contents_big): Don't update the offset + of the symbol table, xcoff_write_armap will do it. + +2000-07-23 Ulf Carlsson + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead + of dynobj for SGI_COMPAT checks. + +2000-07-21 Michael Sokolov + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-21 Nick Clifton + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of + range symbol indices in relocs and issue an error message. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check + info->new_dtags when setting DT_FLAGS_1. It will only be set + by the new linker options. It shouldn't break anything. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1 + only if info->new_dtags is true. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set + DT_RUNPATH and DT_FLAGS only if info->new_dtags is true. + +2000-07-20 Hans-Peter Nilsson + + * Makefile.am (ALL_MACHINES): Add cpu-cris.lo. + (ALL_MACHINES_CFILES): Add cpu-cris.c. + (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo. + (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c. + (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules. + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris. + * archures.c (enum bfd_architecture): Add bfd_arch_cris. + (bfd_cris_arch): Declare. + (bfd_archures_list): Add bfd_cris_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (cris-*-*): New target. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors. + * configure: Rebuild. + * elf.c (prep_headers): Add bfd_arch_cris. + * libbfd.h: Rebuild. + * libaout.h (enum machine_type): Add M_CRIS. + * reloc.c: Add CRIS relocations. + * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare. + (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec. + * cpu-cris.c, aout-cris.c, elf32-cris.c: New files. + * po/POTFILES.in, po/bfd.pot: Regenerate. + +2000-07-19 H.J. Lu + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set + DF_TEXTREL if DT_TEXTREL is set. + * elf32-i370.c (i370_elf_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 (_bfd_mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also + set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if + DT_RPATH is set. + Set the DT_FLAGS and DT_FLAGS_1 entries if necessary. + +2000-07-19 H.J. Lu + + * bfd-in.h (bfd_elf_set_dt_needed_soname): New. + * bfd-in2.h: Rebuild. + + * elf-bfd.h (elf_obj_tdata): Add dt_soname. + (elf_dt_soname): New. + + * elf.c (bfd_elf_set_dt_needed_soname): New. + + * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED + entry if the shared object loaded by DT_NEEDED is used to + resolve the reference in a regular object. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG, + DT_DEPAUDIT and DT_AUDIT as strings. + +2000-07-19 Nick Clifton + + * format.c: Fix formatting. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW, + DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, + DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ, + DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1, + DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT, + DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT, + DT_FLAGS_1, DT_USED and DT_CHECKSUM. + +2000-07-18 Andrew Cagney + + * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move + renamed functions from here... + (assign_section_numbers): Use renamed functions. + (prep_headers): Use renamed functions. + + * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here. + * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update. + * bfd-in2.h: Regenerate. + +2000-07-18 Ulf Carlsson + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add + parenthesis in if statement. + +2000-07-17 Koundinya K + + Enable the support for Traditional MIPS. + * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand + return ict_none appropriately for traditional mips targets. + (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips. + (STUB_MOVE): Conditionalize for traditonal mips. + (STUB_LI16): Likewise. + (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making + room for RTPROC header. + (_bfd_mips_elf_modify_segment_map): For a normal mips executable set + the permission for the PT_DYNAMIC as read, write and execute. + (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING + for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP + in case of traditonal mips. + (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT + entry is required. For a function if PLT is not required then set the + corresponding hash table entry to 0. + (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for + traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a + shared object set the value to 0. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP + for traditonal mips. + +2000-07-15 H.J. Lu + + * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL. + +2000-07-12 Charles Wilson + + * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing + out a structure that is BFD_IN_MEMORY. + +2000-07-11 Alan Modra + + * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of + bfd pointer. Print section id instead of bfd pointer for local + syms. Prefix addend with `+' for global syms as well as local. + Correct calculation of name component lengths. + (elf64_hppa_check_relocs): Update call to get_dyn_name. + + From David Huggins-Daines + * elf-hppa.h (elf_hppa_relocate_section): Update calls here too. + * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings. + (elf64_hppa_modify_segment_map): Likewise. + +2000-07-11 Andrew Cagney + + * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA + addresses to be "naturally" sign extended. Return -1 if unknown. + * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-11 Andrew Cagney + + * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32 + and ECOF_SIGNED_64 to list ways to extract an offset. + (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in, + ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out): + Update. + * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64. + * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32. + +2000-07-11 Andrew Cagney + + * elfcode.h (elf_object_p): Use bfd_set_start_address and not + bfd_get_start_address. + (elf_swap_ehdr_in): Sign extend e_entry when applicable. + (elf_swap_ehdr_out): Ditto. + +2000-07-10 Alexander Aganichev + + * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for + compatibility with older binutils. + +2000-07-10 Alan Modra + + * section.c (bfd_make_section_anyway): Start section_id at 0x10. + (STD_SECTION): Avoid negative ids, instead use 0 to 3. + + From Ryan Bradetich + * dwarf1.c (parse_die): Cure signed/unsigned char warnings. + (parse_line_table): Ditto. + (_bfd_dwarf1_find_nearest_line): Ditto. + * syms.c (cmpindexentry): Remove extra `*' from params. + +2000-07-09 Koundinya K + + * elf32-mips.c (sort_dynamic_relocs): New Function. + (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs + via qsort to sort the dynamic relocations in increasing r_symndx + value. + +2000-07-09 Alan Modra + + * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add + ATTRIBUTE_UNUSED to unused args. + (get_opd): Likewise. + (get_plt): Likewise. + (get_dlt): Likewise. + (get_stub): Likewise. + (elf64_hppa_adjust_dynamic_symbol): Likewise. + (elf64_hppa_link_output_symbol_hook): Likewise. + (elf64_hppa_check_relocs): Delete unused var. + (elf64_hppa_size_dynamic_sections): Likewise. + (elf64_hppa_finalize_opd): Likewise. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_modify_segment_map): Likewise. + (elf64_hppa_finish_dynamic_sections): Likewise. + + * elf-hppa.h (elf_hppa_final_write_processing): Add + ATTRIBUTE_UNUSED to unused args. + (elf_hppa_final_link_relocate): Likewise. + (elf_hppa_record_segment_addrs): Add paretheses. + (elf_hppa_relocate_section): Constify dyn_name. + + From David Huggins-Daines + * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and + rearrange case statement so that it gets preferred to 32-bit ones. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use + asection->id instead of address of asection structure. + (elf32_hppa_size_stubs): Likewise. + + * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section + for .init* and .fini*. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers + and addends used in stub names to 32 bits. + (elf32_hppa_size_stubs): Likewise. + + * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend + twice for R_PARISC_GPREL64. Use bfd_put_32 for R_PARISC_PCREL32, + not bfd_put_64. Fix minor comment typo and formatting. + + Changes to create multiple linker stubs, positioned immediately + before the section where they are required. + * elf32-hppa.c: Don't include hppa_stubs.h. + (elf32_hppa_stub_hash_entry): Add a pointer to the stub section. + (elf32_hppa_stub_hash_table): Delete. + (elf32_hppa_link_hash_entry): Delete. + (elf32_hppa_link_hash_table): Use plain bfd_hash_table for + stub_hash_table, and store the struct here rather than a pointer. + Delete output_symbol_count. Add offset array. Change + global_value to a bfd_vma. + (elf32_hppa_stub_hash_lookup): Use table instead of table->root. + (elf32_hppa_stub_hash_traverse): Delete. + (elf32_hppa_name_of_stub): Delete. + (elf32_hppa_link_hash_lookup): Delete. + (elf32_hppa_link_hash_traverse): Delete. + (elf32_hppa_stub_hash_table_init): Delete. + (elf32_hppa_size_of_stub): Pass input section and offset rather + than location and calculate location here. Don't pass name as all + stubs are now the same size. + (elf32_hppa_stub_hash_newfunc): Init new fields. + (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table + too. + (elf32_hppa_bfd_final_link_relocate): Cast enums to int before + comparing against ints. Rewrite stub handling code. + (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned. + Case enums to int before comparing against ints. Remove + bfd_reloc_dangerous case. + (elf32_hppa_build_one_stub): Rewrite. + (elf32_hppa_size_one_stub): New function. + (elf32_hppa_build_stubs): Rewrite. + (elf32_hppa_size_stubs): Pass in linker call-back functions. + Rewrite stub-handling specific code. + + * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype. + + * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo. + + * hppa_stubs.h: Delete. + * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h + (elf32-hppa.lo): Remove hppa_stubs.h from dependencies. + * Makefile.in: Regenerate. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and + e_nlrsel. + + * libhppa.h (hppa_field_adjust): Correct e_nsel case. + + * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset + and section name for bfd_reloc_notsupported error message. + (elf32_hppa_bfd_final_link_relocate): Print reasons for returning + bfd_reloc_notsupported. + (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle + undefined weak symbols for all relocs. + (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch + offsets are relative to one past the delay slot. + (elf32_hppa_size_stubs): Account for reloc addend when calculating + branch destination. Put addend into stub name too. + (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and + adjust by 8 when deciding whether a linker stub is needed. Put + addend into stub name as for above. + + * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on + various args and vars. + (elf32_hppa_bfd_final_link_relocate): Here too. + (elf32_hppa_size_stubs): Rename index -> indx. Use e_indx for + inner block var to avoid shadowing. + + * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Make `field' arg + unsigned. + * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto. + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto. + (elf_hppa_fake_sections): Rename local var to avoid shadowing. + + * libhppa.h: Change practically all unsigned ints to plain ints. + Remove tests on gcc version. Instead use ATTRIBUTE_UNUSED for + prototypes. + + From Ryan Bradetich + * libhppa.h (hppa_opcode_type): New enum to replace #define's. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to + suit above. + From David Huggins-Daines + * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants + to the new OP_* ones. + + * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on + error exit. Bail out earlier on plabel relocs that we aren't + interested in. Don't tell elf32_hppa_stub_hash_lookup to copy + string, and then don't free our copy. + (elf32_hppa_build_one_stub): Make insn unsigned int. + + * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only + available with BL, not BE and BLE. + + * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example + code for elf arg relocs. + (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local + argument with elf_link_hash_entry h. Handle undefined weak + symbols. Move $global$ lookup from here... + (elf32_hppa_relocate_section): ...to here. Return correct error + message for non-handled relocs. + (elf32_hppa_size_of_stub): Correctly test branch range. Previous + wrong test was -0x3ffff to +0x40000. + + * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R, + R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches; + Handle them as such. + (elf_hppa_relocate_insn): Fix a typo. + + * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21): Delete. + Supply defines for all 64 possible opcodes. + (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode + formats. Handle COMICLR. + (hppa_rebuild_insn): Delete bfd argument. Handle formats 10, -11, + -10, -16, 16, 22. + + * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite. + (elf32_hppa_bfd_final_link_relocate): Major rewrite. + (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls + to suit. + (elf32_hppa_size_stubs): Don't free stub_name twice. Read in all + the local syms - did this code get deleted accidentally? Ignore + undefined and undefweak syms. + + * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost + block. Use it instead of elf64_hppa_hash_table (info). + (elf_hppa_final_link_relocate): Use hppa_info instead of + elf64_hppa_hash_table (info). + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-07-08 Alan Modra + + * section.c (struct sec): Add id field. Tidy comment formatting. + (bfd_make_section_anyway): Set id. + (STD_SECTION): Init id too. + Change CONST to const throughout. + * archures.c (bfd_arch_info): Tidy comment. + (bfd_arch_list): Change a CONST to const. + * libbfd-in.h: Tidy comments and replace CONST with const. + * elf-bfd.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + +2000-07-07 DJ Delorie + + * archive.c (_bfd_write_archive_contents): Add an informative + comment. + +2000-07-06 Kazu Hirata + + * srec.c: Fix formatting. + +2000-06-05 DJ Delorie + + * MAINTAINERS: new + +2000-07-04 Alexandre Oliva + + * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol + value of PC-relative offsets. + +2000-07-03 Jim Wilson + + * elf64-alpha.c (alpha_elf_size_info): New. + (elf_backend_size_info): Define to alpha_elf_size_info. + * elfcode.h (elf_size_info): Change hash bucket size to 4. + +2000-07-03 Ulf Carlsson + + * elf32-mips.c: Include elf32-target.h again for the traditional + MIPS targets. + +2000-07-03 Marek Michalkiewicz + + * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup): + Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings. + (avr_info_to_howto_rela): Likewise. + (elf32_avr_gc_mark_hook): Likewise. + (elf32_avr_gc_sweep_hook): Likewise. + (elf32_avr_relocate_section): Likewise. + +2000-07-03 Mark Elbrecht + + * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into + an external symbol for a non-shared, non-relocatable link. + +2000-07-03 Nick Clifton + + * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol + is an external symbol. + (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak + external symbol. + +2000-07-03 Kazu Hirata + + * reloc16.c: Fix formatting. + +2000-07-01 Koundinya K + + * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4* + to add a new target for traditional mips i.e + bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec. + * configure.in: Likewise. + * configure: Rebuild. + * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_tradlittlemips_vec): Likewise. + * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test + to see that elfNN_bed does not get redefined even if the target file + is included twice for a chip. See elf32-mips.c. + +2000-07-01 Alan Modra + + * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed + (CLEANFILES): Add DEPA. + * Makefile.in: Regenerate. + +2000-06-30 DJ Delorie + + * peicode.h (coff_swap_filehdr_in): can't use e_magic because we + can't assume the PE header is at 0x80. + +2000-06-29 Mark Elbrecht + + * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH. + +2000-06-28 Mark Elbrecht + + * go32stub.h: Update stub. + +2000-06-26 Marek Michalkiewicz + + * archures.c (bfd_mach_avr5): Define. + * bfd-in2.h (bfd_mach_avr5): Define. + * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to + bfd_mach_avr5, add bfd_mach_avr4. Update comments. + (compatible): Update comment. Add missing test. + * elf32-avr.c (avr_final_link_relocate): Support 8K wrap + for avr2 and avr4. Simplify 8K wrap code. + (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5. + (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5. + +2000-06-26 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * cpu-h8300.c: Likewise. + +2000-06-24 Alexandre Oliva + + * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)' + for local symbols whose names are unknown. + +2000-06-22 Alan Modra + + * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we + find one. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2000-06-20 H.J. Lu + + * Makefile.am: Rebuild dependency. + * Makefile.in: Rebuild. + +2000-06-20 Maciej W. Rozycki + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Map to the new function. + +2000-06-20 Alan Modra + + * archive.c (normalize): Correct pointer comparison when checking + for backslashes. + (bfd_bsd_truncate_arname): Likewise. + (bfd_gnu_truncate_arname): Likewise. + +2000-06-20 Ulf Carlsson + + * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual + sections elf_{text,data}_{section,symbol}. + * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove. + (_bfd_mips_elf_hide_symbol): New function. + (elf_backend_hide_symbol): Map to the new function. + (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD + definitions of mips_elf_{text,data}_{section,symbol}. + (mips_elf_local_relocation_p): Try to find the direct symbol + based on new check_forced argument. + (mips_elf_calculate_relocation): Use new version of + mips_elf_local_relocation_p. + (mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_sort_hash_table): Only assert that have enough GOT + space. + (mips_elf_got16_entry): Match all 32 bits to the existing GOT + entry if the relocation based on the new external argument. + (mips_elf_create_dynamic_relocation): Assert that we have a + section contents allocated where we can swap out the dynamic + relocations. + (mips_elf_calculate_relocation): Find the real hash-table entry + correctly by using h->root.root.type. Only create a dynamic + relocation entry if the symbol is defined in a shared library. + Create an external GOT entry for the GOT16 relocation if the + symbol was forced local. + (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a + dynamic index if the symbol was forced local. + +2000-06-20 Maciej W. Rozycki + + * elf32-mips.c: Fix typos in comments. + +2000-06-19 Mark Kettenis + + * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef + CORE_VERSION_1. + +2000-06-18 Stephane Carrez + + * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild. + * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS, + BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files. + * configure.in (bfd_elf32_m68hc12_vec): Recognize. + (bfd_elf32_m68hc11_vec): Likewise. + * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11. + Supports 68hc11 & 68hc12 at the same time. + * targets.c (bfd_elf32_m68hc12_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_m68hc11_vec): Likewise. + * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11. + * archures.c (bfd_m68hc12_arch): Define and register in global list + (bfd_m68hc11_arch): Likewise. + * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8, + BFD_RELOC_M68HC11_3B): Define. + * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support. + * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support. + +2000-06-18 Ulf Carlsson + + * elf_bfd.h (struct elf_backend_data): Add info argument to + elf_backend_hide_symbol. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + +2000-06-18 H.J. Lu + + * coff-i386.c (coff_i386_reloc): Don't return in case of + output_bfd == (bfd *) NULL if COFF_WITH_PE is defined. + Compensate PE relocations when linking with non-PE object + files to generate a non-PE executable. + +2000-06-17 Ulf Carlsson + + * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write + GOT entries if we're doing a static link or -Bsymbolic link. + +2000-06-15 Ulf Carlsson + + * elflink.h (elf_link_adjust_relocs): Check for and call backend + specifific swap_reloc_{in,out} and swap_reloca_{in,out} if + available. + (elf_link_output_relocs): Likewise. + (elf_reloc_link_order): Likewise. + +2000-06-16 Nicholas Duffek + + * archures.c (enum bfd_architecture): #define constants for + PowerPc and RS6000 machine numbers. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch + to bfd_arch_powerpc instead of bfd_arch_rs6000. Refer to PowerPc + and RS6000 machine numbers using #defined constants from + archures.c. + * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000 + machine numbers using #defined constants from archures.c. Add + entries for EC603e, 630, A35, RS64II, RS64III, 7400. Specify + 64-bit words in 620 entry. + * cpu-rs6000.c (arch_info_struct): Create with entries for RS1, + RSC, and RS2. + (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k). + +2000-06-16 Nicholas Duffek + + * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64. + * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field. + * libcoff.h (struct xcoff_tdata): Define xcoff64 field. + +2000-06-16 Nicholas Duffek + + * bfd-in.h (bfd_family_coff): Define. + * bfd-in2.h: Regenerate. + * coffgen.c (coff_count_linenumbers, coff_symbol_from, + coff_find_nearest_line): Check COFFness using bfd_family_coff() + instead of bfd_target_coff_flavour. + * cofflink.c (_bfd_coff_final_link): Likewise. + * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to + exclude XCOFF files. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Likewise. + * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour. + * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour. + * xcofflink.c (XCOFF_XVECP): Delete. + (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol, + bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc, + bfd_xcoff_record_link_assignment, + bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with + check for bfd_target_xcoff_flavour. + +2000-06-16 Nicholas Duffek + + * rs6000-core.c: Support 64-bit core files, support pre-4.3 core + files on AIX 4.3. + (read_hdr): New function. + (rs6000coff_core_p): Store mstsave or __context64 struct instead + of trying to extract individual registers. Set abfd->arch_info + to match the architecture that created the core file. + (rs6000coff_get_section_contents): Delete. + * xcoff-target.h (rs6000coff_get_section_contents): Delete. + +2000-06-14 H.J. Lu + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec) + is NULL. + +2000-06-13 H.J. Lu + + * configure: Regenerate. + +2000-06-13 J"orn Rennecke + + * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of + armpei_little_vec. + +2000-06-08 David O'Brien + + * configure.in (VERSION): Update to show this is the CVS mainline. + +2000-06-07 Alan Modra + + * elf32-d10v.c: Include elf/d10v.h + (enum reloc_type): Delete. + * elf32-d30v.c: Include elf/d30v.h + (enum reloc_type): Delete. + + * Makefile.am: Run "make dep-am" to regenerate dependencies. + * Makefile.in: Regenerate. + + * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs. + (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and + move HOWTOs into elf_howto_table. + (R_386_standard, R_386_ext_offset): Define. + (R_386_ext, R_386_vt_offset, R_386_vt): Define. + (elf_i386_reloc_type_lookup): Modify calculation of index into + elf_howto_table since we've removed the padding. + (elf_i386_info_to_howto_rel): Likewise. + (elf_i386_relocate_section): Likewise. + +2000-06-06 Michael Snyder + + * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t. + +2000-06-05 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + +2000-06-05 H.J. Lu + + * elflink.h (elf_fix_symbol_flags): Follow the link for the + indirect symbol for the ELF_LINK_NON_ELF bit. + (elf_link_output_extsym): Don't output the indirect symbol even + if the ELF_LINK_NON_ELF bit is set. + +2000-06-01 J.T. Conklin + + * config.bfd (i[3456]86-*-netbsdelf*): New target. + (i[3456]86-*-netbsdaout*): New target. + (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs. + (i[3456]86-*-openbsd*): Likewise. + +2000-05-30 Andrew Cagney + + * trad-core.c: From hpux-core.c, include or + when possible. + +2000-05-31 Ulrich Drepper + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-05-31 Alan Modra + + * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field + selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and + R_PARISC_DIR17F are for absolute branches; Handle them as such. + +2000-05-30 Nick Clifton + + * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB, + 80960CA, 80960MC as valid machine names. + +2000-05-30 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + +2000-05-29 Philip Blundell + + * ppcboot.c: Add packed attribute if compiling with GCC. + +2000-05-29 Anatoly Vorobey + + * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal. + +2000-05-26 Michael Snyder + + * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus, + elfcore_grok_psinfo): Add code to allow debugging a 32-bit + corefile on a 64-bit (Sparc Solaris) host. Also clean up + a few old comments. + +2000-05-26 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am" + * Makefile.in: Regenerate. + + * sysdep.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. + +2000-05-26 Eli Zaretskii + + * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH. + + * archive.c (normalize, bfd_bsd_truncate_arname, + bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support + file names with backslashes. + + * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file + before opening it. + + * sysdep.h: Include filenames.h. + +2000-05-26 Alan Modra + + * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_relax_section): New. + (sparc64_elf_relocate_section): Optimize tail call into branch always + if possible. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_relax_section): New. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters. + Remove unusued variables. + (sparc64_elf_relocate_section): Change r_symndx type to unsigned long. + (sparc64_elf_merge_private_bfd_data): Fix shared library case from + previous fix, so that shared libs really don't influence targets + extension mask and memory model. + +2000-05-23 H.J. Lu + + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-05-23 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-05-22 Richard Henderson + + * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI, + PCREL22, PCREL64I. Zero size of special relocs. + (elf64_ia64_reloc_type_lookup): Likewise. + (USE_BRL, oor_brl, oor_ip): New. + (elf64_ia64_relax_section): New. + (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I. + (elf64_ia64_install_value): Likewise, plus PCREL21BI. + (elf64_ia64_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): New. + * reloc.c (BFD_RELOC_IA64_PCREL21BI): New. + (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-05-22 Nick Clifton + + * configure.in : Add peigen.lo to MIPS PE targets. + * configure: Regenerate. + +2000-05-22 Momchil Velikov + + * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess + only if it is known for both input and output bfds. Separate + error message strings as in some languages, it may be necessary + to change more than one place in the string to change between + 'big' and 'little'. + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline + endianess checks, call _bfd_generic_verify_endian_match() instead. + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. + + * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify + endianess before checking bfd flavours. + +2000-05-22 H.J. Lu + + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + +2000-05-18 Alan Modra + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-05-18 Momchil Velikov + + * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting + relocs for an executable, ensure that they are virtual addresses. + +2000-05-18 Jeffrey A Law (law@cygnus.com) + + * config.bfd (hppa*64*-*-hpux11*): New target triplet. + +2000-05-17 S. Bharadwaj Yadavalli + Rick Gorton + + * elflink.h: Add emitrelocations support: when enabled, relocation + information and relocation sections are put into final output + executables. If the emitrelocations flag is set, do the following: + (elf_bfd_final_link): Emit relocation sections. + (elf_link_input_bfd): Compute relocation section contents. + (elf_gc_sections): Don't clean relocation sections. + +2000-05-16 Catherine Moore + + * som.c (som_decode_symclass): Recognize weak symbols. + +2000-05-16 Szabolcs Szakacsits + + * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that + read idata section only from dataoff. + (pe_print_edata): Correctly check for valid eat_member. + +2000-05-16 J"orn Rennecke + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + +2000-05-14 Philip Blundell + + * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets. + +2000-05-12 Alan Modra + + * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec + + * peigen.c (pe_print_idata): Look for .idata section and print + info even if data directory has zero entries. Read idata section + starting from dataoff, and adjust all data offsets to suit. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + * peigen.c (pe_print_edata): Similarly, look for .edata section + and print info even if data directory has zero entries. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + + From Szabolcs Szakacsits + * peigen.c (pe_print_idata): Use bfd_section_size rather than data + directory size which may be bogus. + * peigen.c (pe_print_edata): Similarly. + +2000-05-09 Alan Modra + + * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela + section is empty. + (copy_private_bfd_data): Allow for space possibly taken up by elf + headers when calculating segment physical address from lma. + +2000-05-08 Alan Modra + + * versados.c (versados_scan): Init stringlen and pass_2_done. + + * trad-core.c (trad_unix_core_file_p): Return + bfd_error_wrong_format rather than bfd_error_file_truncated. + + * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to + add_data_entry. DataDirectory virtual address is relative. + (pe_print_idata): Account for relative DataDirectory virtual + addresses. Don't trash datasize inside POWERPC_LE_PE code. + (pe_print_edata): Similarly. + + From Szabolcs Szakacsits + * peigen.c (dir_names): Add Delay Import Directory. + (pe_print_idata): Always search for bfd section containing + idata address rather than looking up section name. Print this + section name rather than .idata. + (pe_print_edata): Similarly. Also print some fields as %08lx. + (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as + Win32Version. + +2000-05-05 Clinton Popetz + + * xcoff.h: Rename to xcoff-target.h + * Makefile.am: Change all instances of xcoff.h to xcoff-target.h + * coff-rs6000.c: Ditto. + * coff64-rs6000.c: Ditto. + * coff-pmac.c: Ditto. + * Makefile.in: Regenerate. + +2000-05-05 Clinton Popetz + + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): + Change U802TOC64MAGIC to U803XTOCMAGIC. + +2000-05-04 Michael Snyder + + * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1. + * bfd-in.h: Prototype bfd_elf_get_arch_size. + * bfd-in2.h: Prototype bfd_elf_get_arch_size. + +2000-05-04 Alan Modra + + * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma. + +2000-05-03 Martin v. Löwis + + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + +2000-05-03 Mark Elbrecht + + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for + the .bss section. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2000-05-02 H.J. Lu + + * elf.c (prep_headers): Use ELFOSABI_NONE instead of + ELFOSABI_SYSV. + +2000-05-02 Alan Modra + + * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec. + * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate + dependencies. + * Makefile.in: Regenerate. + +2000-05-01 Jim Wilson + + * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo. + (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c. + (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo. + (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c. + * Makefile.in: Rebuild. + +2000-05-02 Alan Modra + + * config.bfd: Re-enable elf32-hppa. It now compiles, even if it + doesn't work very well. + + * elf-hppa.h (elf_hppa_internal_shdr): Define. + (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr. + Set hdr->s_type to 1 if ARCH_SIZE == 32. + (_bfd_elf_hppa_gen_reloc_type): Add prototype. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_is_local_label_name): Likewise. + (elf_hppa_fake_sections): Likewise. + (elf_hppa_final_write_processing): Likewise. + (elf_hppa_howto_table): Fully initialise all entries. + (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_record_segment_addrs, elf_hppa_final_link, + elf_hppa_relocate_section, elf_hppa_final_link_relocate, + elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until + elf32-hppa.c mess is cleaned up. + (elf_hppa_final_link_relocate): Make insn and r_type unsigned + int. Delete r_field. In case R_PARISC_PCREL21L, don't set + r_field then call hppa_field_adjust inline func with variable + r_field arg, instead call hppa_field_adjust with fixed arg. + In case R_PARISC_PCREL22F, don't set r_field. + (elf_hppa_relocate_insn): Change args and return type to unsigned + int. Call re_assemble_* funcs to do the work. + + * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when + sign extending. + + * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign + extending. + (sign_extend): Mask first before sign extending. + (low_sign_extend): Rewrite without condition expression. + (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16, + dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21, sign_unext, low_sign_unext): Return + result as function return value rather than through pointer arg. + Accept unsigned int args, and return unsigned int. + (re_assemble_3): New. Combines function of dis_assemble_3 with + re-assembly of opcode and immediate. + (re_assemble_12): Likewise. + (re_assemble_16): Likewise. + (re_assemble_17): Likewise. + (re_assemble_21): Likewise. + (re_assemble_22): Likewise. + (hppa_field_adjust): Rewrite and document, paying attention to + size of types and signed/unsigned issues. + (get_opcode): Shift before masking. + (FDLW): Rename to FLDW. + (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt. + (hppa_rebuild_insn): Change args and return value to unsigned + int. Make use of re_assemble_*. Correct case 11. + + * dep-in.sed: Handle ../opcodes/. + * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h, + elf64-hppa.h, hppa_stubs.h, xcoff.h. + (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c. + Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo, + elfarm-nabi.lo dependencies outside of auto-dependency area. + Regenerate dependencies. + * Makefile.in: Regenerate. + + * configure.in (TRAD_HEADER): Test non-null before + AC_DEFINE_UNQUOTED. + * configure: Regenerate. + + * reloc.c: Fix mis-spelling in comment. + +2000-05-01 Alan Modra + + * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. + * vms.c (vms_openr_next_archived_file): Return NULL. + +2000-04-28 Clinton Popetz + + * coffcode.h Copy changes mistakenly done to libcoff.h in + 4/24/2000 patch. + +2000-04-29 Andreas Jaeger + + * libbfd-in.h: Correctly check GCC version. + * bfd-in.h: Likewise. + * libhppa.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2000-04-28 Clinton Popetz + + * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add + coffdu-rs6000.{lo,c}. + (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency + on xcoff.h + * Makefile.in: Regenerate. + * xcoff.h: New file. + * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c. + * coff-rs6000.c: Move all declarations and defines that are + common to the xcoff backends into xcoff.h + * coff64-rs6000.c: Ditto, + +2000-04-28 Clinton Popetz + + * coff-mips.c (mips_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + * coff-sh.c: (bfd_coff_small_swap_table): Ditto. + +2000-04-28 Clinton Popetz + + * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + +2000-04-27 Alan Modra + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL. + Check local_got_refcounts before dereferencing. + + * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL + before deciding we don't need R_PPC_PLT32 relocation. + (ppc_elf_gc_sweep_hook): Check local_got_refcounts before + dereferencing. + + * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment. + + * elf32-i386.c (elf_i386_check_relocs): Reference count .got and + .plt entries. + (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries. + (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries. + (elf_i386_relocate_section): Allow for .plt to go missing. + (elf_i386_finish_dynamic_symbol): Use same test to decide if we + can use a relative reloc for got as elf_i386_relocate_section. + (bfd_elf32_bfd_final_link): Define to use gc form of final link. + +2000-04-26 Clinton Popetz + + * config.bfd: Remove extraneous bfd_powerpc_64_arch. + +2000-04-24 Clinton Popetz + + * Makefile.am (coff64-rs6000.lo): New rule. + * Makefile.in: Regenerate. + * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data, + xcoff_is_local_label_name, xcoff_rtype2howto, + xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p, + xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap, + xcoff_write_archive_contents): No longer static, and prefix with _bfd_. + (NO_COFF_SYMBOLS): Define. + (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in, + xcoff64_swap_aux_out): New functions; handle xcoff symbol tables + internally. + (MINUS_ONE): New macro. + (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS + relocation. + (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, + coff_SWAP_aux_out): Map to the new functions. + * coff64-rs6000.c: New file. + * libcoff.h (bfd_coff_backend_data): Add new fields + _bfd_coff_force_symnames_in_strings and + _bfd_coff_debug_string_prefix_length. + (bfd_coff_force_symnames_in_strings, + bfd_coff_debug_string_prefix_length): New macros for above fields. + * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic. + Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead + of using coff_swap_sym_in directly. + (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64. + (coff_set_flags) Set magic for XCOFF64. + (coff_compute_section_file_positions): Add symbol name length to + string section length if bfd_coff_debug_string_prefix_length is + true. + (coff_write_object_contents): Don't do reloc overflow for XCOFF64. + (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of + using coff_swap_lineno_in directly. + (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings + and _bfd_coff_debug_string_prefix_length fields. + * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force + symbol names into strings table when + bfd_coff_force_symnames_in_strings is true. + * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR, + SET_RELOC_VADDR): New macros. + (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros. + (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C + code. + (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64 + changes within RS6000COFF_C specific code. + (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, + MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Extend existing hack on target name. + * xcofflink.c (XCOFF_XVECP): Extend existing hack on + target name. + * coff-tic54x.c (ticof): Keep up to date with new fields + in bfd_coff_backend_data. + * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define + targ_selvecs to include rs6000coff64_vec for rs6000. + * configure.in: Add rs6000coff64_vec case. + * cpu-powerpc.c: New bfd_arch_info_type. + +2000-04-24 Jeffrey A Law (law@cygnus.com) + + * config.bfd: Only disable elf32-hppa vectors, not all of the + BSD and OSF configuration support. Provide (disabled) clauses + for PA64 support. + * configure.in: Add clause for PA64 support. + * configure: Rebuilt. + + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec. + (bfd_elf64_hppa_vec): Declare. + + * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo + (BFD64_BACKENDS_CFILES): Add elf64-hppa.c + (elf64-hppa.lo): Add dependencies. + * Makefile.in: Rebuilt. + + * elf64-hppa.c, elf64-hppa.h: New files with PA64 support. + +2000-04-24 Jason Eckhardt + + * libhppa.h (dis_assemble_16): New function. + (pa_arch): Added pa20w element. + +2000-04-24 Ulrich Drepper + + * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs, + bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and + bfd_elf64_slurp_reloc_table. + + * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New + definitions to get external names. + (elf_write_relocs): Renamed from write_relocs and make global. + (elf_slurp_reloc_table): Make global. + (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs. + + * archive.c (hpux_uid_gid_encode): New function. + (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is + defined and the ID is greater than 99999. + (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode + special uid/gid fields into 32 bit values. + +2000-04-21 Matthew Green + + * config.bfd: Add NetBSD/sparc64 support. + +2000-04-21 Richard Henderson + David Mosberger + Timothy Wall + Jim Wilson + + * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo. + (ALL_MACHINES_CFILES): Add cpu-ia64.c. + (BFD64_BACKENDS): Add elf64-ia64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ia64.c. + (cpu-ia64.lo, elf64-ia64.lo): New rules. + * Makefile.in: Rebuild. + * archures.c (enum bfd_architecture): Add bfd_arch_ia64. + (bfd_ia64_arch): Declare. + (bfd_archures_list): Add bfd_ia64_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets. + * configure: Rebuild. + * configure.host: (ia64-*-linux*): New host. + * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec, + bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors. + * elf.c (prep_headers): Add bfd_arch_ia64. + * libbfd.h: Rebuild. + * reloc.c: Add IA-64 relocations. + * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec): + Declare. + (bfd_target_vect): Add bfd_elf64_ia64_little_vec. + * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files. + +2000-04-21 Richard Henderson + + * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section + contents when performing a partial link. + (bfd_elf_d30v_reloc_21): Likewise. + +2000-04-20 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + * elf32-ppc.c (ppc_elf_relocate_section): Similarly. + +2000-04-19 Michael Sokolov + + K&R compiler fixes. + * dwarf2.c (concat_filename): Avoid string literal concatenation. + * ieee.c (ieee_get_symtab): Don't initialise union in struct. + +2000-04-11 David Mosberger + + * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo. + (BFD64_BACKENDS_CFILES): Mention coff-ia64.c + (coff-ia64.lo): Add dependency. + * Makefile.in: Regenerate. + * coff-ia64.c: New file. + * efi-app-ia32.c: Ditto. + * efi-app-ia64.c: Ditto. + * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC. + (coff_set_flags): Ditto. + (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC. + * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec. + * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec. + * configure: Regenerate. + * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro. + (PUT_OPTHDR_IMAGE_BASE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (GET_PDATA_ENTRY): Ditto. + * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read + data_start. Use above macros to read fields that are 64 bit wide for + COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits. + (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force + FileAlignment and SectionAlignment to minimum alignment if they + are zero. + (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set + Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM. + (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start. + Use above macros to write fields that are 64 bit wide for + COFF_WITH_PEP64. + (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64, + 5*4 otherwise. This should be right for IA-32 and IA-64, but may + be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded + value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print + begin address, end address, and unwind info address only. Use + GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to + print addresses. + (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and + HIGH3ADJ relocation names. + (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form. + * targets.c: Declare bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + (bfd_target_vector): Mention bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + +2000-04-17 Timothy Wall + + * bfd-in2.h: Add prototypes for tic54x load page access. + * bfd-in.h: Regenerate. + * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown + in customized _set_arch_mach function. + * coffcode.h (coff_set_alignment_hook): Set section load page if + the appropriate macro is defined. + (write_object_contents): Read section load page. + +2000-04-13 Alan Modra + + * elf32-hppa.h: Update copyright date. + + * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. + * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. + + * elf32-d30v.c (MAX32): Don't use LL suffix. + (MIN32): Define in terms of MAX32. + (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + + * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise + expression. + + * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + +2000-04-12 Alan Modra + + * dep-in.sed: Match space before file name, not after. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + + * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield + case, allow address wrap-around stupidly removed 2000-03-17. Sign + extend without an if statement. + +2000-04-11 Alan Modra + + * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using + signed quantites. + * elf32-mips.c (gprel16_with_gp): Likewise. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range + here using -0x40000, not (int)0xfffc0000. + (elf32_hppa_size_of_stub): Likewise. + +2000-04-11 Timothy Wall + + * coff-tic54x.c: Now builds with all targets. + * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies. + * Makefile.in: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on + unitialized variable. + +2000-04-07 Andrew Cagney + + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add + --enable-build-warnings option. + * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. + * Makefile.in, configure: Re-generate. + +2000-04-07 Nick Clifton + + * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and + BFD_RELOC_THUMB_PCREL_BLX. + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_XPC25 and R_ARM_THM_PC22. + + * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of + R_ARM_XPC25 and R_ARM_THM_XPC22. + (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to + R_ARM_[XPC25|THM_XPC22]. + + * elfarm-oabi.c: Define OLD_ARM_ABI and change include from + elf/arm-oabi.h to elf/arm.h + + * Makefile.am: Fix dependency for elfarm-oabi.c + * Makefile.in: Regenerate. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2000-04-06 Michael Snyder + + * elfcore.h (elf_core_file_p): preserve value of tdata at entry, + and restore it on failure. Release newly allocated tdata on + failure. + +2000-04-07 Jim Wilson + + * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size. + (decode_line_info): Set it. Report error if unit->line_offset is + equal to or larger than it. + +2000-04-07 Timothy Wall + + * targets.c: Added vecs for tic54x. + * reloc.c: Added relocs for tic54x. + * libbfd.h: Regenerated. + * configure: Add TI COFF vecs for tic54x. + * configure.in: Ditto. + * config.bfd (targ_cpu): Recognize new tic54x target. + * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling. + * bfd-in2.h: Add tic54x target and relocations. + * Makefile.am, Makefile.in: Add tic54x target. + * archures.c (bfd_archures_list): Add tic54x target. + * coff-tic54x.c: New. + * cpu-tic54x.c: New. + +2000-04-06 Michael Snyder + + * elfcore.h (elf_core_file_p): call backend_object_p which + thereby gets an opportunity to update the arch/machine type. + +2000-04-06 Timothy Wall + + * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage + class. Handle SEC_CLINK and SEC_BLOCK flags. + * section.c: Add SEC_CLINK and SEC_BLOCK flags. + * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags. + +2000-04-06 Nick Clifton + + * elf32-arm.h (elf32_arm_set_private_flags): Only check for + EF_INTERWORK if this is an unknown EABI. + (elf32_arm_merge_private_bfd_data): Check EABI version + numbers. Only check EF_xxx flags if the EABI version number + is unknown. + (elf32_arm_check_private_bfd_data): Only check EF_xxx flags + if the EABI version number is unknown. + (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags + if the EABI version number is unknown. + +2000-04-05 J"orn Rennecke + + * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and + BFD_RELOC_SH_LOOP_END. + * elf32-sh.c (sh_elf_howto_tab): Change special_func to + sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore. + Add entries for R_SH_LOOP_START and R_SH_LOOP_END. + (sh_elf_reloc_loop): New function. + (sh_elf_reloc): No need to test for always-to-be-ignored relocs + any more. + (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}. + (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-04-04 Alan Modra + + * po/bfd.pot: Regenerate. + + * Makefile.am: Remove extraneous mkdep comment. + (MKDEP): Use gcc -MM rather than mkdep. + (DEP): Quote when passing vars to sub-make. Add warning + message to end. + (DEP1): Rewrite for "gcc -MM". + (CLEANFILES): Add DEP2. + Update dependencies. + * Makefile.in: Regenerate. + +2000-04-03 Kevin Buettner + + * configure.in: Added corefile support for AIX 4.3. In particular, + AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when + compiling rs6000-core.c. + * configure: Regenerated. + +2000-04-03 H.J. Lu + + * cache.c (bfd_open_file): Unlink the output file only if + it has non-zero size. + +2000-04-01 Ken Block USG + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit + relative relocations for non-loaded sections in shared objects. + (elf64_alpha_check_relocs): Similarly. + +2000-04-03 Hans-Peter Nilsson + + * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and + BFD_RELOC_16 to switch for extended relocs. + (MY_swap_ext_reloc_in): New. + (MY_swap_ext_reloc_out): New. + (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather + than NAME(aout,swap_ext_reloc_in) for extended relocs. + (NAME(aout,squirt_out_relocs)): Similarly use + MY_swap_ext_reloc_out. + (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined. + +2000-04-03 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to + the R_PCRWORD_B case. + +2000-03-31 Thomas de Lellis + + * srec.c : Set CHUNK size to 16 bytes to prevent download failures + on some targets. + * ihex.c : Ditto. + +2000-03-30 Donald Lindsay + + * elf32-m32r.c (m32r_elf_generic_reloc): new function. All + HOWTO references to bfd_elf_generic_reloc, that have + partial_inplace == true, now use the new function. The function + is based on the recent rewrite of m32r_elf_lo16_reloc(), and + extends its fixes to the R_M32R_{16,24,32} relocs. + The new logic in m32r_elf_lo16_reloc() has been removed, and + it instead calls the new routine to obtain that functionality. + +2000-03-27 Alan Modra + + * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook, + elf32_avr_check_relocs, avr_final_link_relocate, + elf32_avr_relocate_section, bfd_elf_avr_final_write_processing, + elf32_avr_object_p): Add prototypes. + (elf32_avr_gc_mark_hook): Add default for h->root.type. + (bfd_elf_avr_final_write_processing): Make static. + +2000-03-27 Denis Chertykov + + * cpu-avr.c: New file. BFD support routines for AVR architecture. + * archures.c (bfd_architecture): Add AVR architecture. + (bfd_archures_list): Add reference to AVR architecture info. + * elf.c (prep_headers): Handle bfd_arch_avr. + * reloc.c: Add various AVR relocation enums. + * targets.c (bfd_elf32_avr_vec): Declare and add to target vector + list. + * Makefile.am: Add support for AVR elf. + * configure.in: Likewise. + * config.bfd: Likewise. + * Makefile.in: Regenerate. + * configure: This too. + * bfd-in2.h: And this. + * libbfd.h: And this. + +2000-03-24 H.J. Lu + + * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype. + (elf64_alpha_find_reloc_at_ofs): Likewise. + +2000-03-17 Alan Modra + + * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield, + flag an overflow if the bitfield is outside -2**n to 2**n-1. The + allowable range used to be -2**(n-1) to 2**n-1. + * reloc.c (_bfd_relocate_contents): Same here. Also replace + "boolean overflow" with "bfd_reloc_status_type flag". + +2000-03-14 Doug Evans + + * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. + +2000-03-14 Kazu Hirata + + * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number + of shrinks properly, including the last reloc. + +2000-03-13 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity + check for R_MOVL2. + +2000-03-11 Alan Modra + + * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on + a format mismatch rather than an "error" from bfd_read such as + bfd_error_file_truncated. + +2000-03-10 Geoff Keating + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper + sign-extension and big-endian compensation for + R_MIPS_64 even in ld -r. + +2000-03-10 Geoffrey Keating + + * elf32-mips.c (mips_elf_next_relocation): Rename from + mips_elf_next_lo16_relocation, and generalize to look + for any relocation type. + (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset. + (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16. + (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16. + (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2. + (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64. + (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32. + (bfd_elf32_bfd_reloc_type_lookup): Add new relocs. + (mips_rtype_to_howto): Likewise. + (mips_elf_calculate_relocation): Handle new relocs. + (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs + are paired. The addend for R_MIPS_GNU_REL16_S2 + is shifted right two bits. + +2000-03-10 Alan Modra + + * reloc.c (bfd_perform_relocation): Undo emacs formatting of + comment, and ensure it doesn't happen again. + (bfd_install_relocation): Same here. + (_bfd_relocate_contents): Don't bother assigning unused signmask + shift result. Fix typos in comments. + Remove trailing whitespace throughout file. + +2000-03-07 Doug Evans + + * reloc.c (reloc_howto_struct): Fix partial_inplace comment. + * bfd-in2.h: Rebuild. + +2000-03-06 Nick Clifton + + * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and + sym_ptr_ptr fields. + (SIZEOF_ILF_SYM_PTR_TABLE): Define. + (SIZEOF_ILF_STRINGS): Redefine. + (pe_ILF_make_a_symbol-reloc): New function. Creates a symbol + relative reloc, as opposed to a section relative reloc. + (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT + not C_LABEL. + Add length of symbol's prefix to string pointer. + Store a pointer to the symbol in the symbol pointer table. + (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7. + Initialise the symbol pointer table. + Store the hint in the Hint/Name table. + Make the jump reloc be symbol realtive, not section relative. + Create an import symbol for imported code. + +2000-03-06 Catherine Moore + + * elf.c (swap_out_syms): Check for null type_ptr. + +2000-03-01 Hans-Peter Nilsson + + * aout-target.h (MY(write_object_contents)): Remove unused + and unusable "#if CHOOSE_RELOC_SIZE". + * pc532-mach.c (MY(write_object_contents)): Ditto. + * netbsd.h (MY(write_object_contents)): Ditto. + * hp300hpux.c (MY(write_object_contents)): Ditto. + * freebsd.h (MY(write_object_contents)): Ditto. + * aout-tic30.c (tic30_aout_write_object_contents): Ditto. + +2000-02-29 H.J. Lu + + * peicode.h (jtab): Make it static. + + * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is + defined and COFF_IMAGE_WITH_PE is not defined. + (_bfd_sh_align_load_span): Defined as sh_align_load_span if + COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined. + +2000-03-01 Nick Clifton + + * coff-arm.c (bfd_arm_process_before_allocation): Make + 'symndx' signed to prevent compile time warning. + + * coff-mcore.c: Remove unused prototype for pe_object_p. + + * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static + functions that are not used when COFF_IMAGE_WITH_PE is + defined. + (struct sh_opcode): Change type of 'flags' field to unsigned + long so that it can hold the USESAS flag. + + * coffcode.h (styp_to_sec_flags): Initialise 'target_name'. + + * elf-m10300.c (mn10300_elf_relax_section): Initialise + 'sym_sec'. + + * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and + 'srelgot'. + + * elf32-mcore.c (mcore_elf_relocate_section): Initialise + 'oldinst'. + + * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'. + + * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED + to unused function parameter. + + * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Use EMPTY_HOWTO to initialise empty howto slots. + Remove unused variables. + + * peicode.h (pe_ILF_build_a_bfd): Initialise id6. + +2000-03-01 H.J. Lu + + * aoutx.h (aout_link_input_section_std): Pass "true" to + the undefined_symbol callback. + (aout_link_input_section_ext): Likewise. + * bout.c (get_value): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_conten): + Likewise. + (alpha_relocate_section): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise. + * coff-i960.c (coff_i960_relocate_section): Likewise. + * coff-mcore.c (coff_mcore_relocate_section): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + * coff-ppc.c (coff_ppc_relocate_section): Likewise. + * coff-sh.c (sh_relocate_section): Likewise. + * coff-tic80.c (coff_tic80_relocate_section): Likewise. + * cofflink.c (_bfd_coff_generic_relocate_section): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. + * elflink.h (elf_link_output_extsym): Likewise. + * pe-mips.c (coff_pe_mips_relocate_section): Likewise. + * reloc.c (bfd_generic_get_relocated_section_conten): Likewise. + * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the + undefined_symbol callback when building shared library with + -Bsymbolic and undefined symbols are allowed. Otherwise, pass + "true". + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + (elf32_mips_get_relocated_section_content): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-02-28 Nick Clifton + + * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects. + * Makefile.in: Regenerate. + + * configure.in: Add support for mips and sh pe vectors. + * configure: regenerate. + + * config.bfd: Add support for arm-wince, mips-pe and sh-pe + targets. + + * targets.c: Add mips and sh pe vectors. + + * libpei.h (coff_final_link_postscript): Only define if not + already defined. + + * coffcode.h: Add support for WinCE magic numbers. + + * peigen.c (pe_print_reloc): Update comment and rearrange + appending of newline character. + + * peicode.h: Add support for Image Library Format. + (pe_ILF_vars): Structure containing data used by ILF code. + (pe_ILF_make_a_section): New function. Create a section based + on ILF data. + (pe_ILF_make_a_reloc): New function. Create a reloc based on + ILF data. + (pe_ILF_make_a_symbol): New function. Create a symbol based + on ILF data. + (pe_ILF_save_relocs): New function. Store the relocs created + by pe_ILF_make_a_reloc in a section. + (pe_ILF_build_a_bfd): New function. Create a BFD describing + an ILF object. + (pe_ILF_object_p): New function. Return a bfd_target pointer + for an ILF object. + (pe_bfd_object_p): If an ILF object is detected call + pe_ILF_object_p on it. + + * coff-arm.c: Add support for WinCE relocs which are different + from normal ARM COFF relocs. + * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target. + + * coff-sh.c: Add support for sh-pe target. + * pe-sh.c: New file. Support code for sh-pe target. + * pei-sh.c: New file. Support code for sh-pe target. + + * pe-mips.c: New file. Support code for mips-pe target. + * pei-mips.c: New file. Support code for mips-pe target. + +2000-02-27 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump + architecture if the object causing the bump is dynamic. + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise, + and also don't it for memory ordering. + (sparc64_elf_write_relocs): Take src_rela out of the loop. + +2000-02-27 Ian Lance Taylor + + * dwarf2.c (read_abbrevs): Use _raw_size directly rather than + calling bfd_get_section_size_before_reloc. + (decode_line_info): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. + +2000-02-27 Eli Zaretskii + + * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the + name of the libtool directory. + * Makefile.in: Rebuild. + +2000-02-25 Rodney Brown (RodneyBrown@pmsc.com) + + * som.c (SOM_HOWTO): Define. + (som_hppa_howto_table): Use it. + +2000-02-25 Alexandre Oliva + + * config.bfd: Enable 64 bit support for GNU/Linux/sparc. + + * config.bfd: Enable 64 bit support for Solaris7+/sparc. + +2000-02-24 Catherine Moore + + * som.c (som_misc_symbol_info): Add field + secondary_def. + (som_bfd_derive_misc_symbol_info): Initialize + secondary_def. + (som_build_and_write_symbol_table): Keep track + of secondary_def field. + (som_slurp_symbol_table): Set BSF_WEAK symbol flag + if secondary_def field is set. + (som_bfd_ar_write_symbol_stuff): Initialize + secondary_def. + +2000-02-23 Stephane Carrez + + * dwarf2.c (read_address): Read 16-bits addresses. + (parse_comp_unit): Accept addr_size == 2. + +2000-02-23 Alan Modra + + * bfd-in.h: Update copyright date. + +2000-02-23 Linas Vepstas + + * cpu-i370.c: New file. + * elf32-i370.c: New file. + * archures.c (enum bfd_architecture): Add bfd_arch_i370. + (bfd_i370_arch): New. + (bfd_archures_list): Add bfd_i370_arch. + * elf.c (prep_headers): Add bfd_arch_i370. + * Makefile.am: Add support for IBM 370 elf. + * config.bfd: Likewise. + * configure.in: Likewise. + * libbfd.h (bfd_reloc_code_real_names): Likewise. + * reloc.c (bfd_reloc_code_type): Likewise. + * targets.c: Likewise. + + * Makefile.in: Regenerate. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + +2000-02-22 Ian Lance Taylor + + * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for + invalid relocation types, and change them to R_386_NONE. + +2000-02-22 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): If a version symbol is + not defined, don't add a second ELF_VER_CHR. + + * elflink.h (elf_bfd_final_link): Call output_extsym for global + symbols converted to local symbols even when stripping all + symbols. + (elf_link_output_extsym): Process global symbols converted to + local symbols even if they are being stripped. + +2000-02-21 Alan Modra + + * archures.c (bfd_octets_per_byte): Return unsigned int. + (bfd_arch_mach_octets_per_byte): Ditto. + * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned + comparison warning. + * section.c (bfd_get_section_size_before_reloc): Quell signed + vs. unsigned comparison warning. + (bfd_get_section_size_after_reloc): Same here. Fix parentheses too. + * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27 + change. What was I thinking? + * bfd-in2.h: Regenerate. + + * elflink.h (elf_gc_sweep): Skip non-elf input bfds. + (elf_gc_sections): Same here. + (elf_gc_common_finalize_got_offsets): And here. + +2000-02-21 Ian Lance Taylor + + ELF HPPA doesn't work at present; remove it until it does. + * config.bfd: Comment out setting targ_defvec to + bfd_elf32_hppa_vec. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Remove elf32-hppa.lo. + (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c. + (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h. + * Makefile.in: Rebuild. + * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec. + +2000-02-18 Geoff Keating + + * coffcode.h (coff_set_arch_mach_hook): Use free(), because there + is no bfd_free(). Revert bfd_free part of previous change. + +2000-02-18 Geoff Keating + + * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size + arrays. + (coff_compute_section_file_positions): Use bfd_free to pair + bfd_malloc. + (coff_write_object_contents): Likewise. + + * coff-rs6000.c (xcoff_howto_table_16): New variable. + (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs. + +2000-02-18 Ulrich Drepper + + * coff-rs6000.c (XCOFFARMAGBIG): New macro. + (xcoff_ar_file_hdr_big): New structure. + (SIZEOF_AR_FILE_HDR_BIG): New macro. + (xcoff_ar_hdr_big): New structure. + (SIZEOF_AR_HDR_BIG): New macro. + (xcoff_big_format_p): New macro. + (xcoff_ardata_big): New macro. + (arch_xhdr_big): New macro. + (xcoff_slurp_armap): Handle large archives. + (xcoff_archive_p): Detect large archives. + (xcoff_read_ar_hdr): Handle large archives. + (xcoff_openr_next_archived_file): Handle large archives. + (xcoff_generic_stat_arch_elt): Handle large archives. + (xcoff_write_armap_old): Rename from xcoff_write_armap. + (xcoff_write_armap_big): New function. + (xcoff_write_armap): New function, dispatch to _old or _big. + (xcoff_write_archive_contents_old): Rename from + xcoff_write_archive_contents. + (xcoff_write_archive_contents_big): New function. + (xcoff_write_archive_contents): New function, dispatch to _old or + _big. + +2000-02-18 Richard Henderson + + * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect + and hide_symbol members. + (elf_link_hash_copy_indirect): Remove. + (elf_link_hash_hide_symbol): Remove. + (struct elf_backend_data): Add elf_backend_copy_indirect_symbol + and elf_backend_hide_symbol. + (_bfd_elf_link_hash_copy_indirect): Declare. + (_bfd_elf_link_hash_hide_symbol): Declare. + * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument. + (_bfd_elf_link_hash_hide_symbol): Likewise. + (_bfd_elf_link_hash_table_init): Don't init killed members. + * elflink.h (elf_link_add_object_symbols): Use the bed function + pointers not elf_link_hash_{copy_indirect,hide_symbol}. + (elf_link_assign_sym_version): Likewise. + * elfxx-target.h (elf_backend_copy_indirect_symbol): Default. + (elf_backend_hide_symbol): Likewise. + (elfNN_bed): Update for new members. + +2000-02-17 Kevin Buettner + + * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD, + STACK_END_ADDR): Define for new core file format. + (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines + for handling the vagaries of the various core file structures used + by AIX over the years. + (rs6000coff_core_p, rs6000coff_core_file_matches_executable, + Rs6kCorData): Use above defines to adapt code to use AIX 4.3's + core_dumpx structure. + +2000-02-17 J"orn Rennecke + + * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros. + (bfd_mach_sh3_dsp): Likewise. + (bfd_mach_sh4): Reinstate. + (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750. + * bfd-in2.h: Regenerate. + * coff-sh.c (struct sh_opcode): flags is no longer short. + (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros. + (sh_opcode41, sh_opcode42): Integrate as sh_opcode41. + (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes. + (sh_opcode41, sh_opcode4, sh_opcode80): Likewise. + (sh_opcodes): No longer const. + (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays. + (sh_insn_uses_reg): Check for USESAS and USESR8. + (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS. + (_bfd_sh_align_load_span): Return early for SH4. + Modify sh_opcodes lookup table for sh-dsp / sh3-dsp. + Take into account that field b of a parallel processing insn + could be mistaken for a separate insn. + * cpu-sh.c (arch_info_struct): New array elements for + sh2, sh-dsp and sh3-dsp. + Reinstate element for sh4. + (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros. + (SH4_NEXT): Reinstate. + (SH3_NEXT, SH3E_NEXT): Adjust. + * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare. + * elf32-sh.c (sh_elf_set_private_flags): New function. + (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise. + (sh_elf_merge_private_data): New function. + (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define. + (bfd_elf32_bfd_copy_private_bfd_data): Define. + (bfd_elf32_bfd_merge_private_bfd_data): Change to + sh_elf_merge_private_data. + +2000-02-13 Richard Henderson + + * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and + hide_symbol members. + (elf_link_hash_copy_indirect): New. + (elf_link_hash_hide_symbol): New. + * elflink.h (elf_link_add_object_symbols): Break out copy from + indirect new new symbol to elf.c. + (elf_link_assign_sym_version): Break out privatization of + non-exported symbol to elf.c. + * elf.c (_bfd_elf_link_hash_copy_indirect): New. + (_bfd_elf_link_hash_hide_symbol): New. + (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol. + +2000-02-13 Ian Lance Taylor + + * section.c (_bfd_strip_section_from_output): Add info parameter. + If it passed as non-NULL, use it to check whether any input BFD + has an input section which uses this output section. Change all + callers. + * bfd-in2.h: Rebuild. + + * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and + bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of + 1999-11-29. + * bfd-in2.h: Rebuild. + +2000-02-10 Timothy Wall + + * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to + allow final modifications of swapped-in symbol. + (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST. + * coffcode.h (coff_write_relocs): Use macro + SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether + symbol index should be set to -1. + +2000-02-10 Toshiyasu Morita (toshi.morita@sega.com) + + * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG, + USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros. + * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes. + * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg, + sh_insns_uses_or_sets_freg): New functions. + * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros. + * (sh_insns_conflict): Use new functions and new macros to + detect conflicts when two instructions both set same integer registers, + both set same fp register, and both set special register. + +2000-02-09 Timothy Wall + + * coffgen.c (coff_real_object_p): Set arch/mach info prior to + swapping in sections, so that the swapping routines have access to + the arch/mach info. + +2000-02-08 Mark Elbrecht + + * coff-go32.c: Update comment. Update copyright. + +2000-01-27 Thomas de Lellis + + * syms.c (bfd_decode_symclass) + Two new class characters were added - 'V' and 'v'. The + meaning of 'W' is now restricted to just weak non-object + symbols. This allows differentiation between, for example, + weak functions vs weak objects. nm for example now dumps: + 'W' = weak global + 'w' = weak unresolved + 'V' = weak global object + 'v' = weak unresolved object + + (bfd_is_undefined_symclass): New function. Return true if the + given symbol class represents and undefined/unresolved symbol. + + (bfd_symbol_info): Use bfd_is_undefined_symclass to check for + unresolved symbols. + + * bfd-in2.h: Add prototype for bfd_is_undefined_symbol(). + + * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the + STT_ARM_16BIT flag set, but it is not attached to a data object + return STT_ARM_16BIT so that it will be treated as code by the + disassembler. + +2000-01-27 Alan Modra + + * coff-i386.c (i3coff_object_p): Remove prototype. + Update copyright. + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const + to name. Update copyright. + + * trad-core.c (trad_unix_core_file_p): Cast core_regsec + assignment to avoid warning. Update copyright. + +2000-01-24 Robert Lipe (robertl@sco.com) + + * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc + instead of using GNU C extension. + +2000-01-21 Nick Clifton + + * libbfd.c (bfd_read): Do not attempt to get a negativly sized + amount from a bfd_in_memory structure. + (bfd_seek): Do not allow seeks past the end of a bfd_in_memory + structure. + +2000-01-14 Nick Clifton + + * linker.c (default_indirect_link_order): oops - fix incorrectly + applied patch from Tim Wall. + +2000-01-13 Timothy Wall (twall@tiac.net> + + * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx + = scnhsz, filhsz, relsz, aoutsz, etc) + + * coffswap.h: Ditto. + +2000-01-13 Nick Clifton + + * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to + interwork thumb to arm stub. + +2000-01-13 Timothy Wall (twall@tiac.net> + + * archures.c (bfd_octets_per_byte): New function: Return + target byte size. + (bfd_arch_mach_octets_per_byte): New function: Return target + byte size. + + * section.c: Distinguish between octets and bytes for usage of + _cooked_size, _raw_size, and output_offset. Clarify + description of bfd_set_section_contents. + + * bfd-in2.h: Regenerate. + + * coffgen.c: Indicate that the offset parameter is in bytes, not + octets. + + * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte + where appropriate to get the octet offset when calling + bfd_set_section_contents. + (bfd_coff_reloc_link_order): Ditto. + + * linker.c (bfd_generic_reloc_link_order): Ditto. + (_bfd_default_link_order): Ditto. + + * reloc.c (bfd_perform_relocation): Distinguish between octets + and bytes. Use octets when indexing into octet data; use bytes + when calculating target addresses. + (bfd_install_relocation): Ditto. + + * srec.c (srec_write_section): Ditto. + +2000-01-13 Nick Clifton + + * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from + 3 to 2. This allows 4 byte sized sections, which is necessary for + dlltool to build functioning DLLs. + +2000-01-10 Philip Blundell + + * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu. + (arm*-*-conix*): New target. + +2000-01-10 Egor Duda + + * config.bfd: Include elf32_i386 vector to target list for cygwin + and mingw. + + * config.in: Undefine HAVE_WIN32_PSTATUS_T. + * configure.in: Test for structure win32_pstatus_t in + + * configure: Regenerate. + + * elf.c (elfcore_grok_win32pstatus): New function: process + win32_pstatus_t notes in elf core file. + (elfcore_grok_note): Detect win32_pstatus notes. + +2000-01-03 Martin v. Loewis + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol + visibility. + * elflink.h (elf_link_add_object_symbols): Combine visibilities. + * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility. + +For older changes see ChangeLog-9899 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/bfd/ChangeLog-9193 b/contrib/binutils/bfd/ChangeLog-9193 index 15af931..01863de 100644 --- a/contrib/binutils/bfd/ChangeLog-9193 +++ b/contrib/binutils/bfd/ChangeLog-9193 @@ -408,7 +408,7 @@ Tue Nov 30 16:45:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE. (HDEPFILES): Define to be irix-core.o. * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o. Removed - sco-core.o, which no longer exists. + sco5-core.o, which no longer exists. (CFILES): Added all *-core.c files. Rebuilt dependencies. @@ -458,11 +458,11 @@ Mon Nov 22 14:17:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Mon Nov 22 10:54:27 1993 Fred Fish (fnf@cygnus.com) Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner): - * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE. - * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o. - * bfd/ptrace-core.c: New file for dealing with core files with + * config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE. + * config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o. + * ptrace-core.c: New file for dealing with core files with start with the ptrace_user structure found on BCS compliant systems. - * bfd/targets.c (ptrace_core_vec): New vector. + * targets.c (ptrace_core_vec): New vector. Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu) @@ -1855,7 +1855,7 @@ Thu Sep 2 00:59:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * libhppa.h (hppa_field_adjust): Remove unused `init_value' variable. * hosts/delta88v4.h: New for SVR4. - * configure.hosts: Use it. + * configure.host: Use it. Wed Sep 1 14:23:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) @@ -2379,8 +2379,9 @@ Sat Aug 7 09:14:21 1993 David J. Mackenzie (djm@thepub.cygnus.com) * config/i386-sco.mt (TDEFAULTS): Don't put &sco_core_vec in SELECT_VECS manually; -DSCO_CORE does it automatically now. - * config/h8300-coff.mt,h8500-coff.mt,sh-coff.mt,st2000.mt,z8k-coff.mt - (TDEFAULTS): Don't define BFD; not used. + * config/h8300-coff.mt, config/h8500-coff.mt, config/sh-coff.mt, + config/st2000.mt, config/z8k-coff.mt (TDEFAULTS): Don't define + BFD; not used. * config/hppaosf.mh (HDEFINES): Don't define SELECT_ARCHITECTURES; this is a host, not a target. @@ -2559,7 +2560,7 @@ Tue Aug 3 16:33:11 1993 David J. Mackenzie (djm@thepub.cygnus.com) Tue Aug 3 15:19:09 1993 Fred Fish (fnf@deneb.cygnus.com) - * nlm_slurp_symbol_table: Don't use '&' on arrays. + * nlmcode.h (nlm_slurp_symbol_table): Don't use '&' on arrays. Tue Aug 3 11:06:28 1993 Ian Lance Taylor (ian@cygnus.com) @@ -2671,7 +2672,7 @@ Mon Jul 26 17:39:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com) Yet another trad-core variant: * config/esix.mh, hosts/esix.h: New files. - * configure.hosts: Use them. + * configure.host: Use them. Mon Jul 26 13:22:15 1993 Ian Lance Taylor (ian@cygnus.com) @@ -3740,8 +3741,8 @@ Fri Apr 30 17:25:23 1993 Stu Grossman (grossman@cygnus.com) * The following patches are from Jeffrey Law . * hppa.c (hppa_core_file_p): Provide a temporary dummy routine for HOST_HPPABSD. - * bfd/hosts/hppabsd.h: Fix declarations of malloc and free. - * bfd/libhppa.h: Include sysdep here. Conditionalize + * hosts/hppabsd.h: Fix declarations of malloc and free. + * libhppa.h: Include sysdep here. Conditionalize includes based on HOST_HPPAHPUX or HOST_HPPABSD. Provide definitions for MAXCOMLEN and _PA_RISC_ID suitable for BSD. @@ -4424,7 +4425,7 @@ Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com) (bfd_com_section): Set SEC_IS_COMMON flag. * bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON. * aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c, - coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.: Use + coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.c: Use bfd_is_com_section macro rather than checking for equality to bfd_com_section. @@ -4850,7 +4851,7 @@ Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com) Thu Nov 5 04:43:09 1992 John Gilmore (gnu@cygnus.com) - * target.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT + * targets.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT macros; use PARAMS to declare the function pointers involved. * bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c, @@ -5261,12 +5262,6 @@ Fri Aug 28 16:29:15 1992 Ian Lance Taylor (ian@cygnus.com) large, assume we're using a swapped byte order and fail with wrong_format rather than dumping core. -Fri Aug 28 15:38:03 1992 Ken Raeburn (raeburn@cygnus.com) - - * Renamed opc-sparc.c to sparc-opc.c for systems with short - filename constraints. - * Makefile.in: Updated to reflect change. - Thu Aug 27 13:05:28 1992 Brendan Kehoe (brendan@cygnus.com) Add preliminary support for the we32k: @@ -5297,7 +5292,7 @@ Tue Aug 25 08:39:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) Fri Aug 14 15:39:29 PDT 1992 Howard Chu (hyc@hanauma.jpl.nasa.gov) Documentation fixes: - * ctors.c, format.c, section.c, reloc.c: append " -" to item tags. + * ctor.c, format.c, section.c, reloc.c: append " -" to item tags. * reloc.c, section.c, syms.c, targets.c: add DOCDD before @node comments. * reloc.c: break out addend item from surrounding text. @@ -5381,7 +5376,7 @@ Sat Aug 8 23:15:35 1992 Fred Fish (fnf@cygnus.com) pointers to bfd_byte* before performing arithmetic on them. Such use with bare void* pointers is a gcc extension. * cache.c (bfd_cache_delete): Forward decl with prototype form. - * archive (normalize): Add to CONST to match actual usages with + * archive.c (normalize): Add to CONST to match actual usages with CONST. Mon Aug 3 00:35:29 1992 Fred Fish (fnf@cygnus.com) @@ -5471,7 +5466,7 @@ Tue Jul 7 00:23:23 1992 Fred Fish (fnf@cygnus.com) Sat Jul 4 03:29:41 1992 John Gilmore (gnu at cygnus.com) - * syms.h: Define BSF_FILE, update BSF_SECTION_SYM desc. + * syms.c: Define BSF_FILE, update BSF_SECTION_SYM desc. * elf.c: Remove unconditional debug printf's. (elf_write_object_contents, elf_slurp_symbol_table): Handle BSF_SECTION_SYM <=> STT_SECTION, BSF_FILE <=> STT_FILE. @@ -5497,7 +5492,7 @@ Tue Jun 23 21:54:44 1992 Fred Fish (fnf@cygnus.com) * libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition. * reloc.c (bfd_default_reloc_type_lookup): Make cast on return type match actual return type. - * elf_print_symbol (section_name): Make CONST. + * section.c (elf_print_symbol): Make CONST. Mon Jun 22 17:35:24 1992 Per Bothner (bothner@cygnus.com) @@ -5766,7 +5761,7 @@ Tue May 12 14:08:59 1992 Steve Chamberlain (sac@thepub.cygnus.com) * opncls.c: don't use fdopen on DOS systems short patches from Glenn Kasten (glenn@ready.com) - * target.c: enabled oasys support + * targets.c: enabled oasys support * oasys.c: Insert . when UNDERSCORE_HACK is enabled, fix problem where a relocation which crossed a modification byte boundary did not work. Fix problem where a relocation near the end @@ -5923,7 +5918,7 @@ Tue Mar 17 14:12:25 1992 Per Bothner (bothner@rtl.cygnus.com) Tue Mar 17 10:45:12 1992 Steve Chamberlain (sac@thepub.cygnus.com) * aout-target.h: change ar_max_namelen to 15 (the right value) - * coff-a29k, coffcode.h: more hangovers from the bfd_abs_section + * coff-a29k.c, coffcode.h: more hangovers from the bfd_abs_section change Mon Mar 16 14:57:22 1992 Steve Chamberlain (sac@rtl.cygnus.com) @@ -6384,7 +6379,7 @@ Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com) * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c, coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c, - newos3.c, stab-syms.c, syms.c: All these files have had their + newsos3.c, stab-syms.c, syms.c: All these files have had their #includes altered to point to the new places. Fri Nov 29 20:04:49 1991 Fred Fish (fnf at cygnus.com) @@ -6792,7 +6787,7 @@ Fri Oct 11 13:03:02 1991 Per Bothner (bothner at cygnus.com) * host-aout.c (NAME(host_aout, callback) and NAME(host_aout,mkobject): Ditto. * i386aout.c (aout386_callback) and new aout386_mkobject): Ditto. - * newos3.c (newsos3_callback) and new newsos_mkobject): Ditto. + * newsos3.c (newsos3_callback) and new newsos_mkobject): Ditto. * aoutf1.c (sunos4_callback) and new sunos_mkobject): Ditto. * aoutx.h (NAME(aout,some_aout_object_p)): Don't subtract EXEC_BYTES_SIZE from the a_test size; this is only appropriate @@ -7182,7 +7177,7 @@ Wed Aug 21 14:33:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com) * bfd.c, reloc.c, syms.c: minor spelling/wording fixes in doc portions - * Makefile.in, awkscan-ip, awkscan-p, intobfd, + * Makefile.in, awkscan-ip, awkscan-p, doc/intobfd, libbfd.h, libcoff.h, tolibcoff; new bfd-in.h, libbfd-in.h, libcoff-in.h: (a) use separate files for invariant parts of bfd.h, libbfd.h, and libcoff.h; (b) in generated parts of same, use less @@ -7251,12 +7246,14 @@ Mon Jul 15 16:27:42 1991 Steve Chamberlain (steve at cygint.cygnus.com) Thu Jul 4 09:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com) - * Everything: created some new files, core.c format.c, reloc.c, - section.c and syms.c to split the functionality a bit better. + * core.c: New file. + * format.c: New file. + * reloc.c: New file. + * section.c: New file. + * syms.c: New filew. Cleaned up the rest of the files a bit, and added some documentation. - Mon Jul 1 13:29:47 1991 David Wood (wood at david.ultra.nya.edu) * opncls.c, ../include/sys/h-sun3.h ../include/sys/h-sun4.h: fcntl @@ -7299,7 +7296,7 @@ Fri Jun 7 12:35:46 1991 Sean Fagan (sef at cygint.cygnus.com) Thu Jun 6 18:27:38 1991 Steve Chamberlain (steve at cygint.cygnus.com) - * ../include/oasys.h oasys.c (oasys_archive_p): fixed so it works + * oasys.c (oasys_archive_p): fixed so it works * srec.c: now allows any number of sections to be created in a file. Outputs addresses of the right length. @@ -7445,7 +7442,7 @@ Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com) get_section_contents in favor of generics. New transfer vector regime. - * newsos.c: New support for Sony NEWS, another a.out format. + * newsos3.c: New support for Sony NEWS, another a.out format. * ecoff.c: Remove close_and_cleanup. New tvec regime. * icoff.c, m88k-bcs.c: Add write_contents to tvec. @@ -7465,7 +7462,7 @@ Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com) * liba.out.h: Handle the new aout.c split. Add prototypes for all routines defined in aout.c. Rename "sunos" things to "aout" things. Add a few fields where needed for various formats. - * Makefile.in: Add aout.c and newsos.c. + * Makefile.in: Add aout.c and newsos3.c. * archive.c, ieee.c, oasys.c: Lint. @@ -7698,7 +7695,7 @@ Mon Jan 28 19:15:29 PST 1991 steve@cygnus.com Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com - * bfd.h changed name of alignment entry in sec_struct to + * bfd.h: changed name of alignment entry in sec_struct to alignment_power, because of conflicting uses within bfd. Now it should be obvious that it's a 2**n alignment specifier. Removed start_pad, end_alignment, block, minsize, @@ -7706,21 +7703,21 @@ Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com Added align_power() macro. Fixed bfd_section_alignment acessor macros. Added bfd_symbol_same_target macro. - * b.out.c (b_out_write_object_contents) fixed to use + * b.out.c (b_out_write_object_contents): fixed to use new alignment member. Fixed (callj_callback) to use section relative symbols properly. - * sunos.c (sunos4_object_p) fixed to use new alignment_power. + * sunos.c (sunos4_object_p): fixed to use new alignment_power. Fixed (translate_from_native_sym_flags) to correctly make symbols section relative. - * bfd.c (bfd_errmsg) fixed various enum cast problems. - (bfd_make_section) took out initialization of obsolete members. - (bfd_print_symbol_vandf) added + * bfd.c (bfd_errmsg): fixed various enum cast problems. + (bfd_make_section): took out initialization of obsolete members. + (bfd_print_symbol_vandf): added - * opncls.c (bfd_create) created. + * opncls.c (bfd_create): created. - * coff-code.h (coff_new_section_hook) took away refs + * coff-code.h (coff_new_section_hook): took away refs to obsolete members. (make_a_section_from_file) added conversion between alignment types. (coff_symbol_from) added. (coff_count_linenumbers) only counts linenumbers @@ -7732,36 +7729,36 @@ Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com Sat Jan 19 16:10:42 PST 1991 steve@cygnus.com - * archive.c lots of lint + * archive.c> lots of lint. - * b.out.c added callj relocation support, upgrated reloc howto. + * b.out.c: added callj relocation support, upgrated reloc howto. Fixed so that asymbol and reloc records are output correctly. - * bfd.c lots of lint, support for new bfd entry point + * bfd.c: lots of lint, support for new bfd entry point bfd_print_symbol. - * bfd.h changed definition of asymbol to contain pointer to + * bfd.h: changed definition of asymbol to contain pointer to owning bfd, removed target dependencies. - * cache.c took out print statements, put in BFD_ASSERT calls. + * cache.c: took out print statements, put in BFD_ASSERT calls. - * coff-code.h various lints, corrected linenumber output + * coff-code.h: various lints, corrected linenumber output functionality. Added support for new style asymbols and bfd_print_symbol. Fixed so that asymbol and reloc records are handled correctly. Added timestamp. - * icoff.c Added support for new howto shape. + * icoff.c: Added support for new howto shape. - * liba.out.h Added support for new asymbol shape + * liba.out.h: Added support for new asymbol shape - * libbfd.c various lints + * libbfd.c: various lints - * libbfd.h various lints + * libbfd.h: various lints - * libcoff.h added support for new asymbol shape. + * libcoff.h: added support for new asymbol shape. - * sunos.c various lints. Added support for new asymbol shape + * sunos.c: various lints. Added support for new asymbol shape and bfd_print_symbol. Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com @@ -7785,7 +7782,7 @@ Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com Wed Jan 16 01:55:53 1991 John Gilmore (gnu at rtl) * ChangeLog: Started ChangeLog for BFD. - * ToDo: Create file for suggestions. + * TODO: Create file for suggestions. * Makefile: Support easy loading into Saber C. Add dependencies for icoff.o and bcs88kcoff.o. diff --git a/contrib/binutils/bfd/ChangeLog-9495 b/contrib/binutils/bfd/ChangeLog-9495 index 9868583..4657d66 100644 --- a/contrib/binutils/bfd/ChangeLog-9495 +++ b/contrib/binutils/bfd/ChangeLog-9495 @@ -178,7 +178,7 @@ Fri Dec 1 14:46:51 1995 Ian Lance Taylor * bfd.c (bfd_record_phdr): New function. * bfd-in.h (bfd_record_phdr): Declare. - * bfd_in2.h: Rebuild. + * bfd-in2.h: Rebuild. * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus BFD_ASSERT. @@ -407,7 +407,7 @@ Wed Nov 15 18:05:52 1995 Ian Lance Taylor _bfd_print_private_bfd_data from void * to PTR. * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast using PTR rather than void *. - * bfd-in2, libbfd.h: Rebuild. + * bfd-in2.h, libbfd.h: Rebuild. * peicode.h (pe_print_private_bfd_data): Change vfile from void * to PTR. * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as @@ -2357,7 +2357,7 @@ Wed Aug 6 09:12:50 1995 Doug Evans Sat Aug 5 00:04:08 1995 Jeff Law (law@snake.cs.utah.edu) - * som (som_get_reloc_upper_bound): Return -1 on error. Compute + * som.c (som_get_reloc_upper_bound): Return -1 on error. Compute return value with sizeof (arelent *), not sizeof (arelent). Wed Aug 2 12:32:21 1995 Ian Lance Taylor @@ -4334,7 +4334,7 @@ Thu Nov 17 17:37:39 1994 Ken Raeburn Thu Nov 17 13:12:08 1994 Jeff Law (law@snake.cs.utah.edu) - * bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the vma from the output_section containing $global$ when computing global_vlaue. @@ -7454,7 +7454,7 @@ Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) gas does this anyhow, but some other assemblers seem to leave garbage in the R_IHCONST address field. - * bfd/archive.c: Consistently use ARFMAG; from + * archive.c: Consistently use ARFMAG; from schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). (_bfd_write_archive_contents): Use ARFMAG rather than '`' and '\012'. @@ -8307,7 +8307,7 @@ Mon Mar 21 12:28:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Sun Mar 20 09:24:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - * bfd/som.c (som_begin_writing): Fix thinko (off by one error). + * som.c (som_begin_writing): Fix thinko (off by one error). * som.c (bfd_section_from_som_symbol): Only to do the value comparison for function symbols within executables. @@ -8539,7 +8539,7 @@ Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu) undefined symbols. Correctly distinguish between debugger symbols and section symbols. - * som (setup_sections): Set SEC_DEBUGGING and the section attributes + * som.c (setup_sections): Set SEC_DEBUGGING and the section attributes for spaces and subspaces. * som.c (som_bfd_count_ar_symbols): Fix typo. @@ -9587,7 +9587,7 @@ Mon Jan 24 12:38:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =). - * bfd/aoutx.h (aout_link_input_section_std, + * aoutx.h (aout_link_input_section_std, aout_link_input_section_ext): Pass additional arguments to reloc_overflow callback. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents, diff --git a/contrib/binutils/bfd/ChangeLog-9697 b/contrib/binutils/bfd/ChangeLog-9697 index dc22c8c..e9a5c1d 100644 --- a/contrib/binutils/bfd/ChangeLog-9697 +++ b/contrib/binutils/bfd/ChangeLog-9697 @@ -235,7 +235,7 @@ Tue Nov 25 11:26:27 1997 Ian Lance Taylor * 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 + * aclocal.m4, configure, Makefile.in: Rebuild with current automake and autoconf. * coff-arm.c (arm_allocate_interworking_sections): Fix typo @@ -672,7 +672,7 @@ Tue Sep 9 10:21:56 1997 Nick Clifton 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. + * elf64-alpha.c (reloc_howto_type): Fix the howto table. Thu Sep 4 09:44:10 1997 Ian Lance Taylor @@ -762,7 +762,10 @@ Tue Aug 26 17:26:51 1997 Ian Lance Taylor * 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. + * aclocal.m4: Rebuild. + * configure: Rebuild. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. Mon Aug 25 16:14:34 1997 Christopher Provenzano @@ -920,8 +923,10 @@ Sun Aug 10 14:45:56 1997 Ian Lance Taylor * 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. + * Makefile.am: Corresponding changes. + * configure.in: Corresponding changes. + * Makefile.in: Rebuild. + * configure: Rebuild. Fri Aug 8 18:34:36 1997 Ian Lance Taylor @@ -958,7 +963,9 @@ Fri Aug 1 12:58:32 1997 Ian Lance Taylor * 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. + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * configure: Rebuild. Thu Jul 31 19:55:36 1997 Ian Lance Taylor @@ -2022,7 +2029,7 @@ Thu Mar 20 12:39:02 1997 Ian Lance Taylor * cf-m68klynx.c: Simplify greatly: just define macros to control coff-m68k.c. * coff-aux.c: Likewise. Just leave add_one_symbol routine. - * targets. (m68ksysvcoff_vec): Declare. + * targets.c (m68ksysvcoff_vec): Declare. (bfd_target_vector): Add m68ksysvcoff_vec. * config.bfd (m68*-motorola-sysv*): New target. * configure.in (m68ksysvcoff_vec): New vector. @@ -2478,7 +2485,7 @@ Fri Feb 21 13:55:14 1997 Doug Evans Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns. Add small data area support (R_M32R_SDA16). * reloc.c: Document BFD_RELOC_M32R_SDA16. - * bfd-in2.h,libbfd.h: Regenerated. + * bfd-in2.h, libbfd.h: Regenerated. Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com) @@ -2495,12 +2502,18 @@ Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com) Tue Feb 18 17:22:59 1997 Martin M. Hunt - * Makefile.in, archures.c, config.bfd, configure.in, elf.c, - reloc.c, targets.c: New target, elf-*-D30V. - - * bfd-in2.h, configure, libbfd.h: Rebuilt. - - * cpu-d30v.c, elf32-d30v.c: New files. + * Makefile.in: New target, elf-*-D30V. + * archures.c: New target, elf-*-D30V. + * config.bfd: New target, elf-*-D30V. + * configure.in: New target, elf-*-D30V. + * elf.c: New target, elf-*-D30V. + * reloc.c: New target, elf-*-D30V. + * targets.c: New target, elf-*-D30V. + * bfd-in2.h: Rebuilt. + * configure: Rebuilt. + * libbfd.h: Rebuilt. + * cpu-d30v.c: New files. + * elf32-d30v.c: New files. Tue Feb 18 15:31:48 1997 Fred Fish @@ -3398,8 +3411,8 @@ Wed Oct 2 15:46:45 1996 Klaus Kaempf * evax-emh.c (get_vms_time_string): Local function now. (_bfd_evax_write_emh): Extract source filename and case_hack flags from symbol table. - * evax_write_etir (_bfd_evax_write_etir): Pass all symbol names - through _bfd_evax_case_hack_symbol. + (_bfd_evax_write_etir): Pass all symbol names through + _bfd_evax_case_hack_symbol. * evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New functions. (_bfd_evax_basename): Removed. @@ -3521,7 +3534,7 @@ Thu Sep 12 11:45:57 1996 Doug Evans * reloc.c: Add m32r relocs. * bfd-in2.h, libbfd.h: Rebuilt. - * cpu-m32r.c,elf32-m32r.c: New files. + * cpu-m32r.c, elf32-m32r.c: New files. Thu Sep 12 11:10:05 1996 Ian Lance Taylor @@ -3626,8 +3639,13 @@ Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com) Mon Sep 9 12:31:22 1996 Doug Evans - * config.bfd,configure.in,configure: Add m32r support. - * Makefile.in,archures.c,elf.c,targets.c: Likewise. + * config.bfd: Add m32r support. + * configure.in: Likewise. + * configure: Likewise. + * Makefile.in: Likewise. + * archures.c: Likewise. + * elf.c: Likewise. + * targets.c: Likewise. * config.bfd: Keep target list alphabetically sorted. Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com) @@ -4320,7 +4338,7 @@ Tue Jun 25 11:41:24 1996 Richard Henderson 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 @@ -4699,7 +4717,7 @@ Wed May 29 16:15:29 1996 Ian Lance Taylor * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to targ_selvecs. (mips*-*-elf*): Likewise. - * confingure.in: Add bfd_elf64_bigmips_vec and + * configure.in: Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to vector switch. * configure: Rebuild. * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function, @@ -5110,7 +5128,7 @@ Wed Apr 17 12:08:24 1996 Michael Meissner * pe{,i}-ppc.c (PPC_PE): Define instead of PPC, so that compiling on Solaris PowerPC systems doesn't get confused. - * ccffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not + * coffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not #ifdef PPC. * elfcore.h (bfd_prstatus, bfd_fpregset): Add thread argument. diff --git a/contrib/binutils/bfd/ChangeLog-9899 b/contrib/binutils/bfd/ChangeLog-9899 index c6348c4..6d7f5cd 100644 --- a/contrib/binutils/bfd/ChangeLog-9899 +++ b/contrib/binutils/bfd/ChangeLog-9899 @@ -2072,10 +2072,10 @@ Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com) 1999-06-10 Jakub Jelinek - * elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std + * elf64-sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std instead of R_SPARC_max. (sparc64_elf_info_to_howto): Likewise. - * elf32_sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. (elf32_sparc_info_to_howto): Likewise; handle vtable relocations. 1999-06-07 Richard Henderson @@ -2380,7 +2380,7 @@ Wed Jun 2 11:51:12 1999 Andreas Schwab 1999-05-25 Philip Blundell - * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function. + * elf32-arm.h (elf32_arm_link_hash_newfunc): New function. (elf32_arm_link_hash_table_create): Use above function as the constructor for hash table entries. (elf32_arm_relocate_section): Avoid crash when there is no output @@ -2431,7 +2431,7 @@ Mon May 17 13:35:35 1999 Stan Cox IMAGE_REL_MCORE_RVA. (coff_mcore_relocate_section): Add support for IMAGE_REL_MCORE_RVA. - * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE. + * elf32-mcore.c (mcore_elf_howto_): Add R_MCORE_RELATIVE. (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to R_MCORE_RELATIVE. (mcore_elf_relocate_section): Delete redundant case labels. @@ -2724,9 +2724,9 @@ Sat Apr 10 15:12:09 1999 Richard Henderson * targets.c: Add support for arm-epoc-pe target. * coff-arm.c: Allow header files to override definition of TARGET_UNDERSCORE and USER_LABEL_PREFIX. - * pe-arm.h: Allow previous header files to override definition of + * pe-arm.c: Allow previous header files to override definition of TARGET_LITTLE_SYM and TARGET_BIG_SYM. - * pei-arm.h: Allow previous header files to override definition of + * pei-arm.c: Allow previous header files to override definition of TARGET_LITTLE_SYM and TARGET_BIG_SYM. * epoc-pe-arm.c: New file. Support arm-epoc-pe target. * epoc-pei-arm.c: New file. Support arm-epoc-pei target. @@ -3079,7 +3079,8 @@ Tue Dec 22 15:21:41 1998 Catherine Moore 1998-12-16 Gavin Romig-Koch - * archures.c,bfd-in2.h (bfd_mach_mips4111): New. + * archures.c (bfd_mach_mips4111): New. + * bfd-in2.h: Regenerate. * cpu-mips.c: Add support for and independent 4111. * elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111. (_bfd_mips_elf_final_write_processing): @@ -3597,7 +3598,7 @@ Mon Oct 5 12:02:31 1998 Gavin Romig-Koch * dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line. * configure.in (elf): Add dwarf1.lo. - * elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info. + * elf-bfd.h (elf_ob_tdata): Add dwarf1_find_line_info. * elf.c (_bfd_elf_find_nearest_line): Add call to _bfd_dwarf1_find_nearest_line. * elf32-mips.c (_bfd_mips_elf_find_nearest_line): @@ -4334,7 +4335,10 @@ Thu Jun 25 18:31:41 1998 Richard Henderson * aout-adobe.c: Hook to default implementation. * aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise. * coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise. - * evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise. + * evax-alpha.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. * ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise. * tekhex.c, versados.c: Likewise. * libbfd-in.h (_bfd_nolink_bfd_gc_sections): New. @@ -4600,7 +4604,7 @@ Thu May 7 17:40:56 1998 Ian Lance Taylor * aoutx.h: Don't include . Use "sysdep.h" rather than . * archive.c: Don't include or . - * evax-alpha.c; Don't include . + * evax-alpha.c: Don't include . * evax-egsd.c: Likewise. * evax-etir.c: Likewise. * evax-misc.c: Likewise. diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am index 630cbe1..c96f171 100644 --- a/contrib/binutils/bfd/Makefile.am +++ b/contrib/binutils/bfd/Makefile.am @@ -25,19 +25,23 @@ BFD_H = bfd.h # 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 = \ +BFD32_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 \ - dwarf2.lo + merge.lo dwarf2.lo -BFD_LIBS_CFILES = \ +BFD64_LIBS = archive64.lo + +BFD32_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 \ - dwarf2.c + merge.c dwarf2.c + +BFD64_LIBS_CFILES = archive64.c # This list is alphabetized to make it easier to keep in sync # with the decls and initializer in archures.c. @@ -68,10 +72,14 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-mcore.lo \ cpu-mips.lo \ + cpu-mmix.lo \ cpu-ns32k.lo \ + cpu-openrisc.lo \ + cpu-pdp11.lo \ cpu-pj.lo \ cpu-powerpc.lo \ cpu-rs6000.lo \ + cpu-s390.lo \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ @@ -81,6 +89,7 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-we32k.lo \ cpu-w65.lo \ + cpu-xstormy16.lo \ cpu-z8k.lo ALL_MACHINES_CFILES = \ @@ -110,10 +119,14 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-mcore.c \ cpu-mips.c \ + cpu-mmix.c \ cpu-ns32k.c \ + cpu-openrisc.c \ + cpu-pdp11.c \ cpu-pj.c \ cpu-powerpc.c \ cpu-rs6000.c \ + cpu-s390.c \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ @@ -123,6 +136,7 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-we32k.c \ cpu-w65.c \ + cpu-xstormy16.c \ cpu-z8k.c # The .o files needed by all of the 32 bit vectors that are configured into @@ -154,7 +168,6 @@ BFD32_BACKENDS = \ coff-m68k.lo \ coff-m88k.lo \ coff-mips.lo \ - coff-pmac.lo \ coff-rs6000.lo \ coff-sh.lo \ coff-sparc.lo \ @@ -182,6 +195,7 @@ BFD32_BACKENDS = \ elf32-d30v.lo \ elf32-fr30.lo \ elf32-gen.lo \ + elf32-h8300.lo \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ @@ -197,14 +211,20 @@ BFD32_BACKENDS = \ elf-m10300.lo \ elf32-mcore.lo \ elf32-mips.lo \ + elf32-openrisc.lo \ elf32-pj.lo \ elf32-ppc.lo \ + elf32-s390.lo \ elf32-sh.lo \ elf32-sh-lin.lo \ + elf32-sh-nbsd.lo \ elf32-sparc.lo \ elf32-v850.lo \ + elf32-xstormy16.lo \ elf32.lo \ elflink.lo \ + elf-strtab.lo \ + elf-eh-frame.lo \ epoc-pe-arm.lo \ epoc-pei-arm.lo \ hp300bsd.lo \ @@ -236,6 +256,7 @@ BFD32_BACKENDS = \ ns32knetbsd.lo \ oasys.lo \ pc532-mach.lo \ + pdp11.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -292,7 +313,6 @@ BFD32_BACKENDS_CFILES = \ coff-m68k.c \ coff-m88k.c \ coff-mips.c \ - coff-pmac.c \ coff-rs6000.c \ coff-sh.c \ coff-sparc.c \ @@ -320,6 +340,7 @@ BFD32_BACKENDS_CFILES = \ elf32-d30v.c \ elf32-fr30.c \ elf32-gen.c \ + elf32-h8300.c \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ @@ -334,14 +355,20 @@ BFD32_BACKENDS_CFILES = \ elf-m10300.c \ elf32-mcore.c \ elf32-mips.c \ + elf32-openrisc.c \ elf32-pj.c \ elf32-ppc.c \ + elf32-s390.c \ elf32-sh.c \ elf32-sh-lin.c \ + elf32-sh-nbsd.c \ elf32-sparc.c \ elf32-v850.c \ + elf32-xstormy16.c \ elf32.c \ elflink.c \ + elf-strtab.c \ + elf-eh-frame.c \ epoc-pe-arm.c \ epoc-pei-arm.c \ hp300bsd.c \ @@ -373,6 +400,7 @@ BFD32_BACKENDS_CFILES = \ ns32knetbsd.c \ oasys.c \ pc532-mach.c \ + pdp11.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -416,8 +444,12 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-mmix.lo \ + elf64-ppc.lo \ + elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ + mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ pepigen.lo @@ -433,8 +465,12 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-mmix.c \ + elf64-ppc.c \ + elf64-s390.c \ elf64-sparc.c \ elf64.c \ + mmo.c \ nlm32-alpha.c \ nlm64.c @@ -462,6 +498,7 @@ OPTIONAL_BACKENDS_CFILES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ +BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ @@ -469,7 +506,8 @@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES # C source files that correspond to .o's. SOURCE_CFILES = \ - $(BFD_LIBS_CFILES) \ + $(BFD32_LIBS_CFILES) \ + $(BFD64_LIBS_CFILES) \ $(ALL_MACHINES_CFILES) \ $(BFD32_BACKENDS_CFILES) \ $(BFD64_BACKENDS_CFILES) \ @@ -487,7 +525,8 @@ SOURCE_HFILES = \ elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ - nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h + nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \ + xcoff-target.h version.h ## ... and all .h files which are in the build tree. BUILD_HFILES = \ @@ -499,12 +538,12 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES) BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) - for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/SRC-POTFILES.in + for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \ + && mv tmp.src $(srcdir)/po/SRC-POTFILES.in po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) - for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/BLD-POTFILES.in + for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \ + && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in # The following target is retained for upgrade purposes. # This target used to exist in older versions of this makefile, and was @@ -539,7 +578,7 @@ stamp-ofiles: Makefile ofiles: stamp-ofiles ; @true -libbfd_la_SOURCES = $(BFD_LIBS_CFILES) +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ @@ -610,12 +649,14 @@ pepigen.c : peXXigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c -BFD_H_DEPS= $(INCDIR)/ansidecl.h +BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.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) +$(BFD32_LIBS) \ + $(BFD64_LIBS) \ + $(ALL_MACHINES) \ + $(BFD32_BACKENDS) \ + $(BFD64_BACKENDS) \ + $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) # Install BFD include file, and others that it needs. install-data-local: $(BFD_H) @@ -623,8 +664,10 @@ install-data-local: $(BFD_H) $(mkinstalldirs) $(DESTDIR)$(includedir) $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h + $(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h +Makefile: $(srcdir)/configure.in # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) bfd.h @@ -684,7 +727,8 @@ stmp-bfd-h: bfd-in3.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 + reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h +BFD64_H_FILES = archive64.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 @@ -702,7 +746,7 @@ headers: # configured with --enable-maintainer-mode. $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true -stmp-bin2-h: $(BFD_H_FILES) +stmp-bin2-h: $(BFD_H_FILES) $(BFD64_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 @@ -739,12 +783,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ - $(INCDIR)/aout/ranlib.h -archures.lo: archures.c $(INCDIR)/filenames.h + $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h +archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h bfd.lo: bfd.c $(INCDIR)/filenames.h $(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 + $(INCDIR)/safe-ctype.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 $(INCDIR)/filenames.h coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h @@ -755,24 +800,28 @@ libbfd.lo: libbfd.c $(INCDIR)/filenames.h opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ targmatch.h hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h -srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h -binary.lo: binary.c $(INCDIR)/filenames.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h +binary.lo: binary.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def + $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def +merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(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 +archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h @@ -800,47 +849,55 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h +cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h -cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h 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 + $(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.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 + $(INCDIR)/safe-ctype.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 aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ - ns32k.h libaout.h $(INCDIR)/bfdlink.h + ns32k.h libaout.h $(INCDIR)/bfdlink.h aoutx.h $(INCDIR)/filenames.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ libaout.h aoutf1.h $(INCDIR)/filenames.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 $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h \ + $(INCDIR)/safe-ctype.h aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.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)/filenames.h $(INCDIR)/bfdlink.h \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.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 @@ -848,94 +905,94 @@ bout.lo: bout.c $(INCDIR)/filenames.h $(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 $(INCDIR)/filenames.h \ - coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ + coffcode.h coffswap.h cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ - libcoff.h coffcode.h coffswap.h + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(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 $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ - xcoff-target.h coffcode.h coffswap.h + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ - $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ + $(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \ + coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ - go32stub.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.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)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h libcoff.h dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ @@ -951,16 +1008,16 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ - coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h + $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/libiberty.h elf32-target.h elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -992,6 +1049,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h +elf32-h8300.lo: elf32-h8300.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/h8.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ @@ -1045,7 +1106,12 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.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)/elf/reloc-macros.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + ecoffswap.h elf32-target.h +elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -1055,11 +1121,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \ +elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \ + $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h @@ -1071,28 +1145,41 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/libiberty.h elf32-target.h +elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h elfcore.h elflink.h + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ + elflink.h elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h +elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h +elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ - coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ - coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.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 hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/filenames.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 + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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 $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ @@ -1101,9 +1188,9 @@ i386bsd.lo: i386bsd.c $(INCDIR)/filenames.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 i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/filenames.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 + $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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 $(INCDIR)/filenames.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 @@ -1124,7 +1211,7 @@ i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ libaout.h $(INCDIR)/os9k.h ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ - libieee.h + libieee.h $(INCDIR)/safe-ctype.h m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.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 @@ -1163,58 +1250,64 @@ nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.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)/filenames.h $(INCDIR)/oasys.h \ - liboasys.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/oasys.h liboasys.h pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h 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 +pdp11.lo: pdp11.c $(INCDIR)/filenames.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 $(INCDIR)/safe-ctype.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ - $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ - $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h coffcode.h peicode.h libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + coffcode.h peicode.h libpei.h pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ - $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ libpei.h pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/internal.h libcoff.h riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ @@ -1243,31 +1336,33 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - vms.h + $(INCDIR)/safe-ctype.h vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ + libxcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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)/filenames.h $(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 coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ - $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ + $(INCDIR)/coff/rs6k64.h libcoff.h libxcoff.h coffcode.h \ + coffswap.h demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.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 efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ - coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \ @@ -1293,14 +1388,29 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h elf64-target.h +elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf64-ppc.h elf64-target.h +elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ + elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h elfcore.h elflink.h +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ + elflink.h +mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ @@ -1308,8 +1418,8 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h irix-core.lo: irix-core.c $(INCDIR)/filenames.h lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h @@ -1328,9 +1438,9 @@ elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ $(INCDIR)/elf/reloc-macros.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h + $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in index 10beb2d..7333ca7 100644 --- a/contrib/binutils/bfd/Makefile.in +++ b/contrib/binutils/bfd/Makefile.in @@ -114,7 +114,12 @@ WIN32LDFLAGS = @WIN32LDFLAGS@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ bfd_backends = @bfd_backends@ +bfd_default_target_size = @bfd_default_target_size@ +bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ +bfd_version = @bfd_version@ +bfd_version_date = @bfd_version_date@ +bfd_version_string = @bfd_version_string@ l = @l@ tdefaults = @tdefaults@ wordsize = @wordsize@ @@ -144,21 +149,25 @@ BFD_H = bfd.h # 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 = \ +BFD32_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 \ - dwarf2.lo + merge.lo dwarf2.lo -BFD_LIBS_CFILES = \ +BFD64_LIBS = archive64.lo + +BFD32_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 \ - dwarf2.c + merge.c dwarf2.c + +BFD64_LIBS_CFILES = archive64.c # This list is alphabetized to make it easier to keep in sync # with the decls and initializer in archures.c. @@ -189,10 +198,14 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-mcore.lo \ cpu-mips.lo \ + cpu-mmix.lo \ cpu-ns32k.lo \ + cpu-openrisc.lo \ + cpu-pdp11.lo \ cpu-pj.lo \ cpu-powerpc.lo \ cpu-rs6000.lo \ + cpu-s390.lo \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ @@ -202,6 +215,7 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-we32k.lo \ cpu-w65.lo \ + cpu-xstormy16.lo \ cpu-z8k.lo @@ -232,10 +246,14 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-mcore.c \ cpu-mips.c \ + cpu-mmix.c \ cpu-ns32k.c \ + cpu-openrisc.c \ + cpu-pdp11.c \ cpu-pj.c \ cpu-powerpc.c \ cpu-rs6000.c \ + cpu-s390.c \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ @@ -245,6 +263,7 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-we32k.c \ cpu-w65.c \ + cpu-xstormy16.c \ cpu-z8k.c @@ -277,7 +296,6 @@ BFD32_BACKENDS = \ coff-m68k.lo \ coff-m88k.lo \ coff-mips.lo \ - coff-pmac.lo \ coff-rs6000.lo \ coff-sh.lo \ coff-sparc.lo \ @@ -305,6 +323,7 @@ BFD32_BACKENDS = \ elf32-d30v.lo \ elf32-fr30.lo \ elf32-gen.lo \ + elf32-h8300.lo \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ @@ -320,14 +339,20 @@ BFD32_BACKENDS = \ elf-m10300.lo \ elf32-mcore.lo \ elf32-mips.lo \ + elf32-openrisc.lo \ elf32-pj.lo \ elf32-ppc.lo \ + elf32-s390.lo \ elf32-sh.lo \ elf32-sh-lin.lo \ + elf32-sh-nbsd.lo \ elf32-sparc.lo \ elf32-v850.lo \ + elf32-xstormy16.lo \ elf32.lo \ elflink.lo \ + elf-strtab.lo \ + elf-eh-frame.lo \ epoc-pe-arm.lo \ epoc-pei-arm.lo \ hp300bsd.lo \ @@ -359,6 +384,7 @@ BFD32_BACKENDS = \ ns32knetbsd.lo \ oasys.lo \ pc532-mach.lo \ + pdp11.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -416,7 +442,6 @@ BFD32_BACKENDS_CFILES = \ coff-m68k.c \ coff-m88k.c \ coff-mips.c \ - coff-pmac.c \ coff-rs6000.c \ coff-sh.c \ coff-sparc.c \ @@ -444,6 +469,7 @@ BFD32_BACKENDS_CFILES = \ elf32-d30v.c \ elf32-fr30.c \ elf32-gen.c \ + elf32-h8300.c \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ @@ -458,14 +484,20 @@ BFD32_BACKENDS_CFILES = \ elf-m10300.c \ elf32-mcore.c \ elf32-mips.c \ + elf32-openrisc.c \ elf32-pj.c \ elf32-ppc.c \ + elf32-s390.c \ elf32-sh.c \ elf32-sh-lin.c \ + elf32-sh-nbsd.c \ elf32-sparc.c \ elf32-v850.c \ + elf32-xstormy16.c \ elf32.c \ elflink.c \ + elf-strtab.c \ + elf-eh-frame.c \ epoc-pe-arm.c \ epoc-pei-arm.c \ hp300bsd.c \ @@ -497,6 +529,7 @@ BFD32_BACKENDS_CFILES = \ ns32knetbsd.c \ oasys.c \ pc532-mach.c \ + pdp11.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -541,8 +574,12 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-mmix.lo \ + elf64-ppc.lo \ + elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ + mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ pepigen.lo @@ -559,8 +596,12 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-mmix.c \ + elf64-ppc.c \ + elf64-s390.c \ elf64-sparc.c \ elf64.c \ + mmo.c \ nlm32-alpha.c \ nlm64.c @@ -591,6 +632,7 @@ OPTIONAL_BACKENDS_CFILES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ +BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ @@ -598,7 +640,8 @@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES # C source files that correspond to .o's. SOURCE_CFILES = \ - $(BFD_LIBS_CFILES) \ + $(BFD32_LIBS_CFILES) \ + $(BFD64_LIBS_CFILES) \ $(ALL_MACHINES_CFILES) \ $(BFD32_BACKENDS_CFILES) \ $(BFD64_BACKENDS_CFILES) \ @@ -617,7 +660,8 @@ SOURCE_HFILES = \ elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ - nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h + nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \ + xcoff-target.h version.h BUILD_HFILES = \ @@ -635,7 +679,7 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) # COREFILE Core file routines for a native configuration OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ -libbfd_la_SOURCES = $(BFD_LIBS_CFILES) +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ @@ -648,12 +692,13 @@ libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ noinst_LIBRARIES = libbfd.a libbfd_a_SOURCES = -BFD_H_DEPS = $(INCDIR)/ansidecl.h +BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.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 + reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h +BFD64_H_FILES = archive64.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 @@ -672,6 +717,7 @@ LIBRARIES = $(noinst_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I. +#DEFS = @DEFS@ @elf_dynamic_interpreter@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -682,7 +728,7 @@ 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 dwarf2.lo +ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -1074,12 +1120,12 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) - for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/SRC-POTFILES.in + for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \ + && mv tmp.src $(srcdir)/po/SRC-POTFILES.in po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) - for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/BLD-POTFILES.in + for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \ + && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in # The following target is retained for upgrade purposes. # This target used to exist in older versions of this makefile, and was @@ -1164,10 +1210,12 @@ pepigen.c : peXXigen.c rm -f pepigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c -$(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) +$(BFD32_LIBS) \ + $(BFD64_LIBS) \ + $(ALL_MACHINES) \ + $(BFD32_BACKENDS) \ + $(BFD64_BACKENDS) \ + $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) # Install BFD include file, and others that it needs. install-data-local: $(BFD_H) @@ -1175,8 +1223,11 @@ install-data-local: $(BFD_H) $(mkinstalldirs) $(DESTDIR)$(includedir) $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h + $(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h +Makefile: $(srcdir)/configure.in + # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) bfd.h rm -f DEP1 @@ -1248,7 +1299,7 @@ headers: # configured with --enable-maintainer-mode. $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true -stmp-bin2-h: $(BFD_H_FILES) +stmp-bin2-h: $(BFD_H_FILES) $(BFD64_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 @@ -1277,12 +1328,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ - $(INCDIR)/aout/ranlib.h -archures.lo: archures.c $(INCDIR)/filenames.h + $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h +archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h bfd.lo: bfd.c $(INCDIR)/filenames.h $(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 + $(INCDIR)/safe-ctype.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 $(INCDIR)/filenames.h coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h @@ -1293,24 +1345,28 @@ libbfd.lo: libbfd.c $(INCDIR)/filenames.h opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ targmatch.h hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h -srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h -binary.lo: binary.c $(INCDIR)/filenames.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h +binary.lo: binary.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def + $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def +merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(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 +archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h @@ -1338,47 +1394,55 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h +cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h -cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h 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 + $(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.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 + $(INCDIR)/safe-ctype.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 aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ - ns32k.h libaout.h $(INCDIR)/bfdlink.h + ns32k.h libaout.h $(INCDIR)/bfdlink.h aoutx.h $(INCDIR)/filenames.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ libaout.h aoutf1.h $(INCDIR)/filenames.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 $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h \ + $(INCDIR)/safe-ctype.h aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.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)/filenames.h $(INCDIR)/bfdlink.h \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.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 @@ -1386,94 +1450,94 @@ bout.lo: bout.c $(INCDIR)/filenames.h $(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 $(INCDIR)/filenames.h \ - coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ + coffcode.h coffswap.h cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ - libcoff.h coffcode.h coffswap.h + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(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 $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ - xcoff-target.h coffcode.h coffswap.h + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ - $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ + $(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \ + coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ - go32stub.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.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)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h coffswap.h + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ - coffcode.h coffswap.h + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h libcoff.h dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ @@ -1489,16 +1553,16 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ - coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h + $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/libiberty.h elf32-target.h elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -1530,6 +1594,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h +elf32-h8300.lo: elf32-h8300.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/h8.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ @@ -1583,7 +1651,12 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.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)/elf/reloc-macros.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + ecoffswap.h elf32-target.h +elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -1593,11 +1666,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \ +elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \ + $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h @@ -1609,28 +1690,41 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/libiberty.h elf32-target.h +elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h elfcore.h elflink.h + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ + elflink.h elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h +elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h +elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ - coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ - coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.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 hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/filenames.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 + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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 $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ @@ -1639,9 +1733,9 @@ i386bsd.lo: i386bsd.c $(INCDIR)/filenames.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 i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/filenames.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 + $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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 $(INCDIR)/filenames.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 @@ -1662,7 +1756,7 @@ i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ libaout.h $(INCDIR)/os9k.h ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ - libieee.h + libieee.h $(INCDIR)/safe-ctype.h m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.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 @@ -1701,58 +1795,64 @@ nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.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)/filenames.h $(INCDIR)/oasys.h \ - liboasys.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/oasys.h liboasys.h pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h 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 +pdp11.lo: pdp11.c $(INCDIR)/filenames.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 $(INCDIR)/safe-ctype.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ - $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ - $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h coffcode.h peicode.h libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + coffcode.h peicode.h libpei.h pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ - $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ libpei.h pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/internal.h libcoff.h riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ @@ -1781,31 +1881,33 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - vms.h + $(INCDIR)/safe-ctype.h vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ + libxcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.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)/filenames.h $(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 coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ - $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ + $(INCDIR)/coff/rs6k64.h libcoff.h libxcoff.h coffcode.h \ + coffswap.h demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.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 efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ - coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ - peicode.h libpei.h + coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \ @@ -1831,14 +1933,29 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h elf64-target.h +elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf64-ppc.h elf64-target.h +elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ + elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h elfcore.h elflink.h +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ + elflink.h +mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ @@ -1846,8 +1963,8 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h irix-core.lo: irix-core.c $(INCDIR)/filenames.h lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h @@ -1866,11 +1983,11 @@ elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ $(INCDIR)/elf/reloc-macros.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h + $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/contrib/binutils/bfd/README b/contrib/binutils/bfd/README index 992c285..fe6b6f3 100644 --- a/contrib/binutils/bfd/README +++ b/contrib/binutils/bfd/README @@ -1,4 +1,4 @@ -BFD is a an object file library. It permits applications to use the +BFD is an object file library. It permits applications to use the same routines to process object files regardless of their format. BFD is used by the GNU debugger, assembler, linker, and the binary diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c index ddb0325..b87e09c 100644 --- a/contrib/binutils/bfd/aout-arm.c +++ b/contrib/binutils/bfd/aout-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright 1994, 1995, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) @@ -19,80 +19,90 @@ 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 N_TXTADDR(x) \ - ((N_MAGIC(x) == NMAGIC) ? 0x8000 : \ - (N_MAGIC(x) != ZMAGIC) ? 0 : \ - (N_SHARED_LIB(x)) ? ((x).a_entry & ~(TARGET_PAGE_SIZE - 1)) : \ - TEXT_START_ADDR) +#include "bfd.h" +#include "sysdep.h" + +/* Avoid multiple defininitions from aoutx if supporting standarad a.out + as well as our own. */ +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define NAME(x,y) CONCAT3 (aoutarm,_32_,y) + +#define N_TXTADDR(x) \ + ((N_MAGIC (x) == NMAGIC) \ + ? (bfd_vma) 0x8000 \ + : ((N_MAGIC (x) != ZMAGIC) \ + ? (bfd_vma) 0 \ + : ((N_SHARED_LIB (x)) \ + ? ((x).a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \ + : (bfd_vma) TEXT_START_ADDR))) #define TEXT_START_ADDR 0x8000 #define TARGET_PAGE_SIZE 0x8000 #define SEGMENT_SIZE TARGET_PAGE_SIZE #define DEFAULT_ARCH bfd_arch_arm -#define MY(OP) CAT(aoutarm_,OP) +#define MY(OP) CONCAT2 (aoutarm_,OP) #define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \ (((x).a_info & ~006000) != OMAGIC) && \ ((x).a_info != NMAGIC)) #define N_MAGIC(x) ((x).a_info & ~07200) -#include "bfd.h" -#include "sysdep.h" - -#define MYARM(OP) CAT(aoutarm_,OP) -reloc_howto_type *MYARM(bfd_reloc_type_lookup) - PARAMS((bfd *, bfd_reloc_code_real_type)); -static boolean MYARM(write_object_contents) PARAMS((bfd *)); - -/* Avoid multiple defininitions from aoutx if supporting standarad a.out - as well as our own. */ -#define NAME(x,y) CAT3(aoutarm,_32_,y) - #define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup #include "libaout.h" #include "aout/aout64.h" -static bfd_reloc_status_type -MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); - -static bfd_reloc_status_type -MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); -static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, - arelent *, asymbol **, - bfd_size_type)); -void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, - struct reloc_std_external *)); - +static boolean MY(write_object_contents) + PARAMS ((bfd *)); +static bfd_reloc_status_type MY(fix_pcrel_26_done) + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type MY(fix_pcrel_26) + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static void MY(swap_std_reloc_in) + PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, + bfd_size_type)); +reloc_howto_type *MY(bfd_reloc_type_lookup) + PARAMS ((bfd *, bfd_reloc_code_real_type)); +reloc_howto_type * MY(reloc_howto) + PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *)); +void MY(put_reloc) + PARAMS ((bfd *, int, int, bfd_vma, reloc_howto_type *, + struct reloc_std_external *)); +void MY(relocatable_reloc) + PARAMS ((reloc_howto_type *, bfd *, struct reloc_std_external *, bfd_vma *, + bfd_vma)); +void MY(swap_std_reloc_out) + PARAMS ((bfd *, arelent *, struct reloc_std_external *)); + reloc_howto_type MY(howto_table)[] = -{ - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask - pcdone */ - HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, - 0x000000ff, 0x000000ff, false), - HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, - 0xffffffff, 0xffffffff, false), - HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), - "ARM26", true, 0x00ffffff, 0x00ffffff, true), - HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, - 0x000000ff, 0x000000ff, true), - HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, - 0x0000ffff, 0x0000ffff, true), - HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, - 0xffffffff, 0xffffffff, true), - HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, - MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, - false), - EMPTY_HOWTO (-1), - HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, - 0xffffffff, 0xffffffff, false) -}; + { + /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl + readmask setmask pcdone. */ + HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, + 0x000000ff, 0x000000ff, false), + HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, + 0x0000ffff, 0x0000ffff, false), + HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, + 0xffffffff, 0xffffffff, false), + HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), + "ARM26", true, 0x00ffffff, 0x00ffffff, true), + HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, + 0x000000ff, 0x000000ff, true), + HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, + 0x0000ffff, 0x0000ffff, true), + HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, + 0xffffffff, 0xffffffff, true), + HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, + MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, + false), + EMPTY_HOWTO (-1), + HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, + 0x0000ffff, 0x0000ffff, false), + HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, + 0xffffffff, 0xffffffff, false) + }; #define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08) #define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10) @@ -148,7 +158,7 @@ MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc) bfd *abfd; int r_extern; int r_index; - long value; + bfd_vma value; reloc_howto_type *howto; struct reloc_std_external *reloc; { @@ -157,14 +167,16 @@ MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc) int r_neg; PUT_WORD (abfd, value, reloc->r_address); - r_length = howto->size ; /* Size as a power of two */ + /* Size as a power of two. */ + r_length = howto->size; /* Special case for branch relocations. */ if (howto->type == 3 || howto->type == 7) r_length = 3; - r_pcrel = howto->type & 4; /* PC Relative done? */ - r_neg = howto->type & 8; /* Negative relocation */ + r_pcrel = howto->type & 4; /* PC Relative done? */ + r_neg = howto->type & 8; /* Negative relocation. */ + if (bfd_header_big_endian (abfd)) { reloc->r_index[0] = r_index >> 16; @@ -255,10 +267,10 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, { bfd_vma relocation; bfd_size_type addr = reloc_entry->address; - long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); + bfd_vma target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; @@ -270,7 +282,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_ok; relocation = (target & 0x00ffffff) << 2; - relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */ + relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -281,16 +293,16 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, if (relocation & 3) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & 0x02000000) { if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff) flag = bfd_reloc_overflow; } - else if (relocation & ~0x03ffffff) + else if (relocation & ~ (bfd_vma) 0x03ffffff) flag = bfd_reloc_overflow; - target &= ~0x00ffffff; + target &= ~ (bfd_vma) 0x00ffffff; target |= (relocation >> 2) & 0x00ffffff; bfd_put_32 (abfd, target, (bfd_byte *) data + addr); @@ -313,7 +325,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) case 32: code = BFD_RELOC_32; break; - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (const struct reloc_howto_struct *) 0; } switch (code) @@ -324,7 +337,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) ASTD (BFD_RELOC_8_PCREL, 4); ASTD (BFD_RELOC_16_PCREL, 5); ASTD (BFD_RELOC_32_PCREL, 6); - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (const struct reloc_howto_struct *) 0; } } @@ -350,7 +364,7 @@ MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount) int r_pcrel; struct aoutdata *su = &(abfd->tdata.aout_data->a); - cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address); + cache_ptr->address = H_GET_32 (abfd, bytes->r_address); cache_ptr->howto = MY_reloc_howto (abfd, bytes, r_index, r_extern, r_pcrel); @@ -419,25 +433,25 @@ MY_swap_std_reloc_out (abfd, g, natptr) if (bfd_abs_section.symbol == sym) { /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ + from the abs section. */ r_index = 0; r_extern = 0; } else { - /* Fill in symbol */ + /* Fill in symbol. */ r_extern = 1; r_index = (*(g->sym_ptr_ptr))->KEEPIT; } } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -469,83 +483,83 @@ MY_swap_std_reloc_out (abfd, g, natptr) extern const bfd_target aout_arm_big_vec; const bfd_target aout_arm_little_vec = -{ - "a.out-arm-little", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_LITTLE, /* target byte order (little) */ - BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ - (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 | SEC_CODE | SEC_DATA), - MY_symbol_leading_char, - AR_PAD_CHAR, /* 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, 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), - - & aout_arm_big_vec, - - (PTR) MY_backend_data, -}; + { + "a.out-arm-little", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_LITTLE, /* target byte order (little) */ + BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ + (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 | SEC_CODE | SEC_DATA), + MY_symbol_leading_char, + AR_PAD_CHAR, /* 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, 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), + + & aout_arm_big_vec, + + (PTR) MY_backend_data, + }; const bfd_target aout_arm_big_vec = -{ - "a.out-arm-big", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_BIG, /* target byte order (big) */ - BFD_ENDIAN_BIG, /* target headers byte order (big) */ - (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 | SEC_CODE | SEC_DATA), - 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), - - & aout_arm_little_vec, - - (PTR) MY_backend_data, -}; + { + "a.out-arm-big", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_BIG, /* target byte order (big) */ + BFD_ENDIAN_BIG, /* target headers byte order (big) */ + (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 | SEC_CODE | SEC_DATA), + 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), + + & aout_arm_little_vec, + + (PTR) MY_backend_data, + }; diff --git a/contrib/binutils/bfd/aout-encap.c b/contrib/binutils/bfd/aout-encap.c index 77d6358..84c46c6 100644 --- a/contrib/binutils/bfd/aout-encap.c +++ b/contrib/binutils/bfd/aout-encap.c @@ -1,5 +1,6 @@ /* BFD back-end for a.out files encapsulated with COFF headers. - Copyright 1990, 1991, 1994, 1995, 2000 Free Software Foundation, Inc. + Copyright 1990, 1991, 1994, 1995, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -27,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #include "bfd.h" -#include +#include "sysdep.h" #include "libbfd.h" -#include +#include "aout/aout64.h" #include "aout/stab_gnu.h" #include "aout/ar.h" #include "libaout.h" /* BFD a.out internal data structures */ @@ -45,39 +46,40 @@ encap_object_p (abfd) short coff_magic; struct external_exec exec_bytes; struct internal_exec exec; + bfd_size_type amt = sizeof (magicbuf); - if (bfd_read ((PTR)magicbuf, 1, sizeof (magicbuf), abfd) != - sizeof (magicbuf)) + if (bfd_bread ((PTR) magicbuf, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return 0; } - coff_magic = bfd_h_get_16 (abfd, magicbuf); + coff_magic = H_GET_16 (abfd, magicbuf); if (coff_magic != COFF_MAGIC) return 0; /* Not an encap coff file */ - __header_offset_temp==COFF_MAGIC ? sizeof (struct coffheader) : 0) - (fseek ((f), HEADER_OFFSET((f)), 1)) + magic = H_GET_32 (abfd, magicbuf); - magic = bfd_h_get_32 (abfd, magicbuf); - - if (N_BADMAG (*((struct internal_exec *) &magic))) return 0; + if (N_BADMAG (*((struct internal_exec *) &magic))) + return 0; - struct external_exec exec_bytes; - 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); + if (bfd_seek (abfd, (file_ptr) sizeof (struct coffheader), SEEK_SET) != 0) return 0; - } + + amt = EXEC_BYTES_SIZE; + if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec); return aout_32_some_aout_object_p (abfd, &exec, encap_realcallback); } -/* Finish up the reading of a encapsulated-coff a.out file header */ +/* Finish up the reading of an encapsulated-coff a.out file header. */ const bfd_target * encap_real_callback (abfd) bfd *abfd; @@ -90,24 +92,26 @@ encap_real_callback (abfd) text_start and exec_data_start. This is particularly useful for remote debugging of embedded systems. */ if (N_FLAGS(exec_aouthdr) & N_FLAGS_COFF_ENCAPSULATE) - { - struct coffheader ch; - int val; - val = lseek (execchan, -(sizeof (AOUTHDR) + sizeof (ch)), 1); - if (val == -1) - perror_with_name (filename); - val = myread (execchan, &ch, sizeof (ch)); - if (val < 0) - perror_with_name (filename); - text_start = ch.text_start; - exec_data_start = ch.data_start; - } else - { - text_start = - IS_OBJECT_FILE (exec_aouthdr) ? 0 : N_TXTADDR (exec_aouthdr); - exec_data_start = IS_OBJECT_FILE (exec_aouthdr) - ? exec_aouthdr.a_text : N_DATADDR (exec_aouthdr); - } + { + struct coffheader ch; + int val; + val = lseek (execchan, -(sizeof (AOUTHDR) + sizeof (ch)), 1); + if (val == -1) + perror_with_name (filename); + val = myread (execchan, &ch, sizeof (ch)); + if (val < 0) + perror_with_name (filename); + text_start = ch.text_start; + exec_data_start = ch.data_start; + } + else + { + text_start = + IS_OBJECT_FILE (exec_aouthdr) ? 0 : N_TXTADDR (exec_aouthdr); + exec_data_start = (IS_OBJECT_FILE (exec_aouthdr) + ? exec_aouthdr.a_text + : N_DATADDR (exec_aouthdr)); + } /* Determine the architecture and machine type of the object file. */ bfd_default_set_arch_mach(abfd, bfd_arch_m68k, 0); /* FIXME */ @@ -127,10 +131,10 @@ encap_write_object_contents (abfd) struct external_exec exec_bytes; struct internal_exec *execp = exec_hdr (abfd); -/****** FIXME: Fragments from the old GNU LD program for dealing with - encap coff. */ -struct coffheader coffheader; -int need_coff_header; + /* FIXME: Fragments from the old GNU LD program for dealing with + encap coff. */ + struct coffheader coffheader; + int need_coff_header; /* Determine whether to count the header as part of the text size, and initialize the text size accordingly. diff --git a/contrib/binutils/bfd/aout-sparcle.c b/contrib/binutils/bfd/aout-sparcle.c index d8ad8a5..7772c29 100644 --- a/contrib/binutils/bfd/aout-sparcle.c +++ b/contrib/binutils/bfd/aout-sparcle.c @@ -1,5 +1,5 @@ /* BFD backend for sparc little-endian aout binaries. - Copyright 1996 Free Software Foundation, Inc. + Copyright 1996, 2001 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,7 +19,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGETNAME "a.out-sparc-little" -#define MY(OP) CAT(sparcle_aout_,OP) + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (sparcle_aout_,OP) #include "bfd.h" #include "bfdlink.h" diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h index 2e74e37..ccedb93 100644 --- a/contrib/binutils/bfd/aout-target.h +++ b/contrib/binutils/bfd/aout-target.h @@ -88,9 +88,9 @@ MY(callback) (abfd) /* Determine the architecture and machine type of the object file. */ #ifdef SET_ARCH_MACH - SET_ARCH_MACH(abfd, *execp); + SET_ARCH_MACH (abfd, *execp); #else - bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0); + bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0); #endif /* The number of relocation records. This must be called after @@ -146,18 +146,19 @@ MY(object_p) (abfd) struct external_exec exec_bytes; /* Raw exec header from file */ struct internal_exec exec; /* Cleaned-up exec header */ const bfd_target *target; + bfd_size_type amt = EXEC_BYTES_SIZE; - 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; - } + if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt) + { + 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); + exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info); #endif /* SWAP_MAGIC */ if (N_BADMAG (exec)) return 0; @@ -250,6 +251,8 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) file header, symbols, and relocation. */ #ifndef MY_write_object_contents +static boolean MY(write_object_contents) PARAMS ((bfd *)); + static boolean MY(write_object_contents) (abfd) bfd *abfd; @@ -326,7 +329,7 @@ MY(set_sizes) (abfd) #define MY_finish_dynamic_link 0 #endif -static CONST struct aout_backend_data MY(backend_data) = { +static const struct aout_backend_data MY(backend_data) = { MY_zmagic_contiguous, MY_text_includes_header, MY_entry_is_text_address, @@ -507,6 +510,9 @@ MY_bfd_final_link (abfd, info) #ifndef MY_bfd_gc_sections #define MY_bfd_gc_sections bfd_generic_gc_sections #endif +#ifndef MY_bfd_merge_sections +#define MY_bfd_merge_sections bfd_generic_merge_sections +#endif #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup) #endif diff --git a/contrib/binutils/bfd/aout0.c b/contrib/binutils/bfd/aout0.c index 1d4c66e..731d476 100644 --- a/contrib/binutils/bfd/aout0.c +++ b/contrib/binutils/bfd/aout0.c @@ -1,5 +1,5 @@ /* BFD backend for SunOS style a.out with flags set to 0 - Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,7 +20,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGETNAME "a.out-zero-big" -#define MY(OP) CAT(aout0_big_,OP) + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (aout0_big_,OP) #include "bfd.h" diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h index a62c68d..0f773a1 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, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, + 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -75,7 +76,7 @@ The name put into the target vector. #endif static boolean sunos_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static void sunos_set_arch_mach PARAMS ((bfd *, int)); +static void sunos_set_arch_mach PARAMS ((bfd *, enum machine_type)); static void choose_reloc_size PARAMS ((bfd *)); static boolean sunos_write_object_contents PARAMS ((bfd *)); static const bfd_target *sunos4_core_file_p PARAMS ((bfd *)); @@ -113,11 +114,11 @@ sunos_merge_private_bfd_data (ibfd, obfd) static void sunos_set_arch_mach (abfd, machtype) bfd *abfd; - int machtype; + enum machine_type machtype; { /* Determine the architecture and machine type of the object file. */ enum bfd_architecture arch; - long machine; + unsigned long machine; switch (machtype) { @@ -259,7 +260,7 @@ sunos_write_object_contents (abfd) N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags); - N_SET_DYNAMIC (*execp, bfd_get_file_flags (abfd) & DYNAMIC); + N_SET_DYNAMIC (*execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC)); WRITE_HEADERS (abfd, execp); @@ -422,8 +423,8 @@ swapcore_sun3 (abfd, ext, intcore) { struct external_sun3_core *extcore = (struct external_sun3_core *) ext; - intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic); - intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len); + intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic); + intcore->c_len = H_GET_32 (abfd, &extcore->c_len); intcore->c_regs_pos = (long) (((struct external_sun3_core *) 0)->c_regs); intcore->c_regs_size = sizeof (extcore->c_regs); #if ARCH_SIZE == 64 @@ -432,20 +433,21 @@ swapcore_sun3 (abfd, ext, intcore) aout_32_swap_exec_header_in #endif (abfd, &extcore->c_aouthdr, &intcore->c_aouthdr); - intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo); - intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize); - intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize); + intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo); + intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize); + intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize); intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr); - intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize); + intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize); memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff); /* FP stuff takes up whole rest of struct, except c_ucode. */ intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_sun3_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ - intcore->c_ucode = - bfd_h_get_32 (abfd, - intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore); + intcore->c_ucode = H_GET_32 (abfd, + (intcore->c_len + - sizeof (extcore->c_ucode) + + (unsigned char *) extcore)); intcore->c_stacktop = 0x0E000000; /* By experimentation */ } @@ -458,8 +460,8 @@ swapcore_sparc (abfd, ext, intcore) { struct external_sparc_core *extcore = (struct external_sparc_core *) ext; - intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic); - intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len); + intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic); + intcore->c_len = H_GET_32 (abfd, &extcore->c_len); intcore->c_regs_pos = (long) (((struct external_sparc_core *) 0)->c_regs); intcore->c_regs_size = sizeof (extcore->c_regs); #if ARCH_SIZE == 64 @@ -468,20 +470,21 @@ swapcore_sparc (abfd, ext, intcore) aout_32_swap_exec_header_in #endif (abfd, &extcore->c_aouthdr, &intcore->c_aouthdr); - intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo); - intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize); - intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize); + intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo); + intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize); + intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize); intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr); - intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize); + intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize); memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff); /* FP stuff takes up whole rest of struct, except c_ucode. */ intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_sparc_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ - intcore->c_ucode = - bfd_h_get_32 (abfd, - intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore); + intcore->c_ucode = H_GET_32 (abfd, + (intcore->c_len + - sizeof (extcore->c_ucode) + + (unsigned char *) extcore)); /* Supposedly the user stack grows downward from the bottom of kernel memory. Presuming that this remains true, this definition will work. */ @@ -499,8 +502,7 @@ swapcore_sparc (abfd, ext, intcore) #define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000) #define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000) { - bfd_vma sp = bfd_h_get_32 - (abfd, (unsigned char *) &((struct regs *) &extcore->c_regs[0])->r_o6); + bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6); if (sp < SPARC_USRSTACK_SPARC10) intcore->c_stacktop = SPARC_USRSTACK_SPARC10; else @@ -518,8 +520,8 @@ swapcore_solaris_bcp (abfd, ext, intcore) struct external_solaris_bcp_core *extcore = (struct external_solaris_bcp_core *) ext; - intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic); - intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len); + intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic); + intcore->c_len = H_GET_32 (abfd, &extcore->c_len); intcore->c_regs_pos = (long) (((struct external_solaris_bcp_core *) 0)->c_regs); intcore->c_regs_size = sizeof (extcore->c_regs); @@ -534,12 +536,11 @@ swapcore_solaris_bcp (abfd, ext, intcore) the data section is written from address zero instead of the data start address. */ memset ((PTR) &intcore->c_aouthdr, 0, sizeof (struct internal_exec)); - intcore->c_data_addr = - bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_exdata_datorg); - intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo); - intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize); - intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize); - intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize); + intcore->c_data_addr = H_GET_32 (abfd, &extcore->c_exdata_datorg); + intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo); + intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize); + intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize); + intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize); memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_solaris_bcp_core *) 0)->fp_stuff); @@ -547,9 +548,10 @@ swapcore_solaris_bcp (abfd, ext, intcore) intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_solaris_bcp_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ - intcore->c_ucode = - bfd_h_get_32 (abfd, - intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore); + intcore->c_ucode = H_GET_32 (abfd, + (intcore->c_len + - sizeof (extcore->c_ucode) + + (unsigned char *) extcore)); /* Supposedly the user stack grows downward from the bottom of kernel memory. Presuming that this remains true, this definition will work. */ @@ -567,8 +569,7 @@ swapcore_solaris_bcp (abfd, ext, intcore) #define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000) #define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000) { - bfd_vma sp = bfd_h_get_32 - (abfd, (unsigned char *) &((struct regs *) &extcore->c_regs[0])->r_o6); + bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6); if (sp < SPARC_USRSTACK_SPARC10) intcore->c_stacktop = SPARC_USRSTACK_SPARC10; else @@ -598,7 +599,7 @@ sunos4_core_file_p (abfd) bfd *abfd; { unsigned char longbuf[4]; /* Raw bytes of various header fields */ - bfd_size_type core_size; + bfd_size_type core_size, amt; unsigned long core_mag; struct internal_sunos_core *core; char *extcore; @@ -607,38 +608,41 @@ sunos4_core_file_p (abfd) struct sun_core_struct suncoredata; struct internal_sunos_core internal_sunos_core; char external_core[1]; - } - *mergem; + } *mergem; - if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) != - sizeof (longbuf)) + if (bfd_bread ((PTR) longbuf, (bfd_size_type) sizeof (longbuf), abfd) + != sizeof (longbuf)) return 0; - core_mag = bfd_h_get_32 (abfd, longbuf); + core_mag = H_GET_32 (abfd, longbuf); if (core_mag != CORE_MAGIC) return 0; /* SunOS core headers can vary in length; second word is size; */ - if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) != - sizeof (longbuf)) + if (bfd_bread ((PTR) longbuf, (bfd_size_type) sizeof (longbuf), abfd) + != sizeof (longbuf)) return 0; - core_size = bfd_h_get_32 (abfd, longbuf); + core_size = H_GET_32 (abfd, longbuf); /* Sanity check */ if (core_size > 20000) return 0; - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0) + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return 0; - mergem = (struct mergem *) bfd_zalloc (abfd, core_size + sizeof (struct mergem)); + amt = core_size + sizeof (struct mergem); + mergem = (struct mergem *) bfd_zalloc (abfd, amt); if (mergem == NULL) return 0; extcore = mergem->external_core; - if ((bfd_read ((PTR) extcore, 1, core_size, abfd)) != core_size) + if ((bfd_bread ((PTR) extcore, core_size, abfd)) != core_size) { + loser: bfd_release (abfd, (char *) mergem); + abfd->tdata.any = NULL; + bfd_section_list_clear (abfd); return 0; } @@ -659,47 +663,29 @@ sunos4_core_file_p (abfd) break; default: bfd_set_error (bfd_error_system_call); /* FIXME */ - bfd_release (abfd, (char *) mergem); - return 0; + goto loser; } abfd->tdata.sun_core_data = &mergem->suncoredata; abfd->tdata.sun_core_data->hdr = core; - /* create the sections. This is raunchy, but bfd_close wants to reclaim - them */ - core_stacksec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + /* Create the sections. */ + core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); if (core_stacksec (abfd) == NULL) - { - loser: - bfd_release (abfd, (char *) mergem); - return 0; - } - core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + /* bfd_release frees everything allocated after it's arg. */ + goto loser; + + core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); if (core_datasec (abfd) == NULL) - { - loser1: - bfd_release (abfd, core_stacksec (abfd)); - goto loser; - } - core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + goto loser; + + core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); if (core_regsec (abfd) == NULL) - { - loser2: - bfd_release (abfd, core_datasec (abfd)); - goto loser1; - } - core_reg2sec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); - if (core_reg2sec (abfd) == NULL) - { - bfd_release (abfd, core_regsec (abfd)); - goto loser2; - } + goto loser; - core_stacksec (abfd)->name = ".stack"; - core_datasec (abfd)->name = ".data"; - core_regsec (abfd)->name = ".reg"; - core_reg2sec (abfd)->name = ".reg2"; + core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2"); + if (core_reg2sec (abfd) == NULL) + goto loser; core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; @@ -728,13 +714,6 @@ sunos4_core_file_p (abfd) core_regsec (abfd)->alignment_power = 2; core_reg2sec (abfd)->alignment_power = 2; - abfd->sections = core_stacksec (abfd); - core_stacksec (abfd)->next = core_datasec (abfd); - core_datasec (abfd)->next = core_regsec (abfd); - core_regsec (abfd)->next = core_reg2sec (abfd); - - abfd->section_count = 4; - return abfd->xvec; } @@ -822,7 +801,7 @@ sunos4_set_sizes (abfd) #define MY_finish_dynamic_link 0 #endif -static CONST struct aout_backend_data sunos4_aout_backend = +static const struct aout_backend_data sunos4_aout_backend = { 0, /* zmagic files are not contiguous */ 1, /* text includes header */ diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h index 490ead7..0a3c05a 100644 --- a/contrib/binutils/bfd/aoutx.h +++ b/contrib/binutils/bfd/aoutx.h @@ -120,9 +120,9 @@ DESCRIPTION #define KEEPIT udata.i -#include #include "bfd.h" #include "sysdep.h" +#include "safe-ctype.h" #include "bfdlink.h" #include "libaout.h" @@ -139,6 +139,8 @@ static boolean translate_to_native_sym_flags static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *)); static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *)); static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *)); +reloc_howto_type * NAME(aout,reloc_type_lookup) + PARAMS ((bfd *, bfd_reloc_code_real_type)); /* SUBSECTION @@ -156,9 +158,10 @@ DESCRIPTION */ #ifndef CTOR_TABLE_RELOC_HOWTO #define CTOR_TABLE_RELOC_IDX 2 -#define CTOR_TABLE_RELOC_HOWTO(BFD) ((obj_reloc_entry_size(BFD) == RELOC_EXT_SIZE \ - ? howto_table_ext : howto_table_std) \ - + CTOR_TABLE_RELOC_IDX) +#define CTOR_TABLE_RELOC_HOWTO(BFD) \ + ((obj_reloc_entry_size (BFD) == RELOC_EXT_SIZE \ + ? howto_table_ext : howto_table_std) \ + + CTOR_TABLE_RELOC_IDX) #endif #ifndef MY_swap_std_reloc_in @@ -225,23 +228,23 @@ reloc_howto_type howto_table_ext[] = reloc_howto_type howto_table_std[] = { /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ -HOWTO( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false), -HOWTO( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false), -HOWTO( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false), -HOWTO( 3, 0, 4, 64, false, 0, complain_overflow_bitfield,0,"64", true, 0xdeaddead,0xdeaddead, false), -HOWTO( 4, 0, 0, 8, true, 0, complain_overflow_signed, 0,"DISP8", true, 0x000000ff,0x000000ff, false), -HOWTO( 5, 0, 1, 16, true, 0, complain_overflow_signed, 0,"DISP16", true, 0x0000ffff,0x0000ffff, false), -HOWTO( 6, 0, 2, 32, true, 0, complain_overflow_signed, 0,"DISP32", true, 0xffffffff,0xffffffff, false), -HOWTO( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", true, 0xfeedface,0xfeedface, false), -HOWTO( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false), -HOWTO( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false), -HOWTO(10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false), +HOWTO ( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false), +HOWTO ( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false), +HOWTO ( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false), +HOWTO ( 3, 0, 4, 64, false, 0, complain_overflow_bitfield,0,"64", true, 0xdeaddead,0xdeaddead, false), +HOWTO ( 4, 0, 0, 8, true, 0, complain_overflow_signed, 0,"DISP8", true, 0x000000ff,0x000000ff, false), +HOWTO ( 5, 0, 1, 16, true, 0, complain_overflow_signed, 0,"DISP16", true, 0x0000ffff,0x0000ffff, false), +HOWTO ( 6, 0, 2, 32, true, 0, complain_overflow_signed, 0,"DISP32", true, 0xffffffff,0xffffffff, false), +HOWTO ( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", true, 0xfeedface,0xfeedface, false), +HOWTO ( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false), +HOWTO ( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false), +HOWTO (10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO(16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false), + HOWTO (16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), @@ -257,7 +260,7 @@ EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO(32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false), + HOWTO (32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), @@ -265,18 +268,18 @@ EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO(40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false), + HOWTO (40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false), }; -#define TABLE_SIZE(TABLE) (sizeof (TABLE)/sizeof (TABLE[0])) +#define TABLE_SIZE(TABLE) (sizeof (TABLE) / sizeof (TABLE[0])) reloc_howto_type * NAME(aout,reloc_type_lookup) (abfd,code) bfd *abfd; bfd_reloc_code_real_type code; { -#define EXT(i,j) case i: return &howto_table_ext[j] -#define STD(i,j) case i: return &howto_table_std[j] +#define EXT(i, j) case i: return &howto_table_ext[j] +#define STD(i, j) case i: return &howto_table_std[j] int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE; if (code == BFD_RELOC_CTOR) switch (bfd_get_arch_info (abfd)->bits_per_address) @@ -366,7 +369,7 @@ NAME(aout,swap_exec_header_in) (abfd, raw_bytes, execp) are memcmp'd, and thus the contents do matter. */ memset ((PTR) execp, 0, sizeof (struct internal_exec)); /* Now fill in fields in the execp, from the bytes in the raw data. */ - execp->a_info = bfd_h_get_32 (abfd, bytes->e_info); + execp->a_info = H_GET_32 (abfd, bytes->e_info); execp->a_text = GET_WORD (abfd, bytes->e_text); execp->a_data = GET_WORD (abfd, bytes->e_data); execp->a_bss = GET_WORD (abfd, bytes->e_bss); @@ -401,7 +404,7 @@ NAME(aout,swap_exec_header_out) (abfd, execp, raw_bytes) struct external_exec *bytes = (struct external_exec *)raw_bytes; /* Now fill in fields in the raw data, from the fields in the exec struct. */ - bfd_h_put_32 (abfd, execp->a_info , bytes->e_info); + H_PUT_32 (abfd, execp->a_info , bytes->e_info); PUT_WORD (abfd, execp->a_text , bytes->e_text); PUT_WORD (abfd, execp->a_data , bytes->e_data); PUT_WORD (abfd, execp->a_bss , bytes->e_bss); @@ -454,8 +457,9 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) { struct aout_data_struct *rawptr, *oldrawptr; const bfd_target *result; + bfd_size_type amt = sizeof (struct aout_data_struct); - rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, sizeof (struct aout_data_struct )); + rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt); if (rawptr == NULL) return 0; @@ -480,7 +484,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) /* Setting of EXEC_P has been deferred to the bottom of this function */ if (execp->a_syms) abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS; - if (N_DYNAMIC(*execp)) + if (N_DYNAMIC (*execp)) abfd->flags |= DYNAMIC; if (N_MAGIC (*execp) == ZMAGIC) @@ -557,37 +561,38 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) struct exec *execp = exec_hdr (abfd); - obj_textsec (abfd)->size = N_TXTSIZE(*execp); - obj_textsec (abfd)->raw_size = N_TXTSIZE(*execp); + obj_textsec (abfd)->size = N_TXTSIZE (*execp); + obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp); /* data and bss are already filled in since they're so standard */ /* 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)->vma = N_TXTADDR (*execp); + obj_datasec (abfd)->vma = N_DATADDR (*execp); + obj_bsssec (abfd)->vma = N_BSSADDR (*execp); /* The file offsets of the sections */ - obj_textsec (abfd)->filepos = N_TXTOFF(*execp); - obj_datasec (abfd)->filepos = N_DATOFF(*execp); + 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); + 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_str_filepos (abfd) = N_STROFF (*execp); obj_sym_filepos (abfd) = N_SYMOFF (*execp); /* Determine the architecture and machine type of the object file. */ - switch (N_MACHTYPE (*exec_hdr (abfd))) { - default: - abfd->obj_arch = bfd_arch_obscure; - break; - } + switch (N_MACHTYPE (*exec_hdr (abfd))) + { + default: + abfd->obj_arch = bfd_arch_obscure; + break; + } - adata(abfd)->page_size = TARGET_PAGE_SIZE; - adata(abfd)->segment_size = SEGMENT_SIZE; - adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE; + adata (abfd)->page_size = TARGET_PAGE_SIZE; + adata (abfd)->segment_size = SEGMENT_SIZE; + adata (abfd)->exec_bytes_size = EXEC_BYTES_SIZE; return abfd->xvec; @@ -619,8 +624,9 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) sets the entry point, and that is likely to be non-zero for most systems. */ if (execp->a_entry != 0 - || (execp->a_entry >= obj_textsec(abfd)->vma - && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size)) + || (execp->a_entry >= obj_textsec (abfd)->vma + && execp->a_entry < (obj_textsec (abfd)->vma + + obj_textsec (abfd)->_raw_size))) abfd->flags |= EXEC_P; #ifdef STAT_FOR_EXEC else @@ -636,7 +642,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) issue. Many kernels are loaded at non standard addresses. */ if (abfd->iostream != NULL && (abfd->flags & BFD_IN_MEMORY) == 0 - && (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0) + && (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0) && ((stat_buf.st_mode & 0111) != 0)) abfd->flags |= EXEC_P; } @@ -673,22 +679,21 @@ boolean NAME(aout,mkobject) (abfd) bfd *abfd; { - struct aout_data_struct *rawptr; + struct aout_data_struct *rawptr; + bfd_size_type amt = sizeof (struct aout_data_struct); bfd_set_error (bfd_error_system_call); - /* Use an intermediate variable for clarity */ - rawptr = (struct aout_data_struct *)bfd_zalloc (abfd, sizeof (struct aout_data_struct )); - + rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt); if (rawptr == NULL) return false; abfd->tdata.aout_data = rawptr; exec_hdr (abfd) = &(rawptr->e); - obj_textsec (abfd) = (asection *)NULL; - obj_datasec (abfd) = (asection *)NULL; - obj_bsssec (abfd) = (asection *)NULL; + obj_textsec (abfd) = (asection *) NULL; + obj_datasec (abfd) = (asection *) NULL; + obj_bsssec (abfd) = (asection *) NULL; return true; } @@ -723,95 +728,102 @@ NAME(aout,machine_type) (arch, machine, unknown) arch_flags = M_UNKNOWN; *unknown = true; - switch (arch) { - case bfd_arch_sparc: - if (machine == 0 - || machine == bfd_mach_sparc - || machine == bfd_mach_sparc_sparclite - || machine == bfd_mach_sparc_sparclite_le - || machine == bfd_mach_sparc_v9) - arch_flags = M_SPARC; - else if (machine == bfd_mach_sparc_sparclet) - arch_flags = M_SPARCLET; - break; - - case bfd_arch_m68k: - switch (machine) { - 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; - - case bfd_arch_i386: - if (machine == 0) arch_flags = M_386; - break; - - case bfd_arch_a29k: - if (machine == 0) arch_flags = M_29K; - break; - - case bfd_arch_arm: - if (machine == 0) arch_flags = M_ARM; - break; - - case bfd_arch_mips: - switch (machine) { - case 0: - case bfd_mach_mips3000: - case bfd_mach_mips3900: - arch_flags = M_MIPS1; + switch (arch) + { + case bfd_arch_sparc: + if (machine == 0 + || machine == bfd_mach_sparc + || machine == bfd_mach_sparc_sparclite + || machine == bfd_mach_sparc_sparclite_le + || machine == bfd_mach_sparc_v9) + arch_flags = M_SPARC; + else if (machine == bfd_mach_sparc_sparclet) + arch_flags = M_SPARCLET; break; - case bfd_mach_mips6000: - arch_flags = M_MIPS2; + + case bfd_arch_m68k: + switch (machine) + { + 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; - case bfd_mach_mips4000: - case bfd_mach_mips4010: - case bfd_mach_mips4100: - case bfd_mach_mips4300: - case bfd_mach_mips4400: - case bfd_mach_mips4600: - case bfd_mach_mips4650: - case bfd_mach_mips8000: - case bfd_mach_mips10000: - case bfd_mach_mips12000: - case bfd_mach_mips16: - case bfd_mach_mips32: - case bfd_mach_mips32_4k: - case bfd_mach_mips5: - case bfd_mach_mips64: - case bfd_mach_mips_sb1: - /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ - arch_flags = M_MIPS2; + + case bfd_arch_i386: + if (machine == 0) + arch_flags = M_386; break; - default: - arch_flags = M_UNKNOWN; + + case bfd_arch_a29k: + if (machine == 0) + arch_flags = M_29K; break; - } - break; - - case bfd_arch_ns32k: - switch (machine) { - case 0: arch_flags = M_NS32532; break; - case 32032: arch_flags = M_NS32032; break; - case 32532: arch_flags = M_NS32532; break; - default: arch_flags = M_UNKNOWN; break; - } - break; - case bfd_arch_vax: - *unknown = false; - break; + case bfd_arch_arm: + if (machine == 0) + arch_flags = M_ARM; + break; - case bfd_arch_cris: - if (machine == 0 || machine == 255) arch_flags = M_CRIS; - break; + case bfd_arch_mips: + switch (machine) + { + case 0: + case bfd_mach_mips3000: + case bfd_mach_mips3900: + arch_flags = M_MIPS1; + break; + case bfd_mach_mips6000: + arch_flags = M_MIPS2; + break; + case bfd_mach_mips4000: + case bfd_mach_mips4010: + case bfd_mach_mips4100: + case bfd_mach_mips4300: + case bfd_mach_mips4400: + case bfd_mach_mips4600: + case bfd_mach_mips4650: + case bfd_mach_mips8000: + case bfd_mach_mips10000: + case bfd_mach_mips12000: + case bfd_mach_mips16: + case bfd_mach_mipsisa32: + case bfd_mach_mips5: + case bfd_mach_mipsisa64: + case bfd_mach_mips_sb1: + /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ + arch_flags = M_MIPS2; + break; + default: + arch_flags = M_UNKNOWN; + break; + } + break; - default: - arch_flags = M_UNKNOWN; - } + case bfd_arch_ns32k: + switch (machine) + { + case 0: arch_flags = M_NS32532; break; + case 32032: arch_flags = M_NS32032; break; + case 32532: arch_flags = M_NS32532; break; + default: arch_flags = M_UNKNOWN; break; + } + break; + + case bfd_arch_vax: + *unknown = false; + break; + + case bfd_arch_cris: + if (machine == 0 || machine == 255) + arch_flags = M_CRIS; + break; + + default: + arch_flags = M_UNKNOWN; + } if (arch_flags != M_UNKNOWN) *unknown = false; @@ -854,18 +866,19 @@ NAME(aout,set_arch_mach) (abfd, arch, machine) } /* Determine the size of a relocation entry */ - switch (arch) { - case bfd_arch_sparc: - case bfd_arch_a29k: - case bfd_arch_mips: - obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; - break; - default: - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - break; - } + switch (arch) + { + case bfd_arch_sparc: + case bfd_arch_a29k: + case bfd_arch_mips: + obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; + break; + default: + obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; + break; + } - return (*aout_backend_info(abfd)->set_sizes) (abfd); + return (*aout_backend_info (abfd)->set_sizes) (abfd); } static void @@ -878,46 +891,46 @@ adjust_o_magic (abfd, execp) int pad = 0; /* Text. */ - obj_textsec(abfd)->filepos = pos; - if (!obj_textsec(abfd)->user_set_vma) - obj_textsec(abfd)->vma = vma; + obj_textsec (abfd)->filepos = pos; + if (!obj_textsec (abfd)->user_set_vma) + obj_textsec (abfd)->vma = vma; else - vma = obj_textsec(abfd)->vma; + vma = obj_textsec (abfd)->vma; - pos += obj_textsec(abfd)->_raw_size; - vma += obj_textsec(abfd)->_raw_size; + pos += obj_textsec (abfd)->_raw_size; + vma += obj_textsec (abfd)->_raw_size; /* Data. */ - if (!obj_datasec(abfd)->user_set_vma) + if (!obj_datasec (abfd)->user_set_vma) { #if 0 /* ?? Does alignment in the file image really matter? */ - pad = align_power (vma, obj_datasec(abfd)->alignment_power) - vma; + pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma; #endif - obj_textsec(abfd)->_raw_size += pad; + obj_textsec (abfd)->_raw_size += pad; pos += pad; vma += pad; - obj_datasec(abfd)->vma = vma; + obj_datasec (abfd)->vma = vma; } else - vma = obj_datasec(abfd)->vma; - obj_datasec(abfd)->filepos = pos; - pos += obj_datasec(abfd)->_raw_size; - vma += obj_datasec(abfd)->_raw_size; + vma = obj_datasec (abfd)->vma; + obj_datasec (abfd)->filepos = pos; + pos += obj_datasec (abfd)->_raw_size; + vma += obj_datasec (abfd)->_raw_size; /* BSS. */ - if (!obj_bsssec(abfd)->user_set_vma) + if (!obj_bsssec (abfd)->user_set_vma) { #if 0 - pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma; + pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma; #endif - obj_datasec(abfd)->_raw_size += pad; + obj_datasec (abfd)->_raw_size += pad; pos += pad; vma += pad; - obj_bsssec(abfd)->vma = vma; + obj_bsssec (abfd)->vma = vma; } else { - /* The VMA of the .bss section is set by the the VMA of the + /* The VMA of the .bss section is set by the VMA of the .data section plus the size of the .data section. We may need to add padding bytes to make this true. */ pad = obj_bsssec (abfd)->vma - vma; @@ -927,12 +940,12 @@ adjust_o_magic (abfd, execp) pos += pad; } } - obj_bsssec(abfd)->filepos = pos; + obj_bsssec (abfd)->filepos = pos; /* Fix up the exec header. */ - execp->a_text = obj_textsec(abfd)->_raw_size; - execp->a_data = obj_datasec(abfd)->_raw_size; - execp->a_bss = obj_bsssec(abfd)->_raw_size; + execp->a_text = obj_textsec (abfd)->_raw_size; + execp->a_data = obj_datasec (abfd)->_raw_size; + execp->a_bss = obj_bsssec (abfd)->_raw_size; N_SET_MAGIC (*execp, OMAGIC); } @@ -943,7 +956,7 @@ adjust_z_magic (abfd, execp) { bfd_size_type data_pad, text_pad; file_ptr text_end; - CONST struct aout_backend_data *abdp; + const struct aout_backend_data *abdp; int ztih; /* Nonzero if text includes exec header. */ abdp = aout_backend_info (abfd); @@ -952,18 +965,18 @@ adjust_z_magic (abfd, execp) ztih = (abdp != NULL && (abdp->text_includes_header || obj_aout_subformat (abfd) == q_magic_format)); - obj_textsec(abfd)->filepos = (ztih - ? adata(abfd).exec_bytes_size - : adata(abfd).zmagic_disk_block_size); - if (! obj_textsec(abfd)->user_set_vma) + obj_textsec (abfd)->filepos = (ztih + ? adata (abfd).exec_bytes_size + : adata (abfd).zmagic_disk_block_size); + if (! obj_textsec (abfd)->user_set_vma) { /* ?? Do we really need to check for relocs here? */ - obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC) - ? 0 - : (ztih - ? (abdp->default_text_vma - + adata(abfd).exec_bytes_size) - : abdp->default_text_vma)); + obj_textsec (abfd)->vma = ((abfd->flags & HAS_RELOC) + ? 0 + : (ztih + ? (abdp->default_text_vma + + adata (abfd).exec_bytes_size) + : abdp->default_text_vma)); text_pad = 0; } else @@ -994,47 +1007,51 @@ adjust_z_magic (abfd, execp) text_pad += BFD_ALIGN (text_end, adata (abfd).page_size) - text_end; text_end += obj_textsec (abfd)->filepos; } - obj_textsec(abfd)->_raw_size += text_pad; + obj_textsec (abfd)->_raw_size += text_pad; text_end += text_pad; /* Data. */ - if (!obj_datasec(abfd)->user_set_vma) + if (!obj_datasec (abfd)->user_set_vma) { bfd_vma vma; - vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size; - obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size); + vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->_raw_size; + obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size); } if (abdp && abdp->zmagic_mapped_contiguous) { - text_pad = (obj_datasec(abfd)->vma - - obj_textsec(abfd)->vma - - obj_textsec(abfd)->_raw_size); - obj_textsec(abfd)->_raw_size += text_pad; + asection * text = obj_textsec (abfd); + asection * data = obj_datasec (abfd); + + text_pad = data->vma - (text->vma + text->_raw_size); + /* Only pad the text section if the data + section is going to be placed after it. */ + if (text_pad > 0) + text->_raw_size += text_pad; } - obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos - + obj_textsec(abfd)->_raw_size); + obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos + + obj_textsec (abfd)->_raw_size); /* Fix up exec header while we're at it. */ - execp->a_text = obj_textsec(abfd)->_raw_size; + execp->a_text = obj_textsec (abfd)->_raw_size; if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted))) - execp->a_text += adata(abfd).exec_bytes_size; + execp->a_text += adata (abfd).exec_bytes_size; if (obj_aout_subformat (abfd) == q_magic_format) N_SET_MAGIC (*execp, QMAGIC); else N_SET_MAGIC (*execp, ZMAGIC); /* Spec says data section should be rounded up to page boundary. */ - obj_datasec(abfd)->_raw_size - = align_power (obj_datasec(abfd)->_raw_size, - obj_bsssec(abfd)->alignment_power); - execp->a_data = BFD_ALIGN (obj_datasec(abfd)->_raw_size, - adata(abfd).page_size); - data_pad = execp->a_data - obj_datasec(abfd)->_raw_size; + obj_datasec (abfd)->_raw_size + = align_power (obj_datasec (abfd)->_raw_size, + obj_bsssec (abfd)->alignment_power); + execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size, + adata (abfd).page_size); + data_pad = execp->a_data - obj_datasec (abfd)->_raw_size; /* BSS. */ - if (!obj_bsssec(abfd)->user_set_vma) - obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma - + obj_datasec(abfd)->_raw_size); + if (!obj_bsssec (abfd)->user_set_vma) + obj_bsssec (abfd)->vma = (obj_datasec (abfd)->vma + + obj_datasec (abfd)->_raw_size); /* If the BSS immediately follows the data section and extra space in the page is left after the data section, fudge data in the header so that the bss section looks smaller by that @@ -1042,12 +1059,12 @@ adjust_z_magic (abfd, execp) (Note that a linker script, as well as the above assignment, could have explicitly set the BSS vma to immediately follow the data section.) */ - if (align_power (obj_bsssec(abfd)->vma, obj_bsssec(abfd)->alignment_power) - == obj_datasec(abfd)->vma + obj_datasec(abfd)->_raw_size) - execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 : - obj_bsssec(abfd)->_raw_size - data_pad; + if (align_power (obj_bsssec (abfd)->vma, obj_bsssec (abfd)->alignment_power) + == obj_datasec (abfd)->vma + obj_datasec (abfd)->_raw_size) + execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size + ? 0 : obj_bsssec (abfd)->_raw_size - data_pad); else - execp->a_bss = obj_bsssec(abfd)->_raw_size; + execp->a_bss = obj_bsssec (abfd)->_raw_size; } static void @@ -1055,41 +1072,41 @@ adjust_n_magic (abfd, execp) bfd *abfd; struct internal_exec *execp; { - file_ptr pos = adata(abfd).exec_bytes_size; + file_ptr pos = adata (abfd).exec_bytes_size; bfd_vma vma = 0; int pad; /* Text. */ - obj_textsec(abfd)->filepos = pos; - if (!obj_textsec(abfd)->user_set_vma) - obj_textsec(abfd)->vma = vma; + obj_textsec (abfd)->filepos = pos; + if (!obj_textsec (abfd)->user_set_vma) + obj_textsec (abfd)->vma = vma; else - vma = obj_textsec(abfd)->vma; - pos += obj_textsec(abfd)->_raw_size; - vma += obj_textsec(abfd)->_raw_size; + vma = obj_textsec (abfd)->vma; + pos += obj_textsec (abfd)->_raw_size; + vma += obj_textsec (abfd)->_raw_size; /* Data. */ - obj_datasec(abfd)->filepos = pos; - if (!obj_datasec(abfd)->user_set_vma) - obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size); - vma = obj_datasec(abfd)->vma; + obj_datasec (abfd)->filepos = pos; + if (!obj_datasec (abfd)->user_set_vma) + obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size); + vma = obj_datasec (abfd)->vma; /* 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; + 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; /* BSS. */ - if (!obj_bsssec(abfd)->user_set_vma) - obj_bsssec(abfd)->vma = vma; + if (!obj_bsssec (abfd)->user_set_vma) + obj_bsssec (abfd)->vma = vma; else - vma = obj_bsssec(abfd)->vma; + vma = obj_bsssec (abfd)->vma; /* Fix up exec header. */ - execp->a_text = obj_textsec(abfd)->_raw_size; - execp->a_data = obj_datasec(abfd)->_raw_size; - execp->a_bss = obj_bsssec(abfd)->_raw_size; + execp->a_text = obj_textsec (abfd)->_raw_size; + execp->a_data = obj_datasec (abfd)->_raw_size; + execp->a_bss = obj_bsssec (abfd)->_raw_size; N_SET_MAGIC (*execp, NMAGIC); } @@ -1104,12 +1121,12 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) if (! NAME(aout,make_sections) (abfd)) return false; - if (adata(abfd).magic != undecided_magic) + if (adata (abfd).magic != undecided_magic) return true; - obj_textsec(abfd)->_raw_size = - align_power(obj_textsec(abfd)->_raw_size, - obj_textsec(abfd)->alignment_power); + obj_textsec (abfd)->_raw_size = + align_power (obj_textsec (abfd)->_raw_size, + obj_textsec (abfd)->alignment_power); *text_size = obj_textsec (abfd)->_raw_size; /* Rule (heuristic) for when to pad to a new page. Note that there @@ -1130,34 +1147,35 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) if (abfd->flags & D_PAGED) /* Whether or not WP_TEXT is set -- let D_PAGED override. */ - adata(abfd).magic = z_magic; + adata (abfd).magic = z_magic; else if (abfd->flags & WP_TEXT) - adata(abfd).magic = n_magic; + adata (abfd).magic = n_magic; else - adata(abfd).magic = o_magic; + adata (abfd).magic = o_magic; #ifdef BFD_AOUT_DEBUG /* requires gcc2 */ #if __GNUC__ >= 2 fprintf (stderr, "%s text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x,%x>\n", ({ char *str; - switch (adata(abfd).magic) { - case n_magic: str = "NMAGIC"; break; - case o_magic: str = "OMAGIC"; break; - case z_magic: str = "ZMAGIC"; break; - default: abort (); - } + switch (adata (abfd).magic) + { + case n_magic: str = "NMAGIC"; break; + case o_magic: str = "OMAGIC"; break; + case z_magic: str = "ZMAGIC"; break; + default: abort (); + } str; }), - obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size, - obj_textsec(abfd)->alignment_power, - obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size, - obj_datasec(abfd)->alignment_power, - obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size, - obj_bsssec(abfd)->alignment_power); + obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size, + obj_textsec (abfd)->alignment_power, + obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size, + obj_datasec (abfd)->alignment_power, + obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size, + obj_bsssec (abfd)->alignment_power); #endif #endif - switch (adata(abfd).magic) + switch (adata (abfd).magic) { case o_magic: adjust_o_magic (abfd, execp); @@ -1174,11 +1192,11 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) #ifdef BFD_AOUT_DEBUG fprintf (stderr, " text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n", - obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size, - obj_textsec(abfd)->filepos, - obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size, - obj_datasec(abfd)->filepos, - obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size); + obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size, + obj_textsec (abfd)->filepos, + obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size, + obj_datasec (abfd)->filepos, + obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size); #endif return true; @@ -1203,24 +1221,27 @@ NAME(aout,new_section_hook) (abfd, newsect) asection *newsect; { /* align to double at least */ - newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power; + newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power; if (bfd_get_format (abfd) == bfd_object) { - if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) { - obj_textsec(abfd)= newsect; + if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) + { + obj_textsec (abfd)= newsect; newsect->target_index = N_TEXT; return true; } - if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) { - obj_datasec(abfd) = newsect; + if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) + { + obj_datasec (abfd) = newsect; newsect->target_index = N_DATA; return true; } - if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) { - obj_bsssec(abfd) = newsect; + if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) + { + obj_bsssec (abfd) = newsect; newsect->target_index = N_BSS; return true; } @@ -1267,7 +1288,7 @@ NAME(aout,set_section_contents) (abfd, section, location, offset, count) if (count != 0) { if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 - || bfd_write (location, 1, count, abfd) != count) + || bfd_bwrite (location, count, abfd) != count) return false; } @@ -1284,6 +1305,7 @@ aout_get_external_symbols (abfd) { bfd_size_type count; struct external_nlist *syms; + bfd_size_type amt; count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; @@ -1298,13 +1320,13 @@ aout_get_external_symbols (abfd) later on. If we put them on the objalloc it might not be possible to free them. */ syms = ((struct external_nlist *) - bfd_malloc ((size_t) count * EXTERNAL_NLIST_SIZE)); + bfd_malloc (count * EXTERNAL_NLIST_SIZE)); if (syms == (struct external_nlist *) NULL && count != 0) return false; + amt = exec_hdr (abfd)->a_syms; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 - || (bfd_read (syms, 1, exec_hdr (abfd)->a_syms, abfd) - != exec_hdr (abfd)->a_syms)) + || bfd_bread (syms, amt, abfd) != amt) { free (syms); return false; @@ -1321,11 +1343,11 @@ aout_get_external_symbols (abfd) unsigned char string_chars[BYTES_IN_WORD]; bfd_size_type stringsize; char *strings; + bfd_size_type amt = BYTES_IN_WORD; /* Get the size of the strings. */ if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0 - || (bfd_read ((PTR) string_chars, BYTES_IN_WORD, 1, abfd) - != BYTES_IN_WORD)) + || bfd_bread ((PTR) string_chars, amt, abfd) != amt) return false; stringsize = GET_WORD (abfd, string_chars); @@ -1335,15 +1357,14 @@ aout_get_external_symbols (abfd) return false; strings = (char *) obj_aout_string_window (abfd).data; #else - strings = (char *) bfd_malloc ((size_t) stringsize + 1); + strings = (char *) bfd_malloc (stringsize + 1); if (strings == NULL) return false; /* Skip space for the string count in the buffer for convenience when using indexes. */ - if (bfd_read (strings + BYTES_IN_WORD, 1, stringsize - BYTES_IN_WORD, - abfd) - != stringsize - BYTES_IN_WORD) + amt = stringsize - BYTES_IN_WORD; + if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt) { free (strings); return false; @@ -1474,6 +1495,7 @@ translate_from_native_sym_flags (abfd, cache_ptr) asection *section; arelent_chain *reloc; asection *into_section; + bfd_size_type amt; /* This is a set symbol. The name of the symbol is the name of the set (e.g., __CTOR_LIST__). The value of the symbol @@ -1490,7 +1512,8 @@ translate_from_native_sym_flags (abfd, cache_ptr) { char *copy; - copy = bfd_alloc (abfd, strlen (cache_ptr->symbol.name) + 1); + amt = strlen (cache_ptr->symbol.name) + 1; + copy = bfd_alloc (abfd, amt); if (copy == NULL) return false; @@ -1500,7 +1523,8 @@ translate_from_native_sym_flags (abfd, cache_ptr) return false; } - reloc = (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain)); + amt = sizeof (arelent_chain); + reloc = (arelent_chain *) bfd_alloc (abfd, amt); if (reloc == NULL) return false; @@ -1545,7 +1569,7 @@ translate_from_native_sym_flags (abfd, cache_ptr) reloc->relent.address = section->_raw_size; section->_raw_size += BYTES_IN_WORD; - reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO(abfd); + reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd); #endif /* 0 */ @@ -1720,7 +1744,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) sym_pointer->e_type[0] = type; } - PUT_WORD(abfd, value, sym_pointer->e_value); + PUT_WORD (abfd, value, sym_pointer->e_value); return true; } @@ -1731,8 +1755,8 @@ asymbol * NAME(aout,make_empty_symbol) (abfd) bfd *abfd; { - aout_symbol_type *new = - (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type)); + bfd_size_type amt = sizeof (aout_symbol_type); + aout_symbol_type *new = (aout_symbol_type *) bfd_zalloc (abfd, amt); if (!new) return NULL; new->symbol.the_bfd = abfd; @@ -1775,9 +1799,9 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) return false; in->symbol.value = GET_SWORD (abfd, ext->e_value); - in->desc = bfd_h_get_16 (abfd, ext->e_desc); - in->other = bfd_h_get_8 (abfd, ext->e_other); - in->type = bfd_h_get_8 (abfd, ext->e_type); + in->desc = H_GET_16 (abfd, ext->e_desc); + in->other = H_GET_8 (abfd, ext->e_other); + in->type = H_GET_8 (abfd, ext->e_type); in->symbol.udata.p = NULL; if (! translate_from_native_sym_flags (abfd, in)) @@ -1800,7 +1824,7 @@ NAME(aout,slurp_symbol_table) (abfd) { struct external_nlist *old_external_syms; aout_symbol_type *cached; - size_t cached_size; + bfd_size_type cached_size; /* If there's no work to be done, don't do any */ if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL) @@ -1811,13 +1835,13 @@ NAME(aout,slurp_symbol_table) (abfd) if (! aout_get_external_symbols (abfd)) return false; - cached_size = (obj_aout_external_sym_count (abfd) - * sizeof (aout_symbol_type)); + cached_size = obj_aout_external_sym_count (abfd); + cached_size *= sizeof (aout_symbol_type); cached = (aout_symbol_type *) bfd_malloc (cached_size); if (cached == NULL && cached_size != 0) return false; if (cached_size != 0) - memset (cached, 0, cached_size); + memset (cached, 0, (size_t) cached_size); /* Convert from external symbol information to internal. */ if (! (NAME(aout,translate_symbol_table) @@ -1911,10 +1935,11 @@ emit_stringtab (abfd, tab) struct bfd_strtab_hash *tab; { bfd_byte buffer[BYTES_IN_WORD]; + bfd_size_type amt = BYTES_IN_WORD; /* The string table starts with the size. */ PUT_WORD (abfd, _bfd_stringtab_size (tab) + BYTES_IN_WORD, buffer); - if (bfd_write ((PTR) buffer, 1, BYTES_IN_WORD, abfd) != BYTES_IN_WORD) + if (bfd_bwrite ((PTR) buffer, amt, abfd) != amt) return false; return _bfd_stringtab_emit (abfd, tab); @@ -1937,30 +1962,31 @@ NAME(aout,write_syms) (abfd) asymbol *g = generic[count]; bfd_size_type indx; struct external_nlist nsp; + bfd_size_type amt; indx = add_to_stringtab (abfd, strtab, g->name, false); if (indx == (bfd_size_type) -1) goto error_return; PUT_WORD (abfd, indx, (bfd_byte *) nsp.e_strx); - if (bfd_asymbol_flavour(g) == abfd->xvec->flavour) + if (bfd_asymbol_flavour (g) == abfd->xvec->flavour) { - bfd_h_put_16(abfd, aout_symbol(g)->desc, nsp.e_desc); - bfd_h_put_8(abfd, aout_symbol(g)->other, nsp.e_other); - bfd_h_put_8(abfd, aout_symbol(g)->type, nsp.e_type); + H_PUT_16 (abfd, aout_symbol (g)->desc, nsp.e_desc); + H_PUT_8 (abfd, aout_symbol (g)->other, nsp.e_other); + H_PUT_8 (abfd, aout_symbol (g)->type, nsp.e_type); } else { - bfd_h_put_16(abfd,0, nsp.e_desc); - bfd_h_put_8(abfd, 0, nsp.e_other); - bfd_h_put_8(abfd, 0, nsp.e_type); + H_PUT_16 (abfd, 0, nsp.e_desc); + H_PUT_8 (abfd, 0, nsp.e_other); + H_PUT_8 (abfd, 0, nsp.e_type); } if (! translate_to_native_sym_flags (abfd, g, &nsp)) goto error_return; - if (bfd_write((PTR)&nsp,1,EXTERNAL_NLIST_SIZE, abfd) - != EXTERNAL_NLIST_SIZE) + amt = EXTERNAL_NLIST_SIZE; + if (bfd_bwrite ((PTR) &nsp, amt, abfd) != amt) goto error_return; /* NB: `KEEPIT' currently overlays `udata.p', so set this only @@ -1991,8 +2017,10 @@ NAME(aout,get_symtab) (abfd, location) if (!NAME(aout,slurp_symbol_table) (abfd)) return -1; - for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);) - *(location++) = (asymbol *) ( symbase++); + for (symbase = obj_aout_symbols (abfd); + counter++ < bfd_get_symcount (abfd); + ) + *(location++) = (asymbol *) (symbase++); *location++ =0; return bfd_get_symcount (abfd); } @@ -2017,7 +2045,7 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) int r_baserel, r_jmptable, r_relative; asection *output_section = sym->section->output_section; - PUT_WORD(abfd, g->address, natptr->r_address); + PUT_WORD (abfd, g->address, natptr->r_address); r_length = g->howto->size ; /* Size as a power of two */ r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ @@ -2068,29 +2096,30 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) } /* now the fun stuff */ - if (bfd_header_big_endian (abfd)) { + if (bfd_header_big_endian (abfd)) + { natptr->r_index[0] = r_index >> 16; natptr->r_index[1] = r_index >> 8; natptr->r_index[2] = r_index; - natptr->r_type[0] = - (r_extern? RELOC_STD_BITS_EXTERN_BIG: 0) - | (r_pcrel? RELOC_STD_BITS_PCREL_BIG: 0) - | (r_baserel? RELOC_STD_BITS_BASEREL_BIG: 0) - | (r_jmptable? RELOC_STD_BITS_JMPTABLE_BIG: 0) - | (r_relative? RELOC_STD_BITS_RELATIVE_BIG: 0) - | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG); - } else { - natptr->r_index[2] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[0] = r_index; - natptr->r_type[0] = - (r_extern? RELOC_STD_BITS_EXTERN_LITTLE: 0) - | (r_pcrel? RELOC_STD_BITS_PCREL_LITTLE: 0) - | (r_baserel? RELOC_STD_BITS_BASEREL_LITTLE: 0) - | (r_jmptable? RELOC_STD_BITS_JMPTABLE_LITTLE: 0) - | (r_relative? RELOC_STD_BITS_RELATIVE_LITTLE: 0) - | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE); - } + natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_BIG : 0) + | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG : 0) + | (r_baserel ? RELOC_STD_BITS_BASEREL_BIG : 0) + | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_BIG : 0) + | (r_relative ? RELOC_STD_BITS_RELATIVE_BIG : 0) + | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG)); + } + else + { + natptr->r_index[2] = r_index >> 16; + natptr->r_index[1] = r_index >> 8; + natptr->r_index[0] = r_index; + natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_LITTLE : 0) + | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE : 0) + | (r_baserel ? RELOC_STD_BITS_BASEREL_LITTLE : 0) + | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_LITTLE : 0) + | (r_relative ? RELOC_STD_BITS_RELATIVE_LITTLE : 0) + | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE)); + } } /* Extended stuff */ @@ -2108,7 +2137,7 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) int r_index; int r_extern; unsigned int r_type; - unsigned int r_addend; + bfd_vma r_addend; asymbol *sym = *(g->sym_ptr_ptr); asection *output_section = sym->section->output_section; @@ -2149,21 +2178,22 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) } /* now the fun stuff */ - if (bfd_header_big_endian (abfd)) { - natptr->r_index[0] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[2] = r_index; - natptr->r_type[0] = - ((r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0) - | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG)); - } else { - natptr->r_index[2] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[0] = r_index; - natptr->r_type[0] = - (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0) - | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE); - } + if (bfd_header_big_endian (abfd)) + { + natptr->r_index[0] = r_index >> 16; + natptr->r_index[1] = r_index >> 8; + natptr->r_index[2] = r_index; + natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_BIG : 0) + | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG)); + } + else + { + natptr->r_index[2] = r_index >> 16; + natptr->r_index[1] = r_index >> 8; + natptr->r_index[0] = r_index; + natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_LITTLE : 0) + | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE)); + } PUT_WORD (abfd, r_addend, natptr->r_addend); } @@ -2174,40 +2204,44 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) Aout keeps all it's symbols based from zero, so the symbol would contain 60. This macro subs the base of each section from the value - to give the true offset from the section */ - -#define MOVE_ADDRESS(ad) \ - if (r_extern) { \ - /* undefined symbol */ \ - cache_ptr->sym_ptr_ptr = symbols + r_index; \ - cache_ptr->addend = ad; \ - } else { \ - /* defined, section relative. replace symbol with pointer to \ - symbol which points to section */ \ - switch (r_index) { \ - case N_TEXT: \ - case N_TEXT | N_EXT: \ - cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; \ - cache_ptr->addend = ad - su->textsec->vma; \ - break; \ - case N_DATA: \ - case N_DATA | N_EXT: \ - cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; \ - cache_ptr->addend = ad - su->datasec->vma; \ - break; \ - case N_BSS: \ - case N_BSS | N_EXT: \ - cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; \ - cache_ptr->addend = ad - su->bsssec->vma; \ - break; \ - default: \ - case N_ABS: \ - case N_ABS | N_EXT: \ - cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \ + to give the true offset from the section. */ + +#define MOVE_ADDRESS(ad) \ + if (r_extern) \ + { \ + /* Undefined symbol. */ \ + cache_ptr->sym_ptr_ptr = symbols + r_index; \ cache_ptr->addend = ad; \ - break; \ } \ - } \ + else \ + { \ + /* Defined, section relative. Replace symbol with pointer to \ + symbol which points to section. */ \ + switch (r_index) \ + { \ + case N_TEXT: \ + case N_TEXT | N_EXT: \ + cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr; \ + cache_ptr->addend = ad - su->textsec->vma; \ + break; \ + case N_DATA: \ + case N_DATA | N_EXT: \ + cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr; \ + cache_ptr->addend = ad - su->datasec->vma; \ + break; \ + case N_BSS: \ + case N_BSS | N_EXT: \ + cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; \ + cache_ptr->addend = ad - su->bsssec->vma; \ + break; \ + default: \ + case N_ABS: \ + case N_ABS | N_EXT: \ + cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \ + cache_ptr->addend = ad; \ + break; \ + } \ + } void NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) @@ -2225,21 +2259,24 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) cache_ptr->address = (GET_SWORD (abfd, bytes->r_address)); /* now the fun stuff */ - if (bfd_header_big_endian (abfd)) { - r_index = (bytes->r_index[0] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[2]; - r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG)); - r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG) - >> RELOC_EXT_BITS_TYPE_SH_BIG; - } else { - r_index = (bytes->r_index[2] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[0]; - r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); - r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE) - >> RELOC_EXT_BITS_TYPE_SH_LITTLE; - } + if (bfd_header_big_endian (abfd)) + { + r_index = ((bytes->r_index[0] << 16) + | (bytes->r_index[1] << 8) + | bytes->r_index[2]); + r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG)); + r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG) + >> RELOC_EXT_BITS_TYPE_SH_BIG); + } + else + { + r_index = ((bytes->r_index[2] << 16) + | (bytes->r_index[1] << 8) + | bytes->r_index[0]); + r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); + r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE) + >> RELOC_EXT_BITS_TYPE_SH_LITTLE); + } cache_ptr->howto = howto_table_ext + r_type; @@ -2259,7 +2296,7 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) r_index = N_ABS; } - MOVE_ADDRESS(GET_SWORD(abfd, bytes->r_addend)); + MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend)); } void @@ -2278,35 +2315,38 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) struct aoutdata *su = &(abfd->tdata.aout_data->a); unsigned int howto_idx; - cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address); + cache_ptr->address = H_GET_32 (abfd, bytes->r_address); /* now the fun stuff */ - if (bfd_header_big_endian (abfd)) { - r_index = (bytes->r_index[0] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[2]; - r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); - r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); - r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG)); - r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG)); - r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG)); - r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) - >> RELOC_STD_BITS_LENGTH_SH_BIG; - } else { - r_index = (bytes->r_index[2] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[0]; - r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); - r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); - r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE)); - r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); - r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE)); - r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) - >> RELOC_STD_BITS_LENGTH_SH_LITTLE; - } + if (bfd_header_big_endian (abfd)) + { + r_index = ((bytes->r_index[0] << 16) + | (bytes->r_index[1] << 8) + | bytes->r_index[2]); + r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); + r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); + r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG)); + r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG)); + r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG)); + r_length = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) + >> RELOC_STD_BITS_LENGTH_SH_BIG); + } + else + { + r_index = ((bytes->r_index[2] << 16) + | (bytes->r_index[1] << 8) + | bytes->r_index[0]); + r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); + r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); + r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE)); + r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); + r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE)); + r_length = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) + >> RELOC_STD_BITS_LENGTH_SH_LITTLE); + } - howto_idx = r_length + 4 * r_pcrel + 8 * r_baserel - + 16 * r_jmptable + 32 * r_relative; + howto_idx = (r_length + 4 * r_pcrel + 8 * r_baserel + + 16 * r_jmptable + 32 * r_relative); BFD_ASSERT (howto_idx < TABLE_SIZE (howto_table_std)); cache_ptr->howto = howto_table_std + howto_idx; BFD_ASSERT (cache_ptr->howto->type != (unsigned int) -1); @@ -2325,7 +2365,7 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) r_index = N_ABS; } - MOVE_ADDRESS(0); + MOVE_ADDRESS (0); } /* Read and swap the relocs for a section. */ @@ -2336,13 +2376,14 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) sec_ptr asect; asymbol **symbols; { - unsigned int count; + bfd_size_type count; bfd_size_type reloc_size; PTR relocs; arelent *reloc_cache; size_t each_size; unsigned int counter = 0; arelent *cache_ptr; + bfd_size_type amt; if (asect->relocation) return true; @@ -2351,9 +2392,9 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) return true; if (asect == obj_datasec (abfd)) - reloc_size = exec_hdr(abfd)->a_drsize; + reloc_size = exec_hdr (abfd)->a_drsize; else if (asect == obj_textsec (abfd)) - reloc_size = exec_hdr(abfd)->a_trsize; + reloc_size = exec_hdr (abfd)->a_trsize; else if (asect == obj_bsssec (abfd)) reloc_size = 0; else @@ -2369,19 +2410,20 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) count = reloc_size / each_size; - reloc_cache = (arelent *) bfd_malloc ((size_t) (count * sizeof (arelent))); + amt = count * sizeof (arelent); + reloc_cache = (arelent *) bfd_malloc (amt); if (reloc_cache == NULL && count != 0) return false; - memset (reloc_cache, 0, count * sizeof (arelent)); + memset (reloc_cache, 0, (size_t) amt); - relocs = bfd_malloc ((size_t) reloc_size); + relocs = bfd_malloc (reloc_size); if (relocs == NULL && reloc_size != 0) { free (reloc_cache); return false; } - if (bfd_read (relocs, 1, reloc_size, abfd) != reloc_size) + if (bfd_bread (relocs, reloc_size, abfd) != reloc_size) { free (relocs); free (reloc_cache); @@ -2391,21 +2433,19 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) cache_ptr = reloc_cache; if (each_size == RELOC_EXT_SIZE) { - register struct reloc_ext_external *rptr = - (struct reloc_ext_external *) relocs; + struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs; for (; counter < count; counter++, rptr++, cache_ptr++) MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols, - bfd_get_symcount (abfd)); + (bfd_size_type) bfd_get_symcount (abfd)); } else { - register struct reloc_std_external *rptr = - (struct reloc_std_external *) relocs; + struct reloc_std_external *rptr = (struct reloc_std_external *) relocs; for (; counter < count; counter++, rptr++, cache_ptr++) MY_swap_std_reloc_in (abfd, rptr, cache_ptr, symbols, - bfd_get_symcount (abfd)); + (bfd_size_type) bfd_get_symcount (abfd)); } free (relocs); @@ -2428,13 +2468,13 @@ NAME(aout,squirt_out_relocs) (abfd, section) size_t each_size; unsigned int count = section->reloc_count; - size_t natsize; + bfd_size_type natsize; if (count == 0 || section->orelocation == NULL) return true; each_size = obj_reloc_entry_size (abfd); - natsize = each_size * count; + natsize = (bfd_size_type) each_size * count; native = (unsigned char *) bfd_zalloc (abfd, natsize); if (!native) return false; @@ -2454,13 +2494,15 @@ NAME(aout,squirt_out_relocs) (abfd, section) for (natptr = native; count != 0; --count, natptr += each_size, ++generic) - MY_swap_std_reloc_out(abfd, *generic, (struct reloc_std_external *)natptr); + MY_swap_std_reloc_out (abfd, *generic, + (struct reloc_std_external *) natptr); } - if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) { - bfd_release(abfd, native); - return false; - } + if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize) + { + bfd_release (abfd, native); + return false; + } bfd_release (abfd, native); return true; @@ -2486,21 +2528,24 @@ NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols) if (!(tblptr || NAME(aout,slurp_reloc_table) (abfd, section, symbols))) return -1; - if (section->flags & SEC_CONSTRUCTOR) { - arelent_chain *chain = section->constructor_chain; - for (count = 0; count < section->reloc_count; count ++) { - *relptr ++ = &chain->relent; - chain = chain->next; + if (section->flags & SEC_CONSTRUCTOR) + { + arelent_chain *chain = section->constructor_chain; + for (count = 0; count < section->reloc_count; count ++) + { + *relptr ++ = &chain->relent; + chain = chain->next; + } } - } - else { - tblptr = section->relocation; + else + { + tblptr = section->relocation; - for (count = 0; count++ < section->reloc_count;) - { - *relptr++ = tblptr++; - } - } + for (count = 0; count++ < section->reloc_count; ) + { + *relptr++ = tblptr++; + } + } *relptr = 0; return section->reloc_count; @@ -2511,22 +2556,24 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect) bfd *abfd; sec_ptr asect; { - if (bfd_get_format (abfd) != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } - if (asect->flags & SEC_CONSTRUCTOR) { - return (sizeof (arelent *) * (asect->reloc_count+1)); - } + if (bfd_get_format (abfd) != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + if (asect->flags & SEC_CONSTRUCTOR) + { + return (sizeof (arelent *) * (asect->reloc_count+1)); + } if (asect == obj_datasec (abfd)) return (sizeof (arelent *) - * ((exec_hdr(abfd)->a_drsize / obj_reloc_entry_size (abfd)) + * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd)) + 1)); if (asect == obj_textsec (abfd)) return (sizeof (arelent *) - * ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd)) + * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd)) + 1)); if (asect == obj_bsssec (abfd)) @@ -2549,7 +2596,7 @@ NAME(aout,get_symtab_upper_bound) (abfd) return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *)); } - alent * +alent * NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *ignore_symbol ATTRIBUTE_UNUSED; @@ -2567,7 +2614,7 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) if (ret->type == '?') { - int type_code = aout_symbol(symbol)->type & 0xff; + int type_code = aout_symbol (symbol)->type & 0xff; const char *stab_name = bfd_get_stab_name (type_code); static char buf[10]; @@ -2578,47 +2625,49 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) } ret->type = '-'; ret->stab_type = type_code; - ret->stab_other = (unsigned) (aout_symbol(symbol)->other & 0xff); - ret->stab_desc = (unsigned) (aout_symbol(symbol)->desc & 0xffff); + ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff); + ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff); ret->stab_name = stab_name; } } void -NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +NAME(aout,print_symbol) (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; { FILE *file = (FILE *)afile; - switch (how) { - case bfd_print_symbol_name: - if (symbol->name) - fprintf (file,"%s", symbol->name); - break; - case bfd_print_symbol_more: - fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff), - (unsigned) (aout_symbol(symbol)->other & 0xff), - (unsigned) (aout_symbol(symbol)->type)); - break; - case bfd_print_symbol_all: + switch (how) { - CONST char *section_name = symbol->section->name; + case bfd_print_symbol_name: + if (symbol->name) + fprintf (file,"%s", symbol->name); + break; + case bfd_print_symbol_more: + fprintf (file,"%4x %2x %2x", + (unsigned) (aout_symbol (symbol)->desc & 0xffff), + (unsigned) (aout_symbol (symbol)->other & 0xff), + (unsigned) (aout_symbol (symbol)->type)); + break; + case bfd_print_symbol_all: + { + const char *section_name = symbol->section->name; - bfd_print_symbol_vandf((PTR)file,symbol); + bfd_print_symbol_vandf (abfd, (PTR)file, symbol); - fprintf (file," %-5s %04x %02x %02x", - section_name, - (unsigned) (aout_symbol(symbol)->desc & 0xffff), - (unsigned) (aout_symbol(symbol)->other & 0xff), - (unsigned) (aout_symbol(symbol)->type & 0xff)); - if (symbol->name) - fprintf (file," %s", symbol->name); + fprintf (file," %-5s %04x %02x %02x", + section_name, + (unsigned) (aout_symbol (symbol)->desc & 0xffff), + (unsigned) (aout_symbol (symbol)->other & 0xff), + (unsigned) (aout_symbol (symbol)->type & 0xff)); + if (symbol->name) + fprintf (file," %s", symbol->name); + } + break; } - break; - } } /* If we don't have to allocate more than 1MB to hold the generic @@ -2706,123 +2755,126 @@ NAME(aout,find_nearest_line) asection *section; asymbol **symbols; bfd_vma offset; - CONST char **filename_ptr; - CONST char **functionname_ptr; + const char **filename_ptr; + const char **functionname_ptr; unsigned int *line_ptr; { /* Run down the file looking for the filename, function and linenumber */ asymbol **p; - CONST char *directory_name = NULL; - CONST char *main_file_name = NULL; - CONST char *current_file_name = NULL; - CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */ - CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */ + const char *directory_name = NULL; + const char *main_file_name = NULL; + const char *current_file_name = NULL; + const char *line_file_name = NULL; /* Value of current_file_name at line number. */ + const char *line_directory_name = NULL; /* Value of directory_name at line number. */ bfd_vma low_line_vma = 0; bfd_vma low_func_vma = 0; asymbol *func = 0; - size_t filelen, funclen; + bfd_size_type filelen, funclen; char *buf; *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; - if (symbols != (asymbol **)NULL) { - for (p = symbols; *p; p++) { - aout_symbol_type *q = (aout_symbol_type *) (*p); - next: - switch (q->type){ - case N_TEXT: - /* If this looks like a file name symbol, and it comes after - the line number we have found so far, but before the - offset, then we have probably not found the right line - number. */ - if (q->symbol.value <= offset - && ((q->symbol.value > low_line_vma - && (line_file_name != NULL - || *line_ptr != 0)) - || (q->symbol.value > low_func_vma - && func != NULL))) - { - const char *symname; + if (symbols != (asymbol **)NULL) + { + for (p = symbols; *p; p++) + { + aout_symbol_type *q = (aout_symbol_type *) (*p); + next: + switch (q->type) + { + case N_TEXT: + /* If this looks like a file name symbol, and it comes after + the line number we have found so far, but before the + offset, then we have probably not found the right line + number. */ + if (q->symbol.value <= offset + && ((q->symbol.value > low_line_vma + && (line_file_name != NULL + || *line_ptr != 0)) + || (q->symbol.value > low_func_vma + && func != NULL))) + { + const char *symname; - symname = q->symbol.name; - if (strcmp (symname + strlen (symname) - 2, ".o") == 0) - { - if (q->symbol.value > low_line_vma) - { - *line_ptr = 0; - line_file_name = NULL; - } - if (q->symbol.value > low_func_vma) - func = NULL; - } - } - break; + symname = q->symbol.name; + if (strcmp (symname + strlen (symname) - 2, ".o") == 0) + { + if (q->symbol.value > low_line_vma) + { + *line_ptr = 0; + line_file_name = NULL; + } + if (q->symbol.value > low_func_vma) + func = NULL; + } + } + break; - case N_SO: - /* If this symbol is less than the offset, but greater than - the line number we have found so far, then we have not - found the right line number. */ - if (q->symbol.value <= offset) - { - if (q->symbol.value > low_line_vma) - { - *line_ptr = 0; - line_file_name = NULL; - } - if (q->symbol.value > low_func_vma) - func = NULL; - } + case N_SO: + /* If this symbol is less than the offset, but greater than + the line number we have found so far, then we have not + found the right line number. */ + if (q->symbol.value <= offset) + { + if (q->symbol.value > low_line_vma) + { + *line_ptr = 0; + line_file_name = NULL; + } + if (q->symbol.value > low_func_vma) + func = NULL; + } - main_file_name = current_file_name = q->symbol.name; - /* Look ahead to next symbol to check if that too is an N_SO. */ - p++; - if (*p == NULL) - break; - q = (aout_symbol_type *) (*p); - if (q->type != (int)N_SO) - goto next; - - /* Found a second N_SO First is directory; second is filename. */ - directory_name = current_file_name; - main_file_name = current_file_name = q->symbol.name; - if (obj_textsec(abfd) != section) - goto done; - break; - case N_SOL: - current_file_name = q->symbol.name; - break; + main_file_name = current_file_name = q->symbol.name; + /* Look ahead to next symbol to check if that too is an N_SO. */ + p++; + if (*p == NULL) + break; + q = (aout_symbol_type *) (*p); + if (q->type != (int)N_SO) + goto next; + + /* Found a second N_SO First is directory; second is filename. */ + directory_name = current_file_name; + main_file_name = current_file_name = q->symbol.name; + if (obj_textsec (abfd) != section) + goto done; + break; + case N_SOL: + current_file_name = q->symbol.name; + break; - case N_SLINE: + case N_SLINE: - case N_DSLINE: - case N_BSLINE: - /* We'll keep this if it resolves nearer than the one we have - already. */ - if (q->symbol.value >= low_line_vma - && q->symbol.value <= offset) - { - *line_ptr = q->desc; - low_line_vma = q->symbol.value; - line_file_name = current_file_name; - line_directory_name = directory_name; - } - break; - case N_FUN: - { - /* We'll keep this if it is nearer than the one we have already */ - if (q->symbol.value >= low_func_vma && - q->symbol.value <= offset) { - low_func_vma = q->symbol.value; - func = (asymbol *)q; - } - else if (q->symbol.value > offset) - goto done; + case N_DSLINE: + case N_BSLINE: + /* We'll keep this if it resolves nearer than the one we have + already. */ + if (q->symbol.value >= low_line_vma + && q->symbol.value <= offset) + { + *line_ptr = q->desc; + low_line_vma = q->symbol.value; + line_file_name = current_file_name; + line_directory_name = directory_name; + } + break; + case N_FUN: + { + /* We'll keep this if it is nearer than the one we have already */ + if (q->symbol.value >= low_func_vma && + q->symbol.value <= offset) { + low_func_vma = q->symbol.value; + func = (asymbol *)q; + } + else if (q->symbol.value > offset) + goto done; + } + break; + } } - break; - } } - } done: if (*line_ptr != 0) @@ -2869,7 +2921,7 @@ NAME(aout,find_nearest_line) if (func) { const char *function = func->name; - char *p; + char *colon; /* The caller expects a symbol name. We actually have a function name, without the leading underscore. Put the @@ -2882,9 +2934,9 @@ NAME(aout,find_nearest_line) strcpy (buf + 1, function); } /* Have to remove : stuff */ - p = strchr (buf, ':'); - if (p != NULL) - *p = '\0'; + colon = strchr (buf, ':'); + if (colon != NULL) + *colon = '\0'; *functionname_ptr = buf; } @@ -2896,7 +2948,7 @@ NAME(aout,sizeof_headers) (abfd, execable) bfd *abfd; boolean execable ATTRIBUTE_UNUSED; { - return adata(abfd).exec_bytes_size; + return adata (abfd).exec_bytes_size; } /* Free all information we have cached for this BFD. We can always @@ -2994,9 +3046,9 @@ NAME(aout,link_hash_table_create) (abfd) bfd *abfd; { struct aout_link_hash_table *ret; + bfd_size_type amt = sizeof (struct aout_link_hash_table); - ret = ((struct aout_link_hash_table *) - bfd_alloc (abfd, sizeof (struct aout_link_hash_table))); + ret = (struct aout_link_hash_table *) bfd_alloc (abfd, amt); if (ret == NULL) return (struct bfd_link_hash_table *) NULL; if (! NAME(aout,link_hash_table_init) (ret, abfd, @@ -3132,7 +3184,7 @@ aout_link_check_ar_symbols (abfd, info, pneeded) strings = obj_aout_external_strings (abfd); for (; p < pend; p++) { - int type = bfd_h_get_8 (abfd, p->e_type); + int type = H_GET_8 (abfd, p->e_type); const char *name; struct bfd_link_hash_entry *h; @@ -3296,6 +3348,7 @@ aout_link_add_symbols (abfd, info) struct aout_link_hash_entry **sym_hash; register struct external_nlist *p; struct external_nlist *pend; + bfd_size_type amt; syms = obj_aout_external_syms (abfd); sym_count = obj_aout_external_sym_count (abfd); @@ -3316,10 +3369,8 @@ aout_link_add_symbols (abfd, info) to particular symbols. We could just look them up in the hash table, but keeping the list is more efficient. Perhaps this should be conditional on info->keep_memory. */ - sym_hash = ((struct aout_link_hash_entry **) - bfd_alloc (abfd, - ((size_t) sym_count - * sizeof (struct aout_link_hash_entry *)))); + amt = sym_count * sizeof (struct aout_link_hash_entry *); + sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt); if (sym_hash == NULL && sym_count != 0) return false; obj_aout_sym_hashes (abfd) = sym_hash; @@ -3341,7 +3392,7 @@ aout_link_add_symbols (abfd, info) *sym_hash = NULL; - type = bfd_h_get_8 (abfd, p->e_type); + type = H_GET_8 (abfd, p->e_type); /* Ignore debugging symbols. */ if ((type & N_STAB) != 0) @@ -3525,8 +3576,8 @@ struct aout_link_includes_entry /* Look up an entry in an the header file hash table. */ -#define aout_link_includes_lookup(table, string, create, copy) \ - ((struct aout_link_includes_entry *) \ +#define aout_link_includes_lookup(table, string, create, copy) \ + ((struct aout_link_includes_entry *) \ bfd_hash_lookup (&(table)->root, (string), (create), (copy))) /* During the final link step we need to pass around a bunch of @@ -3631,9 +3682,9 @@ NAME(aout,final_link) (abfd, info, callback) boolean includes_hash_initialized = false; register bfd *sub; bfd_size_type trsize, drsize; - size_t max_contents_size; - size_t max_relocs_size; - size_t max_sym_count; + bfd_size_type max_contents_size; + bfd_size_type max_relocs_size; + bfd_size_type max_sym_count; bfd_size_type text_size; file_ptr text_end; register struct bfd_link_order *p; @@ -3665,7 +3716,7 @@ NAME(aout,final_link) (abfd, info, callback) max_sym_count = 0; for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { - size_t sz; + bfd_size_type sz; if (info->relocateable) { @@ -3934,14 +3985,12 @@ NAME(aout,final_link) (abfd, info, callback) && obj_datasec (abfd)->reloc_count == 0) { bfd_byte b; + file_ptr pos; 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) + pos = obj_datasec (abfd)->filepos + exec_hdr (abfd)->a_data - 1; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) goto error_return; } @@ -4062,9 +4111,9 @@ aout_link_write_symbols (finfo, input_bfd) false, false) != NULL) && discard != discard_all) { - bfd_h_put_8 (output_bfd, N_TEXT, outsym->e_type); - bfd_h_put_8 (output_bfd, 0, outsym->e_other); - bfd_h_put_16 (output_bfd, (bfd_vma) 0, outsym->e_desc); + H_PUT_8 (output_bfd, N_TEXT, outsym->e_type); + H_PUT_8 (output_bfd, 0, outsym->e_other); + H_PUT_16 (output_bfd, 0, outsym->e_desc); strtab_index = add_to_stringtab (output_bfd, finfo->strtab, input_bfd->filename, false); if (strtab_index == (bfd_size_type) -1) @@ -4085,7 +4134,7 @@ aout_link_write_symbols (finfo, input_bfd) sym_end = sym + sym_count; sym_hash = obj_aout_sym_hashes (input_bfd); symbol_map = finfo->symbol_map; - memset (symbol_map, 0, sym_count * sizeof *symbol_map); + memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map); for (; sym < sym_end; sym++, sym_hash++, symbol_map++) { const char *name; @@ -4108,7 +4157,7 @@ aout_link_write_symbols (finfo, input_bfd) we do copy the symbol over. */ *symbol_map = -1; - type = bfd_h_get_8 (input_bfd, sym->e_type); + type = H_GET_8 (input_bfd, sym->e_type); name = strings + GET_WORD (input_bfd, sym->e_strx); h = NULL; @@ -4342,6 +4391,7 @@ aout_link_write_symbols (finfo, input_bfd) switch (discard) { case discard_none: + case discard_sec_merge: break; case discard_l: if ((type & N_STAB) == 0 @@ -4378,7 +4428,7 @@ aout_link_write_symbols (finfo, input_bfd) { int incl_type; - incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type); + incl_type = H_GET_8 (input_bfd, incl_sym->e_type); if (incl_type == N_EINCL) { if (nest == 0) @@ -4399,7 +4449,7 @@ aout_link_write_symbols (finfo, input_bfd) { /* Skip the file number. */ ++s; - while (isdigit ((unsigned char) *s)) + while (ISDIGIT (*s)) ++s; --s; } @@ -4447,7 +4497,7 @@ aout_link_write_symbols (finfo, input_bfd) { int incl_type; - incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type); + incl_type = H_GET_8 (input_bfd, incl_sym->e_type); if (incl_type == N_EINCL) { if (nest == 0) @@ -4468,11 +4518,9 @@ aout_link_write_symbols (finfo, input_bfd) /* Copy this symbol into the list of symbols we are going to write out. */ - bfd_h_put_8 (output_bfd, type, outsym->e_type); - bfd_h_put_8 (output_bfd, bfd_h_get_8 (input_bfd, sym->e_other), - outsym->e_other); - bfd_h_put_16 (output_bfd, bfd_h_get_16 (input_bfd, sym->e_desc), - outsym->e_desc); + H_PUT_8 (output_bfd, type, outsym->e_type); + H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other); + H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc); copy = false; if (! finfo->info->keep_memory) { @@ -4498,17 +4546,16 @@ aout_link_write_symbols (finfo, input_bfd) /* Write out the output symbols we have just constructed. */ if (outsym > finfo->output_syms) { - bfd_size_type outsym_count; + bfd_size_type outsym_size; if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0) return false; - outsym_count = outsym - finfo->output_syms; - if (bfd_write ((PTR) finfo->output_syms, - (bfd_size_type) EXTERNAL_NLIST_SIZE, - (bfd_size_type) outsym_count, output_bfd) - != outsym_count * EXTERNAL_NLIST_SIZE) + outsym_size = outsym - finfo->output_syms; + outsym_size *= EXTERNAL_NLIST_SIZE; + if (bfd_bwrite ((PTR) finfo->output_syms, outsym_size, output_bfd) + != outsym_size) return false; - finfo->symoff += outsym_count * EXTERNAL_NLIST_SIZE; + finfo->symoff += outsym_size; } return true; @@ -4528,6 +4575,7 @@ aout_link_write_other_symbol (h, data) bfd_vma val; struct external_nlist outsym; bfd_size_type indx; + bfd_size_type amt; output_bfd = finfo->output_bfd; @@ -4604,12 +4652,12 @@ aout_link_write_other_symbol (h, data) return true; } - bfd_h_put_8 (output_bfd, type, outsym.e_type); - bfd_h_put_8 (output_bfd, 0, outsym.e_other); - bfd_h_put_16 (output_bfd, 0, outsym.e_desc); + H_PUT_8 (output_bfd, type, outsym.e_type); + H_PUT_8 (output_bfd, 0, outsym.e_other); + H_PUT_16 (output_bfd, 0, outsym.e_desc); indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string, false); - if (indx == (bfd_size_type) -1) + if (indx == - (bfd_size_type) 1) { /* FIXME: No way to handle errors. */ abort (); @@ -4617,9 +4665,9 @@ aout_link_write_other_symbol (h, data) PUT_WORD (output_bfd, indx, outsym.e_strx); PUT_WORD (output_bfd, val, outsym.e_value); + amt = EXTERNAL_NLIST_SIZE; if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0 - || bfd_write ((PTR) &outsym, (bfd_size_type) EXTERNAL_NLIST_SIZE, - (bfd_size_type) 1, output_bfd) != EXTERNAL_NLIST_SIZE) + || bfd_bwrite ((PTR) &outsym, amt, output_bfd) != amt) { /* FIXME: No way to handle errors. */ abort (); @@ -4663,7 +4711,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, if (rel_size > 0) { if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 - || bfd_read (relocs, 1, rel_size, input_bfd) != rel_size) + || bfd_bread (relocs, rel_size, input_bfd) != rel_size) return false; } } @@ -4688,7 +4736,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, if (! bfd_set_section_contents (finfo->output_bfd, input_section->output_section, (PTR) finfo->contents, - input_section->output_offset, + (file_ptr) input_section->output_offset, input_size)) return false; @@ -4698,8 +4746,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, { if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0) return false; - if (bfd_write (relocs, (bfd_size_type) 1, rel_size, finfo->output_bfd) - != rel_size) + if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size) return false; *reloff_ptr += rel_size; @@ -4798,7 +4845,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, r_addr = GET_SWORD (input_bfd, rel->r_address); #ifdef MY_reloc_howto - howto = MY_reloc_howto(input_bfd, rel, r_index, r_extern, r_pcrel); + howto = MY_reloc_howto (input_bfd, rel, r_index, r_extern, r_pcrel); #else { int r_jmptable; @@ -5357,7 +5404,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, /* For base relative relocs, r_index is always an index into the symbol table, even if r_extern is 0. */ sym = syms + r_index; - type = bfd_h_get_8 (input_bfd, sym->e_type); + type = H_GET_8 (input_bfd, sym->e_type); if ((type & N_TYPE) == N_TEXT || type == N_WEAKT) r_section = obj_textsec (input_bfd); @@ -5518,6 +5565,7 @@ aout_link_reloc_link_order (finfo, o, p) struct reloc_std_external srel; struct reloc_ext_external erel; PTR rel_ptr; + bfd_size_type amt; pr = p->u.reloc.p; @@ -5583,8 +5631,8 @@ aout_link_reloc_link_order (finfo, o, p) if (obj_reloc_entry_size (finfo->output_bfd) == RELOC_STD_SIZE) { #ifdef MY_put_reloc - MY_put_reloc(finfo->output_bfd, r_extern, r_index, p->offset, howto, - &srel); + MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto, + &srel); #else { int r_pcrel; @@ -5647,7 +5695,7 @@ aout_link_reloc_link_order (finfo, o, p) if (buf == (bfd_byte *) NULL) return false; r = MY_relocate_contents (howto, finfo->output_bfd, - pr->addend, buf); + (bfd_vma) pr->addend, buf); switch (r) { case bfd_reloc_ok: @@ -5670,10 +5718,8 @@ aout_link_reloc_link_order (finfo, o, p) } break; } - ok = bfd_set_section_contents (finfo->output_bfd, o, - (PTR) buf, - (file_ptr) p->offset, - size); + ok = bfd_set_section_contents (finfo->output_bfd, o, (PTR) buf, + (file_ptr) p->offset, size); free (buf); if (! ok) return false; @@ -5706,17 +5752,15 @@ aout_link_reloc_link_order (finfo, o, p) | (howto->type << RELOC_EXT_BITS_TYPE_SH_LITTLE); } - PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend); + PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend); #endif /* MY_put_ext_reloc */ rel_ptr = (PTR) &erel; } + amt = obj_reloc_entry_size (finfo->output_bfd); if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0 - || (bfd_write (rel_ptr, (bfd_size_type) 1, - obj_reloc_entry_size (finfo->output_bfd), - finfo->output_bfd) - != obj_reloc_entry_size (finfo->output_bfd))) + || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt) return false; *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd); diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 0a6f023..fc2ba45 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1,6 +1,6 @@ /* BFD back-end for archive files (libraries). Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -132,7 +132,7 @@ DESCRIPTION #include "libbfd.h" #include "aout/ar.h" #include "aout/ranlib.h" -#include +#include "safe-ctype.h" #ifndef errno extern int errno; @@ -142,12 +142,6 @@ extern int errno; #define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB) #endif -/* Define offsetof for those systems which lack it */ - -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - /* We keep a cache of archive filepointers to archive elements to speed up searching the archive by filepos. We only add an entry to the cache when we actually read one. We also don't sort the cache; @@ -170,6 +164,7 @@ static char *get_extended_arelt_filename PARAMS ((bfd *arch, const char *name)); static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd)); static boolean do_slurp_coff_armap PARAMS ((bfd *abfd)); +boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *abfd)); static const char *normalize PARAMS ((bfd *, const char *file)); static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd, const char *, @@ -179,9 +174,9 @@ boolean _bfd_generic_mkarchive (abfd) bfd *abfd; { - abfd->tdata.aout_ar_data = ((struct artdata *) - bfd_zalloc (abfd, sizeof (struct artdata))); + bfd_size_type amt = sizeof (struct artdata); + abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == NULL) return false; @@ -290,10 +285,9 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) bfd *arch_bfd, *new_elt; file_ptr filepos; { - struct ar_cache *new_cache = ((struct ar_cache *) - bfd_zalloc (arch_bfd, - sizeof (struct ar_cache))); + bfd_size_type amt = sizeof (struct ar_cache); + struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt); if (new_cache == NULL) return false; @@ -364,14 +358,14 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) { struct ar_hdr hdr; char *hdrp = (char *) &hdr; - unsigned int parsed_size; + size_t parsed_size; struct areltdata *ared; char *filename = NULL; - unsigned int namelen = 0; - unsigned int allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr); + bfd_size_type namelen = 0; + bfd_size_type allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr); char *allocptr = 0; - if (bfd_read ((PTR) hdrp, 1, sizeof (struct ar_hdr), abfd) + if (bfd_bread ((PTR) hdrp, (bfd_size_type) sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) { if (bfd_get_error () != bfd_error_system_call) @@ -414,7 +408,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1' && hdr.ar_name[2] == '/' - && isdigit ((unsigned char) hdr.ar_name[3])) + && ISDIGIT (hdr.ar_name[3])) { /* BSD-4.4 extended name */ namelen = atoi (&hdr.ar_name[3]); @@ -427,7 +421,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) filename = (allocptr + sizeof (struct areltdata) + sizeof (struct ar_hdr)); - if (bfd_read (filename, 1, namelen, abfd) != namelen) + if (bfd_bread (filename, namelen, abfd) != namelen) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_no_more_archived_files); @@ -482,7 +476,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) ared->filename = allocptr + (sizeof (struct areltdata) + sizeof (struct ar_hdr)); if (namelen) - memcpy (ared->filename, hdr.ar_name, namelen); + memcpy (ared->filename, hdr.ar_name, (size_t) namelen); ared->filename[namelen] = '\0'; } @@ -607,10 +601,11 @@ bfd_generic_archive_p (abfd) { struct artdata *tdata_hold; char armag[SARMAG + 1]; + bfd_size_type amt; tdata_hold = abfd->tdata.aout_ar_data; - if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG) + if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -628,8 +623,8 @@ bfd_generic_archive_p (abfd) /* We are setting bfd_ardata(abfd) here, but since bfd_ardata involves a cast, we can't do it as the left operand of assignment. */ - abfd->tdata.aout_ar_data = ((struct artdata *) - bfd_zalloc (abfd, sizeof (struct artdata))); + amt = sizeof (struct artdata); + abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == NULL) return NULL; @@ -684,15 +679,19 @@ bfd_generic_archive_p (abfd) if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { +#if 0 + /* We ought to close `first' here, but we can't, because + we have no way to remove it from the archive cache. + It's close to impossible to figure out when we can + release bfd_ardata. FIXME. */ (void) bfd_close (first); bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = tdata_hold; - bfd_set_error (bfd_error_wrong_format); +#endif + bfd_set_error (bfd_error_wrong_object_format); return NULL; } - - /* We ought to close first here, but we can't, because we - have no way to remove it from the archive cache. FIXME. */ + /* And we ought to close `first' here too. */ } } @@ -702,7 +701,7 @@ bfd_generic_archive_p (abfd) /* Some constants for a 32 bit BSD archive structure. We do not support 64 bit archives presently; so far as I know, none actually exist. Supporting them would require changing these constants, and - changing some bfd_h_get_32 to bfd_h_get_64. */ + changing some H_GET_32 to H_GET_64. */ /* The size of an external symdef structure. */ #define BSD_SYMDEF_SIZE 8 @@ -727,7 +726,7 @@ do_slurp_bsd_armap (abfd) bfd_byte *raw_armap, *rbase; struct artdata *ardata = bfd_ardata (abfd); char *stringbase; - unsigned int parsed_size; + bfd_size_type parsed_size, amt; carsym *set; mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); @@ -740,7 +739,7 @@ do_slurp_bsd_armap (abfd) if (raw_armap == (bfd_byte *) NULL) return false; - if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size) + if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -749,7 +748,7 @@ do_slurp_bsd_armap (abfd) return false; } - ardata->symdef_count = bfd_h_get_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; + ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; if (ardata->symdef_count * BSD_SYMDEF_SIZE > parsed_size - BSD_SYMDEF_COUNT_SIZE) @@ -764,9 +763,8 @@ do_slurp_bsd_armap (abfd) stringbase = ((char *) rbase + ardata->symdef_count * BSD_SYMDEF_SIZE + BSD_STRING_COUNT_SIZE); - ardata->symdefs = (carsym *) bfd_alloc (abfd, - (ardata->symdef_count - * sizeof (carsym))); + amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym); + ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); if (!ardata->symdefs) return false; @@ -774,8 +772,8 @@ do_slurp_bsd_armap (abfd) counter < ardata->symdef_count; counter++, set++, rbase += BSD_SYMDEF_SIZE) { - set->name = bfd_h_get_32 (abfd, rbase) + stringbase; - set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); + set->name = H_GET_32 (abfd, rbase) + stringbase; + set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); } ardata->first_file_filepos = bfd_tell (abfd); @@ -798,13 +796,14 @@ do_slurp_coff_armap (abfd) int *raw_armap, *rawptr; struct artdata *ardata = bfd_ardata (abfd); char *stringbase; - unsigned int stringsize; + bfd_size_type stringsize; unsigned int parsed_size; carsym *carsyms; - unsigned int nsymz; /* Number of symbols in armap. */ + bfd_size_type nsymz; /* Number of symbols in armap. */ bfd_vma (*swap) PARAMS ((const bfd_byte *)); char int_buf[sizeof (long)]; - unsigned int carsym_size, ptrsize, i; + bfd_size_type carsym_size, ptrsize; + unsigned int i; mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); if (mapdata == NULL) @@ -812,7 +811,7 @@ do_slurp_coff_armap (abfd) parsed_size = mapdata->parsed_size; bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ - if (bfd_read ((PTR) int_buf, 1, 4, abfd) != 4) + if (bfd_bread ((PTR) int_buf, (bfd_size_type) 4, abfd) != 4) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -857,8 +856,8 @@ do_slurp_coff_armap (abfd) raw_armap = (int *) bfd_alloc (abfd, ptrsize); if (raw_armap == NULL) goto release_symdefs; - if (bfd_read ((PTR) raw_armap, 1, ptrsize, abfd) != ptrsize - || bfd_read ((PTR) stringbase, 1, stringsize, abfd) != stringsize) + if (bfd_bread ((PTR) raw_armap, ptrsize, abfd) != ptrsize + || (bfd_bread ((PTR) stringbase, stringsize, abfd) != stringsize)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -888,7 +887,7 @@ do_slurp_coff_armap (abfd) { struct areltdata *tmp; - bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); + bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd); if (tmp != NULL) { @@ -896,7 +895,7 @@ do_slurp_coff_armap (abfd) && tmp->arch_header[1] == ' ') { ardata->first_file_filepos += - (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1; + (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~(unsigned) 1; } bfd_release (abfd, tmp); } @@ -919,14 +918,14 @@ bfd_slurp_armap (abfd) bfd *abfd; { char nextname[17]; - int i = bfd_read ((PTR) nextname, 1, 16, abfd); + int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); if (i == 0) return true; if (i != 16) return false; - if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) + if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return false; if (!strncmp (nextname, "__.SYMDEF ", 16) @@ -936,9 +935,13 @@ bfd_slurp_armap (abfd) return do_slurp_coff_armap (abfd); else if (!strncmp (nextname, "/SYM64/ ", 16)) { - /* Irix 6 archive--must be recognized by code in elf64-mips.c. */ + /* 64bit ELF (Irix 6) archive. */ +#ifdef BFD64 + return bfd_elf64_archive_slurp_armap (abfd); +#else bfd_set_error (bfd_error_wrong_format); return false; +#endif } bfd_has_map (abfd) = false; @@ -963,8 +966,9 @@ bfd_slurp_bsd_armap_f2 (abfd) struct artdata *ardata = bfd_ardata (abfd); char *stringbase; unsigned int stringsize; + bfd_size_type amt; carsym *set; - int i = bfd_read ((PTR) nextname, 1, 16, abfd); + int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); if (i == 0) return true; @@ -972,7 +976,7 @@ bfd_slurp_bsd_armap_f2 (abfd) return false; /* The archive has at least 16 bytes in it. */ - if (bfd_seek (abfd, -16L, SEEK_CUR) != 0) + if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return false; if (!strncmp (nextname, "__.SYMDEF ", 16) @@ -989,7 +993,8 @@ bfd_slurp_bsd_armap_f2 (abfd) if (mapdata == NULL) return false; - raw_armap = (bfd_byte *) bfd_zalloc (abfd, mapdata->parsed_size); + amt = mapdata->parsed_size; + raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt); if (raw_armap == NULL) { byebye: @@ -997,8 +1002,7 @@ bfd_slurp_bsd_armap_f2 (abfd) return false; } - if (bfd_read ((PTR) raw_armap, 1, mapdata->parsed_size, abfd) != - mapdata->parsed_size) + if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -1007,7 +1011,7 @@ bfd_slurp_bsd_armap_f2 (abfd) goto byebye; } - ardata->symdef_count = bfd_h_get_16 (abfd, (PTR) raw_armap); + ardata->symdef_count = H_GET_16 (abfd, (PTR) raw_armap); if (ardata->symdef_count * BSD_SYMDEF_SIZE > mapdata->parsed_size - HPUX_SYMDEF_COUNT_SIZE) @@ -1019,15 +1023,14 @@ bfd_slurp_bsd_armap_f2 (abfd) ardata->cache = 0; - stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE); + stringsize = H_GET_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE); /* Skip sym count and string sz. */ stringbase = ((char *) raw_armap + HPUX_SYMDEF_COUNT_SIZE + BSD_STRING_COUNT_SIZE); rbase = (bfd_byte *) stringbase + stringsize; - ardata->symdefs = (carsym *) bfd_alloc (abfd, - (ardata->symdef_count - * BSD_SYMDEF_SIZE)); + amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE; + ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); if (!ardata->symdefs) return false; @@ -1035,8 +1038,8 @@ bfd_slurp_bsd_armap_f2 (abfd) counter < ardata->symdef_count; counter++, set++, rbase += BSD_SYMDEF_SIZE) { - set->name = bfd_h_get_32 (abfd, rbase) + stringbase; - set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); + set->name = H_GET_32 (abfd, rbase) + stringbase; + set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); } ardata->first_file_filepos = bfd_tell (abfd); @@ -1067,13 +1070,14 @@ _bfd_slurp_extended_name_table (abfd) { char nextname[17]; struct areltdata *namedata; + bfd_size_type amt; /* FIXME: Formatting sucks here, and in case of failure of BFD_READ, we probably don't want to return true. */ bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET); - if (bfd_read ((PTR) nextname, 1, 16, abfd) == 16) + if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16) { - if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) + if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return false; if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && @@ -1087,8 +1091,8 @@ _bfd_slurp_extended_name_table (abfd) if (namedata == NULL) return false; - bfd_ardata (abfd)->extended_names = - bfd_zalloc (abfd, namedata->parsed_size); + amt = namedata->parsed_size; + bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->extended_names == NULL) { byebye: @@ -1096,8 +1100,7 @@ _bfd_slurp_extended_name_table (abfd) return false; } - if (bfd_read ((PTR) bfd_ardata (abfd)->extended_names, 1, - namedata->parsed_size, abfd) != namedata->parsed_size) + if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -1147,8 +1150,8 @@ normalize (abfd, file) bfd *abfd; const char *file; { - CONST char *first; - CONST char *last; + const char *first; + const char *last; char *copy; first = file + strlen (file) - 1; @@ -1166,7 +1169,7 @@ normalize (abfd, file) first--; } - copy = (char *) bfd_alloc (abfd, last - first + 1); + copy = (char *) bfd_alloc (abfd, (bfd_size_type) (last - first + 1)); if (copy == NULL) return NULL; @@ -1244,7 +1247,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) bfd_size_type *tablen; { unsigned int maxname = abfd->xvec->ar_max_namelen; - unsigned int total_namelen = 0; + bfd_size_type total_namelen = 0; bfd *current; char *strptr; @@ -1392,6 +1395,7 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) struct areltdata *ared; struct ar_hdr *hdr; char *temp, *temp1; + bfd_size_type amt; if (member && (member->flags & BFD_IN_MEMORY) != 0) { @@ -1409,8 +1413,8 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) return NULL; } - ared = (struct areltdata *) bfd_zalloc (abfd, sizeof (struct ar_hdr) + - sizeof (struct areltdata)); + amt = sizeof (struct ar_hdr) + sizeof (struct areltdata); + ared = (struct areltdata *) bfd_zalloc (abfd, amt); if (ared == NULL) return NULL; hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata)); @@ -1537,7 +1541,7 @@ bfd_generic_stat_arch_elt (abfd, buf) void bfd_dont_truncate_arname (abfd, pathname, arhdr) bfd *abfd; - CONST char *pathname; + const char *pathname; char *arhdr; { /* FIXME: This interacts unpleasantly with ar's quick-append option. @@ -1577,13 +1581,13 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr) void bfd_bsd_truncate_arname (abfd, pathname, arhdr) bfd *abfd; - CONST char *pathname; + const char *pathname; char *arhdr; { struct ar_hdr *hdr = (struct ar_hdr *) arhdr; - int length; - CONST char *filename = strrchr (pathname, '/'); - int maxlen = ar_maxnamelen (abfd); + size_t length; + const char *filename = strrchr (pathname, '/'); + size_t maxlen = ar_maxnamelen (abfd); #ifdef HAVE_DOS_BASED_FILE_SYSTEM { @@ -1628,13 +1632,13 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) void bfd_gnu_truncate_arname (abfd, pathname, arhdr) bfd *abfd; - CONST char *pathname; + const char *pathname; char *arhdr; { struct ar_hdr *hdr = (struct ar_hdr *) arhdr; - int length; - CONST char *filename = strrchr (pathname, '/'); - int maxlen = ar_maxnamelen (abfd); + size_t length; + const char *filename = strrchr (pathname, '/'); + size_t maxlen = ar_maxnamelen (abfd); #ifdef HAVE_DOS_BASED_FILE_SYSTEM { @@ -1733,16 +1737,16 @@ _bfd_write_archive_contents (arch) if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0) return false; #ifdef GNU960 - wrote = bfd_write (BFD_GNU960_ARMAG (arch), 1, SARMAG, arch); + wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch); #else - wrote = bfd_write (ARMAG, 1, SARMAG, arch); + wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch); #endif if (wrote != SARMAG) return false; if (makemap && hasobjects) { - if (_bfd_compute_and_write_armap (arch, elength) != true) + if (_bfd_compute_and_write_armap (arch, (unsigned int) elength) != true) return false; } @@ -1754,18 +1758,18 @@ _bfd_write_archive_contents (arch) strcpy (hdr.ar_name, ename); /* Round size up to even number in archive header. */ sprintf (&(hdr.ar_size[0]), "%-10d", - (int) ((elength + 1) & ~1)); + (int) ((elength + 1) & ~(bfd_size_type) 1)); strncpy (hdr.ar_fmag, ARFMAG, 2); for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - if ((bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch) + if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) - || bfd_write (etable, 1, elength, arch) != elength) + || bfd_bwrite (etable, elength, arch) != elength) return false; if ((elength % 2) == 1) { - if (bfd_write ("\012", 1, 1, arch) != 1) + if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) return false; } } @@ -1777,7 +1781,8 @@ _bfd_write_archive_contents (arch) struct ar_hdr *hdr = arch_hdr (current); /* Write ar header. */ - if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr)) + if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch) + != sizeof (*hdr)) return false; if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) return false; @@ -1787,19 +1792,19 @@ _bfd_write_archive_contents (arch) if (amt > remaining) amt = remaining; errno = 0; - if (bfd_read (buffer, amt, 1, current) != amt) + if (bfd_bread (buffer, (bfd_size_type) amt, current) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); return false; } - if (bfd_write (buffer, amt, 1, arch) != amt) + if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt) return false; remaining -= amt; } if ((arelt_size (current) % 2) == 1) { - if (bfd_write ("\012", 1, 1, arch) != 1) + if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) return false; } } @@ -1837,25 +1842,27 @@ _bfd_compute_and_write_armap (arch, elength) bfd *current; file_ptr elt_no = 0; struct orl *map = NULL; - int orl_max = 1024; /* fine initial default */ - int orl_count = 0; + unsigned int orl_max = 1024; /* fine initial default */ + unsigned int orl_count = 0; int stridx = 0; /* string index */ asymbol **syms = NULL; long syms_max = 0; boolean ret; + bfd_size_type amt; /* Dunno if this is the best place for this info... */ if (elength != 0) elength += sizeof (struct ar_hdr); elength += elength % 2; - map = (struct orl *) bfd_malloc (orl_max * sizeof (struct orl)); + amt = (bfd_size_type) orl_max * sizeof (struct orl); + map = (struct orl *) bfd_malloc (amt); if (map == NULL) goto error_return; /* We put the symbol names on the arch objalloc, and then discard them when done. */ - first_name = bfd_alloc (arch, 1); + first_name = bfd_alloc (arch, (bfd_size_type) 1); if (first_name == NULL) goto error_return; @@ -1887,7 +1894,7 @@ _bfd_compute_and_write_armap (arch, elength) if (syms_max > 0) free (syms); syms_max = storage; - syms = (asymbol **) bfd_malloc ((size_t) syms_max); + syms = (asymbol **) bfd_malloc ((bfd_size_type) syms_max); if (syms == NULL) goto error_return; } @@ -1908,16 +1915,15 @@ _bfd_compute_and_write_armap (arch, elength) bfd_is_com_section (sec)) && ! bfd_is_und_section (sec)) { - size_t namelen; + bfd_size_type namelen; struct orl *new_map; /* This symbol will go into the archive header. */ if (orl_count == orl_max) { orl_max *= 2; - new_map = - ((struct orl *) - bfd_realloc (map, orl_max * sizeof (struct orl))); + amt = (bfd_size_type) orl_max * sizeof (struct orl); + new_map = (struct orl *) bfd_realloc (map, amt); if (new_map == (struct orl *) NULL) goto error_return; @@ -1925,17 +1931,16 @@ _bfd_compute_and_write_armap (arch, elength) } namelen = strlen (syms[src_count]->name); - map[orl_count].name = ((char **) - bfd_alloc (arch, - sizeof (char *))); + amt = sizeof (char *); + map[orl_count].name = (char **) bfd_alloc (arch, amt); if (map[orl_count].name == NULL) goto error_return; *(map[orl_count].name) = bfd_alloc (arch, namelen + 1); if (*(map[orl_count].name) == NULL) goto error_return; strcpy (*(map[orl_count].name), syms[src_count]->name); - (map[orl_count]).pos = (file_ptr) current; - (map[orl_count]).namidx = stridx; + map[orl_count].u.abfd = current; + map[orl_count].namidx = stridx; stridx += namelen + 1; ++orl_count; @@ -2013,18 +2018,18 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - if (bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch) + if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) return false; - bfd_h_put_32 (arch, (bfd_vma) ranlibsize, temp); - if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp)) + H_PUT_32 (arch, ranlibsize, temp); + if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) return false; for (count = 0; count < orl_count; count++) { bfd_byte buf[BSD_SYMDEF_SIZE]; - if (((bfd *) (map[count]).pos) != last_elt) + if (map[count].u.abfd != last_elt) { do { @@ -2032,25 +2037,26 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) firstreal += firstreal % 2; current = current->next; } - while (current != (bfd *) (map[count]).pos); + while (current != map[count].u.abfd); } /* if new archive element */ last_elt = current; - bfd_h_put_32 (arch, map[count].namidx, buf); - bfd_h_put_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); - if (bfd_write (buf, BSD_SYMDEF_SIZE, 1, arch) != BSD_SYMDEF_SIZE) + H_PUT_32 (arch, map[count].namidx, buf); + H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); + if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch) + != BSD_SYMDEF_SIZE) return false; } /* Now write the strings themselves. */ - bfd_h_put_32 (arch, stringsize, temp); - if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp)) + H_PUT_32 (arch, stringsize, temp); + if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) return false; for (count = 0; count < orl_count; count++) { size_t len = strlen (*map[count].name) + 1; - if (bfd_write (*map[count].name, 1, len, arch) != len) + if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) return false; } @@ -2058,7 +2064,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) bug-compatible for sun's ar we use a null. */ if (padit) { - if (bfd_write ("", 1, 1, arch) != 1) + if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) return false; } @@ -2107,7 +2113,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch) bfd_ardata (arch)->armap_datepos = (SARMAG + offsetof (struct ar_hdr, ar_date[0])); if (bfd_seek (arch, bfd_ardata (arch)->armap_datepos, SEEK_SET) != 0 - || (bfd_write (hdr.ar_date, sizeof (hdr.ar_date), 1, arch) + || (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch) != sizeof (hdr.ar_date))) { /* FIXME: bfd can't call perror. */ @@ -2144,11 +2150,11 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) int stridx; { /* The size of the ranlib is the number of exported symbols in the - archive * the number of bytes in a int, + an int for the count. */ + archive * the number of bytes in an int, + an int for the count. */ unsigned int ranlibsize = (symbol_count * 4) + 4; unsigned int stringsize = stridx; unsigned int mapsize = stringsize + ranlibsize; - file_ptr archive_member_file_ptr; + unsigned int archive_member_file_ptr; bfd *current = arch->archive_head; unsigned int count; struct ar_hdr hdr; @@ -2180,7 +2186,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) /* Write the ar header for this item and the number of symbols. */ - if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), arch) + if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) return false; @@ -2199,7 +2205,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) /* For each symbol which is used defined in this object, write out the object file's address in the archive. */ - while (count < symbol_count && ((bfd *) (map[count]).pos) == current) + while (count < symbol_count && map[count].u.abfd == current) { bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr); count++; @@ -2217,7 +2223,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) { size_t len = strlen (*map[count].name) + 1; - if (bfd_write (*map[count].name, 1, len, arch) != len) + if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) return false; } @@ -2225,7 +2231,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) bug-compatible for arc960 we use a null. */ if (padit) { - if (bfd_write ("", 1, 1, arch) != 1) + if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) return false; } diff --git a/contrib/binutils/bfd/archive64.c b/contrib/binutils/bfd/archive64.c new file mode 100644 index 0000000..ea94c6a --- /dev/null +++ b/contrib/binutils/bfd/archive64.c @@ -0,0 +1,245 @@ +/* MIPS-specific support for 64-bit ELF + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + Ian Lance Taylor, Cygnus Support + Linker support added by Mark Mitchell, CodeSourcery, LLC. + + +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 supports the 64-bit (MIPS) ELF archives. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "aout/ar.h" + +/* Irix 6 defines a 64bit archive map format, so that they can + have archives more than 4 GB in size. */ + +boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *)); +boolean bfd_elf64_archive_write_armap + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); + +/* Read an Irix 6 armap. */ + +boolean +bfd_elf64_archive_slurp_armap (abfd) + bfd *abfd; +{ + struct artdata *ardata = bfd_ardata (abfd); + char nextname[17]; + file_ptr arhdrpos; + bfd_size_type i, parsed_size, nsymz, stringsize, carsym_size, ptrsize; + struct areltdata *mapdata; + bfd_byte int_buf[8]; + char *stringbase; + bfd_byte *raw_armap = NULL; + carsym *carsyms; + bfd_size_type amt; + + ardata->symdefs = NULL; + + /* Get the name of the first element. */ + arhdrpos = bfd_tell (abfd); + i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); + if (i == 0) + return true; + if (i != 16) + return false; + + if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) + return false; + + /* Archives with traditional armaps are still permitted. */ + if (strncmp (nextname, "/ ", 16) == 0) + return bfd_slurp_armap (abfd); + + if (strncmp (nextname, "/SYM64/ ", 16) != 0) + { + bfd_has_map (abfd) = false; + return true; + } + + mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); + if (mapdata == NULL) + return false; + parsed_size = mapdata->parsed_size; + bfd_release (abfd, (PTR) mapdata); + + if (bfd_bread (int_buf, (bfd_size_type) 8, abfd) != 8) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_malformed_archive); + return false; + } + + nsymz = bfd_getb64 (int_buf); + stringsize = parsed_size - 8 * nsymz - 8; + + carsym_size = nsymz * sizeof (carsym); + ptrsize = 8 * nsymz; + + amt = carsym_size + stringsize + 1; + ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt); + if (ardata->symdefs == NULL) + return false; + carsyms = ardata->symdefs; + stringbase = ((char *) ardata->symdefs) + carsym_size; + + raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize); + if (raw_armap == NULL) + goto release_symdefs; + + if (bfd_bread (raw_armap, ptrsize, abfd) != ptrsize + || bfd_bread (stringbase, stringsize, abfd) != stringsize) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_malformed_archive); + goto release_raw_armap; + } + + for (i = 0; i < nsymz; i++) + { + carsyms->file_offset = bfd_getb64 (raw_armap + i * 8); + carsyms->name = stringbase; + stringbase += strlen (stringbase) + 1; + ++carsyms; + } + *stringbase = '\0'; + + ardata->symdef_count = nsymz; + ardata->first_file_filepos = bfd_tell (abfd); + /* Pad to an even boundary if you have to. */ + ardata->first_file_filepos += (ardata->first_file_filepos) % 2; + + bfd_has_map (abfd) = true; + bfd_release (abfd, raw_armap); + + return true; + +release_raw_armap: + bfd_release (abfd, raw_armap); +release_symdefs: + bfd_release (abfd, ardata->symdefs); + return false; +} + +/* Write out an Irix 6 armap. The Irix 6 tools are supposed to be + able to handle ordinary ELF armaps, but at least on Irix 6.2 the + linker crashes. */ + +boolean +bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) + bfd *arch; + unsigned int elength; + struct orl *map; + unsigned int symbol_count; + int stridx; +{ + unsigned int ranlibsize = (symbol_count * 8) + 8; + unsigned int stringsize = stridx; + unsigned int mapsize = stringsize + ranlibsize; + file_ptr archive_member_file_ptr; + bfd *current = arch->archive_head; + unsigned int count; + struct ar_hdr hdr; + unsigned int i; + int padding; + bfd_byte buf[8]; + + padding = BFD_ALIGN (mapsize, 8) - mapsize; + mapsize += padding; + + /* work out where the first object file will go in the archive */ + archive_member_file_ptr = (mapsize + + elength + + sizeof (struct ar_hdr) + + SARMAG); + + memset ((char *) (&hdr), 0, sizeof (struct ar_hdr)); + strcpy (hdr.ar_name, "/SYM64/"); + sprintf (hdr.ar_size, "%-10d", (int) mapsize); + sprintf (hdr.ar_date, "%ld", (long) time (NULL)); + /* This, at least, is what Intel coff sets the values to.: */ + sprintf ((hdr.ar_uid), "%d", 0); + sprintf ((hdr.ar_gid), "%d", 0); + sprintf ((hdr.ar_mode), "%-7o", (unsigned) 0); + strncpy (hdr.ar_fmag, ARFMAG, 2); + + for (i = 0; i < sizeof (struct ar_hdr); i++) + if (((char *) (&hdr))[i] == '\0') + (((char *) (&hdr))[i]) = ' '; + + /* Write the ar header for this item and the number of symbols */ + + if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) + != sizeof (struct ar_hdr)) + return false; + + bfd_putb64 ((bfd_vma) symbol_count, buf); + if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) + return false; + + /* Two passes, first write the file offsets for each symbol - + remembering that each offset is on a two byte boundary. */ + + /* Write out the file offset for the file associated with each + symbol, and remember to keep the offsets padded out. */ + + current = arch->archive_head; + count = 0; + while (current != (bfd *) NULL && count < symbol_count) + { + /* For each symbol which is used defined in this object, write out + the object file's address in the archive */ + + while (map[count].u.abfd == current) + { + bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf); + if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) + return false; + count++; + } + /* Add size of this archive entry */ + archive_member_file_ptr += (arelt_size (current) + + sizeof (struct ar_hdr)); + /* remember about the even alignment */ + archive_member_file_ptr += archive_member_file_ptr % 2; + current = current->next; + } + + /* now write the strings themselves */ + for (count = 0; count < symbol_count; count++) + { + size_t len = strlen (*map[count].name) + 1; + + if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) + return false; + } + + /* The spec says that this should be padded to an 8 byte boundary. + However, the Irix 6.2 tools do not appear to do this. */ + while (padding != 0) + { + if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) + return false; + --padding; + } + + return true; +} diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c index 8f7f9de..19d862e 100644 --- a/contrib/binutils/bfd/archures.c +++ b/contrib/binutils/bfd/archures.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" #include "libbfd.h" -#include +#include "safe-ctype.h" /* @@ -137,11 +137,10 @@ DESCRIPTION .#define bfd_mach_mips10000 10000 .#define bfd_mach_mips12000 12000 .#define bfd_mach_mips16 16 -.#define bfd_mach_mips32 32 -.#define bfd_mach_mips32_4k 3204113 {* 32, 04, octal 'K' *} .#define bfd_mach_mips5 5 -.#define bfd_mach_mips64 64 .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} +.#define bfd_mach_mipsisa32 32 +.#define bfd_mach_mipsisa64 64 . bfd_arch_i386, {* Intel 386 *} .#define bfd_mach_i386_i386 0 .#define bfd_mach_i386_i8086 1 @@ -161,6 +160,7 @@ DESCRIPTION .#define bfd_mach_h8300 1 .#define bfd_mach_h8300h 2 .#define bfd_mach_h8300s 3 +. bfd_arch_pdp11, {* DEC PDP-11 *} . bfd_arch_powerpc, {* PowerPC *} .#define bfd_mach_ppc 0 .#define bfd_mach_ppc_403 403 @@ -254,6 +254,13 @@ DESCRIPTION .#define bfd_mach_avr4 4 .#define bfd_mach_avr5 5 . bfd_arch_cris, {* Axis CRIS *} +. bfd_arch_s390, {* IBM s390 *} +.#define bfd_mach_s390_esa 0 +.#define bfd_mach_s390_esame 1 +. bfd_arch_openrisc, {* OpenRISC *} +. bfd_arch_mmix, {* Donald Knuth's educational processor *} +. bfd_arch_xstormy16, +.#define bfd_mach_xstormy16 0 . bfd_arch_last . }; */ @@ -311,6 +318,7 @@ extern const bfd_arch_info_type bfd_m88k_arch; extern const bfd_arch_info_type bfd_mips_arch; extern const bfd_arch_info_type bfd_mn10200_arch; extern const bfd_arch_info_type bfd_mn10300_arch; +extern const bfd_arch_info_type bfd_pdp11_arch; 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_pj_arch; @@ -329,6 +337,10 @@ extern const bfd_arch_info_type bfd_fr30_arch; extern const bfd_arch_info_type bfd_mcore_arch; extern const bfd_arch_info_type bfd_avr_arch; extern const bfd_arch_info_type bfd_ia64_arch; +extern const bfd_arch_info_type bfd_s390_arch; +extern const bfd_arch_info_type bfd_openrisc_arch; +extern const bfd_arch_info_type bfd_mmix_arch; +extern const bfd_arch_info_type bfd_xstormy16_arch; static const bfd_arch_info_type * const bfd_archures_list[] = { #ifdef SELECT_ARCHITECTURES @@ -356,6 +368,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = { &bfd_mips_arch, &bfd_mn10200_arch, &bfd_mn10300_arch, + &bfd_pdp11_arch, &bfd_powerpc_arch, &bfd_rs6000_arch, &bfd_sh_arch, @@ -373,6 +386,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] = { &bfd_mcore_arch, &bfd_avr_arch, &bfd_ia64_arch, + &bfd_s390_arch, + &bfd_openrisc_arch, + &bfd_mmix_arch, + &bfd_xstormy16_arch, #endif 0 }; @@ -448,6 +465,7 @@ bfd_arch_list () const char **name_ptr; const char **name_list; const bfd_arch_info_type * const *app; + bfd_size_type amt; /* Determine the number of architectures. */ vec_length = 0; @@ -460,8 +478,8 @@ bfd_arch_list () } } - name_list = (const char **) - bfd_malloc ((vec_length + 1) * sizeof (char **)); + amt = (vec_length + 1) * sizeof (char **); + name_list = (const char **) bfd_malloc (amt); if (name_list == NULL) return NULL; @@ -717,7 +735,7 @@ DESCRIPTION boolean bfd_default_scan (info, string) - const struct bfd_arch_info *info; + const bfd_arch_info_type *info; const char *string; { const char *ptr_src; @@ -741,7 +759,7 @@ bfd_default_scan (info, string) printable_name_colon = strchr (info->printable_name, ':'); if (printable_name_colon == NULL) { - int strlen_arch_name = strlen (info->arch_name); + size_t strlen_arch_name = strlen (info->arch_name); if (strncasecmp (string, info->arch_name, strlen_arch_name) == 0) { if (string[strlen_arch_name] == ':') @@ -763,7 +781,7 @@ bfd_default_scan (info, string) Attempt to match: ? */ if (printable_name_colon != NULL) { - int colon_index = printable_name_colon - info->printable_name; + size_t 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) @@ -802,7 +820,7 @@ bfd_default_scan (info, string) } number = 0; - while (isdigit ((unsigned char) *ptr_src)) + while (ISDIGIT (*ptr_src)) { number = number * 10 + *ptr_src - '0'; ptr_src++; diff --git a/contrib/binutils/bfd/armnetbsd.c b/contrib/binutils/bfd/armnetbsd.c index aa6a882..e899adb 100644 --- a/contrib/binutils/bfd/armnetbsd.c +++ b/contrib/binutils/bfd/armnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/ARM a.out-ish binaries. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -27,12 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DEFAULT_MID M_ARM6_NETBSD /*#define MACHTYPE_OK(mtype) ((mtype) == M_ARM6_NETBSD)*/ -#define MY(OP) CAT (armnetbsd_, OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (armnetbsd_, OP) + /* This needs to start with a.out so GDB knows it is an a.out variant. */ #define TARGETNAME "a.out-arm-netbsd" #if 0 -#define NAME(x,y) CAT3(aoutarm,_32_,y) +#define NAME(x,y) CONCAT3 (aoutarm,_32_,y) #define aoutarm_32_get_section_contents aout_32_get_section_contents diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h index 62ce58b..c6f2b41 100644 --- a/contrib/binutils/bfd/bfd-in.h +++ b/contrib/binutils/bfd/bfd-in.h @@ -4,10 +4,6 @@ Free Software Foundation, Inc. Contributed by Cygnus Support. -** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them; -** instead, change bfd-in.h or the other BFD source files processed to -** generate these files. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -24,25 +20,6 @@ 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. */ -/* bfd.h -- The only header file required by users of the bfd library - -The bfd.h file is generated from bfd-in.h and various .c files; if you -change it, your changes will probably be lost. - -All the prototypes and definitions following the comment "THE FOLLOWING -IS EXTRACTED FROM THE SOURCE" are extracted from the source files for -BFD. If you change it, someone oneday will extract it from the source -again, and your changes will be lost. To save yourself from this bind, -change the definitions in the source in the bfd directory. Type "make -docs" and then "make headers" in that directory, and magically this file -will change to reflect your changes. - -If you don't have the tools to perform the extraction, then you are -safe from someone on your system trampling over your header files. -You should still maintain the equivalence between the source and this -file though; every change you make to the .c file should be reflected -here. */ - #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ @@ -51,10 +28,31 @@ extern "C" { #endif #include "ansidecl.h" +#include "symcat.h" +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#ifndef SABER +/* This hack is to avoid a problem with some strict ANSI C preprocessors. + The problem is, "32_" is not a valid preprocessing token, and we don't + want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will + cause the inner CONCAT2 macros to be evaluated first, producing + still-valid pp-tokens. Then the final concatenation can be done. */ +#undef CONCAT4 +#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) +#endif +#endif + +#define BFD_VERSION @bfd_version@ +#define BFD_VERSION_DATE @bfd_version_date@ +#define BFD_VERSION_STRING @bfd_version_string@ -/* These two lines get substitutions done by commands in Makefile.in. */ -#define BFD_VERSION "@VERSION@" +/* The word size used by BFD on the host. This may be 64 with a 32 + bit target if the host is 64 bit, or if other 64 bit targets have + been selected with --enable-targets, or if --enable-64-bit-bfd. */ #define BFD_ARCH_SIZE @wordsize@ + +/* The word size of the default bfd target. */ +#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ + #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ @@ -106,16 +104,6 @@ typedef enum bfd_boolean {false, true} boolean; typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; #endif -/* A pointer to a position in a file. */ -/* FIXME: This should be using off_t from . - For now, try to avoid breaking stuff by not including here. - This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t - in this header file, and to handle this in the BFD implementation - rather than in its interface. */ -/* typedef off_t file_ptr; */ -typedef long int file_ptr; - /* Support for different sizes of target format ints and addresses. If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be set to 1 above. Otherwise, if gcc is being used, this code will @@ -183,7 +171,22 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ +/* A pointer to a position in a file. */ +/* FIXME: This should be using off_t from . + For now, try to avoid breaking stuff by not including here. + This will break on systems with 64-bit file offsets (e.g. 4.4BSD). + Probably the best long-term answer is to avoid using file_ptr AND off_t + in this header file, and to handle this in the BFD implementation + rather than in its interface. */ +/* typedef off_t file_ptr; */ +typedef bfd_signed_vma file_ptr; +typedef bfd_vma ufile_ptr; + +extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); + #define printf_vma(x) fprintf_vma(stdout,x) +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) typedef unsigned int flagword; /* 32 bits of flags */ typedef unsigned char bfd_byte; @@ -289,7 +292,10 @@ typedef struct carsym { Perhaps just a forward definition would do? */ struct orl { /* output ranlib */ char **name; /* symbol name */ - file_ptr pos; /* bfd* or file position */ + union { + file_ptr pos; + bfd *abfd; + } u; /* bfd* or file position */ int namidx; /* index into string table */ }; @@ -298,7 +304,7 @@ typedef struct lineno_cache_entry { unsigned int line_number; /* Linenumber from start of function*/ union { struct symbol_cache_entry *sym; /* Function name */ - unsigned long offset; /* Offset into section */ + bfd_vma offset; /* Offset into section */ } u; } alent; @@ -341,11 +347,11 @@ typedef struct _symbol_info { symvalue value; char type; - CONST char *name; /* Symbol name. */ + const char *name; /* Symbol name. */ unsigned char stab_type; /* Stab type. */ char stab_other; /* Stab other. */ short stab_desc; /* Stab desc. */ - CONST char *stab_name; /* String for stab type. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -438,47 +444,39 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, boolean (*) (struct bfd_hash_entry *, PTR), PTR info)); - -/* Semi-portable string concatenation in cpp. - The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. - The problem is, "32_" is not a valid preprocessing token, and we don't - want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the - inner CAT macros to be evaluated first, producing still-valid pp-tokens. - Then the final concatenation can be done. (Sigh.) */ -#ifndef CAT -#ifdef SABER -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#define CAT4(a,b,c,d) a##b##c##d -#else -#if defined(__STDC__) || defined(ALMOST_STDC) -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#define XCAT2(a,b) CAT(a,b) -#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d)) -#else -#define CAT(a,b) a/**/b -#define CAT3(a,b,c) a/**/b/**/c -#define CAT4(a,b,c,d) a/**/b/**/c/**/d -#endif -#endif -#endif #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table - + /* User program access to BFD facilities */ /* Direct I/O routines, for programs which know more about the object file than BFD does. Use higher level routines if possible. */ -extern bfd_size_type bfd_read - PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); -extern bfd_size_type bfd_write - PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); -extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction)); -extern long bfd_tell PARAMS ((bfd *abfd)); -extern int bfd_flush PARAMS ((bfd *abfd)); -extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); +extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *)); +extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *)); +extern int bfd_seek PARAMS ((bfd *, file_ptr, int)); +extern ufile_ptr bfd_tell PARAMS ((bfd *)); +extern int bfd_flush PARAMS ((bfd *)); +extern int bfd_stat PARAMS ((bfd *, struct stat *)); + +/* Deprecated old routines. */ +#if __GNUC__ +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#else +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#endif +extern void warn_deprecated + PARAMS ((const char *, const char *, int, const char *)); /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ @@ -514,6 +512,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) +extern boolean bfd_cache_close PARAMS ((bfd *abfd)); +/* NB: This declaration should match the autogenerated one in libbfd.h. */ + extern boolean bfd_record_phdr PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, boolean, boolean, unsigned int, struct sec **)); @@ -622,11 +623,11 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list 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 *, + PARAMS ((bfd *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, boolean, const char *, + PARAMS ((bfd *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); @@ -634,6 +635,10 @@ extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf32_discard_info + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf64_discard_info + PARAMS ((bfd *, struct bfd_link_info *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -708,10 +713,9 @@ extern boolean bfd_xcoff_link_record_set bfd_size_type)); extern boolean bfd_xcoff_import_symbol PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_vma, const char *, const char *, const char *)); + bfd_vma, const char *, const char *, const char *, unsigned int)); extern boolean bfd_xcoff_export_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - boolean)); + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); extern boolean bfd_xcoff_link_count_reloc PARAMS ((bfd *, struct bfd_link_info *, const char *)); extern boolean bfd_xcoff_record_link_assignment @@ -720,6 +724,8 @@ extern boolean bfd_xcoff_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, unsigned long, unsigned long, unsigned long, boolean, int, boolean, boolean, struct sec **)); +extern boolean bfd_xcoff_link_generate_rtinit + PARAMS ((bfd *, const char *, const char *)); /* Externally visible COFF routines. */ diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h index 08456db..e48a20d 100644 --- a/contrib/binutils/bfd/bfd-in2.h +++ b/contrib/binutils/bfd/bfd-in2.h @@ -1,13 +1,15 @@ +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "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" and "format.c". + Run "make headers" in your build bfd/ to regenerate. */ + /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. -** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them; -** instead, change bfd-in.h or the other BFD source files processed to -** generate these files. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -24,25 +26,6 @@ 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. */ -/* bfd.h -- The only header file required by users of the bfd library - -The bfd.h file is generated from bfd-in.h and various .c files; if you -change it, your changes will probably be lost. - -All the prototypes and definitions following the comment "THE FOLLOWING -IS EXTRACTED FROM THE SOURCE" are extracted from the source files for -BFD. If you change it, someone oneday will extract it from the source -again, and your changes will be lost. To save yourself from this bind, -change the definitions in the source in the bfd directory. Type "make -docs" and then "make headers" in that directory, and magically this file -will change to reflect your changes. - -If you don't have the tools to perform the extraction, then you are -safe from someone on your system trampling over your header files. -You should still maintain the equivalence between the source and this -file though; every change you make to the .c file should be reflected -here. */ - #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ @@ -51,10 +34,31 @@ extern "C" { #endif #include "ansidecl.h" +#include "symcat.h" +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#ifndef SABER +/* This hack is to avoid a problem with some strict ANSI C preprocessors. + The problem is, "32_" is not a valid preprocessing token, and we don't + want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will + cause the inner CONCAT2 macros to be evaluated first, producing + still-valid pp-tokens. Then the final concatenation can be done. */ +#undef CONCAT4 +#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) +#endif +#endif -/* These two lines get substitutions done by commands in Makefile.in. */ -#define BFD_VERSION "@VERSION@" +#define BFD_VERSION @bfd_version@ +#define BFD_VERSION_DATE @bfd_version_date@ +#define BFD_VERSION_STRING @bfd_version_string@ + +/* The word size used by BFD on the host. This may be 64 with a 32 + bit target if the host is 64 bit, or if other 64 bit targets have + been selected with --enable-targets, or if --enable-64-bit-bfd. */ #define BFD_ARCH_SIZE @wordsize@ + +/* The word size of the default bfd target. */ +#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ + #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ @@ -106,16 +110,6 @@ typedef enum bfd_boolean {false, true} boolean; typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; #endif -/* A pointer to a position in a file. */ -/* FIXME: This should be using off_t from . - For now, try to avoid breaking stuff by not including here. - This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t - in this header file, and to handle this in the BFD implementation - rather than in its interface. */ -/* typedef off_t file_ptr; */ -typedef long int file_ptr; - /* Support for different sizes of target format ints and addresses. If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be set to 1 above. Otherwise, if gcc is being used, this code will @@ -183,7 +177,22 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ +/* A pointer to a position in a file. */ +/* FIXME: This should be using off_t from . + For now, try to avoid breaking stuff by not including here. + This will break on systems with 64-bit file offsets (e.g. 4.4BSD). + Probably the best long-term answer is to avoid using file_ptr AND off_t + in this header file, and to handle this in the BFD implementation + rather than in its interface. */ +/* typedef off_t file_ptr; */ +typedef bfd_signed_vma file_ptr; +typedef bfd_vma ufile_ptr; + +extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); + #define printf_vma(x) fprintf_vma(stdout,x) +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) typedef unsigned int flagword; /* 32 bits of flags */ typedef unsigned char bfd_byte; @@ -289,7 +298,10 @@ typedef struct carsym { Perhaps just a forward definition would do? */ struct orl { /* output ranlib */ char **name; /* symbol name */ - file_ptr pos; /* bfd* or file position */ + union { + file_ptr pos; + bfd *abfd; + } u; /* bfd* or file position */ int namidx; /* index into string table */ }; @@ -298,7 +310,7 @@ typedef struct lineno_cache_entry { unsigned int line_number; /* Linenumber from start of function*/ union { struct symbol_cache_entry *sym; /* Function name */ - unsigned long offset; /* Offset into section */ + bfd_vma offset; /* Offset into section */ } u; } alent; @@ -341,11 +353,11 @@ typedef struct _symbol_info { symvalue value; char type; - CONST char *name; /* Symbol name. */ + const char *name; /* Symbol name. */ unsigned char stab_type; /* Stab type. */ char stab_other; /* Stab other. */ short stab_desc; /* Stab desc. */ - CONST char *stab_name; /* String for stab type. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -438,47 +450,39 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, boolean (*) (struct bfd_hash_entry *, PTR), PTR info)); - -/* Semi-portable string concatenation in cpp. - The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. - The problem is, "32_" is not a valid preprocessing token, and we don't - want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the - inner CAT macros to be evaluated first, producing still-valid pp-tokens. - Then the final concatenation can be done. (Sigh.) */ -#ifndef CAT -#ifdef SABER -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#define CAT4(a,b,c,d) a##b##c##d -#else -#if defined(__STDC__) || defined(ALMOST_STDC) -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#define XCAT2(a,b) CAT(a,b) -#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d)) -#else -#define CAT(a,b) a/**/b -#define CAT3(a,b,c) a/**/b/**/c -#define CAT4(a,b,c,d) a/**/b/**/c/**/d -#endif -#endif -#endif #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table - + /* User program access to BFD facilities */ /* Direct I/O routines, for programs which know more about the object file than BFD does. Use higher level routines if possible. */ -extern bfd_size_type bfd_read - PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); -extern bfd_size_type bfd_write - PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); -extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction)); -extern long bfd_tell PARAMS ((bfd *abfd)); -extern int bfd_flush PARAMS ((bfd *abfd)); -extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); +extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *)); +extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *)); +extern int bfd_seek PARAMS ((bfd *, file_ptr, int)); +extern ufile_ptr bfd_tell PARAMS ((bfd *)); +extern int bfd_flush PARAMS ((bfd *)); +extern int bfd_stat PARAMS ((bfd *, struct stat *)); + +/* Deprecated old routines. */ +#if __GNUC__ +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#else +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#endif +extern void warn_deprecated + PARAMS ((const char *, const char *, int, const char *)); /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ @@ -514,6 +518,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) +extern boolean bfd_cache_close PARAMS ((bfd *abfd)); +/* NB: This declaration should match the autogenerated one in libbfd.h. */ + extern boolean bfd_record_phdr PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, boolean, boolean, unsigned int, struct sec **)); @@ -622,11 +629,11 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list 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 *, + PARAMS ((bfd *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, boolean, const char *, + PARAMS ((bfd *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); @@ -634,6 +641,10 @@ extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf32_discard_info + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf64_discard_info + PARAMS ((bfd *, struct bfd_link_info *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -708,10 +719,9 @@ extern boolean bfd_xcoff_link_record_set bfd_size_type)); extern boolean bfd_xcoff_import_symbol PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_vma, const char *, const char *, const char *)); + bfd_vma, const char *, const char *, const char *, unsigned int)); extern boolean bfd_xcoff_export_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - boolean)); + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); extern boolean bfd_xcoff_link_count_reloc PARAMS ((bfd *, struct bfd_link_info *, const char *)); extern boolean bfd_xcoff_record_link_assignment @@ -720,6 +730,8 @@ extern boolean bfd_xcoff_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, unsigned long, unsigned long, unsigned long, boolean, int, boolean, boolean, struct sec **)); +extern boolean bfd_xcoff_link_generate_rtinit + PARAMS ((bfd *, const char *, const char *)); /* Externally visible COFF routines. */ @@ -783,16 +795,16 @@ void bfd_init PARAMS ((void)); bfd * -bfd_openr PARAMS ((CONST char *filename, CONST char *target)); +bfd_openr PARAMS ((const char *filename, const char *target)); bfd * -bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd)); +bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd)); bfd * bfd_openstreamr PARAMS ((const char *, const char *, PTR)); bfd * -bfd_openw PARAMS ((CONST char *filename, CONST char *target)); +bfd_openw PARAMS ((const char *filename, const char *target)); boolean bfd_close PARAMS ((bfd *abfd)); @@ -801,7 +813,7 @@ boolean bfd_close_all_done PARAMS ((bfd *)); bfd * -bfd_create PARAMS ((CONST char *filename, bfd *templ)); +bfd_create PARAMS ((const char *filename, bfd *templ)); boolean bfd_make_writable PARAMS ((bfd *abfd)); @@ -817,9 +829,9 @@ bfd_make_readable PARAMS ((bfd *abfd)); #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr)) + (*(unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -849,14 +861,14 @@ bfd_make_readable PARAMS ((bfd *abfd)); BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? bfd_get_8 (abfd, ptr) \ + ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ : (abort (), (bfd_vma) - 1)) #define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ + ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ @@ -866,40 +878,88 @@ bfd_make_readable PARAMS ((bfd *abfd)); /* 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)) + 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)) + 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)) + 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)) + 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)) + 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)) + 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)) + +/* Refinements on the above, which should eventually go away. Save + cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ + +#define H_PUT_64(abfd, val, where) \ + bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_32(abfd, val, where) \ + bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_16(abfd, val, where) \ + bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_8 bfd_h_put_8 + +#define H_PUT_S64(abfd, val, where) \ + bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S32(abfd, val, where) \ + bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S16(abfd, val, where) \ + bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S8 bfd_h_put_signed_8 + +#define H_GET_64(abfd, where) \ + bfd_h_get_64 ((abfd), (bfd_byte *) (where)) + +#define H_GET_32(abfd, where) \ + bfd_h_get_32 ((abfd), (bfd_byte *) (where)) + +#define H_GET_16(abfd, where) \ + bfd_h_get_16 ((abfd), (bfd_byte *) (where)) + +#define H_GET_8 bfd_h_get_8 + +#define H_GET_S64(abfd, where) \ + bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S32(abfd, where) \ + bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S16(abfd, where) \ + bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S8 bfd_h_get_signed_8 + /* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker @@ -929,7 +989,7 @@ typedef struct sec int id; - /* Which section is it; 0..nth. */ + /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ int index; @@ -957,9 +1017,11 @@ typedef struct sec some relocation information too. */ #define SEC_RELOC 0x004 -#if 0 /* Obsolete ? */ -#define SEC_BALIGN 0x008 -#endif + /* ELF reserves 4 processor specific bits and 8 operating system + specific bits in sh_flags; at present we can get away with just + one in communicating between the assembler and BFD, but this + isn't a good long-term solution. */ +#define SEC_ARCH_BIT_0 0x008 /* A signal to the OS that the section contains read only data. */ #define SEC_READONLY 0x010 @@ -1042,9 +1104,10 @@ typedef struct sec 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 based on the sum of + the symbol and addend values specified by the associated relocation + entries. Entries without associated relocation entries will be + appended to the end of the section in an unspecified order. */ #define SEC_SORT_ENTRIES 0x80000 /* When linking, duplicate sections of the same name should be @@ -1102,6 +1165,18 @@ typedef struct sec references found to any symbol in the section. */ #define SEC_CLINK 0x10000000 + /* Attempt to merge identical entities in the section. + Entity size is given in the entsize field. */ +#define SEC_MERGE 0x20000000 + + /* If given with SEC_MERGE, entities to merge are zero terminated + strings where entsize specifies character size instead of fixed + size entries. */ +#define SEC_STRINGS 0x40000000 + + /* This section contains data about section groups. */ +#define SEC_GROUP 0x80000000 + /* End of section flags. */ /* Some internal packed boolean fields. */ @@ -1116,13 +1191,14 @@ typedef struct sec unsigned int linker_mark : 1; /* Another mark flag used by some of the linker backends. Set for - output sections that have a input section. */ + output sections that have an input section. */ unsigned int linker_has_input : 1; /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; - /* Used by the ELF code to mark sections which have been allocated to segments. */ + /* Used by the ELF code to mark sections which have been allocated + to segments. */ unsigned int segment_mark : 1; /* End of internal packed boolean fields. */ @@ -1218,14 +1294,14 @@ typedef struct sec unsigned int lineno_count; + /* Entity size for merging purposes. */ + + unsigned int entsize; + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ struct bfd_comdat_info *comdat; - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct sec *kept_section; - /* When a section is being output, this value changes as more linenumbers are written out. */ @@ -1280,6 +1356,12 @@ extern const asection bfd_ind_section; #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +#define bfd_is_const_section(SEC) \ + ( ((SEC) == bfd_abs_section_ptr) \ + || ((SEC) == bfd_und_section_ptr) \ + || ((SEC) == bfd_com_section_ptr) \ + || ((SEC) == bfd_ind_section_ptr)) + extern const struct symbol_cache_entry * const bfd_abs_symbol; extern const struct symbol_cache_entry * const bfd_com_symbol; extern const struct symbol_cache_entry * const bfd_und_symbol; @@ -1290,6 +1372,35 @@ extern const struct symbol_cache_entry * const bfd_ind_symbol; #define bfd_get_section_size_after_reloc(section) \ ((section)->reloc_done ? (section)->_cooked_size \ : (abort (), (bfd_size_type) 1)) + +/* Macros to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +#define bfd_section_list_remove(ABFD, PS) \ + do \ + { \ + asection **_ps = PS; \ + asection *_s = *_ps; \ + *_ps = _s->next; \ + if (_s->next == NULL) \ + (ABFD)->section_tail = _ps; \ + } \ + while (0) +#define bfd_section_list_insert(ABFD, PS, S) \ + do \ + { \ + asection **_ps = PS; \ + asection *_s = S; \ + _s->next = *_ps; \ + *_ps = _s; \ + if (_s->next == NULL) \ + (ABFD)->section_tail = &_s->next; \ + } \ + while (0) + +void +bfd_section_list_clear PARAMS ((bfd *)); + asection * bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); @@ -1321,18 +1432,18 @@ boolean bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val)); boolean -bfd_set_section_contents PARAMS ((bfd *abfd, - asection *section, - PTR data, - file_ptr offset, +bfd_set_section_contents PARAMS ((bfd *abfd, asection *section, + PTR data, file_ptr offset, bfd_size_type count)); boolean -bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location, - file_ptr offset, bfd_size_type count)); +bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, + PTR location, file_ptr offset, + bfd_size_type count)); boolean -bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec)); +bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, + bfd *obfd, asection *osec)); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ BFD_SEND (obfd, _bfd_copy_private_section_data, \ @@ -1410,11 +1521,10 @@ enum bfd_architecture #define bfd_mach_mips10000 10000 #define bfd_mach_mips12000 12000 #define bfd_mach_mips16 16 -#define bfd_mach_mips32 32 -#define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */ #define bfd_mach_mips5 5 -#define bfd_mach_mips64 64 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mipsisa32 32 +#define bfd_mach_mipsisa64 64 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_i386 0 #define bfd_mach_i386_i8086 1 @@ -1434,6 +1544,7 @@ enum bfd_architecture #define bfd_mach_h8300 1 #define bfd_mach_h8300h 2 #define bfd_mach_h8300s 3 + bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ #define bfd_mach_ppc 0 #define bfd_mach_ppc_403 403 @@ -1527,6 +1638,13 @@ enum bfd_architecture #define bfd_mach_avr4 4 #define bfd_mach_avr5 5 bfd_arch_cris, /* Axis CRIS */ + bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_s390_esa 0 +#define bfd_mach_s390_esame 1 + bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_mmix, /* Donald Knuth's educational processor */ + bfd_arch_xstormy16, +#define bfd_mach_xstormy16 0 bfd_arch_last }; @@ -1599,31 +1717,31 @@ bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, typedef enum bfd_reloc_status { - /* No errors detected */ + /* No errors detected */ bfd_reloc_ok, - /* The relocation was performed, but there was an overflow. */ + /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, - /* The address to relocate was not within the section supplied. */ + /* The address to relocate was not within the section supplied. */ bfd_reloc_outofrange, - /* Used by special functions */ + /* Used by special functions */ bfd_reloc_continue, - /* Unsupported relocation size requested. */ + /* Unsupported relocation size requested. */ bfd_reloc_notsupported, - /* Unused */ + /* Unused */ bfd_reloc_other, - /* The symbol to relocate against was undefined. */ + /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok - presently + generated only when linking i960 coff files with i960 b.out + symbols. If this type is returned, the error_message argument + to bfd_perform_relocation will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; @@ -1631,155 +1749,156 @@ typedef enum bfd_reloc_status typedef struct reloc_cache_entry { - /* A pointer into the canonical table of pointers */ + /* A pointer into the canonical table of pointers */ struct symbol_cache_entry **sym_ptr_ptr; - /* offset in section */ + /* offset in section */ bfd_size_type address; - /* addend for relocation value */ + /* addend for relocation value */ bfd_vma addend; - /* Pointer to how to perform the required relocation */ + /* Pointer to how to perform the required relocation */ reloc_howto_type *howto; } 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 }; struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's + external idea of what a reloc number is stored + in this field. For example, a PC relative word relocation + in a coff environment has the type 023 - because that's + what the outside world calls a R_PCRWORD reloc. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ + /* The value the final relocation is shifted right by. This drops + 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. */ + /* The number of bits in the item to be relocated. This is used + when doing overflow checking. */ unsigned int bitsize; - /* Notes that the relocation is relative to the location in the - data section of the addend. The relocation function will - subtract from the relocation value the address of the location - being relocated. */ + /* Notes that the relocation is relative to the location in the + data section of the addend. The relocation function will + subtract from the relocation value the address of the location + 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 - called rather than the normal function. This allows really - strange relocation methods to be accomodated (e.g., i960 callj - instructions). */ + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accomodated (e.g., i960 callj + instructions). */ bfd_reloc_status_type (*special_function) - PARAMS ((bfd *abfd, - arelent *reloc_entry, - struct symbol_cache_entry *symbol, - PTR data, - asection *input_section, - bfd *output_bfd, - char **error_message)); - - /* The textual name of the relocation type. */ + PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, + bfd *, char **)); + + /* The textual name of the relocation type. */ char *name; - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ + /* Some formats record a relocation addend in the section contents + rather than with the relocation. For ELF formats this is the + distinction between USE_REL and USE_RELA (though the code checks + for USE_REL == 1/0). The value of this field is TRUE if the + addend is recorded with the section contents; when performing a + partial link (ld -r) the section contents (the data) will be + modified. The value of this field is FALSE if addends are + recorded with the relocation (in arelent.addend); when performing + a partial link the relocation will be modified. + All relocations for all ELF USE_RELA targets should set this field + to FALSE (values of TRUE should be looked on with suspicion). + However, the converse is not true: not all relocations of all ELF + USE_REL targets set this field to TRUE. Why this is so is peculiar + to each particular target. For relocs that aren't used in partial + links (e.g. GOT stuff) it doesn't matter what this is set to. */ boolean partial_inplace; - /* The src_mask selects which parts of the read in data - are to be used in the relocation sum. E.g., if this was an 8 bit - byte of data which we read and relocated, this would be - 0x000000ff. When we have relocs which have an addend, such as - sun4 extended relocs, the value in the offset part of a - relocating field is garbage so we never use it. In this case - the mask would be 0x00000000. */ + /* The src_mask selects which parts of the read in data + are to be used in the relocation sum. E.g., if this was an 8 bit + byte of data which we read and relocated, this would be + 0x000000ff. When we have relocs which have an addend, such as + sun4 extended relocs, the value in the offset part of a + relocating field is garbage so we never use it. In this case + the mask would be 0x00000000. */ bfd_vma src_mask; - /* The dst_mask selects which parts of the instruction are replaced - into the instruction. In most cases src_mask == dst_mask, - except in the above special case, where dst_mask would be - 0x000000ff, and src_mask would be 0x00000000. */ + /* The dst_mask selects which parts of the instruction are replaced + into the instruction. In most cases src_mask == dst_mask, + except in the above special case, where dst_mask would be + 0x000000ff, and src_mask would be 0x00000000. */ bfd_vma dst_mask; - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact.*/ + /* When some formats create PC relative instructions, they leave + the value of the pc of the place being relocated in the offset + slot of the instruction, so that a PC relative relocation can + be made just by adding in an ordinary offset (e.g., sun3 a.out). + Some formats leave the displacement part of an instruction + empty (e.g., m88k bcs); this flag signals the fact. */ boolean pcrel_offset; - }; -#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} -#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) +#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 } +#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ + HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ + NAME, false, 0, 0, IN) #define EMPTY_HOWTO(C) \ - HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) - -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != (asymbol *)NULL) { \ - if (bfd_is_com_section (symbol->section)) { \ - relocation = 0; \ - } \ - else { \ - relocation = symbol->value; \ - } \ - } \ -} + HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \ + NULL, false, 0, 0, false) + +#define HOWTO_PREPARE(relocation, symbol) \ + { \ + if (symbol != (asymbol *) NULL) \ + { \ + if (bfd_is_com_section (symbol->section)) \ + { \ + relocation = 0; \ + } \ + else \ + { \ + relocation = symbol->value; \ + } \ + } \ + } unsigned int bfd_get_reloc_size PARAMS ((reloc_howto_type *)); -typedef struct relent_chain { +typedef struct relent_chain +{ arelent relent; - struct relent_chain *next; + struct relent_chain *next; } arelent_chain; bfd_reloc_status_type bfd_check_overflow PARAMS ((enum complain_overflow how, @@ -1838,10 +1957,12 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_GOTOFF, BFD_RELOC_HI16_S_GOTOFF, BFD_RELOC_8_GOTOFF, + BFD_RELOC_64_PLT_PCREL, BFD_RELOC_32_PLT_PCREL, BFD_RELOC_24_PLT_PCREL, BFD_RELOC_16_PLT_PCREL, BFD_RELOC_8_PLT_PCREL, + BFD_RELOC_64_PLTOFF, BFD_RELOC_32_PLTOFF, BFD_RELOC_16_PLTOFF, BFD_RELOC_LO16_PLTOFF, @@ -1932,6 +2053,7 @@ relocation types already defined. */ BFD_RELOC_SPARC_6, BFD_RELOC_SPARC_5, #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL + BFD_RELOC_SPARC_PLT32, BFD_RELOC_SPARC_PLT64, BFD_RELOC_SPARC_HIX22, BFD_RELOC_SPARC_LOX10, @@ -1984,24 +2106,11 @@ as the absolute section symbol), and the "addend" indicates the type of instruction using the register: 1 - "memory" fmt insn 2 - byte-manipulation (byte offset reg) -3 - jsr (target of branch) - -The GNU linker currently doesn't do any of this optimizing. */ +3 - jsr (target of branch) */ BFD_RELOC_ALPHA_LITERAL, BFD_RELOC_ALPHA_ELF_LITERAL, BFD_RELOC_ALPHA_LITUSE, -/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to -process the explicit !!sequence relocations, and are mapped -into the normal relocations at the end of processing. */ - BFD_RELOC_ALPHA_USER_LITERAL, - BFD_RELOC_ALPHA_USER_LITUSE_BASE, - BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, - BFD_RELOC_ALPHA_USER_LITUSE_JSR, - BFD_RELOC_ALPHA_USER_GPDISP, - BFD_RELOC_ALPHA_USER_GPRELHIGH, - BFD_RELOC_ALPHA_USER_GPRELLOW, - /* The HINT relocation indicates a value that should be filled into the "hint" field of a jmp/jsr/ret instruction, for possible branch- prediction logic which may be provided on some processors. */ @@ -2015,6 +2124,11 @@ which is filled by the linker. */ which is filled by the linker. */ BFD_RELOC_ALPHA_CODEADDR, +/* The GPREL_HI/LO relocations together form a 32-bit offset from the +GP register. */ + BFD_RELOC_ALPHA_GPREL_HI16, + BFD_RELOC_ALPHA_GPREL_LO16, + /* Bits 27..2 of the relocation address shifted right 2 bits; simple reloc otherwise. */ BFD_RELOC_MIPS_JMP, @@ -2043,16 +2157,12 @@ to compensate for the borrow when the low bits are added. */ /* Like BFD_RELOC_LO16, but PC relative. */ BFD_RELOC_PCREL_LO16, -/* Relocation relative to the global pointer. */ -#define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16 - /* Relocation against a MIPS literal section. */ BFD_RELOC_MIPS_LITERAL, /* MIPS ELF relocations. */ BFD_RELOC_MIPS_GOT16, BFD_RELOC_MIPS_CALL16, -#define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32 BFD_RELOC_MIPS_GOT_HI16, BFD_RELOC_MIPS_GOT_LO16, BFD_RELOC_MIPS_CALL_HI16, @@ -2108,6 +2218,10 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_NS32K_DISP_16_PCREL, BFD_RELOC_NS32K_DISP_32_PCREL, +/* PDP11 relocations */ + BFD_RELOC_PDP11_DISP_8_PCREL, + BFD_RELOC_PDP11_DISP_6_PCREL, + /* Picojava relocs. Not all of these appear in object files. */ BFD_RELOC_PJ_CODE_HI16, BFD_RELOC_PJ_CODE_LO16, @@ -2147,6 +2261,29 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_PPC_EMB_RELST_HA, BFD_RELOC_PPC_EMB_BIT_FLD, BFD_RELOC_PPC_EMB_RELSDA, + BFD_RELOC_PPC64_HIGHER, + BFD_RELOC_PPC64_HIGHER_S, + BFD_RELOC_PPC64_HIGHEST, + BFD_RELOC_PPC64_HIGHEST_S, + BFD_RELOC_PPC64_TOC16_LO, + BFD_RELOC_PPC64_TOC16_HI, + BFD_RELOC_PPC64_TOC16_HA, + BFD_RELOC_PPC64_TOC, + BFD_RELOC_PPC64_PLTGOT16, + BFD_RELOC_PPC64_PLTGOT16_LO, + BFD_RELOC_PPC64_PLTGOT16_HI, + BFD_RELOC_PPC64_PLTGOT16_HA, + BFD_RELOC_PPC64_ADDR16_DS, + BFD_RELOC_PPC64_ADDR16_LO_DS, + BFD_RELOC_PPC64_GOT16_DS, + BFD_RELOC_PPC64_GOT16_LO_DS, + BFD_RELOC_PPC64_PLT16_LO_DS, + BFD_RELOC_PPC64_SECTOFF_DS, + BFD_RELOC_PPC64_SECTOFF_LO_DS, + BFD_RELOC_PPC64_TOC16_DS, + BFD_RELOC_PPC64_TOC16_LO_DS, + BFD_RELOC_PPC64_PLTGOT16_DS, + BFD_RELOC_PPC64_PLTGOT16_LO_DS, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -2470,6 +2607,54 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, +/* These are relocations for the GETA instruction. */ + BFD_RELOC_MMIX_GETA, + BFD_RELOC_MMIX_GETA_1, + BFD_RELOC_MMIX_GETA_2, + BFD_RELOC_MMIX_GETA_3, + +/* These are relocations for a conditional branch instruction. */ + BFD_RELOC_MMIX_CBRANCH, + BFD_RELOC_MMIX_CBRANCH_J, + BFD_RELOC_MMIX_CBRANCH_1, + BFD_RELOC_MMIX_CBRANCH_2, + BFD_RELOC_MMIX_CBRANCH_3, + +/* These are relocations for the PUSHJ instruction. */ + BFD_RELOC_MMIX_PUSHJ, + BFD_RELOC_MMIX_PUSHJ_1, + BFD_RELOC_MMIX_PUSHJ_2, + BFD_RELOC_MMIX_PUSHJ_3, + +/* These are relocations for the JMP instruction. */ + BFD_RELOC_MMIX_JMP, + BFD_RELOC_MMIX_JMP_1, + BFD_RELOC_MMIX_JMP_2, + BFD_RELOC_MMIX_JMP_3, + +/* This is a relocation for a relative address as in a GETA instruction or +a branch. */ + BFD_RELOC_MMIX_ADDR19, + +/* This is a relocation for a relative address as in a JMP instruction. */ + BFD_RELOC_MMIX_ADDR27, + +/* This is a relocation for an instruction field that may be a general +register or a value 0..255. */ + BFD_RELOC_MMIX_REG_OR_BYTE, + +/* This is a relocation for an instruction field that may be a general +register. */ + BFD_RELOC_MMIX_REG, + +/* This is a relocation for two instruction fields holding a register and +an offset, the equivalent of the relocation. */ + BFD_RELOC_MMIX_BASE_PLUS_OFFSET, + +/* This relocation is an assertion that the expression is not allocated as +a global register. It does not modify contents. */ + BFD_RELOC_MMIX_LOCAL, + /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative short offset into 7 bits. */ BFD_RELOC_AVR_7_PCREL, @@ -2538,6 +2723,57 @@ value of SUBI insn. */ into 22 bits. */ BFD_RELOC_AVR_CALL, +/* Direct 12 bit. */ + BFD_RELOC_390_12, + +/* 12 bit GOT offset. */ + BFD_RELOC_390_GOT12, + +/* 32 bit PC relative PLT address. */ + BFD_RELOC_390_PLT32, + +/* Copy symbol at runtime. */ + BFD_RELOC_390_COPY, + +/* Create GOT entry. */ + BFD_RELOC_390_GLOB_DAT, + +/* Create PLT entry. */ + BFD_RELOC_390_JMP_SLOT, + +/* Adjust by program base. */ + BFD_RELOC_390_RELATIVE, + +/* 32 bit PC relative offset to GOT. */ + BFD_RELOC_390_GOTPC, + +/* 16 bit GOT offset. */ + BFD_RELOC_390_GOT16, + +/* PC relative 16 bit shifted by 1. */ + BFD_RELOC_390_PC16DBL, + +/* 16 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT16DBL, + +/* PC relative 32 bit shifted by 1. */ + BFD_RELOC_390_PC32DBL, + +/* 32 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT32DBL, + +/* 32 bit PC rel. GOT shifted by 1. */ + BFD_RELOC_390_GOTPCDBL, + +/* 64 bit GOT offset. */ + BFD_RELOC_390_GOT64, + +/* 64 bit PC relative PLT address. */ + BFD_RELOC_390_PLT64, + +/* 32 bit rel. offset to GOT entry. */ + BFD_RELOC_390_GOTENT, + /* These two relocations are used by the linker to determine which of the entries in a C++ virtual function table are actually used. When the --gc-sections option is given, the linker will zero out the entries @@ -2596,6 +2832,8 @@ this offset in the reloc's section offset. */ BFD_RELOC_IA64_PCREL64LSB, BFD_RELOC_IA64_LTOFF_FPTR22, BFD_RELOC_IA64_LTOFF_FPTR64I, + BFD_RELOC_IA64_LTOFF_FPTR32MSB, + BFD_RELOC_IA64_LTOFF_FPTR32LSB, BFD_RELOC_IA64_LTOFF_FPTR64MSB, BFD_RELOC_IA64_LTOFF_FPTR64LSB, BFD_RELOC_IA64_SEGREL32MSB, @@ -2644,6 +2882,33 @@ This is the 3 bits of a value. */ BFD_RELOC_CRIS_UNSIGNED_6, BFD_RELOC_CRIS_UNSIGNED_4, +/* Relocs used in ELF shared libraries for CRIS. */ + BFD_RELOC_CRIS_COPY, + BFD_RELOC_CRIS_GLOB_DAT, + BFD_RELOC_CRIS_JUMP_SLOT, + BFD_RELOC_CRIS_RELATIVE, + +/* 32-bit offset to symbol-entry within GOT. */ + BFD_RELOC_CRIS_32_GOT, + +/* 16-bit offset to symbol-entry within GOT. */ + BFD_RELOC_CRIS_16_GOT, + +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_CRIS_32_GOTPLT, + +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_CRIS_16_GOTPLT, + +/* 32-bit offset to symbol, relative to GOT. */ + BFD_RELOC_CRIS_32_GOTREL, + +/* 32-bit offset to symbol with PLT entry, relative to GOT. */ + BFD_RELOC_CRIS_32_PLT_GOTREL, + +/* 32-bit offset to symbol with PLT entry, relative to this relocation. */ + BFD_RELOC_CRIS_32_PLT_PCREL, + /* Intel i860 Relocations. */ BFD_RELOC_860_COPY, BFD_RELOC_860_GLOB_DAT, @@ -2677,6 +2942,22 @@ This is the 3 bits of a value. */ BFD_RELOC_860_HIGH, BFD_RELOC_860_HIGOT, BFD_RELOC_860_HIGOTOFF, + +/* OpenRISC Relocations. */ + BFD_RELOC_OPENRISC_ABS_26, + BFD_RELOC_OPENRISC_REL_26, + +/* H8 elf Relocations. */ + BFD_RELOC_H8_DIR16A8, + BFD_RELOC_H8_DIR16R8, + BFD_RELOC_H8_DIR24A8, + BFD_RELOC_H8_DIR24R8, + BFD_RELOC_H8_DIR32A16, + +/* Sony Xstormy16 Relocations. */ + BFD_RELOC_XSTORMY16_REL_12, + BFD_RELOC_XSTORMY16_24, + BFD_RELOC_XSTORMY16_FPTR16, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * @@ -2702,7 +2983,7 @@ typedef struct symbol_cache_entry /* The text of the symbol. The name is left alone, and not copied; the application may not alter it. */ - CONST char *name; + const char *name; /* The value of the symbol. This really should be a union of a numeric value with a pointer, since some flags indicate that @@ -2825,10 +3106,13 @@ boolean bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); void -bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol)); +bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol)); #define bfd_make_empty_symbol(abfd) \ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) +asymbol * +_bfd_generic_make_empty_symbol PARAMS ((bfd *)); + #define bfd_make_debug_symbol(abfd,ptr,size) \ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int @@ -2849,7 +3133,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb struct _bfd { /* The filename the application opened the BFD with. */ - CONST char *filename; + const char *filename; /* A pointer to the target jump table. */ const struct bfd_target *xvec; @@ -2882,7 +3166,7 @@ struct _bfd /* When a file is closed by the caching routines, BFD retains state information on the file here: */ - file_ptr where; + ufile_ptr where; /* and here: (``once'' means at least once) */ @@ -2920,14 +3204,20 @@ struct _bfd anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ - file_ptr origin; + ufile_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; + /* A hash table for section names. */ + struct bfd_hash_table section_htab; + + /* Pointer to linked list of sections. */ + struct sec *sections; + + /* The place where we add to the section list. */ + struct sec **section_tail; /* The number of sections */ unsigned int section_count; @@ -2979,6 +3269,7 @@ struct _bfd struct elf_obj_tdata *elf_obj_data; struct nlm_obj_tdata *nlm_obj_data; struct bout_data_struct *bout_data; + struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; struct trad_core_struct *trad_core_data; @@ -3009,6 +3300,7 @@ typedef enum bfd_error bfd_error_system_call, bfd_error_invalid_target, bfd_error_wrong_format, + bfd_error_wrong_object_format, bfd_error_invalid_operation, bfd_error_no_memory, bfd_error_no_symbols, @@ -3032,11 +3324,11 @@ bfd_get_error PARAMS ((void)); void bfd_set_error PARAMS ((bfd_error_type error_tag)); -CONST char * +const char * bfd_errmsg PARAMS ((bfd_error_type error_tag)); void -bfd_perror PARAMS ((CONST char *message)); +bfd_perror PARAMS ((const char *message)); typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); @@ -3049,6 +3341,9 @@ bfd_set_error_program_name PARAMS ((const char *)); bfd_error_handler_type bfd_get_error_handler PARAMS ((void)); +const char * +bfd_archive_filename PARAMS ((bfd *)); + long bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect)); @@ -3081,14 +3376,14 @@ bfd_get_mtime PARAMS ((bfd *abfd)); long bfd_get_size PARAMS ((bfd *abfd)); -int +unsigned int bfd_get_gp_size PARAMS ((bfd *abfd)); void -bfd_set_gp_size PARAMS ((bfd *abfd, int i)); +bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); bfd_vma -bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base)); +bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); boolean bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); @@ -3140,6 +3435,9 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_gc_sections(abfd, link_info) \ BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) +#define bfd_merge_sections(abfd, link_info) \ + BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) + #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) @@ -3172,6 +3470,9 @@ extern bfd_byte *bfd_get_relocated_section_contents struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); +boolean +bfd_alt_mach_code PARAMS ((bfd *abfd, int index)); + symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); @@ -3181,7 +3482,7 @@ bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); bfd * bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); -CONST char * +const char * bfd_core_file_failing_command PARAMS ((bfd *abfd)); int @@ -3228,7 +3529,8 @@ enum bfd_flavour { bfd_target_versados_flavour, bfd_target_msdos_flavour, bfd_target_ovax_flavour, - bfd_target_evax_flavour + bfd_target_evax_flavour, + bfd_target_mmo_flavour }; enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -3247,237 +3549,232 @@ typedef struct bfd_target char symbol_leading_char; char ar_pad_char; unsigned short ar_max_namelen; - bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); + bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); + void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); + bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); + void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); + bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); + void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); + bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); + void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); + bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); + void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); + bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); + void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); - boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); - boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); + boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); + boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); /* Generic entry points. */ -#define BFD_JUMP_TABLE_GENERIC(NAME)\ -CAT(NAME,_close_and_cleanup),\ -CAT(NAME,_bfd_free_cached_info),\ -CAT(NAME,_new_section_hook),\ -CAT(NAME,_get_section_contents),\ -CAT(NAME,_get_section_contents_in_window) +#define BFD_JUMP_TABLE_GENERIC(NAME) \ +CONCAT2 (NAME,_close_and_cleanup), \ +CONCAT2 (NAME,_bfd_free_cached_info), \ +CONCAT2 (NAME,_new_section_hook), \ +CONCAT2 (NAME,_get_section_contents), \ +CONCAT2 (NAME,_get_section_contents_in_window) /* Called when the BFD is being closed to do any necessary cleanup. */ - boolean (*_close_and_cleanup) PARAMS ((bfd *)); + boolean (*_close_and_cleanup) PARAMS ((bfd *)); /* Ask the BFD to free all cached information. */ - boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); + boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); /* Called when a new section is created. */ - boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); + boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_bfd_get_section_contents_in_window) - PARAMS ((bfd *, sec_ptr, bfd_window *, - file_ptr, bfd_size_type)); + boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + file_ptr, bfd_size_type)); + boolean (*_bfd_get_section_contents_in_window) + PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); /* Entry points to copy private data. */ -#define BFD_JUMP_TABLE_COPY(NAME)\ -CAT(NAME,_bfd_copy_private_bfd_data),\ -CAT(NAME,_bfd_merge_private_bfd_data),\ -CAT(NAME,_bfd_copy_private_section_data),\ -CAT(NAME,_bfd_copy_private_symbol_data),\ -CAT(NAME,_bfd_set_private_flags),\ -CAT(NAME,_bfd_print_private_bfd_data)\ +#define BFD_JUMP_TABLE_COPY(NAME) \ +CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ +CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ +CONCAT2 (NAME,_bfd_copy_private_section_data), \ +CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ +CONCAT2 (NAME,_bfd_set_private_flags), \ +CONCAT2 (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, - bfd *, sec_ptr)); + boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, + bfd *, sec_ptr)); /* Called to copy BFD private symbol data from one symbol to another. */ - boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, - bfd *, asymbol *)); + boolean (*_bfd_copy_private_symbol_data) PARAMS ((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)); + boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); /* Core file entry points. */ -#define BFD_JUMP_TABLE_CORE(NAME)\ -CAT(NAME,_core_file_failing_command),\ -CAT(NAME,_core_file_failing_signal),\ -CAT(NAME,_core_file_matches_executable_p) +#define BFD_JUMP_TABLE_CORE(NAME) \ +CONCAT2 (NAME,_core_file_failing_command), \ +CONCAT2 (NAME,_core_file_failing_signal), \ +CONCAT2 (NAME,_core_file_matches_executable_p) char * (*_core_file_failing_command) PARAMS ((bfd *)); int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); /* Archive entry points. */ -#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ -CAT(NAME,_slurp_armap),\ -CAT(NAME,_slurp_extended_name_table),\ -CAT(NAME,_construct_extended_name_table),\ -CAT(NAME,_truncate_arname),\ -CAT(NAME,_write_armap),\ -CAT(NAME,_read_ar_hdr),\ -CAT(NAME,_openr_next_archived_file),\ -CAT(NAME,_get_elt_at_index),\ -CAT(NAME,_generic_stat_arch_elt),\ -CAT(NAME,_update_armap_timestamp) +#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ +CONCAT2 (NAME,_slurp_armap), \ +CONCAT2 (NAME,_slurp_extended_name_table), \ +CONCAT2 (NAME,_construct_extended_name_table), \ +CONCAT2 (NAME,_truncate_arname), \ +CONCAT2 (NAME,_write_armap), \ +CONCAT2 (NAME,_read_ar_hdr), \ +CONCAT2 (NAME,_openr_next_archived_file), \ +CONCAT2 (NAME,_get_elt_at_index), \ +CONCAT2 (NAME,_generic_stat_arch_elt), \ +CONCAT2 (NAME,_update_armap_timestamp) boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); boolean (*_bfd_construct_extended_name_table) - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); - void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); - boolean (*write_armap) PARAMS ((bfd *arch, - unsigned int elength, - struct orl *map, - unsigned int orl_count, - int stridx)); - PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); + PARAMS ((bfd *, char **, bfd_size_type *, const char **)); + void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); + boolean (*write_armap) + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); + PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); + bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); /* Entry points used for symbols. */ -#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ -CAT(NAME,_get_symtab_upper_bound),\ -CAT(NAME,_get_symtab),\ -CAT(NAME,_make_empty_symbol),\ -CAT(NAME,_print_symbol),\ -CAT(NAME,_get_symbol_info),\ -CAT(NAME,_bfd_is_local_label_name),\ -CAT(NAME,_get_lineno),\ -CAT(NAME,_find_nearest_line),\ -CAT(NAME,_bfd_make_debug_symbol),\ -CAT(NAME,_read_minisymbols),\ -CAT(NAME,_minisymbol_to_symbol) - long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); - long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, - struct symbol_cache_entry **)); - struct symbol_cache_entry * - (*_bfd_make_empty_symbol) PARAMS ((bfd *)); - void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, - struct symbol_cache_entry *, - bfd_print_symbol_type)); +#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ +CONCAT2 (NAME,_get_symtab_upper_bound), \ +CONCAT2 (NAME,_get_symtab), \ +CONCAT2 (NAME,_make_empty_symbol), \ +CONCAT2 (NAME,_print_symbol), \ +CONCAT2 (NAME,_get_symbol_info), \ +CONCAT2 (NAME,_bfd_is_local_label_name), \ +CONCAT2 (NAME,_get_lineno), \ +CONCAT2 (NAME,_find_nearest_line), \ +CONCAT2 (NAME,_bfd_make_debug_symbol), \ +CONCAT2 (NAME,_read_minisymbols), \ +CONCAT2 (NAME,_minisymbol_to_symbol) + long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); + long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, + struct symbol_cache_entry **)); + struct symbol_cache_entry * + (*_bfd_make_empty_symbol) PARAMS ((bfd *)); + void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, + struct symbol_cache_entry *, + bfd_print_symbol_type)); #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) PARAMS ((bfd *, - struct symbol_cache_entry *, - symbol_info *)); + void (*_bfd_get_symbol_info) PARAMS ((bfd *, + 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, - struct sec *section, struct symbol_cache_entry **symbols, - bfd_vma offset, CONST char **file, CONST char **func, - unsigned int *line)); + alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); + boolean (*_bfd_find_nearest_line) + PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, + const char **, const char **, unsigned int *)); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) PARAMS (( - bfd *abfd, - void *ptr, - unsigned long size)); + asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *, + unsigned long size)); #define bfd_read_minisymbols(b, d, m, s) \ BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, - unsigned int *)); + long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, + unsigned int *)); #define bfd_minisymbol_to_symbol(b, d, m, f) \ BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *)); /* Routines for relocs. */ -#define BFD_JUMP_TABLE_RELOCS(NAME)\ -CAT(NAME,_get_reloc_upper_bound),\ -CAT(NAME,_canonicalize_reloc),\ -CAT(NAME,_bfd_reloc_type_lookup) - long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); - long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, - struct symbol_cache_entry **)); +#define BFD_JUMP_TABLE_RELOCS(NAME) \ +CONCAT2 (NAME,_get_reloc_upper_bound), \ +CONCAT2 (NAME,_canonicalize_reloc), \ +CONCAT2 (NAME,_bfd_reloc_type_lookup) + long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); + long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, + struct symbol_cache_entry **)); /* See documentation on reloc types. */ reloc_howto_type * - (*reloc_type_lookup) PARAMS ((bfd *abfd, - bfd_reloc_code_real_type code)); + (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); /* Routines used when writing an object file. */ -#define BFD_JUMP_TABLE_WRITE(NAME)\ -CAT(NAME,_set_arch_mach),\ -CAT(NAME,_set_section_contents) - boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); - boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); +#define BFD_JUMP_TABLE_WRITE(NAME) \ +CONCAT2 (NAME,_set_arch_mach), \ +CONCAT2 (NAME,_set_section_contents) + boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, + unsigned long)); + boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + file_ptr, bfd_size_type)); /* Routines used by the linker. */ -#define BFD_JUMP_TABLE_LINK(NAME)\ -CAT(NAME,_sizeof_headers),\ -CAT(NAME,_bfd_get_relocated_section_contents),\ -CAT(NAME,_bfd_relax_section),\ -CAT(NAME,_bfd_link_hash_table_create),\ -CAT(NAME,_bfd_link_add_symbols),\ -CAT(NAME,_bfd_final_link),\ -CAT(NAME,_bfd_link_split_section),\ -CAT(NAME,_bfd_gc_sections) - int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); - bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, - struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *data, boolean relocateable, - struct symbol_cache_entry **)); - - boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, - struct bfd_link_info *, boolean *again)); +#define BFD_JUMP_TABLE_LINK(NAME) \ +CONCAT2 (NAME,_sizeof_headers), \ +CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ +CONCAT2 (NAME,_bfd_relax_section), \ +CONCAT2 (NAME,_bfd_link_hash_table_create), \ +CONCAT2 (NAME,_bfd_link_add_symbols), \ +CONCAT2 (NAME,_bfd_final_link), \ +CONCAT2 (NAME,_bfd_link_split_section), \ +CONCAT2 (NAME,_bfd_gc_sections), \ +CONCAT2 (NAME,_bfd_merge_sections) + int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); + bfd_byte *(*_bfd_get_relocated_section_contents) + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean, struct symbol_cache_entry **)); + + boolean (*_bfd_relax_section) + PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *)); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); /* Add symbols from this object file into the hash table. */ - boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); + boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); /* Do a link based on the link_order structures attached to each section of the BFD. */ - boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); + boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); /* Should this section be split up into smaller pieces during linking. */ - boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); + boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); /* Remove sections that are not referenced from the output. */ - boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); + boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); + + /* Attempt to merge SEC_MERGE sections. */ + boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); /* Routines to handle dynamic symbols and relocs. */ -#define BFD_JUMP_TABLE_DYNAMIC(NAME)\ -CAT(NAME,_get_dynamic_symtab_upper_bound),\ -CAT(NAME,_canonicalize_dynamic_symtab),\ -CAT(NAME,_get_dynamic_reloc_upper_bound),\ -CAT(NAME,_canonicalize_dynamic_reloc) +#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ +CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ +CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ +CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ +CONCAT2 (NAME,_canonicalize_dynamic_reloc) /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) + long (*_bfd_canonicalize_dynamic_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) + long (*_bfd_canonicalize_dynamic_reloc) PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); /* Opposite endian version of this target. */ @@ -3490,7 +3787,7 @@ boolean bfd_set_default_target PARAMS ((const char *name)); const bfd_target * -bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd)); +bfd_find_target PARAMS ((const char *target_name, bfd *abfd)); const char ** bfd_target_list PARAMS ((void)); @@ -3507,7 +3804,7 @@ bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching boolean bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); -CONST char * +const char * bfd_format_string PARAMS ((bfd_format format)); #ifdef __cplusplus diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c index 3afcd3d..122f523 100644 --- a/contrib/binutils/bfd/bfd.c +++ b/contrib/binutils/bfd/bfd.c @@ -37,7 +37,7 @@ CODE_FRAGMENT .struct _bfd .{ . {* The filename the application opened the BFD with. *} -. CONST char *filename; +. const char *filename; . . {* A pointer to the target jump table. *} . const struct bfd_target *xvec; @@ -70,7 +70,7 @@ CODE_FRAGMENT . {* When a file is closed by the caching routines, BFD retains . state information on the file here: *} . -. file_ptr where; +. ufile_ptr where; . . {* and here: (``once'' means at least once) *} . @@ -108,14 +108,20 @@ CODE_FRAGMENT . anything. I believe that this can become always an add of . origin, with origin set to 0 for non archive files. *} . -. file_ptr origin; +. ufile_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; +. {* A hash table for section names. *} +. struct bfd_hash_table section_htab; +. +. {* Pointer to linked list of sections. *} +. struct sec *sections; +. +. {* The place where we add to the section list. *} +. struct sec **section_tail; . . {* The number of sections *} . unsigned int section_count; @@ -167,6 +173,7 @@ CODE_FRAGMENT . struct elf_obj_tdata *elf_obj_data; . struct nlm_obj_tdata *nlm_obj_data; . struct bout_data_struct *bout_data; +. struct mmo_data_struct *mmo_data; . struct sun_core_struct *sun_core_data; . struct sco5_core_struct *sco5_core_data; . struct trad_core_struct *trad_core_data; @@ -203,6 +210,7 @@ CODE_FRAGMENT #endif #include "libiberty.h" +#include "safe-ctype.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -211,8 +219,6 @@ CODE_FRAGMENT #include "libecoff.h" #undef obj_symbols #include "elf-bfd.h" - -#include /* provide storage for subsystem, stack and heap data which may have been passed in on the command line. Ld puts this data into a bfd_link_info @@ -248,6 +254,7 @@ CODE_FRAGMENT . bfd_error_system_call, . bfd_error_invalid_target, . bfd_error_wrong_format, +. bfd_error_wrong_object_format, . bfd_error_invalid_operation, . bfd_error_no_memory, . bfd_error_no_symbols, @@ -269,27 +276,29 @@ CODE_FRAGMENT static bfd_error_type bfd_error = bfd_error_no_error; -CONST char *CONST bfd_errmsgs[] = { - N_("No error"), - N_("System call error"), - N_("Invalid bfd target"), - N_("File in wrong format"), - N_("Invalid operation"), - N_("Memory exhausted"), - N_("No symbols"), - N_("Archive has no index; run ranlib to add one"), - N_("No more archived files"), - N_("Malformed archive"), - N_("File format not recognized"), - N_("File format is ambiguous"), - N_("Section has no contents"), - N_("Nonrepresentable section on output"), - N_("Symbol needs debug section which does not exist"), - N_("Bad value"), - N_("File truncated"), - N_("File too big"), - N_("#") - }; +const char *const bfd_errmsgs[] = +{ + N_("No error"), + N_("System call error"), + N_("Invalid bfd target"), + N_("File in wrong format"), + N_("Archive object file in wrong format"), + N_("Invalid operation"), + N_("Memory exhausted"), + N_("No symbols"), + N_("Archive has no index; run ranlib to add one"), + N_("No more archived files"), + N_("Malformed archive"), + N_("File format not recognized"), + N_("File format is ambiguous"), + N_("Section has no contents"), + N_("Nonrepresentable section on output"), + N_("Symbol needs debug section which does not exist"), + N_("Bad value"), + N_("File truncated"), + N_("File too big"), + N_("#") +}; /* FUNCTION @@ -331,14 +340,14 @@ FUNCTION bfd_errmsg SYNOPSIS - CONST char *bfd_errmsg (bfd_error_type error_tag); + const char *bfd_errmsg (bfd_error_type error_tag); DESCRIPTION Return a string describing the error @var{error_tag}, or the system error if @var{error_tag} is <>. */ -CONST char * +const char * bfd_errmsg (error_tag) bfd_error_type error_tag; { @@ -348,8 +357,8 @@ bfd_errmsg (error_tag) if (error_tag == bfd_error_system_call) return xstrerror (errno); - if ((((int)error_tag <(int) bfd_error_no_error) || - ((int)error_tag > (int)bfd_error_invalid_error_code))) + if ((((int) error_tag < (int) bfd_error_no_error) || + ((int) error_tag > (int) bfd_error_invalid_error_code))) error_tag = bfd_error_invalid_error_code;/* sanity check */ return _(bfd_errmsgs [(int)error_tag]); @@ -360,7 +369,7 @@ FUNCTION bfd_perror SYNOPSIS - void bfd_perror (CONST char *message); + void bfd_perror (const char *message); DESCRIPTION Print to the standard error stream a string describing the @@ -372,16 +381,18 @@ DESCRIPTION void bfd_perror (message) - CONST char *message; + const char *message; { if (bfd_get_error () == bfd_error_system_call) - perror((char *)message); /* must be system error then... */ - else { - if (message == NULL || *message == '\0') - fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); - else - fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); - } + /* Must be a system error then. */ + perror ((char *)message); + else + { + if (message == NULL || *message == '\0') + fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); + else + fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); + } } /* @@ -406,57 +417,24 @@ static const char *_bfd_error_program_name; /* This is the default routine to handle BFD error messages. */ -#ifdef ANSI_PROTOTYPES - static void _bfd_default_error_handler PARAMS ((const char *s, ...)); static void -_bfd_default_error_handler (const char *s, ...) -{ - va_list p; - - if (_bfd_error_program_name != NULL) - fprintf (stderr, "%s: ", _bfd_error_program_name); - else - fprintf (stderr, "BFD: "); - - va_start (p, s); - - vfprintf (stderr, s, p); - - va_end (p); - - fprintf (stderr, "\n"); -} - -#else /* ! defined (ANSI_PROTOTYPES) */ - -static void _bfd_default_error_handler (); - -static void -_bfd_default_error_handler (va_alist) - va_dcl +_bfd_default_error_handler VPARAMS ((const char *s, ...)) { - va_list p; - const char *s; - if (_bfd_error_program_name != NULL) fprintf (stderr, "%s: ", _bfd_error_program_name); else fprintf (stderr, "BFD: "); - va_start (p); - - s = va_arg (p, const char *); + VA_OPEN (p, s); + VA_FIXEDARG (p, const char *, s); vfprintf (stderr, s, p); - - va_end (p); + VA_CLOSE (p); fprintf (stderr, "\n"); } -#endif /* ! defined (ANSI_PROTOTYPES) */ - /* This is a function pointer to the routine which should handle BFD error messages. It is called when a BFD routine encounters an error for which it wants to print a message. Going through a @@ -525,6 +503,54 @@ bfd_get_error_handler () { return _bfd_error_handler; } + +/* +FUNCTION + bfd_archive_filename + +SYNOPSIS + const char *bfd_archive_filename (bfd *); + +DESCRIPTION + For a BFD that is a component of an archive, returns a string + with both the archive name and file name. For other BFDs, just + returns the file name. +*/ + +const char * +bfd_archive_filename (abfd) + bfd *abfd; +{ + if (abfd->my_archive) + { + static size_t curr = 0; + static char *buf; + size_t needed; + + needed = (strlen (bfd_get_filename (abfd->my_archive)) + + strlen (bfd_get_filename (abfd)) + 3); + if (needed > curr) + { + if (curr) + free (buf); + curr = needed + (needed >> 1); + buf = bfd_malloc ((bfd_size_type) curr); + /* If we can't malloc, fail safe by returning just the file + name. This function is only used when building error + messages. */ + if (!buf) + { + curr = 0; + return bfd_get_filename (abfd); + } + } + sprintf (buf, "%s(%s)", bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd)); + return buf; + } + else + return bfd_get_filename (abfd); +} /* SECTION @@ -550,10 +576,11 @@ bfd_get_reloc_upper_bound (abfd, asect) bfd *abfd; sec_ptr asect; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } return BFD_SEND (abfd, _get_reloc_upper_bound, (abfd, asect)); } @@ -589,10 +616,12 @@ bfd_canonicalize_reloc (abfd, asect, location, symbols) arelent **location; asymbol **symbols; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + return BFD_SEND (abfd, _bfd_canonicalize_reloc, (abfd, asect, location, symbols)); } @@ -648,23 +677,26 @@ bfd_set_file_flags (abfd, flags) bfd *abfd; flagword flags; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_wrong_format); + return false; + } - if (bfd_read_p (abfd)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + if (bfd_read_p (abfd)) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } bfd_get_file_flags (abfd) = flags; - if ((flags & bfd_applicable_file_flags (abfd)) != flags) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + if ((flags & bfd_applicable_file_flags (abfd)) != flags) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } -return true; + return true; } void @@ -672,7 +704,8 @@ bfd_assert (file, line) const char *file; int line; { - (*_bfd_error_handler) (_("bfd assertion fail %s:%d"), file, line); + (*_bfd_error_handler) (_("BFD %s assertion fail %s:%d"), + BFD_VERSION_STRING, file, line); } /* A more or less friendly abort message. In libbfd.h abort is @@ -690,12 +723,12 @@ _bfd_abort (file, line, fn) { if (fn != NULL) (*_bfd_error_handler) - (_("BFD internal error, aborting at %s line %d in %s\n"), - file, line, fn); + (_("BFD %s internal error, aborting at %s line %d in %s\n"), + BFD_VERSION_STRING, file, line, fn); else (*_bfd_error_handler) - (_("BFD internal error, aborting at %s line %d\n"), - file, line); + (_("BFD %s internal error, aborting at %s line %d\n"), + BFD_VERSION_STRING, file, line); (*_bfd_error_handler) (_("Please report this bug.\n")); xexit (EXIT_FAILURE); } @@ -752,9 +785,21 @@ int bfd_get_sign_extend_vma (abfd) bfd *abfd; { + char *name; + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) return (get_elf_backend_data (abfd)->sign_extend_vma); + name = bfd_get_target (abfd); + + /* Return a proper value for DJGPP COFF (an x86 COFF variant). + This function is required for DWARF2 support, but there is + no place to store this information in the COFF back end. + Should enough other COFF targets add support for DWARF2, + a place will have to be found. Until then, this hack will do. */ + if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0) + return 1; + bfd_set_error (bfd_error_wrong_format); return -1; } @@ -774,9 +819,9 @@ RETURNS */ boolean -bfd_set_start_address(abfd, vma) -bfd *abfd; -bfd_vma vma; +bfd_set_start_address (abfd, vma) + bfd *abfd; + bfd_vma vma; { abfd->start_address = vma; return true; @@ -857,7 +902,7 @@ bfd_get_size (abfd) return ((struct bfd_in_memory *) abfd->iostream)->size; fp = bfd_cache_lookup (abfd); - if (0 != fstat (fileno (fp), &buf)) + if (0 != fstat (fileno (fp), & buf)) return 0; return buf.st_size; @@ -868,7 +913,7 @@ FUNCTION bfd_get_gp_size SYNOPSIS - int bfd_get_gp_size(bfd *abfd); + unsigned int bfd_get_gp_size(bfd *abfd); DESCRIPTION Return the maximum size of objects to be optimized using the GP @@ -876,7 +921,7 @@ DESCRIPTION argument to the compiler, assembler or linker. */ -int +unsigned int bfd_get_gp_size (abfd) bfd *abfd; { @@ -895,7 +940,7 @@ FUNCTION bfd_set_gp_size SYNOPSIS - void bfd_set_gp_size(bfd *abfd, int i); + void bfd_set_gp_size(bfd *abfd, unsigned int i); DESCRIPTION Set the maximum size of objects to be optimized using the GP @@ -906,11 +951,12 @@ DESCRIPTION void bfd_set_gp_size (abfd, i) bfd *abfd; - int i; + unsigned int i; { - /* Don't try to set GP size on an archive or core file! */ + /* Don't try to set GP size on an archive or core file! */ if (abfd->format != bfd_object) return; + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) ecoff_data (abfd)->gp_size = i; else if (abfd->xvec->flavour == bfd_target_elf_flavour) @@ -925,13 +971,14 @@ bfd_vma _bfd_get_gp_value (abfd) bfd *abfd; { - if (abfd->format == bfd_object) - { - if (abfd->xvec->flavour == bfd_target_ecoff_flavour) - return ecoff_data (abfd)->gp; - else if (abfd->xvec->flavour == bfd_target_elf_flavour) - return elf_gp (abfd); - } + if (abfd->format != bfd_object) + return 0; + + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) + return ecoff_data (abfd)->gp; + else if (abfd->xvec->flavour == bfd_target_elf_flavour) + return elf_gp (abfd); + return 0; } @@ -944,6 +991,7 @@ _bfd_set_gp_value (abfd, v) { if (abfd->format != bfd_object) return; + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) ecoff_data (abfd)->gp = v; else if (abfd->xvec->flavour == bfd_target_elf_flavour) @@ -955,7 +1003,7 @@ FUNCTION bfd_scan_vma SYNOPSIS - bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base); + bfd_vma bfd_scan_vma(const char *string, const char **end, int base); DESCRIPTION Convert, like <>, a numerical expression @@ -972,8 +1020,8 @@ DESCRIPTION bfd_vma bfd_scan_vma (string, end, base) - CONST char *string; - CONST char **end; + const char *string; + const char **end; int base; { bfd_vma value; @@ -993,33 +1041,32 @@ bfd_scan_vma (string, end, base) { if ((string[1] == 'x') || (string[1] == 'X')) base = 16; - /* XXX should we also allow "0b" or "0B" to set base to 2? */ + /* XXX should we also allow "0b" or "0B" to set base to 2? */ else base = 8; } else base = 10; } + if ((base == 16) && (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X'))) string += 2; - /* XXX should we also skip over "0b" or "0B" if base is 2? */ + /* XXX should we also skip over "0b" or "0B" if base is 2? */ /* Speed could be improved with a table like hex_value[] in gas. */ #define HEX_VALUE(c) \ - (isxdigit ((unsigned char) c) \ - ? (isdigit ((unsigned char) c) \ + (ISXDIGIT (c) \ + ? (ISDIGIT (c) \ ? (c - '0') \ - : (10 + c - (islower ((unsigned char) c) ? 'a' : 'A'))) \ + : (10 + c - (ISLOWER (c) ? 'a' : 'A'))) \ : 42) - for (value = 0; (digit = HEX_VALUE(*string)) < base; string++) - { - value = value * base + digit; - } + for (value = 0; (digit = HEX_VALUE (* string)) < base; string ++) + value = value * base + digit; if (end) - *end = string; + * end = string; return value; } @@ -1126,6 +1173,9 @@ DESCRIPTION .#define bfd_gc_sections(abfd, link_info) \ . BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) . +.#define bfd_merge_sections(abfd, link_info) \ +. BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) +. .#define bfd_link_hash_table_create(abfd) \ . BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) . @@ -1179,11 +1229,12 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data, if (link_order->type == bfd_indirect_link_order) { abfd2 = link_order->u.indirect.section->owner; - if (abfd2 == 0) + if (abfd2 == NULL) abfd2 = abfd; } else abfd2 = abfd; + fn = abfd2->xvec->_bfd_get_relocated_section_contents; return (*fn) (abfd, link_info, link_order, data, relocateable, symbols); @@ -1206,14 +1257,14 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at, asection **secs; { struct elf_segment_map *m, **pm; + bfd_size_type amt; if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) return true; - m = ((struct elf_segment_map *) - bfd_alloc (abfd, - (sizeof (struct elf_segment_map) - + ((size_t) count - 1) * sizeof (asection *)))); + amt = sizeof (struct elf_segment_map); + amt += ((bfd_size_type) count - 1) * sizeof (asection *); + m = (struct elf_segment_map *) bfd_alloc (abfd, amt); if (m == NULL) return false; @@ -1235,3 +1286,82 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at, return true; } + +void +bfd_sprintf_vma (abfd, buf, value) + bfd *abfd; + char *buf; + bfd_vma value; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + get_elf_backend_data (abfd)->elf_backend_sprintf_vma (abfd, buf, value); + else + sprintf_vma (buf, value); +} + +void +bfd_fprintf_vma (abfd, stream, value) + bfd *abfd; + PTR stream; + bfd_vma value; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value); + else + fprintf_vma ((FILE *) stream, value); +} + +/* +FUNCTION + bfd_alt_mach_code + +SYNOPSIS + boolean bfd_alt_mach_code(bfd *abfd, int index); + +DESCRIPTION + + When more than one machine code number is available for the + same machine type, this function can be used to switch between + the preferred one (index == 0) and any others. Currently, + only ELF supports this feature, with up to two alternate + machine codes. +*/ + +boolean +bfd_alt_mach_code (abfd, index) + bfd *abfd; + int index; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + { + int code; + + switch (index) + { + case 0: + code = get_elf_backend_data (abfd)->elf_machine_code; + break; + + case 1: + code = get_elf_backend_data (abfd)->elf_machine_alt1; + if (code == 0) + return false; + break; + + case 2: + code = get_elf_backend_data (abfd)->elf_machine_alt2; + if (code == 0) + return false; + break; + + default: + return false; + } + + elf_elfheader (abfd)->e_machine = code; + + return true; + } + + return false; +} diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c index b80343b..705ac8f 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, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, @@ -32,10 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ the file. objcopy cooperates by specially setting the start address to zero by default. */ -#include - #include "bfd.h" #include "sysdep.h" +#include "safe-ctype.h" #include "libbfd.h" /* Any bfd we create by reading a binary file has three symbols: @@ -49,12 +48,15 @@ static boolean binary_get_section_contents static long binary_get_symtab_upper_bound PARAMS ((bfd *)); static char *mangle_name PARAMS ((bfd *, char *)); static long binary_get_symtab PARAMS ((bfd *, asymbol **)); -static asymbol *binary_make_empty_symbol PARAMS ((bfd *)); static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static boolean binary_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static int binary_sizeof_headers PARAMS ((bfd *, boolean)); +/* Set by external programs - specifies the BFD architecture + to use when creating binary BFDs. */ +enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown; + /* Create a binary object. Invoked via bfd_set_format. */ static boolean @@ -101,6 +103,13 @@ binary_object_p (abfd) abfd->tdata.any = (PTR) sec; + if (bfd_get_arch_info (abfd) != NULL) + { + if ((bfd_get_arch_info (abfd)->arch == bfd_arch_unknown) + && (bfd_external_binary_architecture != bfd_arch_unknown)) + bfd_set_arch_info (abfd, bfd_lookup_arch (bfd_external_binary_architecture, 0)); + } + return abfd->xvec; } @@ -119,7 +128,7 @@ binary_get_section_contents (abfd, section, location, offset, count) bfd_size_type count; { if (bfd_seek (abfd, offset, SEEK_SET) != 0 - || bfd_read (location, 1, count, abfd) != count) + || bfd_bread (location, count, abfd) != count) return false; return true; } @@ -140,7 +149,7 @@ mangle_name (abfd, suffix) bfd *abfd; char *suffix; { - int size; + bfd_size_type size; char *buf; char *p; @@ -156,7 +165,7 @@ mangle_name (abfd, suffix) /* Change any non-alphanumeric characters to underscores. */ for (p = buf; *p; p++) - if (! isalnum ((unsigned char) *p)) + if (! ISALNUM (*p)) *p = '_'; return buf; @@ -172,8 +181,9 @@ binary_get_symtab (abfd, alocation) asection *sec = (asection *) abfd->tdata.any; asymbol *syms; unsigned int i; + bfd_size_type amt = BIN_SYMS * sizeof (asymbol); - syms = (asymbol *) bfd_alloc (abfd, BIN_SYMS * sizeof (asymbol)); + syms = (asymbol *) bfd_alloc (abfd, amt); if (syms == NULL) return false; @@ -208,15 +218,7 @@ binary_get_symtab (abfd, alocation) return BIN_SYMS; } -/* Make an empty symbol. */ - -static asymbol * -binary_make_empty_symbol (abfd) - bfd *abfd; -{ - return (asymbol *) bfd_alloc (abfd, sizeof (asymbol)); -} - +#define binary_make_empty_symbol _bfd_generic_make_empty_symbol #define binary_print_symbol _bfd_nosymbols_print_symbol /* Get information about a symbol. */ @@ -334,6 +336,7 @@ binary_sizeof_headers (abfd, exec) bfd_generic_get_relocated_section_contents #define binary_bfd_relax_section bfd_generic_relax_section #define binary_bfd_gc_sections bfd_generic_gc_sections +#define binary_bfd_merge_sections bfd_generic_merge_sections #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols #define binary_bfd_final_link _bfd_generic_final_link diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index da16409..4e5ef2e 100644 --- a/contrib/binutils/bfd/cache.c +++ b/contrib/binutils/bfd/cache.c @@ -364,7 +364,9 @@ bfd_cache_lookup_worker (abfd) { if (bfd_open_file (abfd) == NULL) return NULL; - if (fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0) + if (abfd->where != (unsigned long) abfd->where) + return NULL; + if (fseek ((FILE *) abfd->iostream, (long) abfd->where, SEEK_SET) != 0) return NULL; } diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c index b3cd0c7..4056e2c 100644 --- a/contrib/binutils/bfd/coff-alpha.c +++ b/contrib/binutils/bfd/coff-alpha.c @@ -76,32 +76,32 @@ static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex)); symbol, and lineno ones. Give them ecoff names. Define some accessor macros for the large sizes used for Alpha ECOFF. */ -#define GET_FILEHDR_SYMPTR bfd_h_get_64 -#define PUT_FILEHDR_SYMPTR bfd_h_put_64 -#define GET_AOUTHDR_TSIZE bfd_h_get_64 -#define PUT_AOUTHDR_TSIZE bfd_h_put_64 -#define GET_AOUTHDR_DSIZE bfd_h_get_64 -#define PUT_AOUTHDR_DSIZE bfd_h_put_64 -#define GET_AOUTHDR_BSIZE bfd_h_get_64 -#define PUT_AOUTHDR_BSIZE bfd_h_put_64 -#define GET_AOUTHDR_ENTRY bfd_h_get_64 -#define PUT_AOUTHDR_ENTRY bfd_h_put_64 -#define GET_AOUTHDR_TEXT_START bfd_h_get_64 -#define PUT_AOUTHDR_TEXT_START bfd_h_put_64 -#define GET_AOUTHDR_DATA_START bfd_h_get_64 -#define PUT_AOUTHDR_DATA_START bfd_h_put_64 -#define GET_SCNHDR_PADDR bfd_h_get_64 -#define PUT_SCNHDR_PADDR bfd_h_put_64 -#define GET_SCNHDR_VADDR bfd_h_get_64 -#define PUT_SCNHDR_VADDR bfd_h_put_64 -#define GET_SCNHDR_SIZE bfd_h_get_64 -#define PUT_SCNHDR_SIZE bfd_h_put_64 -#define GET_SCNHDR_SCNPTR bfd_h_get_64 -#define PUT_SCNHDR_SCNPTR bfd_h_put_64 -#define GET_SCNHDR_RELPTR bfd_h_get_64 -#define PUT_SCNHDR_RELPTR bfd_h_put_64 -#define GET_SCNHDR_LNNOPTR bfd_h_get_64 -#define PUT_SCNHDR_LNNOPTR bfd_h_put_64 +#define GET_FILEHDR_SYMPTR H_GET_64 +#define PUT_FILEHDR_SYMPTR H_PUT_64 +#define GET_AOUTHDR_TSIZE H_GET_64 +#define PUT_AOUTHDR_TSIZE H_PUT_64 +#define GET_AOUTHDR_DSIZE H_GET_64 +#define PUT_AOUTHDR_DSIZE H_PUT_64 +#define GET_AOUTHDR_BSIZE H_GET_64 +#define PUT_AOUTHDR_BSIZE H_PUT_64 +#define GET_AOUTHDR_ENTRY H_GET_64 +#define PUT_AOUTHDR_ENTRY H_PUT_64 +#define GET_AOUTHDR_TEXT_START H_GET_64 +#define PUT_AOUTHDR_TEXT_START H_PUT_64 +#define GET_AOUTHDR_DATA_START H_GET_64 +#define PUT_AOUTHDR_DATA_START H_PUT_64 +#define GET_SCNHDR_PADDR H_GET_64 +#define PUT_SCNHDR_PADDR H_PUT_64 +#define GET_SCNHDR_VADDR H_GET_64 +#define PUT_SCNHDR_VADDR H_PUT_64 +#define GET_SCNHDR_SIZE H_GET_64 +#define PUT_SCNHDR_SIZE H_PUT_64 +#define GET_SCNHDR_SCNPTR H_GET_64 +#define PUT_SCNHDR_SCNPTR H_PUT_64 +#define GET_SCNHDR_RELPTR H_GET_64 +#define PUT_SCNHDR_RELPTR H_PUT_64 +#define GET_SCNHDR_LNNOPTR H_GET_64 +#define PUT_SCNHDR_LNNOPTR H_PUT_64 #define ALPHAECOFF @@ -530,8 +530,8 @@ alpha_ecoff_swap_reloc_in (abfd, ext_ptr, intern) { const RELOC *ext = (RELOC *) ext_ptr; - intern->r_vaddr = bfd_h_get_64 (abfd, (bfd_byte *) ext->r_vaddr); - intern->r_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->r_symndx); + intern->r_vaddr = H_GET_64 (abfd, ext->r_vaddr); + intern->r_symndx = H_GET_32 (abfd, ext->r_symndx); BFD_ASSERT (bfd_header_little_endian (abfd)); @@ -603,8 +603,8 @@ alpha_ecoff_swap_reloc_out (abfd, intern, dst) BFD_ASSERT (intern->r_extern || (intern->r_symndx >= 0 && intern->r_symndx <= 14)); - bfd_h_put_64 (abfd, intern->r_vaddr, (bfd_byte *) ext->r_vaddr); - bfd_h_put_32 (abfd, symndx, (bfd_byte *) ext->r_symndx); + H_PUT_64 (abfd, intern->r_vaddr, ext->r_vaddr); + H_PUT_32 (abfd, symndx, ext->r_symndx); BFD_ASSERT (bfd_header_little_endian (abfd)); @@ -771,7 +771,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, if (reloc_size < 0) goto error_return; - reloc_vector = (arelent **) bfd_malloc (reloc_size); + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (reloc_vector == NULL && reloc_size != 0) goto error_return; @@ -1277,7 +1277,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) hsec = h->root.u.def.section; name = bfd_get_section_name (output_bfd, hsec->output_section); - r_symndx = -1; + r_symndx = (unsigned long) -1; switch (name[1]) { case 'A': @@ -1334,7 +1334,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) break; } - if (r_symndx == -1) + if (r_symndx == (unsigned long) -1) abort (); /* Add the section VMA and the symbol value. */ @@ -1347,7 +1347,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) /* Change the symndx value to the right one for the output BFD. */ r_symndx = h->indx; - if (r_symndx == -1) + if (r_symndx == (unsigned long) -1) { /* Caller must give an error. */ r_symndx = 0; @@ -1356,8 +1356,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) } /* Write out the new r_symndx value. */ - bfd_h_put_32 (input_bfd, (bfd_vma) r_symndx, - (bfd_byte *) ext_rel->r_symndx); + H_PUT_32 (input_bfd, r_symndx, ext_rel->r_symndx); return relocation; } @@ -1384,6 +1383,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, int tos = 0; struct external_reloc *ext_rel; struct external_reloc *ext_rel_end; + bfd_size_type amt; /* We keep a table mapping the symndx found in an internal reloc to the appropriate section. This is faster than looking up the @@ -1391,10 +1391,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, symndx_to_section = ecoff_data (input_bfd)->symndx_to_section; if (symndx_to_section == (asection **) NULL) { - symndx_to_section = ((asection **) - bfd_alloc (input_bfd, - (NUM_RELOC_SECTIONS - * sizeof (asection *)))); + amt = NUM_RELOC_SECTIONS * sizeof (asection *); + symndx_to_section = (asection **) bfd_alloc (input_bfd, amt); if (!symndx_to_section) return false; @@ -1451,9 +1449,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, lita_sec_data = ecoff_section_data (input_bfd, lita_sec); if (lita_sec_data == NULL) { + amt = sizeof (struct ecoff_section_tdata); lita_sec_data = ((struct ecoff_section_tdata *) - bfd_zalloc (input_bfd, - sizeof (struct ecoff_section_tdata))); + bfd_zalloc (input_bfd, amt)); ecoff_section_data (input_bfd, lita_sec) = lita_sec_data; } @@ -1522,8 +1520,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, boolean gp_usedp; bfd_vma addend; - r_vaddr = bfd_h_get_64 (input_bfd, (bfd_byte *) ext_rel->r_vaddr); - r_symndx = bfd_h_get_32 (input_bfd, (bfd_byte *) ext_rel->r_symndx); + r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr); + r_symndx = H_GET_32 (input_bfd, ext_rel->r_symndx); r_type = ((ext_rel->r_bits[0] & RELOC_BITS0_TYPE_LITTLE) >> RELOC_BITS0_TYPE_SH_LITTLE); @@ -1552,9 +1550,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, address of the relocation does not appear to include the section VMA, unlike the other relocation types. */ if (info->relocateable) - bfd_h_put_64 (input_bfd, - input_section->output_offset + r_vaddr, - (bfd_byte *) ext_rel->r_vaddr); + H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr, + ext_rel->r_vaddr); adjust_addrp = false; break; @@ -1751,8 +1748,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (info->relocateable) { /* Adjust r_vaddr by the addend. */ - bfd_h_put_64 (input_bfd, addend, - (bfd_byte *) ext_rel->r_vaddr); + H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr); } else { @@ -1979,18 +1975,18 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (info->relocateable && adjust_addrp) { /* Change the address of the relocation. */ - bfd_h_put_64 (input_bfd, - (input_section->output_section->vma - + input_section->output_offset - - input_section->vma - + r_vaddr), - (bfd_byte *) ext_rel->r_vaddr); + H_PUT_64 (input_bfd, + (input_section->output_section->vma + + input_section->output_offset + - input_section->vma + + r_vaddr), + ext_rel->r_vaddr); } if (gp_usedp && gp_undefined) { if (! ((*info->callbacks->reloc_dangerous) - (info, _("GP relative relocation when GP not defined"), + (info, _("GP relative relocation used when GP not defined"), input_bfd, input_section, r_vaddr - input_section->vma))) return false; /* Only give the error once per link. */ @@ -2062,12 +2058,12 @@ alpha_ecoff_read_ar_hdr (abfd) /* This is a compressed file. We must set the size correctly. The size is the eight bytes after the dummy file header. */ - if (bfd_seek (abfd, FILHSZ, SEEK_CUR) != 0 - || bfd_read (ab, 1, 8, abfd) != 8 - || bfd_seek (abfd, - (FILHSZ + 8), SEEK_CUR) != 0) + if (bfd_seek (abfd, (file_ptr) FILHSZ, SEEK_CUR) != 0 + || bfd_bread (ab, (bfd_size_type) 8, abfd) != 8 + || bfd_seek (abfd, (file_ptr) (- (FILHSZ + 8)), SEEK_CUR) != 0) return NULL; - ret->parsed_size = bfd_h_get_64 (abfd, ab); + ret->parsed_size = H_GET_64 (abfd, ab); } return (PTR) ret; @@ -2105,20 +2101,20 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) return nbfd; /* We must uncompress this element. We do this by copying it into a - memory buffer, and making bfd_read and bfd_seek use that buffer. + memory buffer, and making bfd_bread and bfd_seek use that buffer. This can use a lot of memory, but it's simpler than getting a temporary file, making that work with the file descriptor caching code, and making sure that it is deleted at all appropriate times. It can be changed if it ever becomes important. */ /* The compressed file starts with a dummy ECOFF file header. */ - if (bfd_seek (nbfd, FILHSZ, SEEK_SET) != 0) + if (bfd_seek (nbfd, (file_ptr) FILHSZ, SEEK_SET) != 0) goto error_return; /* The next eight bytes are the real file size. */ - if (bfd_read (ab, 1, 8, nbfd) != 8) + if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8) goto error_return; - size = bfd_h_get_64 (nbfd, ab); + size = H_GET_64 (nbfd, ab); if (size == 0) buf = NULL; @@ -2137,7 +2133,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) left = size; /* I don't know what the next eight bytes are for. */ - if (bfd_read (ab, 1, 8, nbfd) != 8) + if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8) goto error_return; /* This is the uncompression algorithm. It's a simple @@ -2148,7 +2144,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) next eight bytes in the output stream. */ memset (dict, 0, sizeof dict); h = 0; - while (bfd_read (&b, 1, 1, nbfd) == 1) + while (bfd_bread (&b, (bfd_size_type) 1, nbfd) == 1) { unsigned int i; @@ -2160,7 +2156,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) n = dict[h]; else { - if (! bfd_read (&n, 1, 1, nbfd)) + if (! bfd_bread (&n, (bfd_size_type) 1, nbfd)) goto error_return; dict[h] = n; } @@ -2183,7 +2179,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) /* Now the uncompressed file contents are in buf. */ bim = ((struct bfd_in_memory *) - bfd_alloc (nbfd, sizeof (struct bfd_in_memory))); + bfd_alloc (nbfd, (bfd_size_type) sizeof (struct bfd_in_memory))); if (bim == NULL) goto error_return; bim->size = size; @@ -2359,6 +2355,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = /* Relaxing sections is generic. */ #define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections +#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections const bfd_target ecoffalpha_little_vec = { diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c index 8bb4e6c..df2be76 100644 --- a/contrib/binutils/bfd/coff-arm.c +++ b/contrib/binutils/bfd/coff-arm.c @@ -36,18 +36,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Macros for manipulation the bits in the flags field of the coff data structure. */ -#define APCS_26_FLAG( abfd ) (coff_data (abfd)->flags & F_APCS_26) -#define APCS_FLOAT_FLAG( abfd ) (coff_data (abfd)->flags & F_APCS_FLOAT) -#define PIC_FLAG( abfd ) (coff_data (abfd)->flags & F_PIC) -#define APCS_SET( abfd ) (coff_data (abfd)->flags & F_APCS_SET) -#define SET_APCS_FLAGS( abfd, flgs) (coff_data (abfd)->flags = \ - (coff_data (abfd)->flags & ~ (F_APCS_26 | F_APCS_FLOAT | F_PIC)) \ - | (flgs | F_APCS_SET)) -#define INTERWORK_FLAG( abfd ) (coff_data (abfd)->flags & F_INTERWORK) -#define INTERWORK_SET( abfd ) (coff_data (abfd)->flags & F_INTERWORK_SET) -#define SET_INTERWORK_FLAG( abfd, flg ) (coff_data (abfd)->flags = \ - (coff_data (abfd)->flags & ~ F_INTERWORK) \ - | (flg | F_INTERWORK_SET)) +#define APCS_26_FLAG(abfd) \ + (coff_data (abfd)->flags & F_APCS_26) + +#define APCS_FLOAT_FLAG(abfd) \ + (coff_data (abfd)->flags & F_APCS_FLOAT) + +#define PIC_FLAG(abfd) \ + (coff_data (abfd)->flags & F_PIC) + +#define APCS_SET(abfd) \ + (coff_data (abfd)->flags & F_APCS_SET) + +#define SET_APCS_FLAGS(abfd, flgs) \ + do \ + { \ + coff_data (abfd)->flags &= ~(F_APCS_26 | F_APCS_FLOAT | F_PIC); \ + coff_data (abfd)->flags |= (flgs) | F_APCS_SET; \ + } \ + while (0) + +#define INTERWORK_FLAG(abfd) \ + (coff_data (abfd)->flags & F_INTERWORK) + +#define INTERWORK_SET(abfd) \ + (coff_data (abfd)->flags & F_INTERWORK_SET) + +#define SET_INTERWORK_FLAG(abfd, flg) \ + do \ + { \ + coff_data (abfd)->flags &= ~F_INTERWORK; \ + coff_data (abfd)->flags |= (flg) | F_INTERWORK_SET; \ + } \ + while (0) #ifndef NUM_ELEM #define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0])) @@ -79,20 +100,21 @@ static boolean coff_arm_adjust_symndx asection *, struct internal_reloc *, boolean *)); static reloc_howto_type * coff_arm_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); + struct coff_link_hash_entry *, struct internal_syment *, + bfd_vma *)); static bfd_reloc_status_type coff_thumb_pcrel_common PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **, thumb_pcrel_branchtype)); -static CONST struct reloc_howto_struct * coff_arm_reloc_type_lookup +static const struct reloc_howto_struct * coff_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static struct bfd_link_hash_table * coff_arm_link_hash_table_create PARAMS ((bfd *)); static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct coff_link_hash_entry * find_thumb_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct coff_link_hash_entry * find_arm_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); #ifndef COFF_IMAGE_WITH_PE static void record_arm_to_thumb_glue PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *)); @@ -113,12 +135,13 @@ static boolean coff_arm_link_output_has_begun PARAMS ((bfd *, struct coff_final_link_info *)); static boolean coff_arm_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); +static void arm_emit_base_file_entry + PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. Given a function name, and its type, the stub can be found. The - name can be changed. The only requirement is the %s be present. - */ + name can be changed. The only requirement is the %s be present. */ #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" @@ -127,6 +150,7 @@ static boolean coff_arm_final_link_postscript #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" /* Used by the assembler. */ + static bfd_reloc_status_type coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -144,8 +168,9 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, diff = reloc_entry->addend; -#define DOIT(x) \ - x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask)) +#define DOIT(x) \ + x = ((x & ~howto->dst_mask) \ + | (((x & howto->src_mask) + diff) & howto->dst_mask)) if (diff != 0) { @@ -166,7 +191,7 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { short x = bfd_get_16 (abfd, addr); DOIT (x); - bfd_put_16 (abfd, x, addr); + bfd_put_16 (abfd, (bfd_vma) x, addr); } break; @@ -174,7 +199,7 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { long x = bfd_get_32 (abfd, addr); DOIT (x); - bfd_put_32 (abfd, x, addr); + bfd_put_32 (abfd, (bfd_vma) x, addr); } break; @@ -233,300 +258,300 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #endif static reloc_howto_type aoutarm_std_reloc_howto[] = -{ - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ + { #ifdef ARM_WINCE - EMPTY_HOWTO (-1), - HOWTO (ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO (ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO (ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - HOWTO (ARM_SECTION, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO (ARM_SECREL, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), + EMPTY_HOWTO (-1), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + HOWTO (ARM_SECTION, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_SECREL, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), #else /* not ARM_WINCE */ - HOWTO(ARM_8, /* type */ - 0, /* rightshift */ - 0, /* size */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_arm_reloc, /* special_function */ - "ARM_8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - PCRELOFFSET /* pcrel_offset */), - HOWTO(ARM_16, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO(ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO(ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO(ARM_DISP8, - 0, - 0, - 8, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP8", - true, - 0x000000ff, - 0x000000ff, - true), - HOWTO( ARM_DISP16, - 0, - 1, - 16, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP16", - true, - 0x0000ffff, - 0x0000ffff, - true), - HOWTO( ARM_DISP32, - 0, - 2, - 32, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP32", - true, - 0xffffffff, - 0xffffffff, - true), - HOWTO( ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - /* 8 is unused */ - EMPTY_HOWTO (-1), - HOWTO( ARM_NEG16, - 0, - -1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG16", - true, - 0x0000ffff, - 0x0000ffff, - false), - HOWTO( ARM_NEG32, - 0, - -2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG32", - true, - 0xffffffff, - 0xffffffff, - false), - HOWTO( ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO( ARM_THUMB9, - 1, - 1, - 8, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_9 , - "ARM_THUMB9", - false, - 0x000000ff, - 0x000000ff, - PCRELOFFSET), - HOWTO( ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO( ARM_THUMB23, - 1, - 2, - 22, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_23 , - "ARM_THUMB23", - false, - 0x07ff07ff, - 0x07ff07ff, - PCRELOFFSET) + HOWTO (ARM_8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_arm_reloc, /* special_function */ + "ARM_8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + PCRELOFFSET /* pcrel_offset */), + HOWTO (ARM_16, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_DISP8, + 0, + 0, + 8, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP8", + true, + 0x000000ff, + 0x000000ff, + true), + HOWTO (ARM_DISP16, + 0, + 1, + 16, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP16", + true, + 0x0000ffff, + 0x0000ffff, + true), + HOWTO (ARM_DISP32, + 0, + 2, + 32, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP32", + true, + 0xffffffff, + 0xffffffff, + true), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + /* 8 is unused */ + EMPTY_HOWTO (-1), + HOWTO (ARM_NEG16, + 0, + -1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG16", + true, + 0x0000ffff, + 0x0000ffff, + false), + HOWTO (ARM_NEG32, + 0, + -2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG32", + true, + 0xffffffff, + 0xffffffff, + false), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB9, + 1, + 1, + 8, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_9 , + "ARM_THUMB9", + false, + 0x000000ff, + 0x000000ff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_THUMB23, + 1, + 2, + 22, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_23 , + "ARM_THUMB23", + false, + 0x07ff07ff, + 0x07ff07ff, + PCRELOFFSET) #endif /* not ARM_WINCE */ -}; + }; #define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto) #ifdef COFF_WITH_PE +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); /* Return true if this relocation should appear in the output .reloc section. */ @@ -568,6 +593,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } + /* Used by the assembler. */ static bfd_reloc_status_type @@ -603,7 +629,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -615,7 +641,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; relocation = (target & 0x00ffffff) << 2; - relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */ + relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -627,18 +653,18 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, if (relocation & 3) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & 0x02000000) { if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff) flag = bfd_reloc_overflow; } - else if (relocation & ~0x03ffffff) + else if (relocation & ~(bfd_vma) 0x03ffffff) flag = bfd_reloc_overflow; target &= ~0x00ffffff; target |= (relocation >> 2) & 0x00ffffff; - bfd_put_32 (abfd, target, (bfd_byte *) data + addr); + bfd_put_32 (abfd, (bfd_vma) target, (bfd_byte *) data + addr); /* Now the ARM magic... Change the reloc type so that it is marked as done. Strictly this is only necessary if we are doing a partial relocation. */ @@ -694,7 +720,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, abort (); } - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -723,7 +749,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, abort (); } - relocation = (relocation ^ signbit) - signbit; /* Sign extend */ + relocation = (relocation ^ signbit) - signbit; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -735,7 +761,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, if (relocation & 1) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & signbit) { if ((relocation & ~offmsk) != ~offmsk) @@ -754,22 +780,24 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, case b23: if (bfd_big_endian (abfd)) - target |= ((relocation & 0xfff) >> 1) | ((relocation << 4) & 0x07ff0000); + target |= (((relocation & 0xfff) >> 1) + | ((relocation << 4) & 0x07ff0000)); else - target |= ((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff); + target |= (((relocation & 0xffe) << 15) + | ((relocation >> 12) & 0x7ff)); break; default: abort (); } - bfd_put_32 (abfd, target, (bfd_byte *) data + addr); + bfd_put_32 (abfd, (bfd_vma) target, (bfd_byte *) data + addr); /* Now the ARM magic... Change the reloc type so that it is marked as done. Strictly this is only necessary if we are doing a partial relocation. */ reloc_entry->howto = & aoutarm_std_reloc_howto [ARM_26D]; - /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations */ + /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations. */ return flag; } @@ -785,7 +813,8 @@ coff_thumb_pcrel_23 (abfd, reloc_entry, symbol, data, input_section, char **error_message; { return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message, b23); + input_section, output_bfd, error_message, + b23); } static bfd_reloc_status_type @@ -800,7 +829,8 @@ coff_thumb_pcrel_12 (abfd, reloc_entry, symbol, data, input_section, char **error_message; { return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message, b12); + input_section, output_bfd, error_message, + b12); } static bfd_reloc_status_type @@ -815,10 +845,11 @@ coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section, char **error_message; { return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message, b9); + input_section, output_bfd, error_message, + b9); } -static CONST struct reloc_howto_struct * +static const struct reloc_howto_struct * coff_arm_reloc_type_lookup (abfd, code) bfd * abfd; bfd_reloc_code_real_type code; @@ -831,7 +862,8 @@ coff_arm_reloc_type_lookup (abfd, code) case 32: code = BFD_RELOC_32; break; - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (const struct reloc_howto_struct *) 0; } switch (code) @@ -856,7 +888,7 @@ coff_arm_reloc_type_lookup (abfd, code) ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_THUMB23); ASTD (BFD_RELOC_THUMB_PCREL_BLX, ARM_THUMB23); #endif - default: return (CONST struct reloc_howto_struct *) 0; + default: return (const struct reloc_howto_struct *) 0; } } @@ -872,21 +904,21 @@ coff_arm_reloc_type_lookup (abfd, code) This allows us to store global data here without actually creating any global variables, which is a no-no in the BFD world. */ struct coff_arm_link_hash_table -{ - /* The original coff_link_hash_table structure. MUST be first field. */ - struct coff_link_hash_table root; + { + /* The original coff_link_hash_table structure. MUST be first field. */ + struct coff_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + bfd_size_type thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + bfd_size_type arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; - /* Support interworking with old, non-interworking aware ARM code. */ - int support_old_code; + /* Support interworking with old, non-interworking aware ARM code. */ + int support_old_code; }; /* Get the ARM coff linker hash table from a link_info structure. */ @@ -900,9 +932,9 @@ coff_arm_link_hash_table_create (abfd) bfd * abfd; { struct coff_arm_link_hash_table * ret; + bfd_size_type amt = sizeof (struct coff_arm_link_hash_table); - ret = ((struct coff_arm_link_hash_table *) - bfd_alloc (abfd, sizeof (struct coff_arm_link_hash_table))); + ret = (struct coff_arm_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct coff_arm_link_hash_table *) NULL) return NULL; @@ -932,9 +964,9 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) + input_section->output_offset + input_section->output_section->vma; - if (coff_data(output_bfd)->pe) - addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; - fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file); + if (coff_data (output_bfd)->pe) + addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; + fwrite (& addr, 1, sizeof (addr), (FILE *) info->base_file); } @@ -964,7 +996,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) moves the computed address into the PC, so it must be the second one in the sequence. The problem, however is that whilst little endian code stores the instructions in HI then LOW order, big endian code does the - reverse. nickc@cygnus.com */ + reverse. nickc@cygnus.com. */ #define LOW_HI_ORDER 0xF800F000 #define HI_LOW_ORDER 0xF000F800 @@ -988,24 +1020,24 @@ insert_thumb_branch (br_insn, rel_off) else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER) br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits; else - abort (); /* error - not a valid branch instruction form */ - - /* FIXME: abort is probably not the right call. krk@cygnus.com */ + /* FIXME: the BFD library should never abort except for internal errors + - it should return an error status. */ + abort (); /* Error - not a valid branch instruction form. */ return br_insn; } static struct coff_link_hash_entry * find_thumb_glue (info, name, input_bfd) - struct bfd_link_info * info; - CONST char * name; - bfd * input_bfd; + struct bfd_link_info *info; + const char *name; + bfd *input_bfd; { - char * tmp_name; - struct coff_link_hash_entry * myh; + char *tmp_name; + struct coff_link_hash_entry *myh; + bfd_size_type amt = strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1; - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1)); + tmp_name = (char *) bfd_malloc (amt); BFD_ASSERT (tmp_name); @@ -1017,7 +1049,7 @@ find_thumb_glue (info, name, input_bfd) if (myh == NULL) /* xgettext:c-format */ _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), - bfd_get_filename (input_bfd), tmp_name, name); + bfd_archive_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -1026,15 +1058,15 @@ find_thumb_glue (info, name, input_bfd) static struct coff_link_hash_entry * find_arm_glue (info, name, input_bfd) - struct bfd_link_info * info; - CONST char * name; - bfd * input_bfd; + struct bfd_link_info *info; + const char *name; + bfd *input_bfd; { - char * tmp_name; + char *tmp_name; struct coff_link_hash_entry * myh; + bfd_size_type amt = strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1; - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1)); + tmp_name = (char *) bfd_malloc (amt); BFD_ASSERT (tmp_name); @@ -1046,7 +1078,7 @@ find_arm_glue (info, name, input_bfd) if (myh == NULL) /* xgettext:c-format */ _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), - bfd_get_filename (input_bfd), tmp_name, name); + bfd_archive_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -1208,7 +1240,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, && info->relocateable && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) - && h->root.u.def.section->output_section == input_section->output_section) + && (h->root.u.def.section->output_section + == input_section->output_section)) { static reloc_howto_type fake_arm26_reloc = HOWTO (ARM_26, @@ -1246,10 +1279,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, continue; /* FIXME - it is not clear which targets need this next test and which do not. It is known that it is needed for the - VXworks target (hence the #ifdef), but it is also known - that it was supressed for other (arm) targets. This ought - to be sorted out one day. */ -#ifdef VXWORKS + VxWorks and EPOC-PE targets, but it is also known that it + was supressed for other ARM targets. This ought to be + sorted out one day. */ +#ifdef ARM_COFF_BUGFIX /* We must not ignore the symbol value. If the symbol is within the same section, the relocation should have already been fixed, but if it is not, we'll be handed a reloc into @@ -1306,9 +1339,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC) { - /* Arm code calling a Thumb function */ + /* Arm code calling a Thumb function. */ unsigned long int tmp; - long int my_offset; + bfd_vma my_offset; asection * s; long int ret_offset; struct coff_link_hash_entry * myh; @@ -1340,20 +1373,20 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, _bfd_error_handler /* xgettext:c-format */ (_("%s(%s): warning: interworking not enabled."), - bfd_get_filename (h_sec->owner), name); + bfd_archive_filename (h_sec->owner), name); _bfd_error_handler /* xgettext:c-format */ (_(" first occurrence: %s: arm call to thumb"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); } --my_offset; myh->root.u.def.value = my_offset; - bfd_put_32 (output_bfd, a2t1_ldr_insn, + bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn, s->contents + my_offset); - bfd_put_32 (output_bfd, a2t2_bx_r12_insn, + bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn, s->contents + my_offset + 4); /* It's a thumb address. Add the low order bit. */ @@ -1362,7 +1395,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (info->base_file) arm_emit_base_file_entry (info, output_bfd, s, - my_offset + 8); + my_offset + 8); } @@ -1385,14 +1418,14 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); - bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr - - input_section->vma); + bfd_put_32 (output_bfd, (bfd_vma) tmp, + contents + rel->r_vaddr - input_section->vma); done = 1; } } #ifndef ARM_WINCE - /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */ + /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12. */ else if (howto->type == ARM_THUMB23) { if ( h->class == C_EXT @@ -1401,7 +1434,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { /* Thumb code calling an ARM function */ asection * s = 0; - long int my_offset; + bfd_vma my_offset; unsigned long int tmp; long int ret_offset; struct coff_link_hash_entry * myh; @@ -1435,11 +1468,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, _bfd_error_handler /* xgettext:c-format */ (_("%s(%s): warning: interworking not enabled."), - bfd_get_filename (h_sec->owner), name); + bfd_archive_filename (h_sec->owner), name); _bfd_error_handler /* xgettext:c-format */ (_(" first occurrence: %s: thumb call to arm"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); _bfd_error_handler (_(" consider relinking with --support-old-code enabled")); } @@ -1449,22 +1482,22 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (globals->support_old_code) { - bfd_put_16 (output_bfd, t2a1_push_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a1_push_insn, s->contents + my_offset); - bfd_put_16 (output_bfd, t2a2_ldr_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a2_ldr_insn, s->contents + my_offset + 2); - bfd_put_16 (output_bfd, t2a3_mov_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a3_mov_insn, s->contents + my_offset + 4); - bfd_put_16 (output_bfd, t2a4_bx_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a4_bx_insn, s->contents + my_offset + 6); - bfd_put_32 (output_bfd, t2a5_pop_insn, + bfd_put_32 (output_bfd, (bfd_vma) t2a5_pop_insn, s->contents + my_offset + 8); - bfd_put_32 (output_bfd, t2a6_bx_insn, + bfd_put_32 (output_bfd, (bfd_vma) t2a6_bx_insn, s->contents + my_offset + 12); /* Store the address of the function in the last word of the stub. */ @@ -1472,18 +1505,19 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, s->contents + my_offset + 16); if (info->base_file) - arm_emit_base_file_entry (info, output_bfd, s, my_offset + 16); + arm_emit_base_file_entry (info, output_bfd, s, + my_offset + 16); } else { - bfd_put_16 (output_bfd, t2a1_bx_pc_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a1_bx_pc_insn, s->contents + my_offset); - bfd_put_16 (output_bfd, t2a2_noop_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a2_noop_insn, s->contents + my_offset + 2); ret_offset = - ((bfd_signed_vma) h_val) /* Address of destination of the stub */ + ((bfd_signed_vma) h_val) /* Address of destination of the stub. */ - ((bfd_signed_vma) (s->output_offset /* Offset from the start of the current section to the start of the stubs. */ + my_offset /* Offset of the start of this stub from the start of the stubs. */ @@ -1492,7 +1526,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, + 8); /* ARM branches work from the pc of the instruction + 8. */ bfd_put_32 (output_bfd, - t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), + (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), s->contents + my_offset + 4); } @@ -1513,9 +1547,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, - input_section->vma); bfd_put_32 (output_bfd, - insert_thumb_branch (tmp, ret_offset), - contents + rel->r_vaddr - - input_section->vma); + (bfd_vma) insert_thumb_branch (tmp, + ret_offset), + contents + rel->r_vaddr - input_section->vma); done = 1; } @@ -1555,7 +1589,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { /* Emit a reloc if the backend thinks it needs it. */ if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) - arm_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr); + arm_emit_base_file_entry (info, output_bfd, input_section, + rel->r_vaddr); } #if 1 /* THUMBEXTENSION */ @@ -1730,7 +1765,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, case bfd_reloc_outofrange: (*_bfd_error_handler) (_("%s: bad reloc address 0x%lx in section `%s'"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), (unsigned long) rel->r_vaddr, bfd_get_section_name (input_bfd, input_section)); return false; @@ -1787,10 +1822,10 @@ bfd_arm_allocate_interworking_sections (info) BFD_ASSERT (s != NULL); - foo = (bfd_byte *) bfd_alloc - (globals->bfd_of_glue_owner, globals->arm_glue_size); + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, + globals->arm_glue_size); #if 0 - memset (foo, test_char, globals->arm_glue_size); + memset (foo, test_char, (size_t) globals->arm_glue_size); #endif s->_raw_size = s->_cooked_size = globals->arm_glue_size; @@ -1806,10 +1841,10 @@ bfd_arm_allocate_interworking_sections (info) BFD_ASSERT (s != NULL); - foo = (bfd_byte *) bfd_alloc - (globals->bfd_of_glue_owner, globals->thumb_glue_size); + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, + globals->thumb_glue_size); #if 0 - memset (foo, test_char, globals->thumb_glue_size); + memset (foo, test_char, (size_t) globals->thumb_glue_size); #endif s->_raw_size = s->_cooked_size = globals->thumb_glue_size; @@ -1829,6 +1864,8 @@ record_arm_to_thumb_glue (info, h) char * tmp_name; struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; + bfd_vma val; + bfd_size_type amt; globals = coff_arm_hash_table (info); @@ -1840,8 +1877,8 @@ record_arm_to_thumb_glue (info, h) BFD_ASSERT (s != NULL); - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1)); + amt = strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1; + tmp_name = (char *) bfd_malloc (amt); BFD_ASSERT (tmp_name); @@ -1860,10 +1897,9 @@ record_arm_to_thumb_glue (info, h) though the section isn't allocated yet, this is where we will be putting it. */ + val = globals->arm_glue_size + 1; bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, - s, globals->arm_glue_size + 1, - NULL, true, false, + BSF_GLOBAL, s, val, NULL, true, false, (struct bfd_link_hash_entry **) & myh); free (tmp_name); @@ -1883,6 +1919,8 @@ record_thumb_to_arm_glue (info, h) char * tmp_name; struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; + bfd_vma val; + bfd_size_type amt; globals = coff_arm_hash_table (info); @@ -1894,7 +1932,8 @@ record_thumb_to_arm_glue (info, h) BFD_ASSERT (s != NULL); - tmp_name = (char *) bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1); + amt = strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1; + tmp_name = (char *) bfd_malloc (amt); BFD_ASSERT (tmp_name); @@ -1909,10 +1948,10 @@ record_thumb_to_arm_glue (info, h) return; /* we've already seen this guy */ } + val = globals->thumb_glue_size + 1; bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, s, globals->thumb_glue_size + 1, - NULL, true, false, - (struct bfd_link_hash_entry **) & myh); + BSF_GLOBAL, s, val, NULL, true, false, + (struct bfd_link_hash_entry **) &myh); /* If we mark it 'thumb', the disassembler will do a better job. */ myh->class = C_THUMBEXTFUNC; @@ -1924,18 +1963,17 @@ record_thumb_to_arm_glue (info, h) #define CHANGE_TO_ARM "__%s_change_to_arm" #define BACK_FROM_ARM "__%s_back_from_arm" - tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1); + amt = strlen (name) + strlen (CHANGE_TO_ARM) + 1; + tmp_name = (char *) bfd_malloc (amt); BFD_ASSERT (tmp_name); sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name); myh = NULL; - + val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4); bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_LOCAL, s, globals->thumb_glue_size - + (globals->support_old_code ? 8 : 4), - NULL, true, false, + BSF_LOCAL, s, val, NULL, true, false, (struct bfd_link_hash_entry **) & myh); free (tmp_name); @@ -2067,7 +2105,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) if (symndx >= obj_conv_table_size (abfd)) { _bfd_error_handler (_("%s: illegal symbol index in reloc: %d"), - bfd_get_filename (abfd), symndx); + bfd_archive_filename (abfd), symndx); continue; } @@ -2195,7 +2233,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) _bfd_error_handler /* xgettext: c-format */ (_("%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d"), - bfd_get_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32, + bfd_archive_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32, bfd_get_filename (obfd), APCS_26_FLAG (obfd) ? 26 : 32 ); @@ -2214,7 +2252,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) /* xgettext: c-format */ msg = _("%s: ERROR: passes floats in integer registers whereas target %s uses float registers"); - _bfd_error_handler (msg, bfd_get_filename (ibfd), + _bfd_error_handler (msg, bfd_archive_filename (ibfd), bfd_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); @@ -2231,7 +2269,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else /* xgettext: c-format */ msg = _("%s: ERROR: compiled as absolute position code, whereas target %s is position independent"); - _bfd_error_handler (msg, bfd_get_filename (ibfd), + _bfd_error_handler (msg, bfd_archive_filename (ibfd), bfd_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); @@ -2264,7 +2302,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) /* xgettext: c-format */ msg = _("Warning: input file %s does not support interworking, whereas %s does."); - _bfd_error_handler (msg, bfd_get_filename (ibfd), + _bfd_error_handler (msg, bfd_archive_filename (ibfd), bfd_get_filename (obfd)); } } @@ -2361,11 +2399,11 @@ _bfd_coff_arm_set_private_flags (abfd, flags) if (flag) /* xgettext: c-format */ _bfd_error_handler (_("Warning: Not setting interworking flag of %s, since it has already been specified as non-interworking"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); else /* xgettext: c-format */ _bfd_error_handler (_("Warning: Clearing the interworking flag of %s due to outside request"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); flag = 0; } @@ -2425,7 +2463,7 @@ coff_arm_copy_private_bfd_data (src, dest) /* xgettext:c-format */ _bfd_error_handler (("Warning: Clearing the interworking bit of %s, because the non-interworking code in %s has been copied into it"), bfd_get_filename (dest), - bfd_get_filename (src)); + bfd_archive_filename (src)); } SET_INTERWORK_FLAG (dest, 0); @@ -2471,7 +2509,7 @@ coff_arm_is_local_label_name (abfd, name) if (LOCAL_LABEL_PREFIX[0] != 0) { - int len = strlen (LOCAL_LABEL_PREFIX); + size_t len = strlen (LOCAL_LABEL_PREFIX); if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0) return false; diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c index 7d4ab5a..72c58a4 100644 --- a/contrib/binutils/bfd/coff-i386.c +++ b/contrib/binutils/bfd/coff-i386.c @@ -157,7 +157,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { short x = bfd_get_16 (abfd, addr); DOIT (x); - bfd_put_16 (abfd, x, addr); + bfd_put_16 (abfd, (bfd_vma) x, addr); } break; @@ -165,7 +165,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { long x = bfd_get_32 (abfd, addr); DOIT (x); - bfd_put_32 (abfd, x, addr); + bfd_put_32 (abfd, (bfd_vma) x, addr); } break; diff --git a/contrib/binutils/bfd/coff-ia64.c b/contrib/binutils/bfd/coff-ia64.c index 776d3fa..76d1bf6 100644 --- a/contrib/binutils/bfd/coff-ia64.c +++ b/contrib/binutils/bfd/coff-ia64.c @@ -52,6 +52,8 @@ static reloc_howto_type howto_table[] = /* Return true if this relocation should appear in the output .reloc section. */ +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); + static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; @@ -63,6 +65,8 @@ in_reloc_p(abfd, howto) #include "coffcode.h" +static const bfd_target *ia64coff_object_p PARAMS ((bfd *)); + static const bfd_target * ia64coff_object_p (abfd) bfd *abfd; @@ -73,9 +77,9 @@ ia64coff_object_p (abfd) struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; - if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 - || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd) - != sizeof (dos_hdr)) + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || (bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd) + != sizeof (dos_hdr))) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -92,23 +96,23 @@ ia64coff_object_p (abfd) this routine can only be called correctly for a PEI file, check the e_magic number here, and, if it doesn't match, clobber the f_magic number so that we don't get a false match. */ - if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC) + if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) { bfd_set_error (bfd_error_wrong_format); return NULL; } - offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew); - if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0 - || bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd) - != sizeof (image_hdr)) + offset = H_GET_32 (abfd, dos_hdr.e_lfanew); + if (bfd_seek (abfd, offset, SEEK_SET) != 0 + || (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd) + != sizeof (image_hdr))) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return NULL; } - if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature) + if (H_GET_32 (abfd, image_hdr.nt_signature) != 0x4550) { bfd_set_error (bfd_error_wrong_format); @@ -118,10 +122,7 @@ ia64coff_object_p (abfd) /* Here is the hack. coff_object_p wants to read filhsz bytes to pick up the COFF header for PE, see "struct external_PEI_filehdr" in include/coff/pe.h. We adjust so that that will work. */ - if (bfd_seek (abfd, - (file_ptr) (offset - sizeof (dos_hdr)), - SEEK_SET) - != 0) + if (bfd_seek (abfd, offset - sizeof (dos_hdr), SEEK_SET) != 0) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c index 2bf296a..f2bdfe5 100644 --- a/contrib/binutils/bfd/coff-ppc.c +++ b/contrib/binutils/bfd/coff-ppc.c @@ -202,9 +202,9 @@ ppc_coff_link_hash_table_create (abfd) bfd *abfd; { struct ppc_coff_link_hash_table *ret; + bfd_size_type amt = sizeof (struct ppc_coff_link_hash_table); - ret = ((struct ppc_coff_link_hash_table *) - bfd_alloc (abfd, sizeof (struct ppc_coff_link_hash_table))); + ret = (struct ppc_coff_link_hash_table *) bfd_alloc (abfd, amt); if (ret == NULL) return NULL; if (! ppc_coff_link_hash_table_init (ret, abfd, @@ -833,7 +833,7 @@ enum ref_category { priv, pub, - data + tocdata }; struct list_ele @@ -849,18 +849,19 @@ extern struct list_ele *head; extern struct list_ele *tail; static void record_toc - PARAMS ((asection *, int, enum ref_category, const char *)); + PARAMS ((asection *, bfd_signed_vma, enum ref_category, const char *)); static void record_toc (toc_section, our_toc_offset, cat, name) asection *toc_section; - int our_toc_offset; + bfd_signed_vma our_toc_offset; enum ref_category cat; const char *name; { /* add this entry to our toc addr-offset-name list */ - struct list_ele *t; - t = (struct list_ele *) bfd_malloc (sizeof (struct list_ele)); + bfd_size_type amt = sizeof (struct list_ele); + struct list_ele *t = (struct list_ele *) bfd_malloc (amt); + if (t == NULL) abort (); t->next = 0; @@ -916,16 +917,16 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) if (local_syms == 0) { unsigned int i; + bfd_size_type amt; /* allocate a table */ - local_syms = - (int *) bfd_zalloc (abfd, - obj_raw_syment_count(abfd) * sizeof (int)); + amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int); + local_syms = (int *) bfd_zalloc (abfd, amt); if (local_syms == 0) return false; - obj_coff_local_toc_table(abfd) = local_syms; - for (i = 0; i < obj_raw_syment_count(abfd); ++i) + obj_coff_local_toc_table (abfd) = local_syms; + for (i = 0; i < obj_raw_syment_count (abfd); ++i) { - SET_UNALLOCATED(local_syms[i]); + SET_UNALLOCATED (local_syms[i]); } } @@ -1194,12 +1195,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, default: (*_bfd_error_handler) (_("%s: unsupported relocation type 0x%02x"), - bfd_get_filename (input_bfd), r_type); + bfd_archive_filename (input_bfd), r_type); bfd_set_error (bfd_error_bad_value); return false; case IMAGE_REL_PPC_TOCREL16: { - bfd_vma our_toc_offset; + bfd_signed_vma our_toc_offset; int fixit; DUMP_RELOC2(howto->name, rel); @@ -1246,13 +1247,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, else { /* write out the toc entry */ - record_toc(toc_section, - our_toc_offset, - priv, - strdup(name)); + record_toc (toc_section, our_toc_offset, priv, + strdup (name)); - bfd_put_32 (output_bfd, - val, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); MARK_AS_WRITTEN(local_toc_table[symndx]); @@ -1282,21 +1280,22 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, the IAT to be part of the toc, thus saving a load. */ - our_toc_offset = val - - (toc_section->output_section->vma + - toc_section->output_offset); + our_toc_offset = val - (toc_section->output_section->vma + + toc_section->output_offset); /* The size must still fit in a 16bit displacment */ - if (our_toc_offset >= 65535) + if ((bfd_vma) our_toc_offset >= 65535) { (*_bfd_error_handler) - (_("%s: Relocation for %s of %x exceeds Toc size limit"), - bfd_get_filename (input_bfd), name, our_toc_offset); + (_("%s: Relocation for %s of %lx exceeds Toc size limit"), + bfd_archive_filename (input_bfd), name, + (unsigned long) our_toc_offset); bfd_set_error (bfd_error_bad_value); return false; } - record_toc(toc_section, our_toc_offset, pub, strdup(name)); + record_toc (toc_section, our_toc_offset, pub, + strdup (name)); } else if (IS_WRITTEN(our_toc_offset)) { @@ -1308,11 +1307,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } else { - record_toc(toc_section, our_toc_offset, pub, strdup(name)); + record_toc(toc_section, our_toc_offset, pub, + strdup (name)); /* write out the toc entry */ - bfd_put_32 (output_bfd, - val, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); MARK_AS_WRITTEN(h->toc_offset); @@ -1331,8 +1330,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, isn't absolute - we output the address here to a file */ - bfd_vma addr = toc_section->output_section->vma - + toc_section->output_offset + our_toc_offset; + bfd_vma addr = (toc_section->output_section->vma + + toc_section->output_offset + our_toc_offset); if (coff_data(output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; @@ -1341,23 +1340,20 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } /* FIXME: this test is conservative */ - if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN && - our_toc_offset > toc_section->_raw_size) + if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN + && (bfd_vma) our_toc_offset > toc_section->_raw_size) { (*_bfd_error_handler) - (_("%s: Relocation exceeds allocated TOC (%x)"), - bfd_get_filename (input_bfd), - toc_section->_raw_size); + (_("%s: Relocation exceeds allocated TOC (%lx)"), + bfd_archive_filename (input_bfd), + (unsigned long) toc_section->_raw_size); bfd_set_error (bfd_error_bad_value); return false; } /* Now we know the relocation for this toc reference */ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT; - rstat = _bfd_relocate_contents (howto, - input_bfd, - relocation, - loc); + rstat = _bfd_relocate_contents (howto, input_bfd, relocation, loc); } break; case IMAGE_REL_PPC_IFGLUE: @@ -1377,7 +1373,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (h->symbol_is_glue == 1) { x = bfd_get_32 (input_bfd, loc); - bfd_put_32 (input_bfd, h->glue_insn, loc); + bfd_put_32 (input_bfd, (bfd_vma) h->glue_insn, loc); } } } @@ -1406,7 +1402,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, fprintf (stderr, _("Warning: unsupported reloc %s \n"), howto->name, - bfd_get_filename(input_bfd), + bfd_archive_filename(input_bfd), input_section->name); fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", @@ -1425,14 +1421,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: Out of order IMGLUE reloc for %s"), - bfd_get_filename (input_bfd), my_name); + bfd_archive_filename (input_bfd), my_name); bfd_set_error (bfd_error_bad_value); return false; } case IMAGE_REL_PPC_ADDR32NB: { - struct coff_link_hash_entry *myh = 0; const char *name = 0; DUMP_RELOC2(howto->name, rel); @@ -1440,7 +1435,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, { /* set magic values */ int idata5offset; - struct coff_link_hash_entry *myh = 0; + struct coff_link_hash_entry *myh; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", false, false, true); @@ -1480,7 +1475,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (target != 0) { - myh = 0; + struct coff_link_hash_entry *myh; myh = coff_link_hash_lookup (coff_hash_table (info), target, @@ -1654,7 +1649,7 @@ dump_toc (vfile) cat = _("private "); else if (t->cat == pub) cat = _("public "); - else if (t->cat == data) + else if (t->cat == tocdata) cat = _("data-in-toc "); if (t->offset > global_toc_size) @@ -1665,7 +1660,8 @@ dump_toc (vfile) { fprintf (file, _("**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n"), - global_toc_size, global_toc_size, thunk_size, thunk_size); + global_toc_size, global_toc_size, + thunk_size, thunk_size); cat = _("Out of bounds!"); } } @@ -1687,6 +1683,7 @@ ppc_allocate_toc_section (info) { asection *s; bfd_byte *foo; + bfd_size_type amt; static char test_char = '1'; if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ @@ -1705,8 +1702,9 @@ ppc_allocate_toc_section (info) abort (); } - foo = (bfd_byte *) bfd_alloc(bfd_of_toc_owner, global_toc_size); - memset(foo, test_char, global_toc_size); + amt = global_toc_size; + foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt); + memset(foo, test_char, (size_t) global_toc_size); s->_raw_size = s->_cooked_size = global_toc_size; s->contents = foo; @@ -2178,10 +2176,6 @@ ppc_coff_reloc_type_lookup (abfd, code) #define RTYPE2HOWTO(cache_ptr, dst) ppc_coff_rtype2howto (cache_ptr, dst) -#ifndef COFF_IMAGE_WITH_PE -static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); -#endif - /* We use the special COFF backend linker, with our own special touch. */ #define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup @@ -2191,8 +2185,10 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); #ifndef COFF_IMAGE_WITH_PE /* FIXME: This no longer works. */ +#if 0 #define coff_swap_sym_in_hook ppc_coff_swap_sym_in_hook #endif +#endif #define SELECT_RELOC(internal, howto) {internal.r_type=howto->type;} @@ -2220,6 +2216,8 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); #include "coffcode.h" #ifndef COFF_IMAGE_WITH_PE +/* FIXME: This no longer works. */ +#if 0 /* FIXME: What we're trying to do here is allocate a toc section (early), and attach it to the last bfd to be processed. This avoids the problem of having a toc @@ -2233,6 +2231,7 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); 3. Doing it on a "swap in" hook depends on when the "swap in" is called, and how often, etc. It's not clear to me that there isn't a hole here. */ +static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); static void ppc_coff_swap_sym_in_hook (abfd, ext1, in1) @@ -2275,6 +2274,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) return; } #endif +#endif #ifndef COFF_IMAGE_WITH_PE @@ -2321,11 +2321,11 @@ ppc_bfd_coff_final_link (abfd, info) boolean debug_merge_allocated; asection *o; struct bfd_link_order *p; - size_t max_sym_count; - size_t max_lineno_count; - size_t max_reloc_count; - size_t max_output_reloc_count; - size_t max_contents_size; + bfd_size_type max_sym_count; + bfd_size_type max_lineno_count; + bfd_size_type max_reloc_count; + bfd_size_type max_output_reloc_count; + bfd_size_type max_contents_size; file_ptr rel_filepos; unsigned int relsz; file_ptr line_filepos; @@ -2333,6 +2333,7 @@ ppc_bfd_coff_final_link (abfd, info) bfd *sub; bfd_byte *external_relocs = NULL; char strbuf[STRING_SIZE_SIZE]; + bfd_size_type amt; symesz = bfd_coff_symesz (abfd); @@ -2433,10 +2434,9 @@ ppc_bfd_coff_final_link (abfd, info) /* We use section_count + 1, rather than section_count, because the target_index fields are 1 based. */ - finfo.section_info = - ((struct coff_link_section_info *) - bfd_malloc ((abfd->section_count + 1) - * sizeof (struct coff_link_section_info))); + amt = abfd->section_count + 1; + amt *= sizeof (struct coff_link_section_info); + finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt); if (finfo.section_info == NULL) goto error_return; for (i = 0; i <= abfd->section_count; i++) @@ -2477,13 +2477,14 @@ ppc_bfd_coff_final_link (abfd, info) but only when doing a relocateable link, which is not the common case. */ BFD_ASSERT (info->relocateable); + amt = o->reloc_count; + amt *= sizeof (struct internal_reloc); finfo.section_info[o->target_index].relocs = - ((struct internal_reloc *) - bfd_malloc (o->reloc_count * sizeof (struct internal_reloc))); + (struct internal_reloc *) bfd_malloc (amt); + amt = o->reloc_count; + amt *= sizeof (struct coff_link_hash_entry *); finfo.section_info[o->target_index].rel_hashes = - ((struct coff_link_hash_entry **) - bfd_malloc (o->reloc_count - * sizeof (struct coff_link_hash_entry *))); + (struct coff_link_hash_entry **) bfd_malloc (amt); if (finfo.section_info[o->target_index].relocs == NULL || finfo.section_info[o->target_index].rel_hashes == NULL) goto error_return; @@ -2506,7 +2507,7 @@ ppc_bfd_coff_final_link (abfd, info) max_sym_count = 0; for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { - size_t sz; + bfd_size_type sz; sub->output_has_begun = false; sz = obj_raw_syment_count (sub); @@ -2515,22 +2516,23 @@ ppc_bfd_coff_final_link (abfd, info) } /* Allocate some buffers used while linking. */ - finfo.internal_syms = ((struct internal_syment *) - bfd_malloc (max_sym_count - * sizeof (struct internal_syment))); - finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count - * sizeof (asection *)); - finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long)); - finfo.outsyms = ((bfd_byte *) - bfd_malloc ((size_t) ((max_sym_count + 1) * symesz))); - finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count - * bfd_coff_linesz (abfd)); + amt = max_sym_count * sizeof (struct internal_syment); + finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt); + amt = max_sym_count * sizeof (asection *); + finfo.sec_ptrs = (asection **) bfd_malloc (amt); + amt = max_sym_count * sizeof (long); + finfo.sym_indices = (long *) bfd_malloc (amt); + amt = (max_sym_count + 1) * symesz; + finfo.outsyms = (bfd_byte *) bfd_malloc (amt); + amt = max_lineno_count * bfd_coff_linesz (abfd); + finfo.linenos = (bfd_byte *) bfd_malloc (amt); finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz); if (! info->relocateable) - finfo.internal_relocs = ((struct internal_reloc *) - bfd_malloc (max_reloc_count - * sizeof (struct internal_reloc))); + { + amt = max_reloc_count * sizeof (struct internal_reloc); + finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); + } if ((finfo.internal_syms == NULL && max_sym_count > 0) || (finfo.sec_ptrs == NULL && max_sym_count > 0) || (finfo.sym_indices == NULL && max_sym_count > 0) @@ -2649,14 +2651,14 @@ ppc_bfd_coff_final_link (abfd, info) if (finfo.last_file_index != -1 && (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd)) { + file_ptr pos; + finfo.last_file.n_value = obj_raw_syment_count (abfd); bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file, (PTR) finfo.outsyms); - if (bfd_seek (abfd, - (obj_sym_filepos (abfd) - + finfo.last_file_index * symesz), - SEEK_SET) != 0 - || bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz) + pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz) return false; } @@ -2679,8 +2681,8 @@ ppc_bfd_coff_final_link (abfd, info) /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can finally write out the relocs. */ - external_relocs = ((bfd_byte *) - bfd_malloc (max_output_reloc_count * relsz)); + amt = max_output_reloc_count * relsz; + external_relocs = (bfd_byte *) bfd_malloc (amt); if (external_relocs == NULL) goto error_return; @@ -2708,9 +2710,9 @@ ppc_bfd_coff_final_link (abfd, info) bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel); } + amt = relsz * o->reloc_count; if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0 - || bfd_write ((PTR) external_relocs, relsz, o->reloc_count, - abfd) != relsz * o->reloc_count) + || bfd_bwrite ((PTR) external_relocs, amt, abfd) != amt) goto error_return; } @@ -2744,21 +2746,22 @@ ppc_bfd_coff_final_link (abfd, info) /* Write out the string table. */ if (obj_raw_syment_count (abfd) != 0) { - if (bfd_seek (abfd, - (obj_sym_filepos (abfd) - + obj_raw_syment_count (abfd) * symesz), - SEEK_SET) != 0) + file_ptr pos; + + pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz; + if (bfd_seek (abfd, pos, SEEK_SET) != 0) return false; #if STRING_SIZE_SIZE == 4 - bfd_h_put_32 (abfd, - _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE, - (bfd_byte *) strbuf); + H_PUT_32 (abfd, + _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE, + strbuf); #else - #error Change bfd_h_put_32 + #error Change H_PUT_32 above #endif - if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) + if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd) + != STRING_SIZE_SIZE) return false; if (! _bfd_stringtab_emit (abfd, finfo.strtab)) diff --git a/contrib/binutils/bfd/coff-rs6000.c b/contrib/binutils/bfd/coff-rs6000.c index ed47000..2d6d6e9 100644 --- a/contrib/binutils/bfd/coff-rs6000.c +++ b/contrib/binutils/bfd/coff-rs6000.c @@ -29,17 +29,123 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" +#include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" +#include "coff/xcoff.h" #include "coff/rs6000.h" #include "libcoff.h" -#define TARGET_NAME "aixcoff-rs6000" -#define TARGET_SYM rs6000coff_vec -#include "xcoff-target.h" +#include "libxcoff.h" + +extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *)); +extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *)); +extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *)); +extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *)); +extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *)); +extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); +extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +extern boolean _bfd_xcoff_write_armap + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean)); +extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); +extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + +/* Forward declare _bfd_xcoff_rtype2howto for coffcode.h macro. */ +void _bfd_xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); + +/* coffcode.h needs these to be defined. */ +#define RS6000COFF_C 1 + +#define SELECT_RELOC(internal, howto) \ + { \ + internal.r_type = howto->type; \ + internal.r_size = \ + ((howto->complain_on_overflow == complain_overflow_signed \ + ? 0x80 \ + : 0) \ + | (howto->bitsize - 1)); \ + } + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) +#define COFF_LONG_FILENAMES +#define NO_COFF_SYMBOLS +#define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst) +#define coff_mkobject _bfd_xcoff_mkobject +#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data +#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name +#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup +#ifdef AIX_CORE +extern const bfd_target * rs6000coff_core_p (); +extern boolean rs6000coff_core_file_matches_executable_p (); +extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); +extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +#define CORE_FILE_P rs6000coff_core_p +#define coff_core_file_failing_command \ + rs6000coff_core_file_failing_command +#define coff_core_file_failing_signal \ + rs6000coff_core_file_failing_signal +#define coff_core_file_matches_executable_p \ + rs6000coff_core_file_matches_executable_p +#else +#define CORE_FILE_P _bfd_dummy_target +#define coff_core_file_failing_command \ + _bfd_nocore_core_file_failing_command +#define coff_core_file_failing_signal \ + _bfd_nocore_core_file_failing_signal +#define coff_core_file_matches_executable_p \ + _bfd_nocore_core_file_matches_executable_p +#endif +#define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in +#define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out +#define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in +#define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out + +#include "coffcode.h" /* The main body of code is in coffcode.h. */ static const char *normalize_filename PARAMS ((bfd *)); +static boolean xcoff_write_armap_old + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +static boolean xcoff_write_armap_big + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +static boolean xcoff_write_archive_contents_old PARAMS ((bfd *)); +static boolean xcoff_write_archive_contents_big PARAMS ((bfd *)); +static void xcoff_swap_ldhdr_in + PARAMS ((bfd *, const PTR, struct internal_ldhdr *)); +static void xcoff_swap_ldhdr_out + PARAMS ((bfd *, const struct internal_ldhdr *, PTR)); +static void xcoff_swap_ldsym_in + PARAMS ((bfd *, const PTR, struct internal_ldsym *)); +static void xcoff_swap_ldsym_out + PARAMS ((bfd *, const struct internal_ldsym *, PTR)); +static void xcoff_swap_ldrel_in + PARAMS ((bfd *, const PTR, struct internal_ldrel *)); +static void xcoff_swap_ldrel_out + PARAMS ((bfd *, const struct internal_ldrel *, PTR)); +static boolean xcoff_ppc_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + struct internal_reloc *, struct internal_syment *, asection **)); +static boolean _bfd_xcoff_put_ldsymbol_name + PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, + const char *)); +static asection *xcoff_create_csect_from_smclas + PARAMS ((bfd *, union internal_auxent *, const char *)); +static boolean xcoff_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma)); +static boolean xcoff_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma)); +static bfd_vma xcoff_loader_symbol_offset + PARAMS ((bfd *, struct internal_ldhdr *)); +static bfd_vma xcoff_loader_reloc_offset + PARAMS ((bfd *, struct internal_ldhdr *)); +static boolean xcoff_generate_rtinit + PARAMS((bfd *, const char *, const char *)); + /* We use our own tdata type. Its first field is the COFF tdata type, so the COFF routines are compatible. */ @@ -49,10 +155,9 @@ _bfd_xcoff_mkobject (abfd) bfd *abfd; { coff_data_type *coff; + bfd_size_type amt = sizeof (struct xcoff_tdata); - abfd->tdata.xcoff_obj_data = - ((struct xcoff_tdata *) - bfd_zalloc (abfd, sizeof (struct xcoff_tdata))); + abfd->tdata.xcoff_obj_data = (struct xcoff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.xcoff_obj_data == NULL) return false; coff = coff_data (abfd); @@ -70,6 +175,9 @@ _bfd_xcoff_mkobject (abfd) xcoff_data (abfd)->csects = NULL; xcoff_data (abfd)->debug_indices = NULL; + /* text section alignment is different than the default */ + /* xcoff_data (abfd)->text_align_power = 5; */ + return true; } @@ -138,7 +246,7 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) PTR in1; { SYMENT *ext = (SYMENT *)ext1; - struct internal_syment *in = (struct internal_syment *)in1; + struct internal_syment * in = (struct internal_syment *)in1; if (ext->e.e_name[0] != 0) { @@ -147,15 +255,14 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) else { in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = - bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset); + in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e.e.e_offset); } - in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); - in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); - in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); - in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); + in->n_value = H_GET_32 (abfd, ext->e_value); + in->n_scnum = H_GET_16 (abfd, ext->e_scnum); + in->n_type = H_GET_16 (abfd, ext->e_type); + in->n_sclass = H_GET_8 (abfd, ext->e_sclass); + in->n_numaux = H_GET_8 (abfd, ext->e_numaux); } unsigned int @@ -173,26 +280,18 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp) } else { - bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); - bfd_h_put_32(abfd, in->_n._n_n._n_offset, - (bfd_byte *) ext->e.e.e_offset); + H_PUT_32 (abfd, 0, ext->e.e.e_zeroes); + H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); } - bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value); - bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); - bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); - bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + H_PUT_32 (abfd, in->n_value, ext->e_value); + H_PUT_16 (abfd, in->n_scnum, ext->e_scnum); + H_PUT_16 (abfd, in->n_type, ext->e_type); + H_PUT_8 (abfd, in->n_sclass, ext->e_sclass); + H_PUT_8 (abfd, in->n_numaux, ext->e_numaux); return bfd_coff_symesz (abfd); } -#define PUTWORD bfd_h_put_32 -#define PUTHALF bfd_h_put_16 -#define PUTBYTE bfd_h_put_8 -#define GETWORD bfd_h_get_32 -#define GETHALF bfd_h_get_16 -#define GETBYTE bfd_h_get_8 - void _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) bfd *abfd; @@ -203,27 +302,31 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) int numaux; PTR in1; { - AUXENT *ext = (AUXENT *)ext1; + AUXENT * ext = (AUXENT *)ext1; union internal_auxent *in = (union internal_auxent *)in1; - switch (class) { + switch (class) + { case C_FILE: - if (ext->x_file.x_fname[0] == 0) { + if (ext->x_file.x_fname[0] == 0) + { in->x_file.x_n.x_zeroes = 0; in->x_file.x_n.x_offset = - bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); - } else { - if (numaux > 1) - { - if (indx == 0) - memcpy (in->x_file.x_fname, ext->x_file.x_fname, - numaux * sizeof (AUXENT)); - } - else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } - } + H_GET_32 (abfd, ext->x_file.x_n.x_offset); + } + else + { + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + } goto end; /* RS/6000 "csect" auxents */ @@ -231,18 +334,16 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) case C_HIDEXT: if (indx + 1 == numaux) { - in->x_csect.x_scnlen.l = - bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); - in->x_csect.x_parmhash = bfd_h_get_32 (abfd, - ext->x_csect.x_parmhash); - in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); + in->x_csect.x_scnlen.l = H_GET_32 (abfd, ext->x_csect.x_scnlen); + in->x_csect.x_parmhash = H_GET_32 (abfd, ext->x_csect.x_parmhash); + in->x_csect.x_snhash = H_GET_16 (abfd, ext->x_csect.x_snhash); /* We don't have to hack bitfields in x_smtyp because it's defined by shifts-and-ands, which are equivalent on all byte orders. */ - in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); - 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); + in->x_csect.x_smtyp = H_GET_8 (abfd, ext->x_csect.x_smtyp); + in->x_csect.x_smclas = H_GET_8 (abfd, ext->x_csect.x_smclas); + in->x_csect.x_stab = H_GET_32 (abfd, ext->x_csect.x_stab); + in->x_csect.x_snstab = H_GET_16 (abfd, ext->x_csect.x_snstab); goto end; } break; @@ -250,13 +351,11 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) case C_STAT: case C_LEAFSTAT: case C_HIDDEN: - if (type == T_NULL) { - in->x_scn.x_scnlen = bfd_h_get_32(abfd, - (bfd_byte *) ext->x_scn.x_scnlen); - in->x_scn.x_nreloc = bfd_h_get_16(abfd, - (bfd_byte *) ext->x_scn.x_nreloc); - in->x_scn.x_nlinno = bfd_h_get_16(abfd, - (bfd_byte *) ext->x_scn.x_nlinno); + if (type == T_NULL) + { + in->x_scn.x_scnlen = H_GET_32 (abfd, ext->x_scn.x_scnlen); + in->x_scn.x_nreloc = H_GET_16 (abfd, ext->x_scn.x_nreloc); + in->x_scn.x_nlinno = H_GET_16 (abfd, ext->x_scn.x_nlinno); /* PE defines some extra fields; we zero them out for safety. */ in->x_scn.x_checksum = 0; @@ -268,52 +367,57 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) break; } - in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); - in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); + in->x_sym.x_tagndx.l = H_GET_32 (abfd, ext->x_sym.x_tagndx); + in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { - in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_32(abfd, (bfd_byte *) - ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *) - ext->x_sym.x_fcnary.x_fcn.x_endndx); + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = + H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = + H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx); } else { in->x_sym.x_fcnary.x_ary.x_dimen[0] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]); in->x_sym.x_fcnary.x_ary.x_dimen[1] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]); in->x_sym.x_fcnary.x_ary.x_dimen[2] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]); in->x_sym.x_fcnary.x_ary.x_dimen[3] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); - } - else { - in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *) - ext->x_sym.x_misc.x_lnsz.x_lnno); - in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) - ext->x_sym.x_misc.x_lnsz.x_size); - } -end: ; - /* the semicolon is because MSVC doesn't like labels at - end of block. */ + if (ISFCN (type)) + { + in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize); + } + else + { + in->x_sym.x_misc.x_lnsz.x_lnno = + H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = + H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size); + } + end: ; + /* The semicolon is because MSVC doesn't like labels at + end of block. */ } + +unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + unsigned int _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) - bfd *abfd; - PTR inp; + bfd * abfd; + PTR inp; int type; int class; int indx ATTRIBUTE_UNUSED; int numaux ATTRIBUTE_UNUSED; - PTR extp; + PTR extp; { union internal_auxent *in = (union internal_auxent *)inp; AUXENT *ext = (AUXENT *)extp; @@ -321,87 +425,87 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); switch (class) { - case C_FILE: - if (in->x_file.x_fname[0] == 0) - { - PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); - PUTWORD(abfd, - in->x_file.x_n.x_offset, - (bfd_byte *) ext->x_file.x_n.x_offset); - } - else - { - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); - } - goto end; - - /* RS/6000 "csect" auxents */ - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen); - PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); - PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); - 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); - goto end; - } - break; - - case C_STAT: - case C_LEAFSTAT: - case C_HIDDEN: - if (type == T_NULL) { - bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen); - bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc); - bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno); + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + H_PUT_32 (abfd, 0, ext->x_file.x_n.x_zeroes); + H_PUT_32 (abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + H_PUT_32 (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen); + H_PUT_32 (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + H_PUT_16 (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + H_PUT_8 (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + H_PUT_8 (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + H_PUT_32 (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); + H_PUT_16 (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) + { + H_PUT_32 (abfd, in->x_scn.x_scnlen, ext->x_scn.x_scnlen); + H_PUT_16 (abfd, in->x_scn.x_nreloc, ext->x_scn.x_nreloc); + H_PUT_16 (abfd, in->x_scn.x_nlinno, ext->x_scn.x_nlinno); + goto end; + } + break; } - break; - } - PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); - bfd_h_put_16 (abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); + H_PUT_32 (abfd, in->x_sym.x_tagndx.l, ext->x_sym.x_tagndx); + H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { - bfd_h_put_32(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, - (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, - (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + H_PUT_32 (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + H_PUT_32 (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + ext->x_sym.x_fcnary.x_fcn.x_endndx); } else { - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } if (ISFCN (type)) - PUTWORD (abfd, in->x_sym.x_misc.x_fsize, - (bfd_byte *) ext->x_sym.x_misc.x_fsize); + H_PUT_32 (abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize); else { - bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, - (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno); - bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, - (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size); + H_PUT_16 (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + ext->x_sym.x_misc.x_lnsz.x_lnno); + H_PUT_16 (abfd, in->x_sym.x_misc.x_lnsz.x_size, + ext->x_sym.x_misc.x_lnsz.x_size); } end: return bfd_coff_auxesz (abfd); } + + /* The XCOFF reloc table. Actually, XCOFF relocations specify the bitsize and whether they are signed or not, along with a @@ -409,9 +513,6 @@ end: different algorithms for putting in the reloc. Many of these relocs need special_function entries, which I have not written. */ -/* In case we're on a 32-bit machine, construct a 64-bit "-1" value - from smaller values. Start with zero, widen, *then* decrement. */ -#define MINUS_ONE (((bfd_vma)0) - 1) reloc_howto_type xcoff_howto_table[] = { @@ -755,6 +856,7 @@ reloc_howto_type xcoff_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ + HOWTO (0, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ @@ -771,55 +873,6 @@ reloc_howto_type xcoff_howto_table[] = }; -/* These are the first two like the above but for 16-bit relocs. */ -static reloc_howto_type xcoff_howto_table_16[] = -{ - /* Standard 16 bit relocation. */ - HOWTO (0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_POS_16", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit relocation, but store negative value. */ - HOWTO (1, /* type */ - 0, /* rightshift */ - -2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_NEG_16", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit PC relative relocation. */ - HOWTO (2, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_REL_16", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false) /* pcrel_offset */ - }; - void _bfd_xcoff_rtype2howto (relent, internal) arelent *relent; @@ -827,10 +880,12 @@ _bfd_xcoff_rtype2howto (relent, internal) { relent->howto = xcoff_howto_table + internal->r_type; - if (relent->howto->bitsize != ((unsigned int) internal->r_size & 0x1f) + 1 - && (internal->r_type - < sizeof (xcoff_howto_table_16)/sizeof (xcoff_howto_table_16[0]))) - relent->howto = xcoff_howto_table_16 + internal->r_type; + /* Check for relocs we don't know of. */ + if (internal->r_type + >= sizeof (xcoff_howto_table) / sizeof (xcoff_howto_table[0])) + abort (); + if (internal->r_type != relent->howto->type) + abort (); /* The r_size field of an XCOFF reloc encodes the bitsize of the relocation, as well as indicating whether it is signed or not. @@ -871,6 +926,7 @@ _bfd_xcoff_reloc_type_lookup (abfd, code) return NULL; } } + /* XCOFF archive support. The original version of this code was by Damon A. Permezel. It was enhanced to permit cross support, and @@ -917,168 +973,7 @@ _bfd_xcoff_reloc_type_lookup (abfd, code) /* XCOFF archives use this as a magic string. Note that both strings have the same length. */ -#define XCOFFARMAG "\012" -#define XCOFFARMAGBIG "\012" -#define SXCOFFARMAG 8 - -/* This terminates an XCOFF archive member name. */ - -#define XCOFFARFMAG "`\012" -#define SXCOFFARFMAG 2 - -/* XCOFF archives start with this (printable) structure. */ - -struct xcoff_ar_file_hdr -{ - /* Magic string. */ - char magic[SXCOFFARMAG]; - - /* Offset of the member table (decimal ASCII string). */ - char memoff[12]; - - /* Offset of the global symbol table (decimal ASCII string). */ - char symoff[12]; - - /* Offset of the first member in the archive (decimal ASCII string). */ - char firstmemoff[12]; - - /* Offset of the last member in the archive (decimal ASCII string). */ - char lastmemoff[12]; - - /* Offset of the first member on the free list (decimal ASCII - string). */ - char freeoff[12]; -}; - -#define SIZEOF_AR_FILE_HDR (5 * 12 + SXCOFFARMAG) - -/* This is the equivalent data structure for the big archive format. */ - -struct xcoff_ar_file_hdr_big -{ - /* Magic string. */ - char magic[SXCOFFARMAG]; - - /* Offset of the member table (decimal ASCII string). */ - char memoff[20]; - - /* Offset of the global symbol table for 32-bit objects (decimal ASCII - string). */ - char symoff[20]; - - /* Offset of the global symbol table for 64-bit objects (decimal ASCII - string). */ - char symoff64[20]; - - /* Offset of the first member in the archive (decimal ASCII string). */ - char firstmemoff[20]; - - /* Offset of the last member in the archive (decimal ASCII string). */ - char lastmemoff[20]; - - /* Offset of the first member on the free list (decimal ASCII - string). */ - char freeoff[20]; -}; - -#define SIZEOF_AR_FILE_HDR_BIG (6 * 20 + SXCOFFARMAG) - -/* Each XCOFF archive member starts with this (printable) structure. */ - -struct xcoff_ar_hdr -{ - /* File size not including the header (decimal ASCII string). */ - char size[12]; - - /* File offset of next archive member (decimal ASCII string). */ - char nextoff[12]; - - /* File offset of previous archive member (decimal ASCII string). */ - char prevoff[12]; - - /* File mtime (decimal ASCII string). */ - char date[12]; - - /* File UID (decimal ASCII string). */ - char uid[12]; - - /* File GID (decimal ASCII string). */ - char gid[12]; - - /* File mode (octal ASCII string). */ - char mode[12]; - - /* Length of file name (decimal ASCII string). */ - char namlen[4]; - - /* This structure is followed by the file name. The length of the - name is given in the namlen field. If the length of the name is - odd, the name is followed by a null byte. The name and optional - null byte are followed by XCOFFARFMAG, which is not included in - namlen. The contents of the archive member follow; the number of - bytes is given in the size field. */ -}; - -#define SIZEOF_AR_HDR (7 * 12 + 4) - -/* The equivalent for the big archive format. */ - -struct xcoff_ar_hdr_big -{ - /* File size not including the header (decimal ASCII string). */ - char size[20]; - - /* File offset of next archive member (decimal ASCII string). */ - char nextoff[20]; - - /* File offset of previous archive member (decimal ASCII string). */ - char prevoff[20]; - - /* File mtime (decimal ASCII string). */ - char date[12]; - - /* File UID (decimal ASCII string). */ - char uid[12]; - - /* File GID (decimal ASCII string). */ - char gid[12]; - - /* File mode (octal ASCII string). */ - char mode[12]; - - /* Length of file name (decimal ASCII string). */ - char namlen[4]; - /* This structure is followed by the file name. The length of the - name is given in the namlen field. If the length of the name is - odd, the name is followed by a null byte. The name and optional - null byte are followed by XCOFFARFMAG, which is not included in - namlen. The contents of the archive member follow; the number of - bytes is given in the size field. */ -}; - -#define SIZEOF_AR_HDR_BIG (3 * 20 + 4 * 12 + 4) - -/* We often have to distinguish between the old and big file format. - Make it a bit cleaner. We can use `xcoff_ardata' here because the - `hdr' member has the same size and position in both formats. */ -#define xcoff_big_format_p(abfd) \ - (xcoff_ardata (abfd)->magic[1] == 'b') - -/* We store a copy of the xcoff_ar_file_hdr in the tdata field of the - artdata structure. Similar for the big archive. */ -#define xcoff_ardata(abfd) \ - ((struct xcoff_ar_file_hdr *) bfd_ardata (abfd)->tdata) -#define xcoff_ardata_big(abfd) \ - ((struct xcoff_ar_file_hdr_big *) bfd_ardata (abfd)->tdata) - -/* We store a copy of the xcoff_ar_hdr in the arelt_data field of an - archive element. Similar for the big archive. */ -#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) -#define arch_xhdr(bfd) \ - ((struct xcoff_ar_hdr *) arch_eltdata (bfd)->arch_header) -#define arch_xhdr_big(bfd) \ - ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header) /* Read in the armap of an XCOFF archive. */ @@ -1116,12 +1011,14 @@ _bfd_xcoff_slurp_armap (abfd) return false; /* The symbol table starts with a normal archive header. */ - if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR) + if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd) + != SIZEOF_AR_HDR) return false; /* Skip the name (normally empty). */ namlen = strtol (hdr.namlen, (char **) NULL, 10); - if (bfd_seek (abfd, ((namlen + 1) & ~1) + SXCOFFARFMAG, SEEK_CUR) != 0) + off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG; + if (bfd_seek (abfd, off, SEEK_CUR) != 0) return false; sz = strtol (hdr.size, (char **) NULL, 10); @@ -1130,11 +1027,11 @@ _bfd_xcoff_slurp_armap (abfd) contents = (bfd_byte *) bfd_alloc (abfd, sz); if (contents == NULL) return false; - if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + if (bfd_bread ((PTR) contents, sz, abfd) != sz) return false; /* The symbol table starts with a four byte count. */ - c = bfd_h_get_32 (abfd, contents); + c = H_GET_32 (abfd, contents); if (c * 4 >= sz) { @@ -1142,8 +1039,8 @@ _bfd_xcoff_slurp_armap (abfd) return false; } - bfd_ardata (abfd)->symdefs = ((carsym *) - bfd_alloc (abfd, c * sizeof (carsym))); + bfd_ardata (abfd)->symdefs = + ((carsym *) bfd_alloc (abfd, c * sizeof (carsym))); if (bfd_ardata (abfd)->symdefs == NULL) return false; @@ -1151,7 +1048,7 @@ _bfd_xcoff_slurp_armap (abfd) for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 4; i < c; ++i, ++arsym, p += 4) - arsym->file_offset = bfd_h_get_32 (abfd, p); + arsym->file_offset = H_GET_32 (abfd, p); } else { @@ -1169,13 +1066,14 @@ _bfd_xcoff_slurp_armap (abfd) return false; /* The symbol table starts with a normal archive header. */ - if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) + if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) return false; /* Skip the name (normally empty). */ namlen = strtol (hdr.namlen, (char **) NULL, 10); - if (bfd_seek (abfd, ((namlen + 1) & ~1) + SXCOFFARFMAG, SEEK_CUR) != 0) + off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG; + if (bfd_seek (abfd, off, SEEK_CUR) != 0) return false; /* XXX This actually has to be a call to strtoll (at least on 32-bit @@ -1187,11 +1085,11 @@ _bfd_xcoff_slurp_armap (abfd) contents = (bfd_byte *) bfd_alloc (abfd, sz); if (contents == NULL) return false; - if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + if (bfd_bread ((PTR) contents, sz, abfd) != sz) return false; /* The symbol table starts with an eight byte count. */ - c = bfd_h_get_64 (abfd, contents); + c = H_GET_64 (abfd, contents); if (c * 8 >= sz) { @@ -1199,8 +1097,8 @@ _bfd_xcoff_slurp_armap (abfd) return false; } - bfd_ardata (abfd)->symdefs = ((carsym *) - bfd_alloc (abfd, c * sizeof (carsym))); + bfd_ardata (abfd)->symdefs = + ((carsym *) bfd_alloc (abfd, c * sizeof (carsym))); if (bfd_ardata (abfd)->symdefs == NULL) return false; @@ -1208,7 +1106,7 @@ _bfd_xcoff_slurp_armap (abfd) for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 8; i < c; ++i, ++arsym, p += 8) - arsym->file_offset = bfd_h_get_64 (abfd, p); + arsym->file_offset = H_GET_64 (abfd, p); } /* After the file offsets come null terminated symbol names. */ @@ -1238,8 +1136,9 @@ _bfd_xcoff_archive_p (abfd) bfd *abfd; { char magic[SXCOFFARMAG]; + bfd_size_type amt; - if (bfd_read ((PTR) magic, SXCOFFARMAG, 1, abfd) != SXCOFFARMAG) + if (bfd_bread ((PTR) magic, (bfd_size_type) SXCOFFARMAG, abfd) != SXCOFFARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1256,9 +1155,8 @@ _bfd_xcoff_archive_p (abfd) /* We are setting bfd_ardata(abfd) here, but since bfd_ardata involves a cast, we can't do it as the left operand of assignment. */ - abfd->tdata.aout_ar_data = - (struct artdata *) bfd_zalloc (abfd, sizeof (struct artdata)); - + amt = sizeof (struct artdata); + abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == (struct artdata *) NULL) return NULL; @@ -1277,8 +1175,9 @@ _bfd_xcoff_archive_p (abfd) memcpy (hdr.magic, magic, SXCOFFARMAG); /* Now read the rest of the file header. */ - if (bfd_read ((PTR) &hdr.memoff, SIZEOF_AR_FILE_HDR - SXCOFFARMAG, 1, - abfd) != SIZEOF_AR_FILE_HDR - SXCOFFARMAG) + if (bfd_bread ((PTR) &hdr.memoff, + (bfd_size_type) SIZEOF_AR_FILE_HDR - SXCOFFARMAG, abfd) + != SIZEOF_AR_FILE_HDR - SXCOFFARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1288,7 +1187,8 @@ _bfd_xcoff_archive_p (abfd) bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, (char **) NULL, 10); - bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, SIZEOF_AR_FILE_HDR); + amt = SIZEOF_AR_FILE_HDR; + bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->tdata == NULL) return NULL; @@ -1303,8 +1203,9 @@ _bfd_xcoff_archive_p (abfd) memcpy (hdr.magic, magic, SXCOFFARMAG); /* Now read the rest of the file header. */ - if (bfd_read ((PTR) &hdr.memoff, SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG, 1, - abfd) != SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG) + if (bfd_bread ((PTR) &hdr.memoff, + (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG, abfd) + != SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1317,7 +1218,8 @@ _bfd_xcoff_archive_p (abfd) bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, (char **) NULL, 10); - bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, SIZEOF_AR_FILE_HDR_BIG); + amt = SIZEOF_AR_FILE_HDR_BIG; + bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->tdata == NULL) return NULL; @@ -1340,10 +1242,11 @@ PTR _bfd_xcoff_read_ar_hdr (abfd) bfd *abfd; { - size_t namlen; + bfd_size_type namlen; struct areltdata *ret; + bfd_size_type amt = sizeof (struct areltdata); - ret = (struct areltdata *) bfd_alloc (abfd, sizeof (struct areltdata)); + ret = (struct areltdata *) bfd_alloc (abfd, amt); if (ret == NULL) return NULL; @@ -1352,22 +1255,23 @@ _bfd_xcoff_read_ar_hdr (abfd) struct xcoff_ar_hdr hdr; struct xcoff_ar_hdr *hdrp; - if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR) + if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd) + != SIZEOF_AR_HDR) { free (ret); return NULL; } namlen = strtol (hdr.namlen, (char **) NULL, 10); - hdrp = (struct xcoff_ar_hdr *) bfd_alloc (abfd, - SIZEOF_AR_HDR + namlen + 1); + amt = SIZEOF_AR_HDR + namlen + 1; + hdrp = (struct xcoff_ar_hdr *) bfd_alloc (abfd, amt); if (hdrp == NULL) { free (ret); return NULL; } memcpy (hdrp, &hdr, SIZEOF_AR_HDR); - if (bfd_read ((char *) hdrp + SIZEOF_AR_HDR, 1, namlen, abfd) != namlen) + if (bfd_bread ((char *) hdrp + SIZEOF_AR_HDR, namlen, abfd) != namlen) { free (ret); return NULL; @@ -1383,7 +1287,7 @@ _bfd_xcoff_read_ar_hdr (abfd) struct xcoff_ar_hdr_big hdr; struct xcoff_ar_hdr_big *hdrp; - if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) + if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) { free (ret); @@ -1391,16 +1295,15 @@ _bfd_xcoff_read_ar_hdr (abfd) } namlen = strtol (hdr.namlen, (char **) NULL, 10); - hdrp = (struct xcoff_ar_hdr_big *) bfd_alloc (abfd, - SIZEOF_AR_HDR_BIG - + namlen + 1); + amt = SIZEOF_AR_HDR_BIG + namlen + 1; + hdrp = (struct xcoff_ar_hdr_big *) bfd_alloc (abfd, amt); if (hdrp == NULL) { free (ret); return NULL; } memcpy (hdrp, &hdr, SIZEOF_AR_HDR_BIG); - if (bfd_read ((char *) hdrp + SIZEOF_AR_HDR_BIG, 1, namlen, abfd) != namlen) + if (bfd_bread ((char *) hdrp + SIZEOF_AR_HDR_BIG, namlen, abfd) != namlen) { free (ret); return NULL; @@ -1416,7 +1319,7 @@ _bfd_xcoff_read_ar_hdr (abfd) } /* Skip over the XCOFFARFMAG at the end of the file name. */ - if (bfd_seek (abfd, (namlen & 1) + SXCOFFARFMAG, SEEK_CUR) != 0) + if (bfd_seek (abfd, (file_ptr) ((namlen & 1) + SXCOFFARFMAG), SEEK_CUR) != 0) return NULL; return (PTR) ret; @@ -1540,6 +1443,7 @@ normalize_filename (abfd) /* Write out an XCOFF armap. */ +/*ARGSUSED*/ static boolean xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) bfd *abfd; @@ -1558,7 +1462,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) memset (&hdr, 0, sizeof hdr); sprintf (hdr.size, "%ld", (long) (4 + orl_count * 4 + stridx)); sprintf (hdr.nextoff, "%d", 0); - memcpy (hdr.prevoff, xcoff_ardata (abfd)->memoff, 12); + memcpy (hdr.prevoff, xcoff_ardata (abfd)->memoff, XCOFFARMAG_ELEMENT_SIZE); sprintf (hdr.date, "%d", 0); sprintf (hdr.uid, "%d", 0); sprintf (hdr.gid, "%d", 0); @@ -1570,12 +1474,14 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) if (*p == '\0') *p = ' '; - if (bfd_write ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR - || bfd_write (XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) != SXCOFFARFMAG) + if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd) + != SIZEOF_AR_HDR + || (bfd_bwrite (XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) + != SXCOFFARFMAG)) return false; - bfd_h_put_32 (abfd, orl_count, buf); - if (bfd_write (buf, 1, 4, abfd) != 4) + H_PUT_32 (abfd, orl_count, buf); + if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) return false; sub = abfd->archive_head; @@ -1585,15 +1491,15 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) { size_t namlen; - while (((bfd *) (map[i]).pos) == sub) + while (map[i].u.abfd == sub) { - bfd_h_put_32 (abfd, fileoff, buf); - if (bfd_write (buf, 1, 4, abfd) != 4) + H_PUT_32 (abfd, fileoff, buf); + if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) return false; ++i; } namlen = strlen (normalize_filename (sub)); - namlen = (namlen + 1) &~ 1; + namlen = (namlen + 1) &~ (size_t) 1; fileoff += (SIZEOF_AR_HDR + namlen + SXCOFFARFMAG @@ -1609,7 +1515,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) name = *map[i].name; namlen = strlen (name); - if (bfd_write (name, 1, namlen + 1, abfd) != namlen + 1) + if (bfd_bwrite (name, (bfd_size_type) (namlen + 1), abfd) != namlen + 1) return false; } @@ -1618,183 +1524,321 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) char b; b = '\0'; - if (bfd_write (&b, 1, 1, abfd) != 1) + if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) return false; } return true; } -/* Write a single armap in the big format. */ +static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; +#define FMT20 "%-20lld" +#define FMT12 "%-12d" +#define FMT12_OCTAL "%-12o" +#define FMT4 "%-4d" +#define PRINT20(d, v) \ + sprintf (buff20, FMT20, (long long)(v)), \ + memcpy ((void *) (d), buff20, 20) + +#define PRINT12(d, v) \ + sprintf (buff20, FMT12, (int)(v)), \ + memcpy ((void *) (d), buff20, 12) + +#define PRINT12_OCTAL(d, v) \ + sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ + memcpy ((void *) (d), buff20, 12) + +#define PRINT4(d, v) \ + sprintf (buff20, FMT4, (int)(v)), \ + memcpy ((void *) (d), buff20, 4) + +#define READ20(d, v) \ + buff20[20] = 0, \ + memcpy (buff20, (d), 20), \ + (v) = bfd_scan_vma (buff20, (const char **) NULL, 10) + static boolean -xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64, - prevoff, nextoff) +xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd *abfd; + unsigned int elength ATTRIBUTE_UNUSED; struct orl *map; unsigned int orl_count; - unsigned int orl_ccount; - unsigned int stridx; - int bits64; - const char *prevoff; - char *nextoff; + int stridx; { - struct xcoff_ar_hdr_big hdr; - char *p; - unsigned char buf[4]; + struct xcoff_ar_file_hdr_big *fhdr; + bfd_vma i, sym_32, sym_64, str_32, str_64; const bfd_arch_info_type *arch_info = NULL; - bfd *sub; - file_ptr fileoff; - bfd *object_bfd; - unsigned int i; + bfd *current_bfd; + size_t string_length; + ufile_ptr nextoff, prevoff; + + /* First, we look through the symbols and work out which are + from 32-bit objects and which from 64-bit ones. */ + sym_32 = sym_64 = str_32 = str_64 = 0; - memset (&hdr, 0, sizeof hdr); - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (hdr.size, "%ld", (long) (4 + orl_ccount * 4 + stridx)); - if (bits64) - sprintf (hdr.nextoff, "%d", 0); - else - sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10) - + 4 + orl_ccount * 4 + stridx)); - memcpy (hdr.prevoff, prevoff, sizeof (hdr.prevoff)); - sprintf (hdr.date, "%d", 0); - sprintf (hdr.uid, "%d", 0); - sprintf (hdr.gid, "%d", 0); - sprintf (hdr.mode, "%d", 0); - sprintf (hdr.namlen, "%d", 0); + current_bfd = abfd->archive_head; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + i = 0; + while (current_bfd != NULL && i < orl_count) + { + while (map[i].u.abfd == current_bfd) + { + string_length = strlen (*map[i].name) + 1; - /* We need spaces, not null bytes, in the header. */ - for (p = (char *) &hdr; p < (char *) &hdr + SIZEOF_AR_HDR_BIG; p++) - if (*p == '\0') - *p = ' '; + if (arch_info->bits_per_address == 64) + { + sym_64++; + str_64 += string_length; + } + else + { + sym_32++; + str_32 += string_length; + } + i++; + } + current_bfd = current_bfd->next; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + } - memcpy (nextoff, hdr.nextoff, sizeof (hdr.nextoff)); + /* A quick sanity check... */ + BFD_ASSERT (sym_64 + sym_32 == orl_count); + /* Explicit cast to int for compiler. */ + BFD_ASSERT ((int)(str_64 + str_32) == stridx); - if (bfd_write ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) != SIZEOF_AR_HDR_BIG - || bfd_write (XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) != SXCOFFARFMAG) - return false; + fhdr = xcoff_ardata_big (abfd); - bfd_h_put_32 (abfd, orl_ccount, buf); - if (bfd_write (buf, 1, 4, abfd) != 4) - return false; + /* xcoff_write_archive_contents_big passes nextoff in symoff. */ + READ20 (fhdr->memoff, prevoff); + READ20 (fhdr->symoff, nextoff); - sub = abfd->archive_head; - fileoff = SIZEOF_AR_FILE_HDR_BIG; - i = 0; - while (sub != NULL && i < orl_count) - { - size_t namlen; + BFD_ASSERT (nextoff == bfd_tell (abfd)); - if ((bfd_arch_bits_per_address ((bfd *) map[i].pos) == 64) == bits64) - while (((bfd *) (map[i]).pos) == sub) - { - bfd_h_put_32 (abfd, fileoff, buf); - if (bfd_write (buf, 1, 4, abfd) != 4) - return false; - i++; - } + /* Write out the symbol table. + Layout : + + standard big archive header + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [SXCOFFARFMAG] + + Symbol table + 0x0072 num_syms [0x08], binary + 0x0078 offsets [0x08 * num_syms], binary + 0x0086 + 0x08 * num_syms names [??] + ?? pad to even bytes. + */ + + if (sym_32) + { + struct xcoff_ar_hdr_big *hdr; + bfd_byte *symbol_table; + bfd_byte *st; + file_ptr fileoff; + + bfd_vma symbol_table_size = + SIZEOF_AR_HDR_BIG + + SXCOFFARFMAG + + 8 + + 8 * sym_32 + + str_32 + (str_32 & 1); + + symbol_table = NULL; + symbol_table = (bfd_byte *) bfd_malloc (symbol_table_size); + if (symbol_table == NULL) + return false; + memset (symbol_table, 0, symbol_table_size); + + hdr = (struct xcoff_ar_hdr_big *) symbol_table; + + PRINT20 (hdr->size, 8 + 8 * sym_32 + str_32 + (str_32 & 1)); + + if (sym_64) + PRINT20 (hdr->nextoff, nextoff + symbol_table_size); else - while (((bfd *) (map[i]).pos) == sub) - i++; - - namlen = strlen (normalize_filename (sub)); - namlen = (namlen + 1) &~ 1; - fileoff += (SIZEOF_AR_HDR_BIG - + namlen - + SXCOFFARFMAG - + arelt_size (sub)); - fileoff = (fileoff + 1) &~ 1; - sub = sub->next; - } + PRINT20 (hdr->nextoff, 0); + + PRINT20 (hdr->prevoff, prevoff); + PRINT12 (hdr->date, 0); + PRINT12 (hdr->uid, 0); + PRINT12 (hdr->gid, 0); + PRINT12 (hdr->mode, 0); + PRINT4 (hdr->namlen, 0) ; + + st = symbol_table + SIZEOF_AR_HDR_BIG; + memcpy (st, XCOFFARFMAG, SXCOFFARFMAG); + st += SXCOFFARFMAG; + + bfd_h_put_64 (abfd, sym_32, st); + st += 8; + + /* loop over the 32 bit offsets */ + current_bfd = abfd->archive_head; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + fileoff = SIZEOF_AR_FILE_HDR_BIG; + i = 0; + while (current_bfd != NULL && i < orl_count) + { + while (map[i].u.abfd == current_bfd) + { + if (arch_info->bits_per_address == 32) + { + bfd_h_put_64 (abfd, fileoff, st); + st += 8; + } + i++; + } + string_length = strlen (normalize_filename (current_bfd)); + string_length += string_length & 1; + fileoff += (SIZEOF_AR_HDR_BIG + + string_length + + SXCOFFARFMAG + + arelt_size (current_bfd)); + fileoff += fileoff & 1; + current_bfd = current_bfd->next; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + } - object_bfd = NULL; - for (i = 0; i < orl_count; i++) - { - const char *name; - size_t namlen; - bfd *ob = (bfd *)map[i].pos; + /* loop over the 32 bit symbol names */ + current_bfd = abfd->archive_head; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + i = 0; + while (current_bfd != NULL && i < orl_count) + { + while (map[i].u.abfd == current_bfd) + { + if (arch_info->bits_per_address == 32) + { + string_length = sprintf (st, "%s", *map[i].name); + st += string_length + 1; + } + i++; + } + current_bfd = current_bfd->next; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + } - if (ob != object_bfd) - arch_info = bfd_get_arch_info (ob); + bfd_bwrite (symbol_table, symbol_table_size, abfd); - if (arch_info && (arch_info->bits_per_address == 64) != bits64) - continue; + free (symbol_table); + symbol_table = NULL; - name = *map[i].name; - namlen = strlen (name); - if (bfd_write (name, 1, namlen + 1, abfd) != namlen + 1) - return false; + prevoff = nextoff; + nextoff = nextoff + symbol_table_size; } - - if ((stridx & 1) != 0) + else + PRINT20 (fhdr->symoff, 0); + + if (sym_64) { - char b; - - b = '\0'; - if (bfd_write (&b, 1, 1, abfd) != 1) + struct xcoff_ar_hdr_big *hdr; + bfd_byte *symbol_table; + bfd_byte *st; + file_ptr fileoff; + + bfd_vma symbol_table_size = + SIZEOF_AR_HDR_BIG + + SXCOFFARFMAG + + 8 + + 8 * sym_64 + + str_64 + (str_64 & 1); + + symbol_table = NULL; + symbol_table = (bfd_byte *) bfd_malloc (symbol_table_size); + if (symbol_table == NULL) return false; - } - - return true; -} - -static boolean -xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) - bfd *abfd; - unsigned int elength ATTRIBUTE_UNUSED; - struct orl *map; - unsigned int orl_count; - int stridx; -{ - unsigned int i; - unsigned int orl_count_32, orl_count_64; - unsigned int stridx_32, stridx_64; - const bfd_arch_info_type *arch_info = NULL; - bfd *object_bfd; - - /* First, we look through the symbols and work out which are - from 32-bit objects and which from 64-bit ones. */ - orl_count_32 = 0; - orl_count_64 = 0; - stridx_32 = 0; - stridx_64 = 0; - object_bfd = NULL; - for (i = 0; i < orl_count; i++) - { - bfd *ob = (bfd *)map[i].pos; - unsigned int len; - if (ob != object_bfd) - arch_info = bfd_get_arch_info (ob); - len = strlen (*map[i].name) + 1; - if (arch_info && arch_info->bits_per_address == 64) - { - orl_count_64++; - stridx_64 += len; - } - else - { - orl_count_32++; - stridx_32 += len; - } - object_bfd = ob; - } - /* A quick sanity check... */ - BFD_ASSERT (orl_count_64 + orl_count_32 == orl_count); - BFD_ASSERT (stridx_64 + stridx_32 == stridx); - - /* Now write out each map. */ - if (! xcoff_write_one_armap_big (abfd, map, orl_count, orl_count_32, - stridx_32, false, - xcoff_ardata_big (abfd)->memoff, - xcoff_ardata_big (abfd)->symoff)) - return false; - if (! xcoff_write_one_armap_big (abfd, map, orl_count, orl_count_64, - stridx_64, true, - xcoff_ardata_big (abfd)->symoff, - xcoff_ardata_big (abfd)->symoff64)) - return false; + memset (symbol_table, 0, symbol_table_size); + + hdr = (struct xcoff_ar_hdr_big *) symbol_table; + + PRINT20 (hdr->size, 8 + 8 * sym_64 + str_64 + (str_64 & 1)); + PRINT20 (hdr->nextoff, 0); + PRINT20 (hdr->prevoff, prevoff); + PRINT12 (hdr->date, 0); + PRINT12 (hdr->uid, 0); + PRINT12 (hdr->gid, 0); + PRINT12 (hdr->mode, 0); + PRINT4 (hdr->namlen, 0); + + st = symbol_table + SIZEOF_AR_HDR_BIG; + memcpy (st, XCOFFARFMAG, SXCOFFARFMAG); + st += SXCOFFARFMAG; + + bfd_h_put_64 (abfd, sym_64, st); + st += 8; + + /* loop over the 64 bit offsets */ + current_bfd = abfd->archive_head; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + fileoff = SIZEOF_AR_FILE_HDR_BIG; + i = 0; + while (current_bfd != NULL && i < orl_count) + { + while (map[i].u.abfd == current_bfd) + { + if (arch_info->bits_per_address == 64) + { + bfd_h_put_64 (abfd, fileoff, st); + st += 8; + } + i++; + } + string_length = strlen (normalize_filename (current_bfd)); + string_length += string_length & 1; + fileoff += (SIZEOF_AR_HDR_BIG + + string_length + + SXCOFFARFMAG + + arelt_size (current_bfd)); + fileoff += fileoff & 1; + current_bfd = current_bfd->next; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + } + /* loop over the 64 bit symbol names */ + current_bfd = abfd->archive_head; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + i = 0; + while (current_bfd != NULL && i < orl_count) + { + while (map[i].u.abfd == current_bfd) + { + if (arch_info->bits_per_address == 64) + { + string_length = sprintf (st, "%s", *map[i].name); + st += string_length + 1; + } + i++; + } + current_bfd = current_bfd->next; + if (current_bfd != NULL) + arch_info = bfd_get_arch_info (current_bfd); + } + + bfd_bwrite (symbol_table, symbol_table_size, abfd); + + free (symbol_table); + symbol_table = NULL; + + PRINT20 (fhdr->symoff64, nextoff); + } + else + PRINT20 (fhdr->symoff64, 0); + return true; } @@ -1820,18 +1864,18 @@ xcoff_write_archive_contents_old (abfd) bfd *abfd; { struct xcoff_ar_file_hdr fhdr; - size_t count; - size_t total_namlen; + bfd_size_type count; + bfd_size_type total_namlen; file_ptr *offsets; boolean makemap; boolean hasobjects; - file_ptr prevoff, nextoff; + ufile_ptr prevoff, nextoff; bfd *sub; - unsigned int i; + size_t i; struct xcoff_ar_hdr ahdr; bfd_size_type size; char *p; - char decbuf[13]; + char decbuf[XCOFFARMAG_ELEMENT_SIZE + 1]; memset (&fhdr, 0, sizeof fhdr); strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG); @@ -1849,7 +1893,7 @@ xcoff_write_archive_contents_old (abfd) if (offsets == NULL) return false; - if (bfd_seek (abfd, SIZEOF_AR_FILE_HDR, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR, SEEK_SET) != 0) return false; makemap = bfd_has_map (abfd); @@ -1859,7 +1903,7 @@ xcoff_write_archive_contents_old (abfd) for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) { const char *name; - size_t namlen; + bfd_size_type namlen; struct xcoff_ar_hdr *ahdrp; bfd_size_type remaining; @@ -1897,7 +1941,8 @@ xcoff_write_archive_contents_old (abfd) if (sub->arelt_data == NULL) { - sub->arelt_data = bfd_alloc (sub, sizeof (struct areltdata)); + size = sizeof (struct areltdata); + sub->arelt_data = bfd_alloc (sub, size); if (sub->arelt_data == NULL) return false; } @@ -1910,7 +1955,7 @@ xcoff_write_archive_contents_old (abfd) /* If the length of the name is odd, we write out the null byte after the name as well. */ - namlen = (namlen + 1) &~ 1; + namlen = (namlen + 1) &~ (bfd_size_type) 1; remaining = arelt_size (sub); size = (SIZEOF_AR_HDR @@ -1932,9 +1977,10 @@ xcoff_write_archive_contents_old (abfd) if (*p == '\0') *p = ' '; - if (bfd_write ((PTR) ahdrp, 1, SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR - || bfd_write ((PTR) name, 1, namlen, abfd) != namlen - || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + if ((bfd_bwrite ((PTR) ahdrp, (bfd_size_type) SIZEOF_AR_HDR, abfd) + != SIZEOF_AR_HDR) + || (bfd_bwrite ((PTR) name, namlen, abfd) != namlen) + || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) return false; @@ -1948,8 +1994,8 @@ xcoff_write_archive_contents_old (abfd) amt = sizeof buffer; if (amt > remaining) amt = remaining; - if (bfd_read (buffer, 1, amt, sub) != amt - || bfd_write (buffer, 1, amt, abfd) != amt) + if (bfd_bread (buffer, amt, sub) != amt + || bfd_bwrite (buffer, amt, abfd) != amt) return false; remaining -= amt; } @@ -1959,7 +2005,7 @@ xcoff_write_archive_contents_old (abfd) bfd_byte b; b = '\0'; - if (bfd_write (&b, 1, 1, abfd) != 1) + if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) return false; } } @@ -1972,7 +2018,9 @@ xcoff_write_archive_contents_old (abfd) sprintf (fhdr.memoff, "%ld", (long) nextoff); memset (&ahdr, 0, sizeof ahdr); - sprintf (ahdr.size, "%ld", (long) (12 + count * 12 + total_namlen)); + sprintf (ahdr.size, "%ld", (long) (XCOFFARMAG_ELEMENT_SIZE + + count * XCOFFARMAG_ELEMENT_SIZE + + total_namlen)); sprintf (ahdr.prevoff, "%ld", (long) prevoff); sprintf (ahdr.date, "%d", 0); sprintf (ahdr.uid, "%d", 0); @@ -1981,8 +2029,8 @@ xcoff_write_archive_contents_old (abfd) sprintf (ahdr.namlen, "%d", 0); size = (SIZEOF_AR_HDR - + 12 - + count * 12 + + XCOFFARMAG_ELEMENT_SIZE + + count * XCOFFARMAG_ELEMENT_SIZE + total_namlen + SXCOFFARFMAG); @@ -1999,28 +2047,31 @@ xcoff_write_archive_contents_old (abfd) if (*p == '\0') *p = ' '; - if (bfd_write ((PTR) &ahdr, 1, SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR - || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + if ((bfd_bwrite ((PTR) &ahdr, (bfd_size_type) SIZEOF_AR_HDR, abfd) + != SIZEOF_AR_HDR) + || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) return false; sprintf (decbuf, "%-12ld", (long) count); - if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd) + != XCOFFARMAG_ELEMENT_SIZE) return false; - for (i = 0; i < count; i++) + for (i = 0; i < (size_t) count; i++) { sprintf (decbuf, "%-12ld", (long) offsets[i]); - if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, + abfd) != XCOFFARMAG_ELEMENT_SIZE) return false; } for (sub = abfd->archive_head; sub != NULL; sub = sub->next) { const char *name; - size_t namlen; + bfd_size_type namlen; name = normalize_filename (sub); namlen = strlen (name); - if (bfd_write ((PTR) name, 1, namlen + 1, abfd) != namlen + 1) + if (bfd_bwrite ((PTR) name, namlen + 1, abfd) != namlen + 1) return false; } if ((size & 1) != 0) @@ -2028,12 +2079,11 @@ xcoff_write_archive_contents_old (abfd) bfd_byte b; b = '\0'; - if (bfd_write ((PTR) &b, 1, 1, abfd) != 1) + if (bfd_bwrite ((PTR) &b, (bfd_size_type) 1, abfd) != 1) return false; } /* Write out the armap, if appropriate. */ - if (! makemap || ! hasobjects) sprintf (fhdr.symoff, "%d", 0); else @@ -2053,8 +2103,8 @@ xcoff_write_archive_contents_old (abfd) *p = ' '; if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || (bfd_write ((PTR) &fhdr, SIZEOF_AR_FILE_HDR, 1, abfd) != - SIZEOF_AR_FILE_HDR)) + || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR, abfd) + != SIZEOF_AR_FILE_HDR)) return false; return true; @@ -2065,60 +2115,63 @@ xcoff_write_archive_contents_big (abfd) bfd *abfd; { struct xcoff_ar_file_hdr_big fhdr; - size_t count; - size_t total_namlen; + bfd_size_type count; + bfd_size_type total_namlen; file_ptr *offsets; boolean makemap; boolean hasobjects; - file_ptr prevoff, nextoff; - bfd *sub; - unsigned int i; - struct xcoff_ar_hdr_big ahdr; + ufile_ptr prevoff, nextoff; + bfd *current_bfd; + size_t i; + struct xcoff_ar_hdr_big *hdr, ahdr; bfd_size_type size; - char *p; - char decbuf[13]; + bfd_byte *member_table, *mt; + bfd_vma member_table_size; - memset (&fhdr, 0, sizeof fhdr); - strncpy (fhdr.magic, XCOFFARMAGBIG, SXCOFFARMAG); - sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR_BIG); - sprintf (fhdr.freeoff, "%d", 0); + memcpy (fhdr.magic, XCOFFARMAGBIG, SXCOFFARMAG); + PRINT20 (fhdr.firstmemoff, SIZEOF_AR_FILE_HDR_BIG); + PRINT20 (fhdr.freeoff, 0); - count = 0; - total_namlen = 0; - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + /* Calculate count and total_namlen */ + for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; + current_bfd != NULL; + current_bfd = current_bfd->next, count++) + total_namlen += strlen (normalize_filename (current_bfd)) + 1; + + offsets = NULL; + if (count) { - ++count; - total_namlen += strlen (normalize_filename (sub)) + 1; + offsets = (file_ptr *) bfd_malloc (count * sizeof (file_ptr)); + if (offsets == NULL) + return false; } - offsets = (file_ptr *) bfd_alloc (abfd, count * sizeof (file_ptr)); - if (offsets == NULL) - return false; - - if (bfd_seek (abfd, SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0) return false; makemap = bfd_has_map (abfd); hasobjects = false; prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR_BIG; - for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) + for (current_bfd = abfd->archive_head, i = 0; + current_bfd != NULL; + current_bfd = current_bfd->next, i++) { const char *name; - size_t namlen; + bfd_size_type namlen; struct xcoff_ar_hdr_big *ahdrp; bfd_size_type remaining; if (makemap && ! hasobjects) { - if (bfd_check_format (sub, bfd_object)) + if (bfd_check_format (current_bfd, bfd_object)) hasobjects = true; } - name = normalize_filename (sub); + name = normalize_filename (current_bfd); namlen = strlen (name); - if (sub->arelt_data != NULL) - ahdrp = arch_xhdr_big (sub); + if (current_bfd->arelt_data != NULL) + ahdrp = arch_xhdr_big (current_bfd); else ahdrp = NULL; @@ -2126,46 +2179,41 @@ xcoff_write_archive_contents_big (abfd) { struct stat s; - memset (&ahdr, 0, sizeof ahdr); ahdrp = &ahdr; /* XXX This should actually be a call to stat64 (at least on - 32-bit machines). */ - if (stat (bfd_get_filename (sub), &s) != 0) + 32-bit machines). + XXX This call will fail if the original object is not found. */ + if (stat (bfd_get_filename (current_bfd), &s) != 0) { bfd_set_error (bfd_error_system_call); return false; } - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (ahdrp->size, "%ld", (long) s.st_size); - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); - sprintf (ahdrp->uid, "%ld", (long) s.st_uid); - sprintf (ahdrp->gid, "%ld", (long) s.st_gid); - sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); + PRINT20 (ahdrp->size, s.st_size); + PRINT12 (ahdrp->date, s.st_mtime); + PRINT12 (ahdrp->uid, s.st_uid); + PRINT12 (ahdrp->gid, s.st_gid); + PRINT12_OCTAL (ahdrp->mode, s.st_mode); - if (sub->arelt_data == NULL) + if (current_bfd->arelt_data == NULL) { - sub->arelt_data = bfd_alloc (sub, sizeof (struct areltdata)); - if (sub->arelt_data == NULL) + size = sizeof (struct areltdata); + current_bfd->arelt_data = bfd_alloc (current_bfd, size); + if (current_bfd->arelt_data == NULL) return false; } - arch_eltdata (sub)->parsed_size = s.st_size; + arch_eltdata (current_bfd)->parsed_size = s.st_size; } - /* XXX These calls actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (ahdrp->prevoff, "%ld", (long) prevoff); - sprintf (ahdrp->namlen, "%ld", (long) namlen); + PRINT20 (ahdrp->prevoff, prevoff); + PRINT4 (ahdrp->namlen, namlen); /* If the length of the name is odd, we write out the null byte after the name as well. */ - namlen = (namlen + 1) &~ 1; + namlen = (namlen + 1) &~ (bfd_size_type) 1; - remaining = arelt_size (sub); + remaining = arelt_size (current_bfd); size = (SIZEOF_AR_HDR_BIG + namlen + SXCOFFARFMAG @@ -2178,21 +2226,16 @@ xcoff_write_archive_contents_big (abfd) prevoff = nextoff; nextoff += size + (size & 1); - sprintf (ahdrp->nextoff, "%ld", (long) nextoff); + PRINT20 (ahdrp->nextoff, nextoff); - /* We need spaces, not null bytes, in the header. */ - for (p = (char *) ahdrp; p < (char *) ahdrp + SIZEOF_AR_HDR_BIG; p++) - if (*p == '\0') - *p = ' '; - - if (bfd_write ((PTR) ahdrp, 1, SIZEOF_AR_HDR_BIG, abfd) - != SIZEOF_AR_HDR_BIG - || bfd_write ((PTR) name, 1, namlen, abfd) != namlen - || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) - != SXCOFFARFMAG)) + if ((bfd_bwrite ((PTR) ahdrp, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) + != SIZEOF_AR_HDR_BIG) + || bfd_bwrite ((PTR) name, (bfd_size_type) namlen, abfd) != namlen + || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, + abfd) != SXCOFFARFMAG)) return false; - if (bfd_seek (sub, (file_ptr) 0, SEEK_SET) != 0) + if (bfd_seek (current_bfd, (file_ptr) 0, SEEK_SET) != 0) return false; while (remaining != 0) { @@ -2202,8 +2245,8 @@ xcoff_write_archive_contents_big (abfd) amt = sizeof buffer; if (amt > remaining) amt = remaining; - if (bfd_read (buffer, 1, amt, sub) != amt - || bfd_write (buffer, 1, amt, abfd) != amt) + if (bfd_bread (buffer, amt, current_bfd) != amt + || bfd_bwrite (buffer, amt, abfd) != amt) return false; remaining -= amt; } @@ -2213,101 +2256,116 @@ xcoff_write_archive_contents_big (abfd) bfd_byte b; b = '\0'; - if (bfd_write (&b, 1, 1, abfd) != 1) + if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) return false; } } - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (fhdr.lastmemoff, "%ld", (long) prevoff); - - /* Write out the member table. */ + PRINT20 (fhdr.lastmemoff, prevoff); + + /* Write out the member table. + Layout : + + standard big archive header + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [0x02] + + Member table + 0x0072 count [0x14] + 0x0086 offsets [0x14 * counts] + 0x0086 + 0x14 * counts names [??] + ?? pad to even bytes. + */ BFD_ASSERT (nextoff == bfd_tell (abfd)); - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (fhdr.memoff, "%ld", (long) nextoff); - memset (&ahdr, 0, sizeof ahdr); - /* XXX The next two calls actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (ahdr.size, "%ld", (long) (12 + count * 12 + total_namlen)); - sprintf (ahdr.prevoff, "%ld", (long) prevoff); - sprintf (ahdr.date, "%d", 0); - sprintf (ahdr.uid, "%d", 0); - sprintf (ahdr.gid, "%d", 0); - sprintf (ahdr.mode, "%d", 0); - sprintf (ahdr.namlen, "%d", 0); + member_table_size = (SIZEOF_AR_HDR_BIG + + SXCOFFARFMAG + + XCOFFARMAGBIG_ELEMENT_SIZE + + count * XCOFFARMAGBIG_ELEMENT_SIZE + + total_namlen); - size = (SIZEOF_AR_HDR_BIG - + 12 - + count * 12 - + total_namlen - + SXCOFFARFMAG); + member_table_size += member_table_size & 1; + member_table = NULL; + member_table = (bfd_byte *) bfd_malloc (member_table_size); + if (member_table == NULL) + return false; + memset (member_table, 0, member_table_size); - prevoff = nextoff; - nextoff += size + (size & 1); + hdr = (struct xcoff_ar_hdr_big *) member_table; - if (makemap && hasobjects) - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ - sprintf (ahdr.nextoff, "%ld", (long) nextoff); + PRINT20 (hdr->size, (XCOFFARMAGBIG_ELEMENT_SIZE + + count * XCOFFARMAGBIG_ELEMENT_SIZE + + total_namlen + (total_namlen & 1))); + if (makemap && hasobjects) + PRINT20 (hdr->nextoff, nextoff + member_table_size); else - sprintf (ahdr.nextoff, "%d", 0); - - /* We need spaces, not null bytes, in the header. */ - for (p = (char *) &ahdr; p < (char *) &ahdr + SIZEOF_AR_HDR_BIG; p++) - if (*p == '\0') - *p = ' '; - - if (bfd_write ((PTR) &ahdr, 1, SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG - || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) - != SXCOFFARFMAG)) - return false; + PRINT20 (hdr->nextoff, 0); + PRINT20 (hdr->prevoff, prevoff); + PRINT12 (hdr->date, 0); + PRINT12 (hdr->uid, 0); + PRINT12 (hdr->gid, 0); + PRINT12 (hdr->mode, 0); + PRINT4 (hdr->namlen, 0); + + mt = member_table + SIZEOF_AR_HDR_BIG; + memcpy (mt, XCOFFARFMAG, SXCOFFARFMAG); + mt += SXCOFFARFMAG; + + PRINT20 (mt, count); + mt += XCOFFARMAGBIG_ELEMENT_SIZE; + for (i = 0; i < (size_t) count; i++) + { + PRINT20 (mt, offsets[i]); + mt += XCOFFARMAGBIG_ELEMENT_SIZE; + } - sprintf (decbuf, "%-12ld", (long) count); - if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) - return false; - for (i = 0; i < count; i++) + if (count) { - sprintf (decbuf, "%-12ld", (long) offsets[i]); - if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) - return false; + free (offsets); + offsets = NULL; } - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + + for (current_bfd = abfd->archive_head; current_bfd != NULL; + current_bfd = current_bfd->next) { const char *name; size_t namlen; - name = normalize_filename (sub); - namlen = strlen (name); - if (bfd_write ((PTR) name, 1, namlen + 1, abfd) != namlen + 1) - return false; + name = normalize_filename (current_bfd); + namlen = sprintf(mt, "%s", name); + mt += namlen + 1; } - if ((size & 1) != 0) - { - bfd_byte b; + + if (bfd_bwrite (member_table, member_table_size, abfd) != member_table_size) + return false; - b = '\0'; - if (bfd_write ((PTR) &b, 1, 1, abfd) != 1) - return false; - } + free (member_table); + member_table = NULL; + + PRINT20 (fhdr.memoff, nextoff); + + prevoff = nextoff; + nextoff += member_table_size; /* Write out the armap, if appropriate. */ - if (! makemap || ! hasobjects) - sprintf (fhdr.symoff, "%d", 0); + if (! makemap || ! hasobjects) + PRINT20 (fhdr.symoff, 0); else { BFD_ASSERT (nextoff == bfd_tell (abfd)); - /* XXX This call actually should use %lld (at least on 32-bit - machines) since the fields's width is 20 and there numbers with - more than 32 bits can be represented. */ + + /* Save nextoff in fhdr.symoff so the armap routine can use it. */ + PRINT20 (fhdr.symoff, nextoff); + bfd_ardata (abfd)->tdata = (PTR) &fhdr; if (! _bfd_compute_and_write_armap (abfd, 0)) return false; @@ -2315,16 +2373,11 @@ xcoff_write_archive_contents_big (abfd) /* Write out the archive file header. */ - /* We need spaces, not null bytes, in the header. */ - for (p = (char *) &fhdr; p < (char *) &fhdr + SIZEOF_AR_FILE_HDR_BIG; p++) - if (*p == '\0') - *p = ' '; - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || (bfd_write ((PTR) &fhdr, SIZEOF_AR_FILE_HDR_BIG, 1, abfd) != - SIZEOF_AR_FILE_HDR_BIG)) + || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG, + abfd) != SIZEOF_AR_FILE_HDR_BIG)) return false; - + return true; } @@ -2356,3 +2409,1443 @@ _bfd_xcoff_sizeof_headers (abfd, reloc) size += abfd->section_count * SCNHSZ; return size; } + +/* Routines to swap information in the XCOFF .loader section. If we + ever need to write an XCOFF loader, this stuff will need to be + moved to another file shared by the linker (which XCOFF calls the + ``binder'') and the loader. */ + +/* Swap in the ldhdr structure. */ + +static void +xcoff_swap_ldhdr_in (abfd, s, dst) + bfd *abfd; + const PTR s; + struct internal_ldhdr *dst; +{ + const struct external_ldhdr *src = (const struct external_ldhdr *) s; + + dst->l_version = bfd_get_32 (abfd, src->l_version); + dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms); + dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc); + dst->l_istlen = bfd_get_32 (abfd, src->l_istlen); + dst->l_nimpid = bfd_get_32 (abfd, src->l_nimpid); + dst->l_impoff = bfd_get_32 (abfd, src->l_impoff); + dst->l_stlen = bfd_get_32 (abfd, src->l_stlen); + dst->l_stoff = bfd_get_32 (abfd, src->l_stoff); +} + +/* Swap out the ldhdr structure. */ + +static void +xcoff_swap_ldhdr_out (abfd, src, d) + bfd *abfd; + const struct internal_ldhdr *src; + PTR d; +{ + struct external_ldhdr *dst = (struct external_ldhdr *) d; + + bfd_put_32 (abfd, (bfd_vma) src->l_version, dst->l_version); + bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms); + bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc); + bfd_put_32 (abfd, src->l_istlen, dst->l_istlen); + bfd_put_32 (abfd, src->l_nimpid, dst->l_nimpid); + bfd_put_32 (abfd, src->l_impoff, dst->l_impoff); + bfd_put_32 (abfd, src->l_stlen, dst->l_stlen); + bfd_put_32 (abfd, src->l_stoff, dst->l_stoff); +} + +/* Swap in the ldsym structure. */ + +static void +xcoff_swap_ldsym_in (abfd, s, dst) + bfd *abfd; + const PTR s; + struct internal_ldsym *dst; +{ + const struct external_ldsym *src = (const struct external_ldsym *) s; + + if (bfd_get_32 (abfd, src->_l._l_l._l_zeroes) != 0) { + memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); + } else { + dst->_l._l_l._l_zeroes = 0; + dst->_l._l_l._l_offset = bfd_get_32 (abfd, src->_l._l_l._l_offset); + } + dst->l_value = bfd_get_32 (abfd, src->l_value); + dst->l_scnum = bfd_get_16 (abfd, src->l_scnum); + dst->l_smtype = bfd_get_8 (abfd, src->l_smtype); + dst->l_smclas = bfd_get_8 (abfd, src->l_smclas); + dst->l_ifile = bfd_get_32 (abfd, src->l_ifile); + dst->l_parm = bfd_get_32 (abfd, src->l_parm); +} + +/* Swap out the ldsym structure. */ + +static void +xcoff_swap_ldsym_out (abfd, src, d) + bfd *abfd; + const struct internal_ldsym *src; + PTR d; +{ + struct external_ldsym *dst = (struct external_ldsym *) d; + + if (src->_l._l_l._l_zeroes != 0) + memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); + else + { + bfd_put_32 (abfd, (bfd_vma) 0, dst->_l._l_l._l_zeroes); + bfd_put_32 (abfd, (bfd_vma) src->_l._l_l._l_offset, + dst->_l._l_l._l_offset); + } + bfd_put_32 (abfd, src->l_value, dst->l_value); + bfd_put_16 (abfd, (bfd_vma) src->l_scnum, dst->l_scnum); + bfd_put_8 (abfd, src->l_smtype, dst->l_smtype); + bfd_put_8 (abfd, src->l_smclas, dst->l_smclas); + bfd_put_32 (abfd, src->l_ifile, dst->l_ifile); + bfd_put_32 (abfd, src->l_parm, dst->l_parm); +} + +/* Swap in the ldrel structure. */ + +static void +xcoff_swap_ldrel_in (abfd, s, dst) + bfd *abfd; + const PTR s; + struct internal_ldrel *dst; +{ + const struct external_ldrel *src = (const struct external_ldrel *) s; + + dst->l_vaddr = bfd_get_32 (abfd, src->l_vaddr); + dst->l_symndx = bfd_get_32 (abfd, src->l_symndx); + dst->l_rtype = bfd_get_16 (abfd, src->l_rtype); + dst->l_rsecnm = bfd_get_16 (abfd, src->l_rsecnm); +} + +/* Swap out the ldrel structure. */ + +static void +xcoff_swap_ldrel_out (abfd, src, d) + bfd *abfd; + const struct internal_ldrel *src; + PTR d; +{ + struct external_ldrel *dst = (struct external_ldrel *) d; + + bfd_put_32 (abfd, src->l_vaddr, dst->l_vaddr); + bfd_put_32 (abfd, src->l_symndx, dst->l_symndx); + bfd_put_16 (abfd, (bfd_vma) src->l_rtype, dst->l_rtype); + bfd_put_16 (abfd, (bfd_vma) src->l_rsecnm, dst->l_rsecnm); +} + + + +/* This is the relocation function for the RS/6000/POWER/PowerPC. + This is currently the only processor which uses XCOFF; I hope that + will never change. */ + +static boolean +xcoff_ppc_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; +{ + struct internal_reloc *rel; + struct internal_reloc *relend; + + rel = relocs; + relend = rel + input_section->reloc_count; + + for (; rel < relend; rel++) + { + long symndx; + struct xcoff_link_hash_entry *h; + struct internal_syment *sym; + bfd_vma addend; + bfd_vma val; + struct reloc_howto_struct howto; + bfd_reloc_status_type rstat; + + /* Relocation type R_REF is a special relocation type which is + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ + if (rel->r_type == R_REF) + continue; + + symndx = rel->r_symndx; + + if (symndx == -1) + { + h = NULL; + sym = NULL; + addend = 0; + } + else + { + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; + sym = syms + symndx; + addend = - sym->n_value; + + } + + /* We build the howto information on the fly. */ + + howto.type = rel->r_type; + howto.rightshift = 0; + howto.size = 2; + howto.bitsize = (rel->r_size & 0x1f) + 1; + howto.pc_relative = false; + howto.bitpos = 0; + if ((rel->r_size & 0x80) != 0) + howto.complain_on_overflow = complain_overflow_signed; + else + howto.complain_on_overflow = complain_overflow_bitfield; + howto.special_function = NULL; + howto.name = "internal"; + howto.partial_inplace = true; + if (howto.bitsize == 32) + howto.src_mask = howto.dst_mask = 0xffffffff; + else + { + howto.src_mask = howto.dst_mask = (1 << howto.bitsize) - 1; + if (howto.bitsize == 16) + howto.size = 1; + } + howto.pcrel_offset = false; + + val = 0; + + if (h == NULL) + { + asection *sec; + + if (symndx == -1) + { + sec = bfd_abs_section_ptr; + val = 0; + } + else + { + sec = sections[symndx]; + /* Hack to make sure we use the right TOC anchor value + if this reloc is against the TOC anchor. */ + + if (sec->name[3] == '0' + && strcmp (sec->name, ".tc0") == 0) + { + val = xcoff_data (output_bfd)->toc; + } + else + { + val = (sec->output_section->vma + + sec->output_offset + + sym->n_value + - sec->vma); + } + } + } + else + { + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + asection *sec; + + sec = h->root.u.def.section; + val = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_common) + { + asection *sec; + + sec = h->root.u.c.p->section; + val = (sec->output_section->vma + + sec->output_offset); + } + else if ((h->flags & XCOFF_DEF_DYNAMIC) != 0 + || (h->flags & XCOFF_IMPORT) != 0) + { + /* Every symbol in a shared object is defined somewhere. */ + val = 0; + } + else if (! info->relocateable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + rel->r_vaddr - input_section->vma, true))) + return false; + + /* Don't try to process the reloc. It can't help, and + it may generate another error. */ + continue; + } + } + + /* I took the relocation type definitions from two documents: + the PowerPC AIX Version 4 Application Binary Interface, First + Edition (April 1992), and the PowerOpen ABI, Big-Endian + 32-Bit Hardware Implementation (June 30, 1994). Differences + between the documents are noted below. */ + + switch (rel->r_type) + { + case R_RTB: + case R_RRTBI: + case R_RRTBA: + /* These relocs are defined by the PowerPC ABI to be + relative branches which use half of the difference + between the symbol and the program counter. I can't + quite figure out when this is useful. These relocs are + not defined by the PowerOpen ABI. */ + default: + (*_bfd_error_handler) + (_("%s: unsupported relocation type 0x%02x"), + bfd_archive_filename (input_bfd), (unsigned int) rel->r_type); + bfd_set_error (bfd_error_bad_value); + return false; + case R_POS: + /* Simple positive relocation. */ + break; + case R_NEG: + /* Simple negative relocation. */ + val = - val; + break; + case R_REL: + /* Simple PC relative relocation. */ + howto.pc_relative = true; + break; + case R_TOC: + /* TOC relative relocation. The value in the instruction in + the input file is the offset from the input file TOC to + the desired location. We want the offset from the final + TOC to the desired location. We have: + isym = iTOC + in + iinsn = in + o + osym = oTOC + on + oinsn = on + o + so we must change insn by on - in. + */ + case R_GL: + /* Global linkage relocation. The value of this relocation + is the address of the entry in the TOC section. */ + case R_TCL: + /* Local object TOC address. I can't figure out the + difference between this and case R_GL. */ + case R_TRL: + /* TOC relative relocation. A TOC relative load instruction + which may be changed to a load address instruction. + FIXME: We don't currently implement this optimization. */ + case R_TRLA: + /* TOC relative relocation. This is a TOC relative load + address instruction which may be changed to a load + instruction. FIXME: I don't know if this is the correct + implementation. */ + if (h != NULL && h->smclas != XMC_TD) + { + if (h->toc_section == NULL) + { + (*_bfd_error_handler) + (_("%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"), + bfd_archive_filename (input_bfd), rel->r_vaddr, + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return false; + } + + BFD_ASSERT ((h->flags & XCOFF_SET_TOC) == 0); + val = (h->toc_section->output_section->vma + + h->toc_section->output_offset); + } + + val = ((val - xcoff_data (output_bfd)->toc) + - (sym->n_value - xcoff_data (input_bfd)->toc)); + addend = 0; + break; + case R_BA: + /* Absolute branch. We don't want to mess with the lower + two bits of the instruction. */ + case R_CAI: + /* The PowerPC ABI defines this as an absolute call which + may be modified to become a relative call. The PowerOpen + ABI does not define this relocation type. */ + case R_RBA: + /* Absolute branch which may be modified to become a + relative branch. */ + case R_RBAC: + /* The PowerPC ABI defines this as an absolute branch to a + fixed address which may be modified to an absolute branch + to a symbol. The PowerOpen ABI does not define this + relocation type. */ + case R_RBRC: + /* The PowerPC ABI defines this as an absolute branch to a + fixed address which may be modified to a relative branch. + The PowerOpen ABI does not define this relocation type. */ + howto.src_mask &= ~3; + howto.dst_mask = howto.src_mask; + break; + case R_BR: + /* Relative branch. We don't want to mess with the lower + two bits of the instruction. */ + case R_CREL: + /* The PowerPC ABI defines this as a relative call which may + be modified to become an absolute call. The PowerOpen + ABI does not define this relocation type. */ + case R_RBR: + /* A relative branch which may be modified to become an + absolute branch. FIXME: We don't implement this, + although we should for symbols of storage mapping class + XMC_XO. */ + howto.pc_relative = true; + howto.src_mask &= ~3; + howto.dst_mask = howto.src_mask; + break; + case R_RL: + /* The PowerPC AIX ABI describes this as a load which may be + changed to a load address. The PowerOpen ABI says this + is the same as case R_POS. */ + break; + case R_RLA: + /* The PowerPC AIX ABI describes this as a load address + which may be changed to a load. The PowerOpen ABI says + this is the same as R_POS. */ + break; + } + + /* If we see an R_BR or R_RBR reloc which is jumping to global + linkage code, and it is followed by an appropriate cror nop + instruction, we replace the cror with lwz r2,20(r1). This + restores the TOC after the glink code. Contrariwise, if the + call is followed by a lwz r2,20(r1), but the call is not + going to global linkage code, we can replace the load with a + cror. */ + if ((rel->r_type == R_BR || rel->r_type == R_RBR) + && h != NULL + && h->root.type == bfd_link_hash_defined + && (rel->r_vaddr - input_section->vma + 8 + <= input_section->_cooked_size)) + { + bfd_byte *pnext; + unsigned long next; + + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; + next = bfd_get_32 (input_bfd, pnext); + + /* The _ptrgl function is magic. It is used by the AIX + compiler to call a function through a pointer. */ + if (h->smclas == XMC_GL + || strcmp (h->root.root.string, "._ptrgl") == 0) + { + if (next == 0x4def7b82 /* cror 15,15,15 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ + bfd_put_32 (input_bfd, + (bfd_vma) 0x80410014, /* lwz r1,20(r1) */ + pnext); + } + else + { + if (next == 0x80410014) /* lwz r1,20(r1) */ + bfd_put_32 (input_bfd, + (bfd_vma) 0x60000000, /* ori r0,r0,0 */ + pnext); + } + } + + /* A PC relative reloc includes the section address. */ + if (howto.pc_relative) + addend += input_section->vma; + + rstat = _bfd_final_link_relocate (&howto, input_bfd, input_section, + contents, + rel->r_vaddr - input_section->vma, + val, addend); + + switch (rstat) + { + default: + abort (); + case bfd_reloc_ok: + break; + case bfd_reloc_overflow: + { + const char *name; + char buf[SYMNMLEN + 1]; + char howto_name[10]; + + if (symndx == -1) + name = "*ABS*"; + else if (h != NULL) + name = h->root.root.string; + else + { + name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); + + if (name == NULL) + return false; + } + sprintf (howto_name, "0x%02x", rel->r_type); + + if (! ((*info->callbacks->reloc_overflow) + (info, name, howto_name, (bfd_vma) 0, input_bfd, + input_section, rel->r_vaddr - input_section->vma))) + return false; + } + } + } + + return true; +} + +static boolean +_bfd_xcoff_put_ldsymbol_name (abfd, ldinfo, ldsym, name) + bfd *abfd ATTRIBUTE_UNUSED; + struct xcoff_loader_info *ldinfo; + struct internal_ldsym *ldsym; + const char *name; +{ + size_t len; + len = strlen (name); + + if (len <= SYMNMLEN) + strncpy (ldsym->_l._l_name, name, SYMNMLEN); + else + { + if (ldinfo->string_size + len + 3 > ldinfo->string_alc) + { + bfd_size_type newalc; + bfd_byte *newstrings; + + newalc = ldinfo->string_alc * 2; + if (newalc == 0) + newalc = 32; + while (ldinfo->string_size + len + 3 > newalc) + newalc *= 2; + + newstrings = ((bfd_byte *) + bfd_realloc ((PTR) ldinfo->strings, newalc)); + if (newstrings == NULL) + { + ldinfo->failed = true; + return false; + } + ldinfo->string_alc = newalc; + ldinfo->strings = newstrings; + } + + bfd_put_16 (ldinfo->output_bfd, (bfd_vma) (len + 1), + ldinfo->strings + ldinfo->string_size); + strcpy (ldinfo->strings + ldinfo->string_size + 2, name); + ldsym->_l._l_l._l_zeroes = 0; + ldsym->_l._l_l._l_offset = ldinfo->string_size + 2; + ldinfo->string_size += len + 3; + } + + return true; +} + +static boolean +_bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, + struct internal_syment *sym, + const char *name) +{ + if (strlen (name) <= SYMNMLEN) + { + strncpy (sym->_n._n_name, name, SYMNMLEN); + } + else + { + boolean hash; + bfd_size_type indx; + + hash = true; + if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) + hash = false; + indx = _bfd_stringtab_add (strtab, name, hash, false); + if (indx == (bfd_size_type) -1) + return false; + sym->_n._n_n._n_zeroes = 0; + sym->_n._n_n._n_offset = STRING_SIZE_SIZE + indx; + } + return true; +} + +static asection * +xcoff_create_csect_from_smclas (abfd, aux, symbol_name) + bfd *abfd; + union internal_auxent *aux; + const char *symbol_name; +{ + asection *return_value = NULL; + + /* .sv64 = x_smclas == 17 + This is an invalid csect for 32 bit apps. */ + static const char *names[19] = + { + ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", + ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", + ".td", NULL, ".sv3264" + }; + + if ((19 >= aux->x_csect.x_smclas) && + (NULL != names[aux->x_csect.x_smclas])) + { + return_value = bfd_make_section_anyway + (abfd, names[aux->x_csect.x_smclas]); + } + else + { + (*_bfd_error_handler) + (_("%s: symbol `%s' has unrecognized smclas %d"), + bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas); + bfd_set_error (bfd_error_bad_value); + } + + return return_value; +} + +static boolean +xcoff_is_lineno_count_overflow (abfd, value) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_vma value; +{ + if (0xffff <= value) + return true; + + return false; +} + +static boolean +xcoff_is_reloc_count_overflow (abfd, value) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_vma value; +{ + if (0xffff <= value) + return true; + + return false; +} + +static bfd_vma +xcoff_loader_symbol_offset (abfd, ldhdr) + bfd *abfd; + struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; +{ + return bfd_xcoff_ldhdrsz(abfd); +} + +static bfd_vma +xcoff_loader_reloc_offset (abfd, ldhdr) + bfd *abfd; + struct internal_ldhdr *ldhdr; +{ + return bfd_xcoff_ldhdrsz(abfd) + + (ldhdr->l_nsyms * bfd_xcoff_ldsymsz(abfd)); +} + +static boolean +xcoff_generate_rtinit (abfd, init, fini) + bfd *abfd; + const char *init; + const char *fini; +{ + bfd_byte filehdr_ext[FILHSZ]; + bfd_byte scnhdr_ext[SCNHSZ]; + bfd_byte syment_ext[SYMESZ * 8]; + bfd_byte reloc_ext[RELSZ * 2]; + bfd_byte *data_buffer; + bfd_size_type data_buffer_size; + bfd_byte *string_table, *st_tmp; + bfd_size_type string_table_size; + bfd_vma val; + size_t initsz, finisz; + struct internal_filehdr filehdr; + struct internal_scnhdr scnhdr; + struct internal_syment syment; + union internal_auxent auxent; + struct internal_reloc reloc; + + char *data_name = ".data"; + char *rtinit_name = "__rtinit"; + + if (! bfd_xcoff_rtinit_size (abfd) + || (init == NULL && fini == NULL)) + return false; + + initsz = (init == NULL ? 0 : 1 + strlen (init)); + finisz = (fini == NULL ? 0 : 1 + strlen (fini)); + + /* file header */ + memset (filehdr_ext, 0, FILHSZ); + memset (&filehdr, 0, sizeof (struct internal_filehdr)); + filehdr.f_magic = bfd_xcoff_magic_number (abfd); + filehdr.f_nscns = 1; + filehdr.f_timdat = 0; + filehdr.f_nsyms = 0; /* at least 6, no more than 8 */ + filehdr.f_symptr = 0; /* set below */ + filehdr.f_opthdr = 0; + filehdr.f_flags = 0; + + /* section header */ + memset (scnhdr_ext, 0, SCNHSZ); + memset (&scnhdr, 0, sizeof (struct internal_scnhdr)); + memcpy (scnhdr.s_name, data_name, strlen (data_name)); + scnhdr.s_paddr = 0; + scnhdr.s_vaddr = 0; + scnhdr.s_size = 0; /* set below */ + scnhdr.s_scnptr = FILHSZ + SCNHSZ; + scnhdr.s_relptr = 0; /* set below */ + scnhdr.s_lnnoptr = 0; + scnhdr.s_nreloc = 0; /* either 1 or 2 */ + scnhdr.s_nlnno = 0; + scnhdr.s_flags = STYP_DATA; + + /* .data + 0x0000 0x00000000 : rtl + 0x0004 0x00000010 : offset to init, or 0 + 0x0008 0x00000028 : offset to fini, or 0 + 0x000C 0x0000000C : size of descriptor + 0x0010 0x00000000 : init, needs a reloc + 0x0014 0x00000040 : offset to init name + 0x0018 0x00000000 : flags, padded to a word + 0x001C 0x00000000 : empty init + 0x0020 0x00000000 : + 0x0024 0x00000000 : + 0x0028 0x00000000 : fini, needs a reloc + 0x002C 0x00000??? : offset to fini name + 0x0030 0x00000000 : flags, padded to a word + 0x0034 0x00000000 : empty fini + 0x0038 0x00000000 : + 0x003C 0x00000000 : + 0x0040 init name + 0x0040 + initsz fini name */ + + data_buffer_size = 0x0040 + initsz + finisz; + data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0; + data_buffer = NULL; + data_buffer = (bfd_byte *) bfd_malloc (data_buffer_size); + if (data_buffer == NULL) + return false; + + memset (data_buffer, 0, data_buffer_size); + + if (initsz) + { + val = 0x10; + bfd_h_put_32 (abfd, val, &data_buffer[0x04]); + val = 0x40; + bfd_h_put_32 (abfd, val, &data_buffer[0x14]); + memcpy (&data_buffer[val], init, initsz); + } + + if (finisz) + { + val = 0x28; + bfd_h_put_32 (abfd, val, &data_buffer[0x08]); + val = 0x40 + initsz; + bfd_h_put_32 (abfd, val, &data_buffer[0x2C]); + memcpy (&data_buffer[val], fini, finisz); + } + + val = 0x0C; + bfd_h_put_32 (abfd, val, &data_buffer[0x0C]); + + scnhdr.s_size = data_buffer_size; + + /* string table */ + string_table_size = 0; + if (initsz > 9) + string_table_size += initsz; + if (finisz > 9) + string_table_size += finisz; + if (string_table_size) + { + string_table_size += 4; + string_table = (bfd_byte *)bfd_malloc (string_table_size); + memset (string_table, 0, string_table_size); + val = string_table_size; + bfd_h_put_32 (abfd, val, &string_table[0]); + st_tmp = string_table + 4; + } + + /* symbols + 0. .data csect + 2. __rtinit + 4. init function + 6. fini function */ + memset (syment_ext, 0, 8 * SYMESZ); + memset (reloc_ext, 0, 2 * RELSZ); + + /* .data csect */ + memset (&syment, 0, sizeof (struct internal_syment)); + memset (&auxent, 0, sizeof (union internal_auxent)); + memcpy (syment._n._n_name, data_name, strlen (data_name)); + syment.n_scnum = 1; + syment.n_sclass = C_HIDEXT; + syment.n_numaux = 1; + auxent.x_csect.x_scnlen.l = data_buffer_size; + auxent.x_csect.x_smtyp = 3 << 3 | XTY_SD; + auxent.x_csect.x_smclas = XMC_RW; + bfd_coff_swap_sym_out (abfd, &syment, + &syment_ext[filehdr.f_nsyms * SYMESZ]); + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, + &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); + filehdr.f_nsyms += 2; + + /* __rtinit */ + memset (&syment, 0, sizeof (struct internal_syment)); + memset (&auxent, 0, sizeof (union internal_auxent)); + memcpy (syment._n._n_name, rtinit_name, strlen (rtinit_name)); + syment.n_scnum = 1; + syment.n_sclass = C_EXT; + syment.n_numaux = 1; + auxent.x_csect.x_smtyp = XTY_LD; + auxent.x_csect.x_smclas = XMC_RW; + bfd_coff_swap_sym_out (abfd, &syment, + &syment_ext[filehdr.f_nsyms * SYMESZ]); + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, + &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); + filehdr.f_nsyms += 2; + + /* init */ + if (initsz) + { + memset (&syment, 0, sizeof (struct internal_syment)); + memset (&auxent, 0, sizeof (union internal_auxent)); + + if (initsz > 9) + { + syment._n._n_n._n_offset = st_tmp - string_table; + memcpy (st_tmp, init, initsz); + st_tmp += initsz; + } + else + memcpy (syment._n._n_name, init, initsz - 1); + + syment.n_sclass = C_EXT; + syment.n_numaux = 1; + bfd_coff_swap_sym_out (abfd, &syment, + &syment_ext[filehdr.f_nsyms * SYMESZ]); + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, + &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); + + /* reloc */ + memset (&reloc, 0, sizeof (struct internal_reloc)); + reloc.r_vaddr = 0x0010; + reloc.r_symndx = filehdr.f_nsyms; + reloc.r_type = R_POS; + reloc.r_size = 31; + bfd_coff_swap_reloc_out (abfd, &reloc, &reloc_ext[0]); + + filehdr.f_nsyms += 2; + scnhdr.s_nreloc += 1; + } + + /* fini */ + if (finisz) + { + memset (&syment, 0, sizeof (struct internal_syment)); + memset (&auxent, 0, sizeof (union internal_auxent)); + + if (finisz > 9) + { + syment._n._n_n._n_offset = st_tmp - string_table; + memcpy (st_tmp, fini, finisz); + st_tmp += finisz; + } + else + memcpy (syment._n._n_name, fini, finisz - 1); + + syment.n_sclass = C_EXT; + syment.n_numaux = 1; + bfd_coff_swap_sym_out (abfd, &syment, + &syment_ext[filehdr.f_nsyms * SYMESZ]); + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, + &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); + + /* reloc */ + memset (&reloc, 0, sizeof (struct internal_reloc)); + reloc.r_vaddr = 0x0028; + reloc.r_symndx = filehdr.f_nsyms; + reloc.r_type = R_POS; + reloc.r_size = 31; + bfd_coff_swap_reloc_out (abfd, &reloc, + &reloc_ext[scnhdr.s_nreloc * RELSZ]); + + filehdr.f_nsyms += 2; + scnhdr.s_nreloc += 1; + } + + scnhdr.s_relptr = scnhdr.s_scnptr + data_buffer_size; + filehdr.f_symptr = scnhdr.s_relptr + scnhdr.s_nreloc * RELSZ; + + bfd_coff_swap_filehdr_out (abfd, &filehdr, filehdr_ext); + bfd_bwrite (filehdr_ext, FILHSZ, abfd); + bfd_coff_swap_scnhdr_out (abfd, &scnhdr, scnhdr_ext); + bfd_bwrite (scnhdr_ext, SCNHSZ, abfd); + bfd_bwrite (data_buffer, data_buffer_size, abfd); + bfd_bwrite (reloc_ext, scnhdr.s_nreloc * RELSZ, abfd); + bfd_bwrite (syment_ext, filehdr.f_nsyms * SYMESZ, abfd); + bfd_bwrite (string_table, string_table_size, abfd); + + free (data_buffer); + data_buffer = NULL; + + return true; +} + + +static reloc_howto_type xcoff_dynamic_reloc = +HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false); /* pcrel_offset */ + +/* glink + + The first word of global linkage code must be modified by filling in + the correct TOC offset. */ + +static unsigned long xcoff_glink_code[9] = + { + 0x81820000, /* lwz r12,0(r2) */ + 0x90410014, /* stw r2,20(r1) */ + 0x800c0000, /* lwz r0,0(r12) */ + 0x804c0004, /* lwz r2,4(r12) */ + 0x7c0903a6, /* mtctr r0 */ + 0x4e800420, /* bctr */ + 0x00000000, /* start of traceback table */ + 0x000c8000, /* traceback table */ + 0x00000000, /* traceback table */ + }; + + +static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = + { + { /* COFF backend, defined in libcoff.h. */ + _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ + _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ + coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ + _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ + _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ + coff_swap_lineno_out, /* _bfd_swap_lineno_out */ + coff_swap_reloc_out, /* _bfd_swap_reloc_out */ + coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ + coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ + coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ + FILHSZ, /* _bfd_filhsz */ + AOUTSZ, /* _bfd_aoutsz */ + SCNHSZ, /* _bfd_scnhsz */ + SYMESZ, /* _bfd_symesz */ + AUXESZ, /* _bfd_auxesz */ + RELSZ, /* _bfd_relsz */ + LINESZ, /* _bfd_linesz */ + FILNMLEN, /* _bfd_filnmlen */ + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + (3), /* _bfd_coff_default_section_alignment_power */ + false, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ + coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ + coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ + coff_swap_reloc_in, /* _bfd_reloc_in */ + coff_bad_format_hook, /* _bfd_bad_format_hook */ + coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ + coff_mkobject_hook, /* _bfd_mkobject_hook */ + styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ + coff_set_alignment_hook, /* _bfd_set_alignment_hook */ + coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ + symname_in_debug_hook, /* _coff_symname_in_debug_hook */ + coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ + coff_print_aux, /* bfd_coff_print_aux */ + dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ + dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, /* _bfd_coff_compute_section_file_positions */ + NULL, /* _bfd_coff_start_final_link */ + xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ + coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ + NULL, /* _bfd_coff_addust_symndx */ + _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ + coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ + coff_final_link_postscript /* _bfd_coff_final_link_postscript */ + }, + + 0x01DF, /* magic number */ + bfd_arch_rs6000, /* architecture */ + bfd_mach_rs6k, /* machine */ + + /* Function pointers to xcoff specific swap routines. */ + xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ + xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ + xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ + xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ + xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ + xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ + + /* Sizes. */ + LDHDRSZ, /* _xcoff_ldhdrsz */ + LDSYMSZ, /* _xcoff_ldsymsz */ + LDRELSZ, /* _xcoff_ldrelsz */ + 12, /* _xcoff_function_descriptor_size */ + SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ + + /* Versions. */ + 1, /* _xcoff_ldhdr_version */ + + /* Xcoff vs xcoff64 putting symbol names. */ + _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ + _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ + + & xcoff_dynamic_reloc, /* dynamic reloc howto */ + + xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ + + /* Lineno and reloc count overflow. */ + xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, + + xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset, + + /* glink. */ + & xcoff_glink_code[0], + (36), /* _xcoff_glink_size */ + + /* rtinit */ + 64, /* _xcoff_rtinit_size */ + xcoff_generate_rtinit, /* _xcoff_generate_rtinit */ +}; + +/* The transfer vector that leads the outside world to all of the above. */ +const bfd_target rs6000coff_vec = +{ + "aixcoff-rs6000", + bfd_target_xcoff_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 | DYNAMIC | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen??? FIXMEmgo */ + + /* data */ + bfd_getb64, /* bfd_getx64 */ + bfd_getb_signed_64, /* bfd_getx_signed_64 */ + bfd_putb64, /* bfd_putx64 */ + bfd_getb32, /* bfd_getx32 */ + bfd_getb_signed_32, /* bfd_getx_signed_32 */ + bfd_putb32, /* bfd_putx32 */ + bfd_getb16, /* bfd_getx16 */ + bfd_getb_signed_16, /* bfd_getx_signed_16 */ + bfd_putb16, /* bfd_putx16 */ + + /* hdrs */ + bfd_getb64, /* bfd_h_getx64 */ + bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ + bfd_putb64, /* bfd_h_putx64 */ + bfd_getb32, /* bfd_h_getx32 */ + bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ + bfd_putb32, /* bfd_h_putx32 */ + bfd_getb16, /* bfd_h_getx16 */ + bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ + bfd_putb16, /* bfd_h_putx16 */ + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ + bfd_true, /* _close_and_cleanup */ + bfd_true, /* _bfd_free_cached_info */ + coff_new_section_hook, /* _new_section_hook */ + _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ + /* _bfd_get_section_contents_in_window */ + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ + /* _bfd_merge_private_bfd_data */ + ((boolean (*) (bfd *, bfd *)) bfd_true), + /* _bfd_copy_pivate_section_data */ + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + /* _bfd_copy_private_symbol_data */ + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ + ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ + + /* Core */ + coff_core_file_failing_command, /* _core_file_failing_command */ + coff_core_file_failing_signal, /* _core_file_failing_signal */ + /* _core_file_matches_executable_p */ + coff_core_file_matches_executable_p, + + /* Archive */ + _bfd_xcoff_slurp_armap, /* _slurp_armap */ + /* XCOFF archives do not have + anything which corresponds to + an extended name table. */ + bfd_false, /* _slurp_extended_name_table */ + /* _construct_extended_name_table */ + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, /* _truncate_arname */ + _bfd_xcoff_write_armap, /* _write_armap */ + _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ + _bfd_xcoff_openr_next_archived_file, /* _openr_next_archived_file */ + _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ + _bfd_xcoff_generic_stat_arch_elt, /* _generic_dtat_arch_elt */ + /* XCOFF archives do not have + a timestamp. */ + bfd_true, /* _update_armap_timestamp */ + + /* Symbols */ + coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ + coff_get_symtab, /* _get_symtab */ + coff_make_empty_symbol, /* _make_empty_symbol */ + coff_print_symbol, /* _print_symbol */ + coff_get_symbol_info, /* _get_symbol_info */ + _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ + coff_get_lineno, /* _get_lineno */ + coff_find_nearest_line, /* _find_nearest_line */ + coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ + _bfd_generic_read_minisymbols, /* _read_minisymbols */ + _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ + + /* Reloc */ + coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ + coff_canonicalize_reloc, /* _cononicalize_reloc */ + _bfd_xcoff_reloc_type_lookup, /* _bfd_reloc_type_lookup */ + + /* Write */ + coff_set_arch_mach, /* _set_arch_mach */ + coff_set_section_contents, /* _set_section_contents */ + + /* Link */ + _bfd_xcoff_sizeof_headers, /* _sizeof_headers */ + /* _bfd_get_relocated_section_contents */ + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, /* _bfd_relax_section */ + _bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */ + _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ + _bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */ + _bfd_generic_link_split_section, /* _bfd_link_split_section */ + bfd_generic_gc_sections, /* _bfd_gc_sections */ + bfd_generic_merge_sections, /* _bfd_merge_sections */ + + /* Dynamic */ + /* _get_dynamic_symtab_upper_bound */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ + _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ + _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ + + /* Opposite endian version, none exists */ + NULL, + + /* back end data */ + (void *) &bfd_xcoff_backend_data, +}; + +/* + * xcoff-powermac target + * Old target. + * Only difference between this target and the rs6000 target is the + * the default architecture and machine type used in coffcode.h + * + * PowerPC Macs use the same magic numbers as RS/6000 + * (because that's how they were bootstrapped originally), + * but they are always PowerPC architecture. + */ +static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = +{ + { /* COFF backend, defined in libcoff.h */ + _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ + _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ + coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ + _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ + _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ + coff_swap_lineno_out, /* _bfd_swap_lineno_out */ + coff_swap_reloc_out, /* _bfd_swap_reloc_out */ + coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ + coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ + coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ + FILHSZ, /* _bfd_filhsz */ + AOUTSZ, /* _bfd_aoutsz */ + SCNHSZ, /* _bfd_scnhsz */ + SYMESZ, /* _bfd_symesz */ + AUXESZ, /* _bfd_auxesz */ + RELSZ, /* _bfd_relsz */ + LINESZ, /* _bfd_linesz */ + FILNMLEN, /* _bfd_filnmlen */ + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + (3), /* _bfd_coff_default_section_alignment_power */ + false, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ + coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ + coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ + coff_swap_reloc_in, /* _bfd_reloc_in */ + coff_bad_format_hook, /* _bfd_bad_format_hook */ + coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ + coff_mkobject_hook, /* _bfd_mkobject_hook */ + styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ + coff_set_alignment_hook, /* _bfd_set_alignment_hook */ + coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ + symname_in_debug_hook, /* _coff_symname_in_debug_hook */ + coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ + coff_print_aux, /* bfd_coff_print_aux */ + dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ + dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ + NULL, /* bfd_coff_sym_is_global */ + /* _bfd_coff_compute_section_file_positions */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ + xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ + coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ + NULL, /* _bfd_coff_addust_symndx */ + _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ + coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ + coff_final_link_postscript /* _bfd_coff_final_link_postscript */ + }, + + 0x01DF, /* magic number */ + bfd_arch_powerpc, /* architecture */ + bfd_mach_ppc, /* machine */ + + /* function pointers to xcoff specific swap routines */ + xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ + xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ + xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ + xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ + xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ + xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ + + /* sizes */ + LDHDRSZ, /* _xcoff_ldhdrsz */ + LDSYMSZ, /* _xcoff_ldsymsz */ + LDRELSZ, /* _xcoff_ldrelsz */ + 12, /* _xcoff_function_descriptor_size */ + SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ + + /* versions */ + 1, /* _xcoff_ldhdr_version */ + + /* xcoff vs xcoff64 putting symbol names */ + _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ + _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ + + &xcoff_dynamic_reloc, /* dynamic reloc howto */ + + xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ + + /* lineno and reloc count overflow */ + xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, + + xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset, + + /* glink */ + &xcoff_glink_code[0], + (36), /* _xcoff_glink_size */ + + /* rtinit */ + 0, /* _xcoff_rtinit_size */ + xcoff_generate_rtinit, /* _xcoff_generate_rtinit */ + +}; + +/* The transfer vector that leads the outside world to all of the above. */ +const bfd_target pmac_xcoff_vec = +{ + "xcoff-powermac", + bfd_target_xcoff_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 | DYNAMIC | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen??? FIXMEmgo */ + + /* data */ + bfd_getb64, /* bfd_getx64 */ + bfd_getb_signed_64, /* bfd_getx_signed_64 */ + bfd_putb64, /* bfd_putx64 */ + bfd_getb32, /* bfd_getx32 */ + bfd_getb_signed_32, /* bfd_getx_signed_32 */ + bfd_putb32, /* bfd_putx32 */ + bfd_getb16, /* bfd_getx16 */ + bfd_getb_signed_16, /* bfd_getx_signed_16 */ + bfd_putb16, /* bfd_putx16 */ + + /* hdrs */ + bfd_getb64, /* bfd_h_getx64 */ + bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ + bfd_putb64, /* bfd_h_putx64 */ + bfd_getb32, /* bfd_h_getx32 */ + bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ + bfd_putb32, /* bfd_h_putx32 */ + bfd_getb16, /* bfd_h_getx16 */ + bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ + bfd_putb16, /* bfd_h_putx16 */ + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ + bfd_true, /* _close_and_cleanup */ + bfd_true, /* _bfd_free_cached_info */ + coff_new_section_hook, /* _new_section_hook */ + _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ + /* _bfd_get_section_contents_in_window */ + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ + /* _bfd_merge_private_bfd_data */ + ((boolean (*) (bfd *, bfd *)) bfd_true), + /* _bfd_copy_pivate_section_data */ + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + /* _bfd_copy_private_symbol_data */ + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ + ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ + + /* Core */ + coff_core_file_failing_command, /* _core_file_failing_command */ + coff_core_file_failing_signal, /* _core_file_failing_signal */ + /* _core_file_matches_executable_p */ + coff_core_file_matches_executable_p, + + /* Archive */ + _bfd_xcoff_slurp_armap, /* _slurp_armap */ + /* XCOFF archives do not have + anything which corresponds to + an extended name table. */ + bfd_false, /* _slurp_extended_name_table */ + /* _construct_extended_name_table */ + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, /* _truncate_arname */ + _bfd_xcoff_write_armap, /* _write_armap */ + _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ + _bfd_xcoff_openr_next_archived_file, /* _openr_next_archived_file */ + _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ + _bfd_xcoff_generic_stat_arch_elt, /* _generic_dtat_arch_elt */ + /* XCOFF archives do not have + a timestamp. */ + bfd_true, /* _update_armap_timestamp */ + + /* Symbols */ + coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ + coff_get_symtab, /* _get_symtab */ + coff_make_empty_symbol, /* _make_empty_symbol */ + coff_print_symbol, /* _print_symbol */ + coff_get_symbol_info, /* _get_symbol_info */ + _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ + coff_get_lineno, /* _get_lineno */ + coff_find_nearest_line, /* _find_nearest_line */ + coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ + _bfd_generic_read_minisymbols, /* _read_minisymbols */ + _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ + + /* Reloc */ + coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ + coff_canonicalize_reloc, /* _cononicalize_reloc */ + _bfd_xcoff_reloc_type_lookup, /* _bfd_reloc_type_lookup */ + + /* Write */ + coff_set_arch_mach, /* _set_arch_mach */ + coff_set_section_contents, /* _set_section_contents */ + + /* Link */ + _bfd_xcoff_sizeof_headers, /* _sizeof_headers */ + /* _bfd_get_relocated_section_contents */ + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, /* _bfd_relax_section */ + _bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */ + _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ + _bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */ + _bfd_generic_link_split_section, /* _bfd_link_split_section */ + bfd_generic_gc_sections, /* _bfd_gc_sections */ + bfd_generic_merge_sections, /* _bfd_merge_sections */ + + /* Dynamic */ + /* _get_dynamic_symtab_upper_bound */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ + _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ + _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ + + /* Opposite endian version, none exists */ + NULL, + + /* back end data */ + (void *) &bfd_pmac_xcoff_backend_data, +}; diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c index 0f592de..35c23df 100644 --- a/contrib/binutils/bfd/coff-sparc.c +++ b/contrib/binutils/bfd/coff-sparc.c @@ -1,5 +1,5 @@ /* BFD back-end for Sparc COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -33,6 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The page size is a guess based on ELF. */ #define COFF_PAGE_SIZE 0x10000 + +static reloc_howto_type *coff_sparc_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); + enum reloc_type { R_SPARC_NONE = 0, @@ -52,7 +57,7 @@ enum reloc_type }; #if 0 -static CONST char *CONST reloc_type_names[] = +static const char *const reloc_type_names[] = { "R_SPARC_NONE", "R_SPARC_8", "R_SPARC_16", "R_SPARC_32", @@ -129,7 +134,7 @@ struct coff_reloc_map { unsigned char coff_reloc_val; }; -static CONST struct coff_reloc_map sparc_reloc_map[] = +static const struct coff_reloc_map sparc_reloc_map[] = { { BFD_RELOC_NONE, R_SPARC_NONE, }, { BFD_RELOC_16, R_SPARC_16, }, @@ -183,8 +188,8 @@ rtype2howto (cache_ptr, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) -#define SWAP_IN_RELOC_OFFSET bfd_h_get_32 -#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 +#define SWAP_IN_RELOC_OFFSET H_GET_32 +#define SWAP_OUT_RELOC_OFFSET H_PUT_32 #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ cache_ptr->addend = reloc.r_offset; diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h index 2cdc137..0b185a5 100644 --- a/contrib/binutils/bfd/coffcode.h +++ b/contrib/binutils/bfd/coffcode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of most COFF variants, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -248,39 +248,37 @@ CODE_FRAGMENT . .typedef struct coff_ptr_struct .{ +. {* Remembers the offset from the first symbol in the file for +. this symbol. Generated by coff_renumber_symbols. *} +. unsigned int offset; . -. {* Remembers the offset from the first symbol in the file for -. this symbol. Generated by coff_renumber_symbols. *} -.unsigned int offset; +. {* Should the value of this symbol be renumbered. Used for +. XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. *} +. unsigned int fix_value : 1; . -. {* Should the value of this symbol be renumbered. Used for -. XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. *} -.unsigned int fix_value : 1; +. {* Should the tag field of this symbol be renumbered. +. Created by coff_pointerize_aux. *} +. unsigned int fix_tag : 1; . -. {* Should the tag field of this symbol be renumbered. -. Created by coff_pointerize_aux. *} -.unsigned int fix_tag : 1; +. {* Should the endidx field of this symbol be renumbered. +. Created by coff_pointerize_aux. *} +. unsigned int fix_end : 1; . -. {* Should the endidx field of this symbol be renumbered. -. Created by coff_pointerize_aux. *} -.unsigned int fix_end : 1; +. {* Should the x_csect.x_scnlen field be renumbered. +. Created by coff_pointerize_aux. *} +. unsigned int fix_scnlen : 1; . -. {* Should the x_csect.x_scnlen field be renumbered. -. Created by coff_pointerize_aux. *} -.unsigned int fix_scnlen : 1; +. {* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the +. index into the line number entries. Set by coff_slurp_symbol_table. *} +. unsigned int fix_line : 1; . -. {* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the -. index into the line number entries. Set by -. coff_slurp_symbol_table. *} -.unsigned int fix_line : 1; -. -. {* The container for the symbol structure as read and translated -. from the file. *} -. -.union { -. union internal_auxent auxent; -. struct internal_syment syment; -. } u; +. {* The container for the symbol structure as read and translated +. from the file. *} +. union +. { +. union internal_auxent auxent; +. struct internal_syment syment; +. } u; .} combined_entry_type; . . @@ -288,17 +286,17 @@ CODE_FRAGMENT . .typedef struct coff_symbol_struct .{ -. {* The actual symbol which the rest of BFD works with *} -.asymbol symbol; +. {* The actual symbol which the rest of BFD works with *} +. asymbol symbol; . -. {* A pointer to the hidden information for this symbol *} -.combined_entry_type *native; +. {* A pointer to the hidden information for this symbol *} +. combined_entry_type *native; . -. {* A pointer to the linenumber information for this symbol *} -.struct lineno_cache_entry *lineno; +. {* A pointer to the linenumber information for this symbol *} +. struct lineno_cache_entry *lineno; . -. {* Have the line numbers been relocated yet ? *} -.boolean done_lineno; +. {* Have the line numbers been relocated yet ? *} +. boolean done_lineno; .} coff_symbol_type; */ @@ -312,8 +310,8 @@ CODE_FRAGMENT #define STRING_SIZE_SIZE (4) static long sec_to_styp_flags PARAMS ((const char *, flagword)); -static flagword styp_to_sec_flags - PARAMS ((bfd *, PTR, const char *, asection *)); +static boolean styp_to_sec_flags + PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); static boolean coff_bad_format_hook PARAMS ((bfd *, PTR)); static void coff_set_custom_section_alignment PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *, @@ -324,12 +322,12 @@ static boolean coff_write_relocs PARAMS ((bfd *, int)); static boolean coff_set_flags PARAMS ((bfd *, unsigned int *, unsigned short *)); static boolean coff_set_arch_mach - PARAMS ((bfd *, enum bfd_architecture, unsigned long)); + PARAMS ((bfd *, enum bfd_architecture, unsigned long)) ATTRIBUTE_UNUSED; static boolean coff_compute_section_file_positions PARAMS ((bfd *)); -static boolean coff_write_object_contents PARAMS ((bfd *)); +static boolean coff_write_object_contents PARAMS ((bfd *)) ATTRIBUTE_UNUSED; static boolean coff_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static PTR buy_and_read PARAMS ((bfd *, file_ptr, int, size_t)); +static PTR buy_and_read PARAMS ((bfd *, file_ptr, bfd_size_type)); static boolean coff_slurp_line_table PARAMS ((bfd *, asection *)); static boolean coff_slurp_symbol_table PARAMS ((bfd *)); static enum coff_symbol_classification coff_classify_symbol @@ -368,7 +366,7 @@ static flagword handle_COMDAT PARAMS ((bfd *, flagword, PTR, const char *, asect static long sec_to_styp_flags (sec_name, sec_flags) - CONST char *sec_name; + const char *sec_name; flagword sec_flags; { long styp_flags = 0; @@ -430,6 +428,14 @@ sec_to_styp_flags (sec_name, sec_flags) { styp_flags = STYP_LOADER; } + else if (!strcmp (sec_name, _EXCEPT)) + { + styp_flags = STYP_EXCEPT; + } + else if (!strcmp (sec_name, _TYPCHK)) + { + styp_flags = STYP_TYPCHK; + } #endif /* Try and figure out what it should be */ else if (sec_flags & SEC_CODE) @@ -508,7 +514,7 @@ sec_to_styp_flags (sec_name, sec_flags) if ((sec_flags & SEC_ALLOC) != 0 && (sec_flags & SEC_LOAD) == 0) styp_flags |= IMAGE_SCN_CNT_UNINITIALIZED_DATA; /* ==STYP_BSS */ /* skip ROM */ - /* skip CONSTRUCTOR */ + /* skip constRUCTOR */ /* skip CONTENTS */ #ifdef STYP_NOLOAD if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0) @@ -553,12 +559,13 @@ sec_to_styp_flags (sec_name, sec_flags) #ifndef COFF_WITH_PE -static flagword -styp_to_sec_flags (abfd, hdr, name, section) +static boolean +styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd ATTRIBUTE_UNUSED; PTR hdr; const char *name; asection *section ATTRIBUTE_UNUSED; + flagword *flags_ptr; { struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; long styp_flags = internal_s->s_flags; @@ -566,19 +573,17 @@ styp_to_sec_flags (abfd, hdr, name, section) #ifdef STYP_BLOCK if (styp_flags & STYP_BLOCK) - sec_flags |= SEC_BLOCK; + sec_flags |= SEC_BLOCK; #endif #ifdef STYP_CLINK if (styp_flags & STYP_CLINK) - sec_flags |= SEC_CLINK; + sec_flags |= SEC_CLINK; #endif #ifdef STYP_NOLOAD if (styp_flags & STYP_NOLOAD) - { - sec_flags |= SEC_NEVER_LOAD; - } + sec_flags |= SEC_NEVER_LOAD; #endif /* STYP_NOLOAD */ /* For 386 COFF, at least, an unloadable text or data section is @@ -619,9 +624,7 @@ styp_to_sec_flags (abfd, hdr, name, section) #endif } else if (styp_flags & STYP_PAD) - { - sec_flags = 0; - } + sec_flags = 0; else if (strcmp (name, _TEXT) == 0) { if (sec_flags & SEC_NEVER_LOAD) @@ -664,26 +667,19 @@ styp_to_sec_flags (abfd, hdr, name, section) #endif #ifdef _LIT else if (strcmp (name, _LIT) == 0) - { - sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY; - } + sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY; #endif else - { - sec_flags |= SEC_ALLOC | SEC_LOAD; - } + sec_flags |= SEC_ALLOC | SEC_LOAD; #ifdef STYP_LIT /* A29k readonly text/data section type */ if ((styp_flags & STYP_LIT) == STYP_LIT) - { - sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY); - } + sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY); #endif /* STYP_LIT */ + #ifdef STYP_OTHER_LOAD /* Other loaded sections */ if (styp_flags & STYP_OTHER_LOAD) - { - sec_flags = (SEC_LOAD | SEC_ALLOC); - } + sec_flags = (SEC_LOAD | SEC_ALLOC); #endif /* STYP_SDATA */ #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE) @@ -697,7 +693,11 @@ styp_to_sec_flags (abfd, hdr, name, section) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif - return sec_flags; + if (flags_ptr == NULL) + return false; + + * flags_ptr = sec_flags; + return true; } #else /* COFF_WITH_PE */ @@ -736,7 +736,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) if (! _bfd_coff_get_external_symbols (abfd)) return sec_flags; - + esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); @@ -923,21 +923,23 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) drop through from the above). */ { char *newname; + bfd_size_type amt; - /* This must the the second symbol with the + /* This must the second symbol with the section #. It is the actual symbol name. Intel puts the two adjacent, but Alpha (at least) spreads them out. */ - section->comdat = - bfd_alloc (abfd, sizeof (struct bfd_comdat_info)); + amt = sizeof (struct bfd_comdat_info); + section->comdat = bfd_alloc (abfd, amt); if (section->comdat == NULL) abort (); section->comdat->symbol = (esym - esymstart) / bfd_coff_symesz (abfd); - newname = bfd_alloc (abfd, strlen (symname) + 1); + amt = strlen (symname) + 1; + newname = bfd_alloc (abfd, amt); if (newname == NULL) abort (); @@ -966,16 +968,18 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) required information. FIXME: Is the COMDAT symbol index used for any purpose other than objdump? */ -static flagword -styp_to_sec_flags (abfd, hdr, name, section) +static boolean +styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd; PTR hdr; const char *name; asection *section; + flagword *flags_ptr; { struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; long styp_flags = internal_s->s_flags; flagword sec_flags; + boolean result = true; /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified. */ sec_flags = SEC_READONLY; @@ -985,7 +989,7 @@ styp_to_sec_flags (abfd, hdr, name, section) { long flag = styp_flags & - styp_flags; char * unhandled = NULL; - + styp_flags &= ~ flag; /* We infer from the distinct read/write/execute bits the settings @@ -1010,7 +1014,7 @@ styp_to_sec_flags (abfd, hdr, name, section) case STYP_NOLOAD: sec_flags |= SEC_NEVER_LOAD; break; -#endif +#endif case IMAGE_SCN_MEM_READ: /* Ignored, assume it always to be true. */ break; @@ -1067,17 +1071,17 @@ styp_to_sec_flags (abfd, hdr, name, section) break; default: /* Silently ignore for now. */ - break; + break; } - /* If the section flag was not handled, report it here. This will allow - users of the BFD library to report a problem but continue executing. - Tools which need to be aware of these problems (such as the linker) - can override the default bfd_error_handler to intercept these reports. */ + /* If the section flag was not handled, report it here. */ if (unhandled != NULL) - (*_bfd_error_handler) - (_("%s (%s): Section flag %s (0x%x) ignored"), - bfd_get_filename (abfd), name, unhandled, flag); + { + (*_bfd_error_handler) + (_("%s (%s): Section flag %s (0x%x) ignored"), + bfd_archive_filename (abfd), name, unhandled, flag); + result = false; + } } #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE) @@ -1091,7 +1095,10 @@ styp_to_sec_flags (abfd, hdr, name, section) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif - return sec_flags; + if (flags_ptr) + * flags_ptr = sec_flags; + + return result; } #endif /* COFF_WITH_PE */ @@ -1123,234 +1130,166 @@ CODE_FRAGMENT Special entry points for gdb to swap in coff symbol table parts: .typedef struct .{ -. void (*_bfd_coff_swap_aux_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. int type, -. int class, -. int indaux, -. int numaux, -. PTR in)); +. void (*_bfd_coff_swap_aux_in) +. PARAMS ((bfd *, PTR, int, int, int, int, PTR)); . -. void (*_bfd_coff_swap_sym_in) PARAMS (( -. bfd *abfd , -. PTR ext, -. PTR in)); +. void (*_bfd_coff_swap_sym_in) +. PARAMS ((bfd *, PTR, PTR)); . -. void (*_bfd_coff_swap_lineno_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. PTR in)); +. void (*_bfd_coff_swap_lineno_in) +. PARAMS ((bfd *, PTR, PTR)); . - -Special entry points for gas to swap out coff parts: - -. unsigned int (*_bfd_coff_swap_aux_out) PARAMS (( -. bfd *abfd, -. PTR in, -. int type, -. int class, -. int indaux, -. int numaux, -. PTR ext)); +. unsigned int (*_bfd_coff_swap_aux_out) +. PARAMS ((bfd *, PTR, int, int, int, int, PTR)); . -. unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( -. bfd *abfd, -. PTR in, -. PTR ext)); +. unsigned int (*_bfd_coff_swap_sym_out) +. PARAMS ((bfd *, PTR, PTR)); . -. unsigned int (*_bfd_coff_swap_lineno_out) PARAMS (( -. bfd *abfd, -. PTR in, -. PTR ext)); +. unsigned int (*_bfd_coff_swap_lineno_out) +. PARAMS ((bfd *, PTR, PTR)); . -. unsigned int (*_bfd_coff_swap_reloc_out) PARAMS (( -. bfd *abfd, -. PTR src, -. PTR dst)); +. unsigned int (*_bfd_coff_swap_reloc_out) +. PARAMS ((bfd *, PTR, PTR)); . -. unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS (( -. bfd *abfd, -. PTR in, -. PTR out)); +. unsigned int (*_bfd_coff_swap_filehdr_out) +. PARAMS ((bfd *, PTR, PTR)); . -. unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS (( -. bfd *abfd, -. PTR in, -. PTR out)); +. unsigned int (*_bfd_coff_swap_aouthdr_out) +. PARAMS ((bfd *, PTR, PTR)); . -. unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS (( -. bfd *abfd, -. PTR in, -. PTR out)); +. unsigned int (*_bfd_coff_swap_scnhdr_out) +. PARAMS ((bfd *, PTR, PTR)); . - -Special entry points for generic COFF routines to call target -dependent COFF routines: - -. unsigned int _bfd_filhsz; -. unsigned int _bfd_aoutsz; -. unsigned int _bfd_scnhsz; -. unsigned int _bfd_symesz; -. unsigned int _bfd_auxesz; -. unsigned int _bfd_relsz; -. unsigned int _bfd_linesz; -. unsigned int _bfd_filnmlen; -. boolean _bfd_coff_long_filenames; -. boolean _bfd_coff_long_section_names; -. unsigned int _bfd_coff_default_section_alignment_power; -. boolean _bfd_coff_force_symnames_in_strings; -. unsigned int _bfd_coff_debug_string_prefix_length; -. void (*_bfd_coff_swap_filehdr_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. PTR in)); -. void (*_bfd_coff_swap_aouthdr_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. PTR in)); -. void (*_bfd_coff_swap_scnhdr_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. PTR in)); -. void (*_bfd_coff_swap_reloc_in) PARAMS (( -. bfd *abfd, -. PTR ext, -. PTR in)); -. boolean (*_bfd_coff_bad_format_hook) PARAMS (( -. bfd *abfd, -. PTR internal_filehdr)); -. boolean (*_bfd_coff_set_arch_mach_hook) PARAMS (( -. bfd *abfd, -. PTR internal_filehdr)); -. PTR (*_bfd_coff_mkobject_hook) PARAMS (( -. bfd *abfd, -. PTR internal_filehdr, -. PTR internal_aouthdr)); -. flagword (*_bfd_styp_to_sec_flags_hook) PARAMS (( -. bfd *abfd, -. PTR internal_scnhdr, -. const char *name, -. asection *section)); -. void (*_bfd_set_alignment_hook) PARAMS (( -. bfd *abfd, -. asection *sec, -. PTR internal_scnhdr)); -. boolean (*_bfd_coff_slurp_symbol_table) PARAMS (( -. bfd *abfd)); -. boolean (*_bfd_coff_symname_in_debug) PARAMS (( -. bfd *abfd, -. struct internal_syment *sym)); -. boolean (*_bfd_coff_pointerize_aux_hook) PARAMS (( -. bfd *abfd, -. combined_entry_type *table_base, -. combined_entry_type *symbol, -. unsigned int indaux, -. combined_entry_type *aux)); -. boolean (*_bfd_coff_print_aux) PARAMS (( -. bfd *abfd, -. FILE *file, -. combined_entry_type *table_base, -. combined_entry_type *symbol, -. combined_entry_type *aux, -. unsigned int indaux)); -. void (*_bfd_coff_reloc16_extra_cases) PARAMS (( -. bfd *abfd, -. struct bfd_link_info *link_info, -. struct bfd_link_order *link_order, -. arelent *reloc, -. bfd_byte *data, -. unsigned int *src_ptr, -. unsigned int *dst_ptr)); -. int (*_bfd_coff_reloc16_estimate) PARAMS (( -. bfd *abfd, -. asection *input_section, -. arelent *r, -. unsigned int shrink, -. struct bfd_link_info *link_info)); -. enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS (( -. bfd *abfd, -. struct internal_syment *)); -. boolean (*_bfd_coff_compute_section_file_positions) PARAMS (( -. bfd *abfd)); -. boolean (*_bfd_coff_start_final_link) PARAMS (( -. bfd *output_bfd, -. struct bfd_link_info *info)); -. boolean (*_bfd_coff_relocate_section) PARAMS (( -. 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)); -. reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS (( -. bfd *abfd, -. asection *sec, -. struct internal_reloc *rel, -. struct coff_link_hash_entry *h, -. struct internal_syment *sym, -. bfd_vma *addendp)); -. boolean (*_bfd_coff_adjust_symndx) PARAMS (( -. bfd *obfd, -. struct bfd_link_info *info, -. bfd *ibfd, -. asection *sec, -. struct internal_reloc *reloc, -. boolean *adjustedp)); -. boolean (*_bfd_coff_link_add_one_symbol) PARAMS (( -. struct bfd_link_info *info, -. bfd *abfd, -. const char *name, -. flagword flags, -. asection *section, -. bfd_vma value, -. const char *string, -. boolean copy, -. boolean collect, -. struct bfd_link_hash_entry **hashp)); +. unsigned int _bfd_filhsz; +. unsigned int _bfd_aoutsz; +. unsigned int _bfd_scnhsz; +. unsigned int _bfd_symesz; +. unsigned int _bfd_auxesz; +. unsigned int _bfd_relsz; +. unsigned int _bfd_linesz; +. unsigned int _bfd_filnmlen; +. boolean _bfd_coff_long_filenames; +. boolean _bfd_coff_long_section_names; +. unsigned int _bfd_coff_default_section_alignment_power; +. boolean _bfd_coff_force_symnames_in_strings; +. unsigned int _bfd_coff_debug_string_prefix_length; +. +. void (*_bfd_coff_swap_filehdr_in) +. PARAMS ((bfd *, PTR, PTR)); +. +. void (*_bfd_coff_swap_aouthdr_in) +. PARAMS ((bfd *, PTR, PTR)); +. +. void (*_bfd_coff_swap_scnhdr_in) +. PARAMS ((bfd *, PTR, PTR)); +. +. void (*_bfd_coff_swap_reloc_in) +. PARAMS ((bfd *abfd, PTR, PTR)); +. +. boolean (*_bfd_coff_bad_format_hook) +. PARAMS ((bfd *, PTR)); +. +. boolean (*_bfd_coff_set_arch_mach_hook) +. PARAMS ((bfd *, PTR)); +. +. PTR (*_bfd_coff_mkobject_hook) +. PARAMS ((bfd *, PTR, PTR)); +. +. boolean (*_bfd_styp_to_sec_flags_hook) +. PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); +. +. void (*_bfd_set_alignment_hook) +. PARAMS ((bfd *, asection *, PTR)); +. +. boolean (*_bfd_coff_slurp_symbol_table) +. PARAMS ((bfd *)); +. +. boolean (*_bfd_coff_symname_in_debug) +. PARAMS ((bfd *, struct internal_syment *)); +. +. boolean (*_bfd_coff_pointerize_aux_hook) +. PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, +. unsigned int, combined_entry_type *)); +. +. boolean (*_bfd_coff_print_aux) +. PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, +. combined_entry_type *, unsigned int)); +. +. void (*_bfd_coff_reloc16_extra_cases) +. PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, +. bfd_byte *, unsigned int *, unsigned int *)); +. +. int (*_bfd_coff_reloc16_estimate) +. PARAMS ((bfd *, asection *, arelent *, unsigned int, +. struct bfd_link_info *)); +. +. enum coff_symbol_classification (*_bfd_coff_classify_symbol) +. PARAMS ((bfd *, struct internal_syment *)); +. +. boolean (*_bfd_coff_compute_section_file_positions) +. PARAMS ((bfd *)); +. +. boolean (*_bfd_coff_start_final_link) +. PARAMS ((bfd *, struct bfd_link_info *)); . -. boolean (*_bfd_coff_link_output_has_begun) PARAMS (( -. bfd * abfd, -. struct coff_final_link_info * pfinfo)); -. boolean (*_bfd_coff_final_link_postscript) PARAMS (( -. bfd * abfd, -. struct coff_final_link_info * pfinfo)); +. boolean (*_bfd_coff_relocate_section) +. PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, +. struct internal_reloc *, struct internal_syment *, asection **)); +. +. reloc_howto_type *(*_bfd_coff_rtype_to_howto) +. PARAMS ((bfd *, asection *, struct internal_reloc *, +. struct coff_link_hash_entry *, struct internal_syment *, +. bfd_vma *)); +. +. boolean (*_bfd_coff_adjust_symndx)\ +. PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, +. struct internal_reloc *, boolean *)); +. +. boolean (*_bfd_coff_link_add_one_symbol) +. PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, +. asection *, bfd_vma, const char *, boolean, boolean, +. struct bfd_link_hash_entry **)); +. +. boolean (*_bfd_coff_link_output_has_begun) +. PARAMS ((bfd *, struct coff_final_link_info *)); +. +. boolean (*_bfd_coff_final_link_postscript) +. PARAMS ((bfd *, struct coff_final_link_info *)); . .} bfd_coff_backend_data; . -.#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) +.#define coff_backend_info(abfd) \ +. ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) . .#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ -. ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) +. ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) . .#define bfd_coff_swap_sym_in(a,e,i) \ -. ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) +. ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) . .#define bfd_coff_swap_lineno_in(a,e,i) \ -. ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) +. ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) . .#define bfd_coff_swap_reloc_out(abfd, i, o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) . .#define bfd_coff_swap_lineno_out(abfd, i, o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) . .#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ -. ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) +. ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) . .#define bfd_coff_swap_sym_out(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) . .#define bfd_coff_swap_scnhdr_out(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) . .#define bfd_coff_swap_filehdr_out(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) . .#define bfd_coff_swap_aouthdr_out(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) . .#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) .#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) @@ -1360,90 +1299,91 @@ dependent COFF routines: .#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) .#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) .#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) -.#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames) +.#define bfd_coff_long_filenames(abfd) \ +. (coff_backend_info (abfd)->_bfd_coff_long_filenames) .#define bfd_coff_long_section_names(abfd) \ -. (coff_backend_info (abfd)->_bfd_coff_long_section_names) +. (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)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) . .#define bfd_coff_swap_aouthdr_in(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) . .#define bfd_coff_swap_scnhdr_in(abfd, i,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) . .#define bfd_coff_swap_reloc_in(abfd, i, o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) +. ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) . .#define bfd_coff_bad_format_hook(abfd, filehdr) \ -. ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) +. ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) . .#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ -. ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) +. ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) .#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ -. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) +. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) . -.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\ -. ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ -. (abfd, scnhdr, name, section)) +.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ +. ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ +. (abfd, scnhdr, name, section, flags_ptr)) . .#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ -. ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) +. ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) . .#define bfd_coff_slurp_symbol_table(abfd)\ -. ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) +. ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) . .#define bfd_coff_symname_in_debug(abfd, sym)\ -. ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) +. ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) . .#define bfd_coff_force_symnames_in_strings(abfd)\ -. (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) +. (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) . .#define bfd_coff_debug_string_prefix_length(abfd)\ -. (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) +. (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) . .#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ -. ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ -. (abfd, file, base, symbol, aux, indaux)) +. ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ +. (abfd, file, base, symbol, aux, indaux)) . .#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ -. ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ -. (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) +. ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ +. (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) . .#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ -. ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ -. (abfd, section, reloc, shrink, link_info)) +. ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ +. (abfd, section, reloc, shrink, link_info)) . .#define bfd_coff_classify_symbol(abfd, sym)\ -. ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ -. (abfd, sym)) +. ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ +. (abfd, sym)) . .#define bfd_coff_compute_section_file_positions(abfd)\ -. ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ -. (abfd)) +. ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ +. (abfd)) . .#define bfd_coff_start_final_link(obfd, info)\ -. ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ -. (obfd, info)) +. ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ +. (obfd, info)) .#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ -. ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ -. (obfd, info, ibfd, o, con, rel, isyms, secs)) +. ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ +. (obfd, info, ibfd, o, con, rel, isyms, secs)) .#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ -. ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ -. (abfd, sec, rel, h, sym, addendp)) +. ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ +. (abfd, sec, rel, h, sym, addendp)) .#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ -. ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ -. (obfd, info, ibfd, sec, rel, adjustedp)) +. ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ +. (obfd, info, ibfd, sec, rel, adjustedp)) .#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ -. ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ -. (info, abfd, name, flags, section, value, string, cp, coll, hashp)) +. ((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,p) \ -. ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) +. ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) .#define bfd_coff_final_link_postscript(a,p) \ -. ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) +. ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) . */ @@ -1506,7 +1446,10 @@ coff_set_custom_section_alignment (abfd, section, alignment_table, table_size) return; if (alignment_table[i].default_alignment_max != COFF_ALIGNMENT_FIELD_EMPTY - && default_alignment > alignment_table[i].default_alignment_max) +#if COFF_DEFAULT_SECTION_ALIGNMENT_POWER != 0 + && default_alignment > alignment_table[i].default_alignment_max +#endif + ) return; section->alignment_power = alignment_table[i].alignment_power; @@ -1545,6 +1488,7 @@ coff_new_section_hook (abfd, section) asection * section; { combined_entry_type *native; + bfd_size_type amt; section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER; @@ -1562,8 +1506,8 @@ 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). */ - native = ((combined_entry_type *) - bfd_zalloc (abfd, sizeof (combined_entry_type) * 10)); + amt = sizeof (combined_entry_type) * 10; + native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (native == NULL) return false; @@ -1645,6 +1589,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) PTR scnhdr; { struct internal_scnhdr *hdr = (struct internal_scnhdr *) scnhdr; + bfd_size_type amt; ALIGN_SET (hdr->s_flags, IMAGE_SCN_ALIGN_64BYTES, 6) ELIFALIGN_SET (hdr->s_flags, IMAGE_SCN_ALIGN_32BYTES, 5) @@ -1660,8 +1605,8 @@ coff_set_alignment_hook (abfd, section, scnhdr) mapped onto a generic BFD section bit. */ if (coff_section_data (abfd, section) == NULL) { - section->used_by_bfd = - (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)); + amt = sizeof (struct coff_section_tdata); + section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (section->used_by_bfd == NULL) { /* FIXME: Return error. */ @@ -1670,8 +1615,8 @@ coff_set_alignment_hook (abfd, section, scnhdr) } if (pei_section_data (abfd, section) == NULL) { - coff_section_data (abfd, section)->tdata = - (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata)); + amt = sizeof (struct pei_section_tdata); + coff_section_data (abfd, section)->tdata = (PTR) bfd_zalloc (abfd, amt); if (coff_section_data (abfd, section)->tdata == NULL) { /* FIXME: Return error. */ @@ -1688,16 +1633,15 @@ coff_set_alignment_hook (abfd, section, scnhdr) { struct external_reloc dst; struct internal_reloc n; - int oldpos = bfd_tell (abfd); - bfd_seek (abfd, hdr->s_relptr, 0); - if (bfd_read ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd) + file_ptr oldpos = bfd_tell (abfd); + bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0); + if (bfd_bread ((PTR) &dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd) != bfd_coff_relsz (abfd)) return; coff_swap_reloc_in (abfd, &dst, &n); bfd_seek (abfd, oldpos, 0); - section->reloc_count = - hdr->s_nreloc = n.r_vaddr; + section->reloc_count = hdr->s_nreloc = n.r_vaddr; } } #undef ALIGN_SET @@ -1725,7 +1669,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) if ((hdr->s_flags & STYP_OVRFLO) == 0) return; - real_sec = coff_section_from_bfd_index (abfd, hdr->s_nreloc); + real_sec = coff_section_from_bfd_index (abfd, (int) hdr->s_nreloc); if (real_sec == NULL) return; @@ -1736,7 +1680,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) { if (*ps == section) { - *ps = (*ps)->next; + bfd_section_list_remove (abfd, ps); --abfd->section_count; break; } @@ -1761,8 +1705,9 @@ coff_mkobject (abfd) bfd * abfd; { coff_data_type *coff; + bfd_size_type amt = sizeof (coff_data_type); - abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, sizeof (coff_data_type)); + abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.coff_obj_data == 0) return false; coff = coff_data (abfd); @@ -1870,7 +1815,7 @@ coff_set_arch_mach_hook (abfd, filehdr) bfd *abfd; PTR filehdr; { - long machine; + unsigned long machine; enum bfd_architecture arch; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; @@ -2030,11 +1975,11 @@ coff_set_arch_mach_hook (abfd, filehdr) { bfd_byte *buf; struct internal_syment sym; + bfd_size_type amt = bfd_coff_symesz (abfd); - buf = (bfd_byte *) bfd_malloc (bfd_coff_symesz (abfd)); + buf = (bfd_byte *) bfd_malloc (amt); if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 - || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd) - != bfd_coff_symesz (abfd))) + || bfd_bread (buf, amt, abfd) != amt) { free (buf); return false; @@ -2053,21 +1998,8 @@ coff_set_arch_mach_hook (abfd, filehdr) { default: case 0: -#ifdef POWERMAC - /* PowerPC Macs use the same magic numbers as RS/6000 - (because that's how they were bootstrapped originally), - but they are always PowerPC architecture. */ - arch = bfd_arch_powerpc; - machine = bfd_mach_ppc; -#else -#ifdef XCOFF64 - arch = bfd_arch_powerpc; - machine = bfd_mach_ppc_620; -#else - arch = bfd_arch_rs6000; - machine = bfd_mach_rs6k; -#endif -#endif /* POWERMAC */ + arch = bfd_xcoff_architecture (abfd); + machine = bfd_xcoff_machine (abfd); break; case 1: @@ -2338,13 +2270,21 @@ coff_print_aux (abfd, file, table_base, symbol, aux, indaux) if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) != XTY_LD) { BFD_ASSERT (! aux->fix_scnlen); - fprintf (file, "val %5ld", aux->u.auxent.x_csect.x_scnlen.l); +#ifdef XCOFF64 + fprintf (file, "val %5lld", aux->u.auxent.x_csect.x_scnlen.l); +#else + fprintf (file, "val %5ld", (long) aux->u.auxent.x_csect.x_scnlen.l); +#endif } else { fprintf (file, "indx "); if (! aux->fix_scnlen) - fprintf (file, "%4ld", aux->u.auxent.x_csect.x_scnlen.l); +#ifdef XCOFF64 + fprintf (file, "%4lld", aux->u.auxent.x_csect.x_scnlen.l); +#else + fprintf (file, "%4ld", (long) aux->u.auxent.x_csect.x_scnlen.l); +#endif else fprintf (file, "%4ld", (long) (aux->u.auxent.x_csect.x_scnlen.p - table_base)); @@ -2418,12 +2358,18 @@ coff_write_relocs (abfd, first_undef) #ifndef TARG_AUX p = s->orelocation; #else - /* sort relocations before we write them out */ - p = (arelent **) bfd_malloc (s->reloc_count * sizeof (arelent *)); - if (p == NULL && s->reloc_count > 0) - return false; - memcpy (p, s->orelocation, s->reloc_count * sizeof (arelent *)); - qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr); + { + /* sort relocations before we write them out */ + bfd_size_type amt; + + amt = s->reloc_count; + amt *= sizeof (arelent *); + p = (arelent **) bfd_malloc (amt); + if (p == NULL && s->reloc_count > 0) + return false; + memcpy (p, s->orelocation, (size_t) amt); + qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr); + } #endif if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0) @@ -2438,8 +2384,8 @@ coff_write_relocs (abfd, first_undef) /* add one to count *this* reloc (grr) */ n.r_vaddr = s->reloc_count + 1; coff_swap_reloc_out (abfd, &n, &dst); - if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd) - != bfd_coff_relsz (abfd)) + if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), + abfd) != bfd_coff_relsz (abfd)) return false; } #endif @@ -2462,15 +2408,15 @@ coff_write_relocs (abfd, first_undef) if (q->sym_ptr_ptr[0]->the_bfd != abfd) { - int i; + int j; const char *sname = q->sym_ptr_ptr[0]->name; asymbol **outsyms = abfd->outsymbols; - for (i = first_undef; outsyms[i]; i++) + for (j = first_undef; outsyms[j]; j++) { - const char *intable = outsyms[i]->name; + const char *intable = outsyms[j]->name; if (strcmp (intable, sname) == 0) { /* got a hit, so repoint the reloc */ - q->sym_ptr_ptr = outsyms + i; + q->sym_ptr_ptr = outsyms + j; break; } } @@ -2517,8 +2463,8 @@ coff_write_relocs (abfd, first_undef) n.r_type = q->howto->type; #endif coff_swap_reloc_out (abfd, &n, &dst); - if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd) - != bfd_coff_relsz (abfd)) + if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), + abfd) != bfd_coff_relsz (abfd)) return false; } @@ -2994,17 +2940,19 @@ coff_compute_section_file_positions (abfd) right order in the image file itself, but we do need to get the target_index values right. */ - int count; + unsigned int count; asection **section_list; - int i; + unsigned int i; int target_index; + bfd_size_type amt; count = 0; for (current = abfd->sections; current != NULL; current = current->next) ++count; /* We allocate an extra cell to simplify the final loop. */ - section_list = bfd_malloc (sizeof (struct asection *) * (count + 1)); + amt = sizeof (struct asection *) * (count + 1); + section_list = bfd_malloc (amt); if (section_list == NULL) return false; @@ -3068,15 +3016,16 @@ coff_compute_section_file_positions (abfd) page size too, and remember both sizes. */ if (coff_section_data (abfd, current) == NULL) { - current->used_by_bfd = - (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)); + bfd_size_type amt = sizeof (struct coff_section_tdata); + current->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (current->used_by_bfd == NULL) return false; } if (pei_section_data (abfd, current) == NULL) { - coff_section_data (abfd, current)->tdata = - (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata)); + bfd_size_type amt = sizeof (struct pei_section_tdata); + coff_section_data (abfd, current)->tdata + = (PTR) bfd_zalloc (abfd, amt); if (coff_section_data (abfd, current)->tdata == NULL) return false; } @@ -3105,7 +3054,36 @@ coff_compute_section_file_positions (abfd) padding the previous section up if necessary */ old_sofar = sofar; - sofar = BFD_ALIGN (sofar, 1 << current->alignment_power); +#ifdef RS6000COFF_C + /* AIX loader checks the text section alignment of (vma - filepos) + So even though the filepos may be aligned wrt the o_algntext, for + AIX executables, this check fails. This shows up when an native + AIX executable is stripped with gnu strip because the default vma + of native is 0x10000150 but default for gnu is 0x10000140. Gnu + stripped gnu excutable passes this check because the filepos is + 0x0140. */ + if (!strcmp (current->name, _TEXT)) + { + bfd_vma pad; + bfd_vma align; + + sofar = BFD_ALIGN (sofar, 1 << current->alignment_power); + + align = 1 << current->alignment_power; + pad = abs (current->vma - sofar) % align; + + if (pad) + { + pad = align - pad; + sofar += pad; + } + } + else +#else + { + sofar = BFD_ALIGN (sofar, 1 << current->alignment_power); + } +#endif if (previous != (asection *) NULL) { previous->_raw_size += sofar - old_sofar; @@ -3181,7 +3159,7 @@ coff_compute_section_file_positions (abfd) b = 0; if (bfd_seek (abfd, sofar - 1, SEEK_SET) != 0 - || bfd_write (&b, 1, 1, abfd) != 1) + || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) return false; } @@ -3214,11 +3192,12 @@ coff_add_missing_symbols (abfd) asymbol **sympp2; unsigned int i; int need_text = 1, need_data = 1, need_bss = 1, need_file = 1; + bfd_size_type amt; for (i = 0; i < nsyms; i++) { coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]); - CONST char *name; + const char *name; if (csym) { /* only do this if there is a coff representation of the input @@ -3250,7 +3229,9 @@ coff_add_missing_symbols (abfd) if (!need_text && !need_data && !need_bss && !need_file) return true; nsyms += need_text + need_data + need_bss + need_file; - sympp2 = (asymbol **) bfd_alloc (abfd, nsyms * sizeof (asymbol *)); + amt = nsyms; + amt *= sizeof (asymbol *); + sympp2 = (asymbol **) bfd_alloc (abfd, amt); if (!sympp2) return false; memcpy (sympp2, sympp, i * sizeof (asymbol *)); @@ -3370,11 +3351,13 @@ coff_write_object_contents (abfd) { scn_base = bfd_coff_filhsz (abfd); #ifdef RS6000COFF_C +#ifndef XCOFF64 if (xcoff_data (abfd)->full_aouthdr) scn_base += bfd_coff_aoutsz (abfd); else scn_base += SMALL_AOUTSZ; #endif +#endif } if (bfd_seek (abfd, scn_base, SEEK_SET) != 0) @@ -3523,9 +3506,10 @@ coff_write_object_contents (abfd) #endif { SCNHDR buff; + bfd_size_type amt = bfd_coff_scnhsz (abfd); + if (coff_swap_scnhdr_out (abfd, §ion, &buff) == 0 - || bfd_write ((PTR) (&buff), 1, bfd_coff_scnhsz (abfd), abfd) - != bfd_coff_scnhsz (abfd)) + || bfd_bwrite ((PTR) &buff, amt, abfd) != amt) return false; } @@ -3625,6 +3609,7 @@ coff_write_object_contents (abfd) } #ifdef RS6000COFF_C +#ifndef XCOFF64 /* XCOFF handles overflows in the reloc and line number count fields by creating a new section header to hold the correct values. */ for (current = abfd->sections; current != NULL; current = current->next) @@ -3633,6 +3618,7 @@ coff_write_object_contents (abfd) { struct internal_scnhdr scnhdr; SCNHDR buff; + bfd_size_type amt; internal_f.f_nscns++; strncpy (&(scnhdr.s_name[0]), current->name, 8); @@ -3645,13 +3631,14 @@ coff_write_object_contents (abfd) scnhdr.s_nreloc = current->target_index; scnhdr.s_nlnno = current->target_index; scnhdr.s_flags = STYP_OVRFLO; + amt = bfd_coff_scnhsz (abfd); if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0 - || bfd_write ((PTR) &buff, 1, bfd_coff_scnhsz (abfd), abfd) - != bfd_coff_scnhsz (abfd)) + || bfd_bwrite ((PTR) &buff, amt, abfd) != amt) return false; } } #endif +#endif /* OK, now set up the filehdr... */ @@ -3673,11 +3660,13 @@ coff_write_object_contents (abfd) { internal_f.f_opthdr = 0; #ifdef RS6000COFF_C +#ifndef XCOFF64 if (xcoff_data (abfd)->full_aouthdr) internal_f.f_opthdr = bfd_coff_aoutsz (abfd); else internal_f.f_opthdr = SMALL_AOUTSZ; #endif +#endif } if (!hasrelocs) @@ -3890,9 +3879,9 @@ coff_write_object_contents (abfd) rounded up to the page size. */ b = 0; if (bfd_seek (abfd, - BFD_ALIGN (sym_base, COFF_PAGE_SIZE) - 1, + (file_ptr) BFD_ALIGN (sym_base, COFF_PAGE_SIZE) - 1, SEEK_SET) != 0 - || bfd_write (&b, 1, 1, abfd) != 1) + || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) return false; } #endif @@ -4016,14 +4005,14 @@ coff_write_object_contents (abfd) { char * buff; - bfd_size_type amount; + bfd_size_type amount = bfd_coff_filhsz (abfd); - buff = bfd_malloc (bfd_coff_filhsz (abfd)); + buff = bfd_malloc (amount); if (buff == NULL) return false; - bfd_coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff); - amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd); + bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, (PTR) buff); + amount = bfd_bwrite ((PTR) buff, amount, abfd); free (buff); @@ -4036,14 +4025,14 @@ coff_write_object_contents (abfd) /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */ char * buff; - bfd_size_type amount; + bfd_size_type amount = bfd_coff_aoutsz (abfd); - buff = bfd_malloc (bfd_coff_aoutsz (abfd)); + buff = bfd_malloc (amount); if (buff == NULL) return false; - coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff); - amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd); + coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) buff); + amount = bfd_bwrite ((PTR) buff, amount, abfd); free (buff); @@ -4062,7 +4051,7 @@ coff_write_object_contents (abfd) size = bfd_coff_aoutsz (abfd); else size = SMALL_AOUTSZ; - if (bfd_write ((PTR) &buff, 1, size, abfd) != size) + if (bfd_bwrite ((PTR) &buff, (bfd_size_type) size, abfd) != size) return false; } #endif @@ -4129,14 +4118,13 @@ coff_set_section_contents (abfd, section, location, offset, count) if (section->filepos == 0) return true; - if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0) + if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) return false; - if (count != 0) - { - return (bfd_write (location, 1, count, abfd) == count) ? true : false; - } - return true; + if (count == 0) + return true; + + return bfd_bwrite (location, count, abfd) == count; } #if 0 static boolean @@ -4166,17 +4154,16 @@ coff_close_and_cleanup (abfd) #endif static PTR -buy_and_read (abfd, where, seek_direction, size) +buy_and_read (abfd, where, size) bfd *abfd; file_ptr where; - int seek_direction; - size_t size; + bfd_size_type size; { PTR area = (PTR) bfd_alloc (abfd, size); if (!area) return (NULL); - if (bfd_seek (abfd, where, seek_direction) != 0 - || bfd_read (area, 1, size, abfd) != size) + if (bfd_seek (abfd, where, SEEK_SET) != 0 + || bfd_bread (area, size, abfd) != size) return (NULL); return (area); } /* buy_and_read() */ @@ -4212,16 +4199,14 @@ coff_slurp_line_table (abfd, asect) { LINENO *native_lineno; alent *lineno_cache; + bfd_size_type amt; BFD_ASSERT (asect->lineno == (alent *) NULL); - native_lineno = (LINENO *) buy_and_read (abfd, - asect->line_filepos, - SEEK_SET, - (size_t) (bfd_coff_linesz (abfd) * - asect->lineno_count)); - lineno_cache = - (alent *) bfd_alloc (abfd, (size_t) ((asect->lineno_count + 1) * sizeof (alent))); + amt = (bfd_size_type) bfd_coff_linesz (abfd) * asect->lineno_count; + native_lineno = (LINENO *) buy_and_read (abfd, asect->line_filepos, amt); + amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent); + lineno_cache = (alent *) bfd_alloc (abfd, amt); if (lineno_cache == NULL) return false; else @@ -4239,17 +4224,17 @@ coff_slurp_line_table (abfd, asect) if (cache_ptr->line_number == 0) { boolean warned; - long symndx; + bfd_signed_vma symndx; coff_symbol_type *sym; warned = false; symndx = dst.l_addr.l_symndx; if (symndx < 0 - || (unsigned long) symndx >= obj_raw_syment_count (abfd)) + || (bfd_vma) symndx >= obj_raw_syment_count (abfd)) { (*_bfd_error_handler) (_("%s: warning: illegal symbol index %ld in line numbers"), - bfd_get_filename (abfd), dst.l_addr.l_symndx); + bfd_archive_filename (abfd), dst.l_addr.l_symndx); symndx = 0; warned = true; } @@ -4263,7 +4248,7 @@ coff_slurp_line_table (abfd, asect) { (*_bfd_error_handler) (_("%s: warning: duplicate line number information for `%s'"), - bfd_get_filename (abfd), + bfd_archive_filename (abfd), bfd_asymbol_name (&sym->symbol)); } sym->lineno = cache_ptr; @@ -4297,6 +4282,7 @@ coff_slurp_symbol_table (abfd) combined_entry_type *native_symbols; coff_symbol_type *cached_area; unsigned int *table_ptr; + bfd_size_type amt; unsigned int number_of_symbols = 0; @@ -4310,17 +4296,15 @@ coff_slurp_symbol_table (abfd) } /* on error */ /* Allocate enough room for all the symbols in cached form */ - cached_area = ((coff_symbol_type *) - bfd_alloc (abfd, - (obj_raw_syment_count (abfd) - * sizeof (coff_symbol_type)))); - + amt = obj_raw_syment_count (abfd); + amt *= sizeof (coff_symbol_type); + cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt); if (cached_area == NULL) return false; - table_ptr = ((unsigned int *) - bfd_alloc (abfd, - (obj_raw_syment_count (abfd) - * sizeof (unsigned int)))); + + amt = obj_raw_syment_count (abfd); + amt *= sizeof (unsigned int); + table_ptr = (unsigned int *) bfd_alloc (abfd, amt); if (table_ptr == NULL) return false; @@ -4623,7 +4607,7 @@ coff_slurp_symbol_table (abfd) default: (*_bfd_error_handler) (_("%s: Unrecognized storage class %d for %s symbol `%s'"), - bfd_get_filename (abfd), src->u.syment.n_sclass, + bfd_archive_filename (abfd), src->u.syment.n_sclass, dst->symbol.section->name, dst->symbol.name); dst->symbol.flags = BSF_DEBUGGING; dst->symbol.value = (src->u.syment.n_value); @@ -4754,7 +4738,7 @@ coff_classify_symbol (abfd, syment) (*_bfd_error_handler) (_("warning: %s: local symbol `%s' has no section"), - bfd_get_filename (abfd), + bfd_archive_filename (abfd), _bfd_coff_internal_syment_name (abfd, syment, buf)); } @@ -4818,8 +4802,8 @@ coff_slurp_reloc_table (abfd, asect, symbols) RELOC *native_relocs; arelent *reloc_cache; arelent *cache_ptr; - unsigned int idx; + bfd_size_type amt; if (asect->relocation) return true; @@ -4829,14 +4813,10 @@ coff_slurp_reloc_table (abfd, asect, symbols) return true; if (!coff_slurp_symbol_table (abfd)) return false; - native_relocs = - (RELOC *) buy_and_read (abfd, - asect->rel_filepos, - SEEK_SET, - (size_t) (bfd_coff_relsz (abfd) * - asect->reloc_count)); - reloc_cache = (arelent *) - bfd_alloc (abfd, (size_t) (asect->reloc_count * sizeof (arelent))); + amt = (bfd_size_type) bfd_coff_relsz (abfd) * asect->reloc_count; + native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos, amt); + amt = (bfd_size_type) asect->reloc_count * sizeof (arelent); + reloc_cache = (arelent *) bfd_alloc (abfd, amt); if (reloc_cache == NULL) return false; @@ -4865,7 +4845,7 @@ coff_slurp_reloc_table (abfd, asect, symbols) { (*_bfd_error_handler) (_("%s: warning: illegal symbol index %ld in relocs"), - bfd_get_filename (abfd), dst.r_symndx); + bfd_archive_filename (abfd), dst.r_symndx); cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; ptr = NULL; } @@ -4903,7 +4883,7 @@ coff_slurp_reloc_table (abfd, asect, symbols) { (*_bfd_error_handler) (_("%s: illegal relocation type %d at address 0x%lx"), - bfd_get_filename (abfd), dst.r_type, (long) dst.r_vaddr); + bfd_archive_filename (abfd), dst.r_type, (long) dst.r_vaddr); bfd_set_error (bfd_error_bad_value); return false; } @@ -5258,6 +5238,10 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_gc_sections bfd_generic_gc_sections #endif +#ifndef coff_bfd_merge_sections +#define coff_bfd_merge_sections bfd_generic_merge_sections +#endif + #define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ const bfd_target VAR = \ { \ diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c index 82bfdc8..88591f1 100644 --- a/contrib/binutils/bfd/coffgen.c +++ b/contrib/binutils/bfd/coffgen.c @@ -47,13 +47,13 @@ static void coff_fix_symbol_name PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *, asection **, bfd_size_type *)); static boolean coff_write_symbol - PARAMS ((bfd *, asymbol *, combined_entry_type *, unsigned int *, + PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); static boolean coff_write_alien_symbol - PARAMS ((bfd *, asymbol *, unsigned int *, bfd_size_type *, + PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); static boolean coff_write_native_symbol - PARAMS ((bfd *, coff_symbol_type *, unsigned int *, bfd_size_type *, + PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); static void coff_pointerize_aux PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, @@ -68,7 +68,7 @@ static void fixup_symbol_value static char *build_debug_section PARAMS ((bfd *)); static char *copy_name - PARAMS ((bfd *, char *, int)); + PARAMS ((bfd *, char *, size_t)); #define STRING_SIZE_SIZE (4) @@ -82,6 +82,8 @@ make_a_section_from_file (abfd, hdr, target_index) { asection *return_section; char *name; + boolean result = true; + flagword flags; name = NULL; @@ -106,7 +108,7 @@ make_a_section_from_file (abfd, hdr, target_index) strindex does not run us past the end, but right now we don't know the length of the string table. */ strings += strindex; - name = bfd_alloc (abfd, strlen (strings) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1); if (name == NULL) return false; strcpy (name, strings); @@ -116,7 +118,7 @@ make_a_section_from_file (abfd, hdr, target_index) if (name == NULL) { /* Assorted wastage to null-terminate the name, thanks AT&T! */ - name = bfd_alloc (abfd, sizeof (hdr->s_name) + 1); + name = bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1); if (name == NULL) return false; strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); @@ -142,8 +144,12 @@ make_a_section_from_file (abfd, hdr, target_index) return_section->userdata = NULL; return_section->next = (asection *) NULL; return_section->target_index = target_index; - return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, - return_section); + + if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section, + & flags)) + result = false; + + return_section->flags = flags; /* At least on i386-coff, the line number count for a shared library section must be ignored. */ @@ -155,7 +161,8 @@ make_a_section_from_file (abfd, hdr, target_index) /* FIXME: should this check 'hdr->s_size > 0' */ if (hdr->s_scnptr != 0) return_section->flags |= SEC_HAS_CONTENTS; - return true; + + return result; } /* Read in a COFF object and make it into a BFD. This is used by @@ -171,7 +178,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) flagword oflags = abfd->flags; bfd_vma ostart = bfd_get_start_address (abfd); PTR tdata; - size_t readsize; /* length of file_info */ + bfd_size_type readsize; /* length of file_info */ unsigned int scnhsz; char *external_sections; @@ -204,12 +211,12 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) return 0; scnhsz = bfd_coff_scnhsz (abfd); - readsize = nscns * scnhsz; + readsize = (bfd_size_type) nscns * scnhsz; external_sections = (char *) bfd_alloc (abfd, readsize); if (!external_sections) goto fail; - if (bfd_read ((PTR) external_sections, 1, readsize, abfd) != readsize) + if (bfd_bread ((PTR) external_sections, readsize, abfd) != readsize) goto fail; /* Set the arch/mach *before* swapping in sections; section header swapping @@ -250,9 +257,9 @@ const bfd_target * coff_object_p (abfd) bfd *abfd; { - unsigned int filhsz; - unsigned int aoutsz; - int nscns; + bfd_size_type filhsz; + bfd_size_type aoutsz; + unsigned int nscns; PTR filehdr; struct internal_filehdr internal_f; struct internal_aouthdr internal_a; @@ -264,7 +271,7 @@ coff_object_p (abfd) filehdr = bfd_alloc (abfd, filhsz); if (filehdr == NULL) return 0; - if (bfd_read (filehdr, 1, filhsz, abfd) != filhsz) + if (bfd_bread (filehdr, filhsz, abfd) != filhsz) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -273,7 +280,16 @@ coff_object_p (abfd) bfd_coff_swap_filehdr_in (abfd, filehdr, &internal_f); bfd_release (abfd, filehdr); - if (bfd_coff_bad_format_hook (abfd, &internal_f) == false) + /* The XCOFF format has two sizes for the f_opthdr. SMALL_AOUTSZ + (less than aoutsz) used in object files and AOUTSZ (equal to + aoutsz) in executables. The bfd_coff_swap_aouthdr_in function + expects this header to be aoutsz bytes in length, so we use that + value in the call to bfd_alloc below. But we must be careful to + only read in f_opthdr bytes in the call to bfd_bread. We should + also attempt to catch corrupt or non-COFF binaries with a strange + value for f_opthdr. */ + if (bfd_coff_bad_format_hook (abfd, &internal_f) == false + || internal_f.f_opthdr > aoutsz) { bfd_set_error (bfd_error_wrong_format); return 0; @@ -286,8 +302,8 @@ coff_object_p (abfd) opthdr = bfd_alloc (abfd, aoutsz); if (opthdr == NULL) - return 0;; - if (bfd_read (opthdr, 1, internal_f.f_opthdr, abfd) + return 0; + if (bfd_bread (opthdr, (bfd_size_type) internal_f.f_opthdr, abfd) != internal_f.f_opthdr) { return 0; @@ -424,6 +440,7 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs, bfd_byte *erel; bfd_byte *erel_end; struct internal_reloc *irel; + bfd_size_type amt; if (coff_section_data (abfd, sec) != NULL && coff_section_data (abfd, sec)->relocs != NULL) @@ -437,24 +454,24 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs, relsz = bfd_coff_relsz (abfd); + amt = sec->reloc_count * relsz; if (external_relocs == NULL) { - free_external = (bfd_byte *) bfd_malloc (sec->reloc_count * relsz); + free_external = (bfd_byte *) bfd_malloc (amt); if (free_external == NULL && sec->reloc_count > 0) goto error_return; external_relocs = free_external; } if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 - || (bfd_read (external_relocs, relsz, sec->reloc_count, abfd) - != relsz * sec->reloc_count)) + || bfd_bread (external_relocs, amt, abfd) != amt) goto error_return; if (internal_relocs == NULL) { - free_internal = ((struct internal_reloc *) - bfd_malloc (sec->reloc_count - * sizeof (struct internal_reloc))); + amt = sec->reloc_count; + amt *= sizeof (struct internal_reloc); + free_internal = (struct internal_reloc *) bfd_malloc (amt); if (free_internal == NULL && sec->reloc_count > 0) goto error_return; internal_relocs = free_internal; @@ -477,9 +494,8 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs, { if (coff_section_data (abfd, sec) == NULL) { - sec->used_by_bfd = - (PTR) bfd_zalloc (abfd, - sizeof (struct coff_section_tdata)); + amt = sizeof (struct coff_section_tdata); + sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (sec->used_by_bfd == NULL) goto error_return; coff_section_data (abfd, sec)->contents = NULL; @@ -539,15 +555,18 @@ coff_count_linenumbers (abfd) section's linenumber count. */ alent *l = q->lineno; - ++q->symbol.section->output_section->lineno_count; - ++total; - ++l; - while (l->line_number != 0) + do { + asection * sec = q->symbol.section->output_section; + + /* Do not try to update fields in read-only sections. */ + if (! bfd_is_const_section (sec)) + sec->lineno_count ++; + ++total; - ++q->symbol.section->output_section->lineno_count; ++l; } + while (l->line_number != 0); } } } @@ -654,9 +673,10 @@ coff_renumber_symbols (bfd_ptr, first_undef) { asymbol **newsyms; unsigned int i; + bfd_size_type amt; - newsyms = (asymbol **) bfd_alloc (bfd_ptr, - sizeof (asymbol *) * (symbol_count + 1)); + amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1); + newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt); if (!newsyms) return false; bfd_ptr->outsymbols = newsyms; @@ -750,7 +770,8 @@ coff_mangle_symbols (bfd_ptr) { /* FIXME: We should use a union here. */ s->u.syment.n_value = - ((combined_entry_type *) s->u.syment.n_value)->offset; + (bfd_vma)((combined_entry_type *) + ((unsigned long) s->u.syment.n_value))->offset; s->fix_value = 0; } if (s->fix_line) @@ -868,7 +889,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, } else { - long filepos; + file_ptr filepos; bfd_byte buf[4]; int prefix_len = bfd_coff_debug_string_prefix_length (abfd); @@ -881,9 +902,9 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug"); filepos = bfd_tell (abfd); if (prefix_len == 4) - bfd_put_32 (abfd, name_length + 1, buf); + bfd_put_32 (abfd, (bfd_vma) (name_length + 1), buf); else - bfd_put_16 (abfd, name_length + 1, buf); + bfd_put_16 (abfd, (bfd_vma) (name_length + 1), buf); if (!bfd_set_section_contents (abfd, *debug_string_section_p, @@ -893,8 +914,8 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, || !bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) symbol->name, - ((file_ptr) *debug_string_size_p - + prefix_len), + (file_ptr) (*debug_string_size_p + + prefix_len), (bfd_size_type) name_length + 1)) abort (); if (bfd_seek (abfd, filepos, SEEK_SET) != 0) @@ -921,7 +942,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, bfd *abfd; asymbol *symbol; combined_entry_type *native; - unsigned int *written; + bfd_vma *written; bfd_size_type *string_size_p; asection **debug_string_section_p; bfd_size_type *debug_string_size_p; @@ -962,7 +983,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, if (!buf) return false; bfd_coff_swap_sym_out (abfd, &native->u.syment, buf); - if (bfd_write (buf, 1, symesz, abfd) != symesz) + if (bfd_bwrite (buf, symesz, abfd) != symesz) return false; bfd_release (abfd, buf); @@ -981,10 +1002,10 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, &((native + j + 1)->u.auxent), type, class, - j, + (int) j, native->u.syment.n_numaux, buf); - if (bfd_write (buf, 1, auxesz, abfd) != auxesz) + if (bfd_bwrite (buf, auxesz, abfd) != auxesz) return false; } bfd_release (abfd, buf); @@ -1006,7 +1027,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p, debug_string_section_p, debug_string_size_p) bfd *abfd; asymbol *symbol; - unsigned int *written; + bfd_vma *written; bfd_size_type *string_size_p; asection **debug_string_section_p; bfd_size_type *debug_string_size_p; @@ -1045,7 +1066,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p, 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. + /* Copy the any flags from the file header into the symbol. FIXME: Why? */ { coff_symbol_type *c = coff_symbol_from (abfd, symbol); @@ -1074,7 +1095,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, debug_string_section_p, debug_string_size_p) bfd *abfd; coff_symbol_type *symbol; - unsigned int *written; + bfd_vma *written; bfd_size_type *string_size_p; asection **debug_string_section_p; bfd_size_type *debug_string_size_p; @@ -1127,8 +1148,9 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, } symbol->done_lineno = true; - symbol->symbol.section->output_section->moving_line_filepos += - count * bfd_coff_linesz (abfd); + if (! bfd_is_const_section (symbol->symbol.section->output_section)) + symbol->symbol.section->output_section->moving_line_filepos += + count * bfd_coff_linesz (abfd); } return coff_write_symbol (abfd, &(symbol->symbol), native, written, @@ -1147,7 +1169,7 @@ coff_write_symbols (abfd) bfd_size_type debug_string_size; unsigned int i; unsigned int limit = bfd_get_symcount (abfd); - unsigned int written = 0; + bfd_signed_vma written = 0; asymbol **p; string_size = 0; @@ -1211,11 +1233,12 @@ coff_write_symbols (abfd) bfd_byte buffer[STRING_SIZE_SIZE]; #if STRING_SIZE_SIZE == 4 - bfd_h_put_32 (abfd, size, buffer); + H_PUT_32 (abfd, size, buffer); #else - #error Change bfd_h_put_32 + #error Change H_PUT_32 #endif - if (bfd_write ((PTR) buffer, 1, sizeof (buffer), abfd) != sizeof (buffer)) + if (bfd_bwrite ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd) + != sizeof (buffer)) return false; /* Handle long section names. This code must handle section @@ -1231,7 +1254,8 @@ coff_write_symbols (abfd) len = strlen (o->name); if (len > SCNNMLEN) { - if (bfd_write (o->name, 1, len + 1, abfd) != len + 1) + if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd) + != len + 1) return false; } } @@ -1271,7 +1295,10 @@ coff_write_symbols (abfd) && c_symbol->native->u.syment.n_numaux > 0) { if (bfd_coff_force_symnames_in_strings (abfd)) - bfd_write (".file", 1, 6, abfd); + { + if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6) + return false; + } maxlen = bfd_coff_filnmlen (abfd); } else @@ -1279,8 +1306,8 @@ coff_write_symbols (abfd) if (name_length > maxlen) { - if (bfd_write ((PTR) (q->name), 1, name_length + 1, abfd) - != name_length + 1) + if (bfd_bwrite ((PTR) (q->name), (bfd_size_type) name_length + 1, + abfd) != name_length + 1) return false; } } @@ -1294,11 +1321,11 @@ coff_write_symbols (abfd) bfd_byte buffer[STRING_SIZE_SIZE]; #if STRING_SIZE_SIZE == 4 - bfd_h_put_32 (abfd, size, buffer); + H_PUT_32 (abfd, size, buffer); #else - #error Change bfd_h_put_32 + #error Change H_PUT_32 #endif - if (bfd_write ((PTR) buffer, 1, STRING_SIZE_SIZE, abfd) + if (bfd_bwrite ((PTR) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) return false; } @@ -1353,7 +1380,8 @@ coff_write_linenumbers (abfd) out.l_lnno = 0; out.l_addr.l_symndx = l->u.offset; bfd_coff_swap_lineno_out (abfd, &out, buff); - if (bfd_write (buff, 1, linesz, abfd) != linesz) + if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) + != linesz) return false; l++; while (l->line_number) @@ -1361,7 +1389,8 @@ coff_write_linenumbers (abfd) out.l_lnno = l->line_number; out.l_addr.l_symndx = l->u.offset; bfd_coff_swap_lineno_out (abfd, &out, buff); - if (bfd_write (buff, 1, linesz, abfd) != linesz) + if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) + != linesz) return false; l++; } @@ -1409,7 +1438,7 @@ coff_section_symbol (abfd, name) combined_entry_type e[10]; }; struct foo *f; - f = (struct foo *) bfd_alloc (abfd, sizeof (*f)); + f = (struct foo *) bfd_alloc (abfd, (bfd_size_type) sizeof (*f)); if (!f) { bfd_set_error (bfd_error_no_error); @@ -1492,7 +1521,8 @@ build_debug_section (abfd) bfd *abfd; { char *debug_section; - long position; + file_ptr position; + bfd_size_type sec_size; asection *sect = bfd_get_section_by_name (abfd, ".debug"); @@ -1502,8 +1532,8 @@ build_debug_section (abfd) return NULL; } - debug_section = (PTR) bfd_alloc (abfd, - bfd_get_section_size_before_reloc (sect)); + sec_size = bfd_get_section_size_before_reloc (sect); + debug_section = (PTR) bfd_alloc (abfd, sec_size); if (debug_section == NULL) return NULL; @@ -1513,9 +1543,7 @@ build_debug_section (abfd) position = bfd_tell (abfd); if (bfd_seek (abfd, sect->filepos, SEEK_SET) != 0 - || (bfd_read (debug_section, - bfd_get_section_size_before_reloc (sect), 1, abfd) - != bfd_get_section_size_before_reloc (sect)) + || bfd_bread (debug_section, sec_size, abfd) != sec_size || bfd_seek (abfd, position, SEEK_SET) != 0) return NULL; return debug_section; @@ -1528,9 +1556,9 @@ static char * copy_name (abfd, name, maxlen) bfd *abfd; char *name; - int maxlen; + size_t maxlen; { - int len; + size_t len; char *newname; for (len = 0; len < maxlen; ++len) @@ -1541,7 +1569,7 @@ copy_name (abfd, name, maxlen) } } - if ((newname = (PTR) bfd_alloc (abfd, len + 1)) == NULL) + if ((newname = (PTR) bfd_alloc (abfd, (bfd_size_type) len + 1)) == NULL) return (NULL); strncpy (newname, name, len); newname[len] = '\0'; @@ -1555,7 +1583,7 @@ _bfd_coff_get_external_symbols (abfd) bfd *abfd; { bfd_size_type symesz; - size_t size; + bfd_size_type size; PTR syms; if (obj_coff_external_syms (abfd) != NULL) @@ -1570,7 +1598,7 @@ _bfd_coff_get_external_symbols (abfd) return false; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 - || bfd_read (syms, size, 1, abfd) != size) + || bfd_bread (syms, size, abfd) != size) { if (syms != NULL) free (syms); @@ -1591,8 +1619,9 @@ _bfd_coff_read_string_table (abfd) bfd *abfd; { char extstrsize[STRING_SIZE_SIZE]; - size_t strsize; + bfd_size_type strsize; char *strings; + file_ptr pos; if (obj_coff_strings (abfd) != NULL) return obj_coff_strings (abfd); @@ -1603,13 +1632,13 @@ _bfd_coff_read_string_table (abfd) return NULL; } - if (bfd_seek (abfd, - (obj_sym_filepos (abfd) - + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd)), - SEEK_SET) != 0) + pos = obj_sym_filepos (abfd); + pos += obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); + if (bfd_seek (abfd, pos, SEEK_SET) != 0) return NULL; - if (bfd_read (extstrsize, sizeof extstrsize, 1, abfd) != sizeof extstrsize) + if (bfd_bread (extstrsize, (bfd_size_type) sizeof extstrsize, abfd) + != sizeof extstrsize) { if (bfd_get_error () != bfd_error_file_truncated) return NULL; @@ -1620,16 +1649,16 @@ _bfd_coff_read_string_table (abfd) else { #if STRING_SIZE_SIZE == 4 - strsize = bfd_h_get_32 (abfd, (bfd_byte *) extstrsize); + strsize = H_GET_32 (abfd, extstrsize); #else - #error Change bfd_h_get_32 + #error Change H_GET_32 #endif } if (strsize < STRING_SIZE_SIZE) { (*_bfd_error_handler) - (_("%s: bad string table size %lu"), bfd_get_filename (abfd), + (_("%s: bad string table size %lu"), bfd_archive_filename (abfd), (unsigned long) strsize); bfd_set_error (bfd_error_bad_value); return NULL; @@ -1639,8 +1668,7 @@ _bfd_coff_read_string_table (abfd) if (strings == NULL) return NULL; - if (bfd_read (strings + STRING_SIZE_SIZE, - strsize - STRING_SIZE_SIZE, 1, abfd) + if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd) != strsize - STRING_SIZE_SIZE) { free (strings); @@ -1686,12 +1714,12 @@ coff_get_normalized_symtab (abfd) combined_entry_type *internal_ptr; combined_entry_type *symbol_ptr; combined_entry_type *internal_end; - bfd_size_type symesz; + size_t symesz; char *raw_src; char *raw_end; const char *string_table = NULL; char *debug_section = NULL; - unsigned long size; + bfd_size_type size; if (obj_raw_syments (abfd) != NULL) return obj_raw_syments (abfd); @@ -1734,7 +1762,7 @@ coff_get_normalized_symtab (abfd) bfd_coff_swap_aux_in (abfd, (PTR) raw_src, symbol_ptr->u.syment.n_type, symbol_ptr->u.syment.n_sclass, - i, symbol_ptr->u.syment.n_numaux, + (int) i, symbol_ptr->u.syment.n_numaux, &(internal_ptr->u.auxent)); coff_pointerize_aux (abfd, internal, symbol_ptr, i, internal_ptr); @@ -1789,7 +1817,7 @@ coff_get_normalized_symtab (abfd) ((long) copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname, - bfd_coff_filnmlen (abfd))); + (size_t) bfd_coff_filnmlen (abfd))); } } } @@ -1798,23 +1826,20 @@ coff_get_normalized_symtab (abfd) if (internal_ptr->u.syment._n._n_n._n_zeroes != 0) { /* This is a "short" name. Make it long. */ - unsigned long i = 0; - char *newstring = NULL; + size_t i; + char *newstring; /* find the length of this string without walking into memory that isn't ours. */ for (i = 0; i < 8; ++i) - { - if (internal_ptr->u.syment._n._n_name[i] == '\0') - { - break; - } /* if end of string */ - } /* possible lengths of this string. */ + if (internal_ptr->u.syment._n._n_name[i] == '\0') + break; - if ((newstring = (PTR) bfd_alloc (abfd, ++i)) == NULL) + newstring = (PTR) bfd_alloc (abfd, (bfd_size_type) (i + 1)); + if (newstring == NULL) return (NULL); - memset (newstring, 0, i); - strncpy (newstring, internal_ptr->u.syment._n._n_name, i - 1); + memset (newstring, 0, i + 1); + strncpy (newstring, internal_ptr->u.syment._n._n_name, i); internal_ptr->u.syment._n._n_n._n_offset = (long int) newstring; internal_ptr->u.syment._n._n_n._n_zeroes = 0; } @@ -1871,7 +1896,8 @@ asymbol * coff_make_empty_symbol (abfd) bfd *abfd; { - coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type)); + bfd_size_type amt = sizeof (coff_symbol_type); + coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, amt); if (new == NULL) return (NULL); memset (new, 0, sizeof *new); @@ -1891,12 +1917,14 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz) PTR ptr ATTRIBUTE_UNUSED; unsigned long sz ATTRIBUTE_UNUSED; { - coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type)); + bfd_size_type amt = sizeof (coff_symbol_type); + coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, amt); if (new == NULL) return (NULL); /* @@ The 10 is a guess at a plausible maximum number of aux entries (but shouldn't be a constant). */ - new->native = (combined_entry_type *) bfd_zalloc (abfd, sizeof (combined_entry_type) * 10); + amt = sizeof (combined_entry_type) * 10; + new->native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (!new->native) return (NULL); new->symbol.section = bfd_abs_section_ptr; @@ -1917,11 +1945,8 @@ coff_get_symbol_info (abfd, symbol, ret) if (coffsymbol (symbol)->native != NULL && coffsymbol (symbol)->native->fix_value) { - combined_entry_type *psym; - - psym = ((combined_entry_type *) - coffsymbol (symbol)->native->u.syment.n_value); - ret->value = (bfd_vma) (psym - obj_raw_syments (abfd)); + ret->value = coffsymbol (symbol)->native->u.syment.n_value - + (unsigned long) obj_raw_syments (abfd); } } @@ -1945,8 +1970,8 @@ bfd_coff_get_syment (abfd, symbol, psyment) *psyment = csym->native->u.syment; if (csym->native->fix_value) - psyment->n_value = ((combined_entry_type *) psyment->n_value - - obj_raw_syments (abfd)); + psyment->n_value = psyment->n_value - + (unsigned long) obj_raw_syments (abfd); /* FIXME: We should handle fix_line here. */ @@ -2023,7 +2048,7 @@ coff_print_symbol (abfd, filep, symbol, how) case bfd_print_symbol_all: if (coffsymbol (symbol)->native) { - unsigned long val; + bfd_vma val; unsigned int aux; combined_entry_type *combined = coffsymbol (symbol)->native; combined_entry_type *root = obj_raw_syments (abfd); @@ -2032,12 +2057,11 @@ coff_print_symbol (abfd, filep, symbol, how) fprintf (file, "[%3ld]", (long) (combined - root)); if (! combined->fix_value) - val = (unsigned long) combined->u.syment.n_value; + val = (bfd_vma) combined->u.syment.n_value; else - val = ((unsigned long) - ((combined_entry_type *) combined->u.syment.n_value - - root)); + val = combined->u.syment.n_value - (unsigned long) root; +#ifndef XCOFF64 fprintf (file, "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%08lx %s", combined->u.syment.n_scnum, @@ -2045,8 +2069,20 @@ coff_print_symbol (abfd, filep, symbol, how) combined->u.syment.n_type, combined->u.syment.n_sclass, combined->u.syment.n_numaux, + (unsigned long) val, + symbol->name); +#else + /* Print out the wide, 64 bit, symbol value */ + fprintf (file, + "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%016llx %s", + combined->u.syment.n_scnum, + combined->u.syment.n_flags, + combined->u.syment.n_type, + combined->u.syment.n_sclass, + combined->u.syment.n_numaux, val, symbol->name); +#endif for (aux = 0; aux < combined->u.syment.n_numaux; aux++) { @@ -2090,16 +2126,18 @@ coff_print_symbol (abfd, filep, symbol, how) case C_EXT: if (ISFCN (combined->u.syment.n_type)) { + long next, llnos; + + if (auxp->fix_end) + next = (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p + - root); + else + next = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l; + llnos = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr; fprintf (file, - _("AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"), - tagndx, - auxp->u.auxent.x_sym.x_misc.x_fsize, - auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr, - (auxp->fix_end - ? ((long) - (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p - - root)) - : auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l)); + "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld", + tagndx, auxp->u.auxent.x_sym.x_misc.x_fsize, + llnos, next); break; } /* else fall through */ @@ -2133,7 +2171,7 @@ coff_print_symbol (abfd, filep, symbol, how) } else { - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s %s %s", symbol->section->name, coffsymbol (symbol)->native ? "n" : "g", @@ -2167,8 +2205,8 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, asection *section; asymbol **symbols; bfd_vma offset; - CONST char **filename_ptr; - CONST char **functionname_ptr; + const char **filename_ptr; + const char **functionname_ptr; unsigned int *line_ptr; { boolean found; @@ -2180,6 +2218,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, combined_entry_type *pend; alent *l; struct coff_section_tdata *sec_data; + bfd_size_type amt; /* Before looking through the symbol table, try to use a .stab section to find the information. */ @@ -2264,7 +2303,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, /* Avoid endless loops on erroneous files by ensuring that we always move forward in the file. */ - if (p - cof->raw_syments >= p->u.syment.n_value) + if (p >= cof->raw_syments + p->u.syment.n_value) break; p = cof->raw_syments + p->u.syment.n_value; @@ -2354,9 +2393,8 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, /* Cache the results for the next call. */ if (sec_data == NULL && section->owner == abfd) { - section->used_by_bfd = - ((PTR) bfd_zalloc (abfd, - sizeof (struct coff_section_tdata))); + amt = sizeof (struct coff_section_tdata); + section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); sec_data = (struct coff_section_tdata *) section->used_by_bfd; } if (sec_data != NULL) @@ -2413,8 +2451,9 @@ bfd_coff_set_symbol_class (abfd, symbol, class) coff_write_alien_symbol(). */ combined_entry_type * native; + bfd_size_type amt = sizeof (* native); - native = (combined_entry_type *) bfd_alloc (abfd, sizeof (* native)); + native = (combined_entry_type *) bfd_alloc (abfd, amt); if (native == NULL) return false; @@ -2442,7 +2481,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class) 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. + /* Copy the any flags from the file header into the symbol. FIXME: Why? */ native->u.syment.n_flags = bfd_asymbol_bfd (& csym->symbol)->flags; } diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c index 96b005b..00a5289 100644 --- a/contrib/binutils/bfd/cofflink.c +++ b/contrib/binutils/bfd/cofflink.c @@ -117,9 +117,9 @@ _bfd_coff_link_hash_table_create (abfd) bfd *abfd; { struct coff_link_hash_table *ret; + bfd_size_type amt = sizeof (struct coff_link_hash_table); - ret = ((struct coff_link_hash_table *) - bfd_alloc (abfd, sizeof (struct coff_link_hash_table))); + ret = (struct coff_link_hash_table *) bfd_alloc (abfd, amt); if (ret == NULL) return NULL; if (! _bfd_coff_link_hash_table_init (ret, abfd, @@ -277,6 +277,16 @@ coff_link_check_ar_symbols (abfd, info, pneeded) return false; h = bfd_link_hash_lookup (info->hash, name, false, false, true); + /* auto import */ + if (!h && info->pei386_auto_import) + { + if (!strncmp (name,"__imp_", 6)) + { + h = + bfd_link_hash_lookup (info->hash, name + 6, false, false, + true); + } + } /* We are only interested in symbols that are currently undefined. If a symbol is currently known to be common, COFF linkers do not bring in an object file which defines @@ -315,6 +325,7 @@ coff_link_add_symbols (abfd, info) bfd_size_type symesz; bfd_byte *esym; bfd_byte *esym_end; + bfd_size_type amt; /* Keep the symbols during this function, in case the linker needs to read the generic symbols in order to report an error message. */ @@ -330,10 +341,8 @@ coff_link_add_symbols (abfd, info) /* We keep a list of the linker hash table entries that correspond to particular symbols. */ - sym_hash = ((struct coff_link_hash_entry **) - bfd_alloc (abfd, - ((size_t) symcount - * sizeof (struct coff_link_hash_entry *)))); + amt = symcount * sizeof (struct coff_link_hash_entry *); + sym_hash = (struct coff_link_hash_entry **) bfd_alloc (abfd, amt); if (sym_hash == NULL && symcount != 0) goto error_return; obj_coff_sym_hashes (abfd) = sym_hash; @@ -433,7 +442,7 @@ coff_link_add_symbols (abfd, info) /* The Microsoft Visual C compiler does string pooling by hashing the constants to an internal symbol name, and - relying on the the linker comdat support to discard + relying on the linker comdat support to discard duplicate names. However, if one string is a literal and one is a data initializer, one will end up in the .data section and one will end up in the .rdata section. The @@ -526,7 +535,7 @@ coff_link_add_symbols (abfd, info) (*_bfd_error_handler) (_("Warning: type of symbol `%s' changed from %d to %d in %s"), name, (*sym_hash)->type, sym.n_type, - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); /* We don't want to change from a meaningful base type to a null one, but if we know @@ -554,8 +563,8 @@ coff_link_add_symbols (abfd, info) i < sym.n_numaux; i++, eaux += symesz, iaux++) bfd_coff_swap_aux_in (abfd, (PTR) eaux, sym.n_type, - sym.n_sclass, i, sym.n_numaux, - (PTR) iaux); + sym.n_sclass, (int) i, + sym.n_numaux, (PTR) iaux); (*sym_hash)->aux = alloc; } } @@ -608,9 +617,8 @@ coff_link_add_symbols (abfd, info) secdata = coff_section_data (abfd, stab); if (secdata == NULL) { - stab->used_by_bfd = - (PTR) bfd_zalloc (abfd, - sizeof (struct coff_section_tdata)); + amt = sizeof (struct coff_section_tdata); + stab->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (stab->used_by_bfd == NULL) goto error_return; secdata = coff_section_data (abfd, stab); @@ -648,11 +656,11 @@ _bfd_coff_final_link (abfd, info) boolean long_section_names; asection *o; struct bfd_link_order *p; - size_t max_sym_count; - size_t max_lineno_count; - size_t max_reloc_count; - size_t max_output_reloc_count; - size_t max_contents_size; + bfd_size_type max_sym_count; + bfd_size_type max_lineno_count; + bfd_size_type max_reloc_count; + bfd_size_type max_output_reloc_count; + bfd_size_type max_contents_size; file_ptr rel_filepos; unsigned int relsz; file_ptr line_filepos; @@ -660,6 +668,7 @@ _bfd_coff_final_link (abfd, info) bfd *sub; bfd_byte *external_relocs = NULL; char strbuf[STRING_SIZE_SIZE]; + bfd_size_type amt; symesz = bfd_coff_symesz (abfd); @@ -775,10 +784,9 @@ _bfd_coff_final_link (abfd, info) /* We use section_count + 1, rather than section_count, because the target_index fields are 1 based. */ - finfo.section_info = - ((struct coff_link_section_info *) - bfd_malloc ((abfd->section_count + 1) - * sizeof (struct coff_link_section_info))); + amt = abfd->section_count + 1; + amt *= sizeof (struct coff_link_section_info); + finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt); if (finfo.section_info == NULL) goto error_return; for (i = 0; i <= abfd->section_count; i++) @@ -819,13 +827,14 @@ _bfd_coff_final_link (abfd, info) but only when doing a relocateable link, which is not the common case. */ BFD_ASSERT (info->relocateable); + amt = o->reloc_count; + amt *= sizeof (struct internal_reloc); finfo.section_info[o->target_index].relocs = - ((struct internal_reloc *) - bfd_malloc (o->reloc_count * sizeof (struct internal_reloc))); + (struct internal_reloc *) bfd_malloc (amt); + amt = o->reloc_count; + amt *= sizeof (struct coff_link_hash_entry *); finfo.section_info[o->target_index].rel_hashes = - ((struct coff_link_hash_entry **) - bfd_malloc (o->reloc_count - * sizeof (struct coff_link_hash_entry *))); + (struct coff_link_hash_entry **) bfd_malloc (amt); if (finfo.section_info[o->target_index].relocs == NULL || finfo.section_info[o->target_index].rel_hashes == NULL) goto error_return; @@ -857,22 +866,23 @@ _bfd_coff_final_link (abfd, info) } /* Allocate some buffers used while linking. */ - finfo.internal_syms = ((struct internal_syment *) - bfd_malloc (max_sym_count - * sizeof (struct internal_syment))); - finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count - * sizeof (asection *)); - finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long)); - finfo.outsyms = ((bfd_byte *) - bfd_malloc ((size_t) ((max_sym_count + 1) * symesz))); - finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count - * bfd_coff_linesz (abfd)); + amt = max_sym_count * sizeof (struct internal_syment); + finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt); + amt = max_sym_count * sizeof (asection *); + finfo.sec_ptrs = (asection **) bfd_malloc (amt); + amt = max_sym_count * sizeof (long); + finfo.sym_indices = (long *) bfd_malloc (amt); + finfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz); + amt = max_lineno_count * bfd_coff_linesz (abfd); + finfo.linenos = (bfd_byte *) bfd_malloc (amt); finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); - finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz); + amt = max_reloc_count * relsz; + finfo.external_relocs = (bfd_byte *) bfd_malloc (amt); if (! info->relocateable) - finfo.internal_relocs = ((struct internal_reloc *) - bfd_malloc (max_reloc_count - * sizeof (struct internal_reloc))); + { + amt = max_reloc_count * sizeof (struct internal_reloc); + finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); + } if ((finfo.internal_syms == NULL && max_sym_count > 0) || (finfo.sec_ptrs == NULL && max_sym_count > 0) || (finfo.sym_indices == NULL && max_sym_count > 0) @@ -977,14 +987,15 @@ _bfd_coff_final_link (abfd, info) if (finfo.last_file_index != -1 && (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd)) { + file_ptr pos; + finfo.last_file.n_value = obj_raw_syment_count (abfd); bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file, (PTR) finfo.outsyms); - if (bfd_seek (abfd, - (obj_sym_filepos (abfd) - + finfo.last_file_index * symesz), - SEEK_SET) != 0 - || bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz) + + pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz) return false; } @@ -1019,8 +1030,8 @@ _bfd_coff_final_link (abfd, info) /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can finally write out the relocs. */ - external_relocs = ((bfd_byte *) - bfd_malloc (max_output_reloc_count * relsz)); + amt = max_output_reloc_count * relsz; + external_relocs = (bfd_byte *) bfd_malloc (amt); if (external_relocs == NULL) goto error_return; @@ -1049,8 +1060,9 @@ _bfd_coff_final_link (abfd, info) } if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0 - || bfd_write ((PTR) external_relocs, relsz, o->reloc_count, - abfd) != relsz * o->reloc_count) + || (bfd_bwrite ((PTR) external_relocs, + (bfd_size_type) relsz * o->reloc_count, abfd) + != (bfd_size_type) relsz * o->reloc_count)) goto error_return; } @@ -1084,21 +1096,22 @@ _bfd_coff_final_link (abfd, info) /* Write out the string table. */ if (obj_raw_syment_count (abfd) != 0 || long_section_names) { - if (bfd_seek (abfd, - (obj_sym_filepos (abfd) - + obj_raw_syment_count (abfd) * symesz), - SEEK_SET) != 0) + file_ptr pos; + + pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz; + if (bfd_seek (abfd, pos, SEEK_SET) != 0) return false; #if STRING_SIZE_SIZE == 4 - bfd_h_put_32 (abfd, - _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE, - (bfd_byte *) strbuf); + H_PUT_32 (abfd, + _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE, + strbuf); #else - #error Change bfd_h_put_32 + #error Change H_PUT_32 above #endif - if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) + if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd) + != STRING_SIZE_SIZE) return false; if (! _bfd_stringtab_emit (abfd, finfo.strtab)) @@ -1166,17 +1179,17 @@ dores_com (ptr, output_bfd, heap) { int val = strtoul (ptr, &ptr, 0); if (heap) - pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve =val; + pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve = val; else - pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve =val; + pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve = val; if (ptr[0] == ',') { - int val = strtoul (ptr+1, &ptr, 0); + val = strtoul (ptr+1, &ptr, 0); if (heap) - pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit =val; + pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit = val; else - pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit =val; + pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit = val; } } return ptr; @@ -1210,10 +1223,10 @@ process_embedded_commands (output_bfd, info, abfd) if (!sec) return 1; - copy = bfd_malloc ((size_t) sec->_raw_size); + copy = bfd_malloc (sec->_raw_size); if (!copy) return 0; - if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size)) + if (! bfd_get_section_contents(abfd, sec, copy, (bfd_vma) 0, sec->_raw_size)) { free (copy); return 0; @@ -1501,6 +1514,19 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } } +#ifndef COFF_WITH_PE + /* Skip section symbols for sections which are not going to be + emitted. */ + if (!skip + && isym.n_sclass == C_STAT + && isym.n_type == T_NULL + && isym.n_numaux > 0) + { + if ((*secpp)->output_section == bfd_abs_section_ptr) + skip = true; + } +#endif + /* If we stripping debugging symbols, and this is a debugging 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 @@ -1561,6 +1587,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) struct coff_debug_merge_element **epp; bfd_byte *esl, *eslend; struct internal_syment *islp; + bfd_size_type amt; name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf); if (name == NULL) @@ -1581,9 +1608,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Allocate memory to hold type information. If this turns out to be a duplicate, we pass this address to bfd_release. */ - mt = ((struct coff_debug_merge_type *) - bfd_alloc (input_bfd, - sizeof (struct coff_debug_merge_type))); + amt = sizeof (struct coff_debug_merge_type); + mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt); if (mt == NULL) return false; mt->class = isym.n_sclass; @@ -1609,9 +1635,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp); + amt = sizeof (struct coff_debug_merge_element); *epp = ((struct coff_debug_merge_element *) - bfd_alloc (input_bfd, - sizeof (struct coff_debug_merge_element))); + bfd_alloc (input_bfd, amt)); if (*epp == NULL) return false; @@ -1620,8 +1646,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (elename == NULL) return false; - name_copy = (char *) bfd_alloc (input_bfd, - strlen (elename) + 1); + amt = strlen (elename) + 1; + name_copy = (char *) bfd_alloc (input_bfd, amt); if (name_copy == NULL) return false; strcpy (name_copy, elename); @@ -1804,7 +1830,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) have to write the symbol out twice. */ if (finfo->last_file_index != -1 - && finfo->last_file.n_value != (long) output_index) + && finfo->last_file.n_value != (bfd_vma) output_index) { /* We must correct the value of the last C_FILE entry. */ @@ -1821,18 +1847,18 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } else { + file_ptr pos; + /* We have already written out the last C_FILE symbol. We need to write it out again. We borrow *outsym temporarily. */ bfd_coff_swap_sym_out (output_bfd, (PTR) &finfo->last_file, (PTR) outsym); - if (bfd_seek (output_bfd, - (obj_sym_filepos (output_bfd) - + finfo->last_file_index * osymesz), - SEEK_SET) != 0 - || (bfd_write (outsym, osymesz, 1, output_bfd) - != osymesz)) + pos = obj_sym_filepos (output_bfd); + pos += finfo->last_file_index * osymesz; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite (outsym, osymesz, output_bfd) != osymesz) return false; } } @@ -2054,6 +2080,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } else { + file_ptr pos; + /* We have already written out the last .bf aux entry. We need to write it out again. We borrow *outsym @@ -2065,12 +2093,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) isymp->n_sclass, 0, isymp->n_numaux, (PTR) outsym); - if (bfd_seek (output_bfd, - (obj_sym_filepos (output_bfd) - + finfo->last_bf_index * osymesz), - SEEK_SET) != 0 - || bfd_write (outsym, osymesz, 1, - output_bfd) != osymesz) + pos = obj_sym_filepos (output_bfd); + pos += finfo->last_bf_index * osymesz; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || (bfd_bwrite (outsym, osymesz, output_bfd) + != osymesz)) return false; } } @@ -2118,6 +2145,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) bfd_byte *elineend; bfd_byte *oeline; boolean skipping; + file_ptr pos; + bfd_size_type amt; /* FIXME: If SEC_HAS_CONTENTS is not for the section, then build_link_order in ldwrite.c will not have created a @@ -2133,7 +2162,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) continue; if (bfd_seek (input_bfd, o->line_filepos, SEEK_SET) != 0 - || bfd_read (finfo->linenos, linesz, o->lineno_count, + || bfd_bread (finfo->linenos, linesz * o->lineno_count, input_bfd) != linesz * o->lineno_count) return false; @@ -2221,17 +2250,14 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } } - if (bfd_seek (output_bfd, - (o->output_section->line_filepos - + o->output_section->lineno_count * linesz), - SEEK_SET) != 0 - || (bfd_write (finfo->linenos, 1, oeline - finfo->linenos, - output_bfd) - != (bfd_size_type) (oeline - finfo->linenos))) + pos = o->output_section->line_filepos; + pos += o->output_section->lineno_count * linesz; + amt = oeline - finfo->linenos; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo->linenos, amt, output_bfd) != amt) return false; - o->output_section->lineno_count += - (oeline - finfo->linenos) / linesz; + o->output_section->lineno_count += amt / linesz; } } @@ -2252,12 +2278,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Write the modified symbols to the output file. */ if (outsym > finfo->outsyms) { - if (bfd_seek (output_bfd, - obj_sym_filepos (output_bfd) + syment_base * osymesz, - SEEK_SET) != 0 - || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1, - output_bfd) - != (bfd_size_type) (outsym - finfo->outsyms))) + file_ptr pos; + bfd_size_type amt; + + pos = obj_sym_filepos (output_bfd) + syment_base * osymesz; + amt = outsym - finfo->outsyms; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt) return false; BFD_ASSERT ((obj_raw_syment_count (output_bfd) @@ -2288,7 +2315,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) { ((*_bfd_error_handler) (_("%s: relocs in section `%s', but it has no contents"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, o))); bfd_set_error (bfd_error_no_contents); return false; @@ -2429,14 +2456,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Write out the modified section contents. */ if (secdata == NULL || secdata->stab_info == NULL) { + file_ptr loc = o->output_offset * bfd_octets_per_byte (output_bfd); + bfd_size_type amt = (o->_cooked_size != 0 + ? o->_cooked_size : o->_raw_size); if (! bfd_set_section_contents (output_bfd, o->output_section, - contents, - (file_ptr) - (o->output_offset * - bfd_octets_per_byte (output_bfd)), - (o->_cooked_size != 0 - ? o->_cooked_size - : o->_raw_size))) + contents, loc, amt)) return false; } else @@ -2469,6 +2493,7 @@ _bfd_coff_write_global_sym (h, data) struct internal_syment isym; bfd_size_type symesz; unsigned int i; + file_ptr pos; output_bfd = finfo->output_bfd; @@ -2577,11 +2602,10 @@ _bfd_coff_write_global_sym (h, data) symesz = bfd_coff_symesz (output_bfd); - if (bfd_seek (output_bfd, - (obj_sym_filepos (output_bfd) - + obj_raw_syment_count (output_bfd) * symesz), - SEEK_SET) != 0 - || bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz) + pos = obj_sym_filepos (output_bfd); + pos += obj_raw_syment_count (output_bfd) * symesz; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz) { finfo->failed = true; return false; @@ -2649,9 +2673,9 @@ _bfd_coff_write_global_sym (h, data) } bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type, - isym.n_sclass, i, isym.n_numaux, + isym.n_sclass, (int) i, isym.n_numaux, (PTR) finfo->outsyms); - if (bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz) + if (bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz) { finfo->failed = true; return false; @@ -2719,6 +2743,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd_byte *buf; bfd_reloc_status_type rstat; boolean ok; + file_ptr loc; size = bfd_get_reloc_size (howto); buf = (bfd_byte *) bfd_zmalloc (size); @@ -2726,7 +2751,8 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) return false; rstat = _bfd_relocate_contents (howto, output_bfd, - link_order->u.reloc.p->addend, buf); + (bfd_vma) link_order->u.reloc.p->addend,\ + buf); switch (rstat) { case bfd_reloc_ok: @@ -2749,10 +2775,9 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) } break; } + loc = link_order->offset * bfd_octets_per_byte (output_bfd); ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (output_bfd)), size); + loc, size); free (buf); if (! ok) return false; @@ -2868,7 +2893,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, { (*_bfd_error_handler) ("%s: illegal symbol index %ld in relocs", - bfd_get_filename (input_bfd), symndx); + bfd_archive_filename (input_bfd), symndx); return false; } else @@ -2990,7 +3015,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, case bfd_reloc_outofrange: (*_bfd_error_handler) (_("%s: bad reloc address 0x%lx in section `%s'"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), (unsigned long) rel->r_vaddr, bfd_get_section_name (input_bfd, input_section)); return false; diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h index 2ff0a32..454e686 100644 --- a/contrib/binutils/bfd/coffswap.h +++ b/contrib/binutils/bfd/coffswap.h @@ -1,5 +1,6 @@ /* Generic COFF swapping routines, for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, + 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -27,174 +28,186 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Any file which uses this must first include "coff/internal.h" and "coff/CPU.h". The functions will then be correct for that CPU. */ -#define PUTWORD bfd_h_put_32 -#define PUTHALF bfd_h_put_16 -#define PUTBYTE bfd_h_put_8 - #ifndef GET_FCN_LNNOPTR -#define GET_FCN_LNNOPTR(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) +#define GET_FCN_LNNOPTR(abfd, ext) \ + H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) #endif #ifndef GET_FCN_ENDNDX -#define GET_FCN_ENDNDX(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx) +#define GET_FCN_ENDNDX(abfd, ext) \ + H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx) #endif #ifndef PUT_FCN_LNNOPTR -#define PUT_FCN_LNNOPTR(abfd, in, ext) PUTWORD(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) +#define PUT_FCN_LNNOPTR(abfd, in, ext) \ + H_PUT_32 (abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) #endif #ifndef PUT_FCN_ENDNDX -#define PUT_FCN_ENDNDX(abfd, in, ext) PUTWORD(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx) +#define PUT_FCN_ENDNDX(abfd, in, ext) \ + H_PUT_32 (abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx) #endif #ifndef GET_LNSZ_LNNO -#define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno) +#define GET_LNSZ_LNNO(abfd, ext) \ + H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno) #endif #ifndef GET_LNSZ_SIZE -#define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size) +#define GET_LNSZ_SIZE(abfd, ext) \ + H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size) #endif #ifndef PUT_LNSZ_LNNO -#define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno) +#define PUT_LNSZ_LNNO(abfd, in, ext) \ + H_PUT_16 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno) #endif #ifndef PUT_LNSZ_SIZE -#define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size) +#define PUT_LNSZ_SIZE(abfd, in, ext) \ + H_PUT_16 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_size) #endif #ifndef GET_SCN_SCNLEN -#define GET_SCN_SCNLEN(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen) +#define GET_SCN_SCNLEN(abfd, ext) \ + H_GET_32 (abfd, ext->x_scn.x_scnlen) #endif #ifndef GET_SCN_NRELOC -#define GET_SCN_NRELOC(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc) +#define GET_SCN_NRELOC(abfd, ext) \ + H_GET_16 (abfd, ext->x_scn.x_nreloc) #endif #ifndef GET_SCN_NLINNO -#define GET_SCN_NLINNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno) +#define GET_SCN_NLINNO(abfd, ext) \ + H_GET_16 (abfd, ext->x_scn.x_nlinno) #endif #ifndef PUT_SCN_SCNLEN -#define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen) +#define PUT_SCN_SCNLEN(abfd, in, ext) \ + H_PUT_32 (abfd, in, ext->x_scn.x_scnlen) #endif #ifndef PUT_SCN_NRELOC -#define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc) +#define PUT_SCN_NRELOC(abfd, in, ext) \ + H_PUT_16 (abfd, in, ext->x_scn.x_nreloc) #endif #ifndef PUT_SCN_NLINNO -#define PUT_SCN_NLINNO(abfd,in, ext) bfd_h_put_16(abfd,in, (bfd_byte *) ext->x_scn.x_nlinno) +#define PUT_SCN_NLINNO(abfd, in, ext) \ + H_PUT_16 (abfd, in, ext->x_scn.x_nlinno) #endif #ifndef GET_LINENO_LNNO -#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno)); +#define GET_LINENO_LNNO(abfd, ext) \ + H_GET_16 (abfd, ext->l_lnno); #endif #ifndef PUT_LINENO_LNNO -#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno)); +#define PUT_LINENO_LNNO(abfd, val, ext) \ + H_PUT_16 (abfd, val, ext->l_lnno); #endif /* The f_symptr field in the filehdr is sometimes 64 bits. */ #ifndef GET_FILEHDR_SYMPTR -#define GET_FILEHDR_SYMPTR bfd_h_get_32 +#define GET_FILEHDR_SYMPTR H_GET_32 #endif #ifndef PUT_FILEHDR_SYMPTR -#define PUT_FILEHDR_SYMPTR bfd_h_put_32 +#define PUT_FILEHDR_SYMPTR H_PUT_32 #endif /* Some fields in the aouthdr are sometimes 64 bits. */ #ifndef GET_AOUTHDR_TSIZE -#define GET_AOUTHDR_TSIZE bfd_h_get_32 +#define GET_AOUTHDR_TSIZE H_GET_32 #endif #ifndef PUT_AOUTHDR_TSIZE -#define PUT_AOUTHDR_TSIZE bfd_h_put_32 +#define PUT_AOUTHDR_TSIZE H_PUT_32 #endif #ifndef GET_AOUTHDR_DSIZE -#define GET_AOUTHDR_DSIZE bfd_h_get_32 +#define GET_AOUTHDR_DSIZE H_GET_32 #endif #ifndef PUT_AOUTHDR_DSIZE -#define PUT_AOUTHDR_DSIZE bfd_h_put_32 +#define PUT_AOUTHDR_DSIZE H_PUT_32 #endif #ifndef GET_AOUTHDR_BSIZE -#define GET_AOUTHDR_BSIZE bfd_h_get_32 +#define GET_AOUTHDR_BSIZE H_GET_32 #endif #ifndef PUT_AOUTHDR_BSIZE -#define PUT_AOUTHDR_BSIZE bfd_h_put_32 +#define PUT_AOUTHDR_BSIZE H_PUT_32 #endif #ifndef GET_AOUTHDR_ENTRY -#define GET_AOUTHDR_ENTRY bfd_h_get_32 +#define GET_AOUTHDR_ENTRY H_GET_32 #endif #ifndef PUT_AOUTHDR_ENTRY -#define PUT_AOUTHDR_ENTRY bfd_h_put_32 +#define PUT_AOUTHDR_ENTRY H_PUT_32 #endif #ifndef GET_AOUTHDR_TEXT_START -#define GET_AOUTHDR_TEXT_START bfd_h_get_32 +#define GET_AOUTHDR_TEXT_START H_GET_32 #endif #ifndef PUT_AOUTHDR_TEXT_START -#define PUT_AOUTHDR_TEXT_START bfd_h_put_32 +#define PUT_AOUTHDR_TEXT_START H_PUT_32 #endif #ifndef GET_AOUTHDR_DATA_START -#define GET_AOUTHDR_DATA_START bfd_h_get_32 +#define GET_AOUTHDR_DATA_START H_GET_32 #endif #ifndef PUT_AOUTHDR_DATA_START -#define PUT_AOUTHDR_DATA_START bfd_h_put_32 +#define PUT_AOUTHDR_DATA_START H_PUT_32 #endif /* Some fields in the scnhdr are sometimes 64 bits. */ #ifndef GET_SCNHDR_PADDR -#define GET_SCNHDR_PADDR bfd_h_get_32 +#define GET_SCNHDR_PADDR H_GET_32 #endif #ifndef PUT_SCNHDR_PADDR -#define PUT_SCNHDR_PADDR bfd_h_put_32 +#define PUT_SCNHDR_PADDR H_PUT_32 #endif #ifndef GET_SCNHDR_VADDR -#define GET_SCNHDR_VADDR bfd_h_get_32 +#define GET_SCNHDR_VADDR H_GET_32 #endif #ifndef PUT_SCNHDR_VADDR -#define PUT_SCNHDR_VADDR bfd_h_put_32 +#define PUT_SCNHDR_VADDR H_PUT_32 #endif #ifndef GET_SCNHDR_SIZE -#define GET_SCNHDR_SIZE bfd_h_get_32 +#define GET_SCNHDR_SIZE H_GET_32 #endif #ifndef PUT_SCNHDR_SIZE -#define PUT_SCNHDR_SIZE bfd_h_put_32 +#define PUT_SCNHDR_SIZE H_PUT_32 #endif #ifndef GET_SCNHDR_SCNPTR -#define GET_SCNHDR_SCNPTR bfd_h_get_32 +#define GET_SCNHDR_SCNPTR H_GET_32 #endif #ifndef PUT_SCNHDR_SCNPTR -#define PUT_SCNHDR_SCNPTR bfd_h_put_32 +#define PUT_SCNHDR_SCNPTR H_PUT_32 #endif #ifndef GET_SCNHDR_RELPTR -#define GET_SCNHDR_RELPTR bfd_h_get_32 +#define GET_SCNHDR_RELPTR H_GET_32 #endif #ifndef PUT_SCNHDR_RELPTR -#define PUT_SCNHDR_RELPTR bfd_h_put_32 +#define PUT_SCNHDR_RELPTR H_PUT_32 #endif #ifndef GET_SCNHDR_LNNOPTR -#define GET_SCNHDR_LNNOPTR bfd_h_get_32 +#define GET_SCNHDR_LNNOPTR H_GET_32 #endif #ifndef PUT_SCNHDR_LNNOPTR -#define PUT_SCNHDR_LNNOPTR bfd_h_put_32 +#define PUT_SCNHDR_LNNOPTR H_PUT_32 #endif #ifndef GET_SCNHDR_NRELOC -#define GET_SCNHDR_NRELOC bfd_h_get_16 +#define GET_SCNHDR_NRELOC H_GET_16 #endif #ifndef MAX_SCNHDR_NRELOC #define MAX_SCNHDR_NRELOC 0xffff #endif #ifndef PUT_SCNHDR_NRELOC -#define PUT_SCNHDR_NRELOC bfd_h_put_16 +#define PUT_SCNHDR_NRELOC H_PUT_16 #endif #ifndef GET_SCNHDR_NLNNO -#define GET_SCNHDR_NLNNO bfd_h_get_16 +#define GET_SCNHDR_NLNNO H_GET_16 #endif #ifndef MAX_SCNHDR_NLNNO #define MAX_SCNHDR_NLNNO 0xffff #endif #ifndef PUT_SCNHDR_NLNNO -#define PUT_SCNHDR_NLNNO bfd_h_put_16 +#define PUT_SCNHDR_NLNNO H_PUT_16 #endif #ifndef GET_SCNHDR_FLAGS -#define GET_SCNHDR_FLAGS bfd_h_get_32 +#define GET_SCNHDR_FLAGS H_GET_32 #endif #ifndef PUT_SCNHDR_FLAGS -#define PUT_SCNHDR_FLAGS bfd_h_put_32 +#define PUT_SCNHDR_FLAGS H_PUT_32 #endif #ifndef GET_RELOC_VADDR -#define GET_RELOC_VADDR bfd_h_get_32 +#define GET_RELOC_VADDR H_GET_32 #endif #ifndef PUT_RELOC_VADDR -#define PUT_RELOC_VADDR bfd_h_put_32 +#define PUT_RELOC_VADDR H_PUT_32 #endif static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR)); @@ -229,48 +242,44 @@ coff_swap_reloc_in (abfd, src, dst) RELOC *reloc_src = (RELOC *) src; struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; - reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr); - reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx); + reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, reloc_src->r_vaddr); + reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx); #ifdef RS6000COFF_C - reloc_dst->r_type = bfd_h_get_8(abfd, reloc_src->r_type); - reloc_dst->r_size = bfd_h_get_8(abfd, reloc_src->r_size); + reloc_dst->r_type = H_GET_8 (abfd, reloc_src->r_type); + reloc_dst->r_size = H_GET_8 (abfd, reloc_src->r_size); #else - reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type); + reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type); #endif #ifdef SWAP_IN_RELOC_OFFSET - reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET(abfd, - (bfd_byte *) reloc_src->r_offset); + reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset); #endif } static unsigned int coff_swap_reloc_out (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; + bfd *abfd; + PTR src; + PTR dst; { - struct internal_reloc *reloc_src = (struct internal_reloc *)src; - struct external_reloc *reloc_dst = (struct external_reloc *)dst; - PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); - bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx); + struct internal_reloc *reloc_src = (struct internal_reloc *) src; + struct external_reloc *reloc_dst = (struct external_reloc *) dst; + PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); + H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx); #ifdef RS6000COFF_C - bfd_h_put_8 (abfd, reloc_src->r_type, (bfd_byte *) reloc_dst->r_type); - bfd_h_put_8 (abfd, reloc_src->r_size, (bfd_byte *) reloc_dst->r_size); + H_PUT_8 (abfd, reloc_src->r_type, reloc_dst->r_type); + H_PUT_8 (abfd, reloc_src->r_size, reloc_dst->r_size); #else - bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *) - reloc_dst->r_type); + H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type); #endif #ifdef SWAP_OUT_RELOC_OFFSET - SWAP_OUT_RELOC_OFFSET(abfd, - reloc_src->r_offset, - (bfd_byte *) reloc_dst->r_offset); + SWAP_OUT_RELOC_OFFSET (abfd, reloc_src->r_offset, reloc_dst->r_offset); #endif #ifdef SWAP_OUT_RELOC_EXTRA - SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst); + SWAP_OUT_RELOC_EXTRA (abfd, reloc_src, reloc_dst); #endif return bfd_coff_relsz (abfd); @@ -280,9 +289,9 @@ coff_swap_reloc_out (abfd, src, dst) static void coff_swap_filehdr_in (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; + bfd *abfd; + PTR src; + PTR dst; { FILHDR *filehdr_src = (FILHDR *) src; struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst; @@ -290,16 +299,15 @@ coff_swap_filehdr_in (abfd, src, 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); - filehdr_dst->f_symptr = - GET_FILEHDR_SYMPTR (abfd, (bfd_byte *) filehdr_src->f_symptr); - 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); + filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic); + filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src->f_nscns); + filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->f_timdat); + filehdr_dst->f_symptr = GET_FILEHDR_SYMPTR (abfd, filehdr_src->f_symptr); + filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src->f_nsyms); + filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src->f_opthdr); + filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src->f_flags); #ifdef TIC80_TARGET_ID - filehdr_dst->f_target_id = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_target_id); + filehdr_dst->f_target_id = H_GET_16 (abfd, filehdr_src->f_target_id); #endif #ifdef COFF_ADJUST_FILEHDR_IN_POST @@ -309,26 +317,25 @@ coff_swap_filehdr_in (abfd, src, dst) static unsigned int coff_swap_filehdr_out (abfd, in, out) - bfd *abfd; - PTR in; - PTR out; + bfd *abfd; + PTR in; + PTR out; { - struct internal_filehdr *filehdr_in = (struct internal_filehdr *)in; - FILHDR *filehdr_out = (FILHDR *)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); - PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr, - (bfd_byte *) filehdr_out->f_symptr); - bfd_h_put_32(abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); - 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); + H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic); + H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); + H_PUT_32 (abfd, filehdr_in->f_timdat, filehdr_out->f_timdat); + PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, filehdr_out->f_symptr); + H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms); + H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr); + H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags); #ifdef TIC80_TARGET_ID - bfd_h_put_16(abfd, filehdr_in->f_target_id, (bfd_byte *) filehdr_out->f_target_id); + H_PUT_16 (abfd, filehdr_in->f_target_id, filehdr_out->f_target_id); #endif #ifdef COFF_ADJUST_FILEHDR_OUT_POST @@ -341,34 +348,38 @@ coff_swap_filehdr_out (abfd, in, out) static void coff_swap_sym_in (abfd, ext1, in1) - bfd *abfd; + bfd *abfd; PTR ext1; PTR in1; { - SYMENT *ext = (SYMENT *)ext1; - struct internal_syment *in = (struct internal_syment *)in1; - - if( ext->e.e_name[0] == 0) { - in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset); - } - else { + SYMENT *ext = (SYMENT *) ext1; + struct internal_syment *in = (struct internal_syment *) in1; + + if (ext->e.e_name[0] == 0) + { + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e.e.e_offset); + } + else + { #if SYMNMLEN != E_SYMNMLEN - -> Error, we need to cope with truncating or extending SYMNMLEN!; + -> Error, we need to cope with truncating or extending SYMNMLEN!; #else - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); -#endif - } - in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); - in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); - if (sizeof (ext->e_type) == 2){ - in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); - } - else { - in->n_type = bfd_h_get_32(abfd, (bfd_byte *) ext->e_type); - } - in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); +#endif + } + in->n_value = H_GET_32 (abfd, ext->e_value); + in->n_scnum = H_GET_16 (abfd, ext->e_scnum); + if (sizeof (ext->e_type) == 2) + { + in->n_type = H_GET_16 (abfd, ext->e_type); + } + else + { + in->n_type = H_GET_32 (abfd, ext->e_type); + } + in->n_sclass = H_GET_8 (abfd, ext->e_sclass); + in->n_numaux = H_GET_8 (abfd, ext->e_numaux); #ifdef COFF_ADJUST_SYM_IN_POST COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1); #endif @@ -376,35 +387,37 @@ coff_swap_sym_in (abfd, ext1, in1) static unsigned int coff_swap_sym_out (abfd, inp, extp) - bfd *abfd; - PTR inp; - PTR extp; + bfd *abfd; + PTR inp; + PTR extp; { - struct internal_syment *in = (struct internal_syment *)inp; - SYMENT *ext =(SYMENT *)extp; - if(in->_n._n_name[0] == 0) { - bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); - bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e.e.e_offset); - } - else { + struct internal_syment *in = (struct internal_syment *) inp; + SYMENT *ext =(SYMENT *) extp; + if(in->_n._n_name[0] == 0) + { + H_PUT_32 (abfd, 0, ext->e.e.e_zeroes); + H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); + } + else + { #if SYMNMLEN != E_SYMNMLEN - -> Error, we need to cope with truncating or extending SYMNMLEN!; + -> Error, we need to cope with truncating or extending SYMNMLEN!; #else - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); #endif - } - bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value); - bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); + } + H_PUT_32 (abfd, in->n_value, ext->e_value); + H_PUT_16 (abfd, in->n_scnum, ext->e_scnum); if (sizeof (ext->e_type) == 2) - { - bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); - } + { + H_PUT_16 (abfd, in->n_type, ext->e_type); + } else - { - bfd_h_put_32(abfd, in->n_type , (bfd_byte *) ext->e_type); - } - bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + { + H_PUT_32 (abfd, in->n_type, ext->e_type); + } + H_PUT_8 (abfd, in->n_sclass, ext->e_sclass); + H_PUT_8 (abfd, in->n_numaux, ext->e_numaux); #ifdef COFF_ADJUST_SYM_OUT_POST COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp); #endif @@ -413,42 +426,45 @@ coff_swap_sym_out (abfd, inp, extp) static void coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) - bfd *abfd; - PTR ext1; - int type; - int class; - int indx; - int numaux; - PTR in1; + bfd *abfd; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; { - AUXENT *ext = (AUXENT *)ext1; - union internal_auxent *in = (union internal_auxent *)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) { + switch (class) + { case C_FILE: - if (ext->x_file.x_fname[0] == 0) { + if (ext->x_file.x_fname[0] == 0) + { in->x_file.x_n.x_zeroes = 0; - in->x_file.x_n.x_offset = - bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); - } else { + in->x_file.x_n.x_offset = H_GET_32 (abfd, ext->x_file.x_n.x_offset); + } + else + { #if FILNMLEN != E_FILNMLEN - -> Error, we need to cope with truncating or extending FILNMLEN!; + -> Error, we need to cope with truncating or extending FILNMLEN!; #else - if (numaux > 1) - { - if (indx == 0) - memcpy (in->x_file.x_fname, ext->x_file.x_fname, - numaux * sizeof (AUXENT)); - } - else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } -#endif - } + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } +#endif + } goto end; case C_STAT: @@ -456,10 +472,11 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) case C_LEAFSTAT: #endif case C_HIDDEN: - if (type == T_NULL) { - in->x_scn.x_scnlen = GET_SCN_SCNLEN(abfd, ext); - in->x_scn.x_nreloc = GET_SCN_NRELOC(abfd, ext); - in->x_scn.x_nlinno = GET_SCN_NLINNO(abfd, ext); + if (type == T_NULL) + { + in->x_scn.x_scnlen = GET_SCN_SCNLEN (abfd, ext); + in->x_scn.x_nreloc = GET_SCN_NRELOC (abfd, ext); + in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext); /* PE defines some extra fields; we zero them out for safety. */ @@ -472,9 +489,9 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) break; } - in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); + in->x_sym.x_tagndx.l = H_GET_32 (abfd, ext->x_sym.x_tagndx); #ifndef NO_TVNDX - in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); + in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx); #endif if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) @@ -485,29 +502,29 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) else { #if DIMNUM != E_DIMNUM - #error we need to cope with truncating or extending DIMNUM +#error we need to cope with truncating or extending DIMNUM #endif in->x_sym.x_fcnary.x_ary.x_dimen[0] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]); in->x_sym.x_fcnary.x_ary.x_dimen[1] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]); in->x_sym.x_fcnary.x_ary.x_dimen[2] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]); in->x_sym.x_fcnary.x_ary.x_dimen[3] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); - } - else { - 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); - } + if (ISFCN(type)) + { + in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize); + } + else + { + 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. */ + end: ; #ifdef COFF_ADJUST_AUX_IN_POST COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1); @@ -516,87 +533,88 @@ end: ; static unsigned int coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) - bfd *abfd; - PTR inp; - int type; - int class; - int indx ATTRIBUTE_UNUSED; - int numaux ATTRIBUTE_UNUSED; - PTR extp; + bfd *abfd; + PTR inp; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR extp; { - union internal_auxent *in = (union internal_auxent *)inp; - AUXENT *ext = (AUXENT *)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: - if (in->x_file.x_fname[0] == 0) { - PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); - PUTWORD(abfd, - in->x_file.x_n.x_offset, - (bfd_byte *) ext->x_file.x_n.x_offset); - } - else { + switch (class) + { + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + H_PUT_32 (abfd, 0, ext->x_file.x_n.x_zeroes); + H_PUT_32 (abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset); + } + else + { #if FILNMLEN != E_FILNMLEN - -> Error, we need to cope with truncating or extending FILNMLEN!; + -> Error, we need to cope with truncating or extending FILNMLEN!; #else - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); #endif - } - goto end; + } + goto end; - case C_STAT: + case C_STAT: #ifdef C_LEAFSTAT - case C_LEAFSTAT: + case C_LEAFSTAT: #endif - case C_HIDDEN: - if (type == T_NULL) { - 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); - goto end; + case C_HIDDEN: + if (type == T_NULL) + { + 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); + goto end; + } + break; } - break; - } - PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + H_PUT_32 (abfd, in->x_sym.x_tagndx.l, ext->x_sym.x_tagndx); #ifndef NO_TVNDX - bfd_h_put_16(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); + H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx); #endif if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { - PUT_FCN_LNNOPTR(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext); - PUT_FCN_ENDNDX(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext); + PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext); + PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext); } else { #if DIMNUM != E_DIMNUM - #error we need to cope with truncating or extending DIMNUM -#endif - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); +#error we need to cope with truncating or extending DIMNUM +#endif + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } if (ISFCN (type)) - PUTWORD (abfd, in->x_sym.x_misc.x_fsize, - (bfd_byte *) ext->x_sym.x_misc.x_fsize); + H_PUT_32 (abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize); else { PUT_LNSZ_LNNO (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); PUT_LNSZ_SIZE (abfd, in->x_sym.x_misc.x_lnsz.x_size, ext); } -end: + end: #ifdef COFF_ADJUST_AUX_OUT_POST COFF_ADJUST_AUX_OUT_POST (abfd, inp, type, class, indx, numaux, extp); #endif @@ -609,27 +627,26 @@ end: static void coff_swap_lineno_in (abfd, ext1, in1) - bfd *abfd; + bfd *abfd; PTR ext1; PTR in1; { - LINENO *ext = (LINENO *)ext1; - struct internal_lineno *in = (struct internal_lineno *)in1; + LINENO *ext = (LINENO *) ext1; + struct internal_lineno *in = (struct internal_lineno *) in1; - in->l_addr.l_symndx = bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx); - in->l_lnno = GET_LINENO_LNNO(abfd, ext); + in->l_addr.l_symndx = H_GET_32 (abfd, ext->l_addr.l_symndx); + in->l_lnno = GET_LINENO_LNNO (abfd, ext); } static unsigned int coff_swap_lineno_out (abfd, inp, outp) - bfd *abfd; - PTR inp; - PTR outp; + bfd *abfd; + PTR inp; + PTR outp; { - struct internal_lineno *in = (struct internal_lineno *)inp; - struct external_lineno *ext = (struct external_lineno *)outp; - PUTWORD(abfd, in->l_addr.l_symndx, (bfd_byte *) - ext->l_addr.l_symndx); + struct internal_lineno *in = (struct internal_lineno *) inp; + struct external_lineno *ext = (struct external_lineno *) outp; + H_PUT_32 (abfd, in->l_addr.l_symndx, ext->l_addr.l_symndx); PUT_LINENO_LNNO (abfd, in->l_lnno, ext); return LINESZ; @@ -639,128 +656,126 @@ coff_swap_lineno_out (abfd, inp, outp) static void coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) - bfd *abfd; + bfd *abfd; PTR aouthdr_ext1; PTR aouthdr_int1; { - AOUTHDR *aouthdr_ext = (AOUTHDR *) aouthdr_ext1; - struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1; - - aouthdr_int->magic = bfd_h_get_16(abfd, (bfd_byte *) aouthdr_ext->magic); - aouthdr_int->vstamp = bfd_h_get_16(abfd, (bfd_byte *) aouthdr_ext->vstamp); - aouthdr_int->tsize = - GET_AOUTHDR_TSIZE (abfd, (bfd_byte *) aouthdr_ext->tsize); - aouthdr_int->dsize = - GET_AOUTHDR_DSIZE (abfd, (bfd_byte *) aouthdr_ext->dsize); - aouthdr_int->bsize = - GET_AOUTHDR_BSIZE (abfd, (bfd_byte *) aouthdr_ext->bsize); - aouthdr_int->entry = - GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry); + AOUTHDR *aouthdr_ext; + struct internal_aouthdr *aouthdr_int; + + aouthdr_ext = (AOUTHDR *) aouthdr_ext1; + aouthdr_int = (struct internal_aouthdr *) aouthdr_int1; + aouthdr_int->magic = H_GET_16 (abfd, aouthdr_ext->magic); + aouthdr_int->vstamp = H_GET_16 (abfd, aouthdr_ext->vstamp); + aouthdr_int->tsize = GET_AOUTHDR_TSIZE (abfd, aouthdr_ext->tsize); + aouthdr_int->dsize = GET_AOUTHDR_DSIZE (abfd, aouthdr_ext->dsize); + aouthdr_int->bsize = GET_AOUTHDR_BSIZE (abfd, aouthdr_ext->bsize); + aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry); aouthdr_int->text_start = - GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start); + GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start); aouthdr_int->data_start = - GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start); + GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start); #ifdef I960 - aouthdr_int->tagentries = bfd_h_get_32(abfd, (bfd_byte *) aouthdr_ext->tagentries); + aouthdr_int->tagentries = H_GET_32 (abfd, aouthdr_ext->tagentries); #endif #ifdef APOLLO_M68 - bfd_h_put_32(abfd, aouthdr_int->o_inlib, (bfd_byte *) aouthdr_ext->o_inlib); - bfd_h_put_32(abfd, aouthdr_int->o_sri, (bfd_byte *) aouthdr_ext->o_sri); - bfd_h_put_32(abfd, aouthdr_int->vid[0], (bfd_byte *) aouthdr_ext->vid); - bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4); + H_PUT_32 (abfd, aouthdr_int->o_inlib, aouthdr_ext->o_inlib); + H_PUT_32 (abfd, aouthdr_int->o_sri, aouthdr_ext->o_sri); + H_PUT_32 (abfd, aouthdr_int->vid[0], aouthdr_ext->vid); + H_PUT_32 (abfd, aouthdr_int->vid[1], aouthdr_ext->vid + 4); #endif #ifdef RS6000COFF_C #ifdef XCOFF64 - aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc); + aouthdr_int->o_toc = H_GET_64 (abfd, aouthdr_ext->o_toc); #else - aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc); -#endif - aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry); - aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext); - aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata); - aouthdr_int->o_sntoc = bfd_h_get_16(abfd, aouthdr_ext->o_sntoc); - aouthdr_int->o_snloader = bfd_h_get_16(abfd, aouthdr_ext->o_snloader); - aouthdr_int->o_snbss = bfd_h_get_16(abfd, aouthdr_ext->o_snbss); - aouthdr_int->o_algntext = bfd_h_get_16(abfd, aouthdr_ext->o_algntext); - aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata); - aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype); - aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype); + aouthdr_int->o_toc = H_GET_32 (abfd, aouthdr_ext->o_toc); +#endif + aouthdr_int->o_snentry = H_GET_16 (abfd, aouthdr_ext->o_snentry); + aouthdr_int->o_sntext = H_GET_16 (abfd, aouthdr_ext->o_sntext); + aouthdr_int->o_sndata = H_GET_16 (abfd, aouthdr_ext->o_sndata); + aouthdr_int->o_sntoc = H_GET_16 (abfd, aouthdr_ext->o_sntoc); + aouthdr_int->o_snloader = H_GET_16 (abfd, aouthdr_ext->o_snloader); + aouthdr_int->o_snbss = H_GET_16 (abfd, aouthdr_ext->o_snbss); + aouthdr_int->o_algntext = H_GET_16 (abfd, aouthdr_ext->o_algntext); + aouthdr_int->o_algndata = H_GET_16 (abfd, aouthdr_ext->o_algndata); + aouthdr_int->o_modtype = H_GET_16 (abfd, aouthdr_ext->o_modtype); + aouthdr_int->o_cputype = H_GET_16 (abfd, aouthdr_ext->o_cputype); #ifdef XCOFF64 - aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxstack = H_GET_64 (abfd, aouthdr_ext->o_maxstack); + aouthdr_int->o_maxdata = H_GET_64 (abfd, aouthdr_ext->o_maxdata); #else - aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxstack = H_GET_32 (abfd, aouthdr_ext->o_maxstack); + aouthdr_int->o_maxdata = H_GET_32 (abfd, aouthdr_ext->o_maxdata); #endif #endif #ifdef MIPSECOFF - aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = bfd_h_get_32(abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = bfd_h_get_32(abfd, aouthdr_ext->gprmask); - aouthdr_int->cprmask[0] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[0]); - aouthdr_int->cprmask[1] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[1]); - aouthdr_int->cprmask[2] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[2]); - aouthdr_int->cprmask[3] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[3]); + aouthdr_int->bss_start = H_GET_32 (abfd, aouthdr_ext->bss_start); + aouthdr_int->gp_value = H_GET_32 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->cprmask[0] = H_GET_32 (abfd, aouthdr_ext->cprmask[0]); + aouthdr_int->cprmask[1] = H_GET_32 (abfd, aouthdr_ext->cprmask[1]); + aouthdr_int->cprmask[2] = H_GET_32 (abfd, aouthdr_ext->cprmask[2]); + aouthdr_int->cprmask[3] = H_GET_32 (abfd, aouthdr_ext->cprmask[3]); #endif #ifdef ALPHAECOFF - aouthdr_int->bss_start = bfd_h_get_64(abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = bfd_h_get_64(abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = bfd_h_get_32(abfd, aouthdr_ext->gprmask); - aouthdr_int->fprmask = bfd_h_get_32(abfd, aouthdr_ext->fprmask); + aouthdr_int->bss_start = H_GET_64 (abfd, aouthdr_ext->bss_start); + aouthdr_int->gp_value = H_GET_64 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->fprmask = H_GET_32 (abfd, aouthdr_ext->fprmask); #endif } static unsigned int coff_swap_aouthdr_out (abfd, in, out) - bfd *abfd; - PTR in; - PTR out; + bfd *abfd; + PTR in; + PTR out; { - struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *)in; - AOUTHDR *aouthdr_out = (AOUTHDR *)out; - - bfd_h_put_16(abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->magic); - bfd_h_put_16(abfd, aouthdr_in->vstamp, (bfd_byte *) aouthdr_out->vstamp); - PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, (bfd_byte *) aouthdr_out->tsize); - PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, (bfd_byte *) aouthdr_out->dsize); - PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, (bfd_byte *) aouthdr_out->bsize); - PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, (bfd_byte *) aouthdr_out->entry); + struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in; + AOUTHDR *aouthdr_out = (AOUTHDR *) out; + + H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->magic); + H_PUT_16 (abfd, aouthdr_in->vstamp, aouthdr_out->vstamp); + PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, aouthdr_out->tsize); + PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, aouthdr_out->dsize); + PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, aouthdr_out->bsize); + PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, aouthdr_out->entry); PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, - (bfd_byte *) aouthdr_out->text_start); + aouthdr_out->text_start); PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, - (bfd_byte *) aouthdr_out->data_start); + aouthdr_out->data_start); #ifdef I960 - bfd_h_put_32(abfd, aouthdr_in->tagentries, (bfd_byte *) aouthdr_out->tagentries); + H_PUT_32 (abfd, aouthdr_in->tagentries, aouthdr_out->tagentries); #endif #ifdef RS6000COFF_C #ifdef XCOFF64 - bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); + H_PUT_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); #else - bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); -#endif - bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry); - bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext); - bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata); - bfd_h_put_16 (abfd, aouthdr_in->o_sntoc, aouthdr_out->o_sntoc); - bfd_h_put_16 (abfd, aouthdr_in->o_snloader, aouthdr_out->o_snloader); - bfd_h_put_16 (abfd, aouthdr_in->o_snbss, aouthdr_out->o_snbss); - bfd_h_put_16 (abfd, aouthdr_in->o_algntext, aouthdr_out->o_algntext); - bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata); - bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype); - bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype); + H_PUT_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); +#endif + H_PUT_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry); + H_PUT_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext); + H_PUT_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata); + H_PUT_16 (abfd, aouthdr_in->o_sntoc, aouthdr_out->o_sntoc); + H_PUT_16 (abfd, aouthdr_in->o_snloader, aouthdr_out->o_snloader); + H_PUT_16 (abfd, aouthdr_in->o_snbss, aouthdr_out->o_snbss); + H_PUT_16 (abfd, aouthdr_in->o_algntext, aouthdr_out->o_algntext); + H_PUT_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata); + H_PUT_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype); + H_PUT_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype); #ifdef XCOFF64 - bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); - bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); + H_PUT_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); + H_PUT_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); #else - bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); - bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); + H_PUT_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); + H_PUT_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); #endif memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2); #ifdef XCOFF64 @@ -770,23 +785,23 @@ coff_swap_aouthdr_out (abfd, in, out) #endif #ifdef MIPSECOFF - bfd_h_put_32(abfd, aouthdr_in->bss_start, (bfd_byte *) aouthdr_out->bss_start); - bfd_h_put_32(abfd, aouthdr_in->gp_value, (bfd_byte *) aouthdr_out->gp_value); - bfd_h_put_32(abfd, aouthdr_in->gprmask, (bfd_byte *) aouthdr_out->gprmask); - bfd_h_put_32(abfd, aouthdr_in->cprmask[0], (bfd_byte *) aouthdr_out->cprmask[0]); - bfd_h_put_32(abfd, aouthdr_in->cprmask[1], (bfd_byte *) aouthdr_out->cprmask[1]); - bfd_h_put_32(abfd, aouthdr_in->cprmask[2], (bfd_byte *) aouthdr_out->cprmask[2]); - bfd_h_put_32(abfd, aouthdr_in->cprmask[3], (bfd_byte *) aouthdr_out->cprmask[3]); + H_PUT_32 (abfd, aouthdr_in->bss_start, aouthdr_out->bss_start); + H_PUT_32 (abfd, aouthdr_in->gp_value, aouthdr_out->gp_value); + H_PUT_32 (abfd, aouthdr_in->gprmask, aouthdr_out->gprmask); + H_PUT_32 (abfd, aouthdr_in->cprmask[0], aouthdr_out->cprmask[0]); + H_PUT_32 (abfd, aouthdr_in->cprmask[1], aouthdr_out->cprmask[1]); + H_PUT_32 (abfd, aouthdr_in->cprmask[2], aouthdr_out->cprmask[2]); + H_PUT_32 (abfd, aouthdr_in->cprmask[3], aouthdr_out->cprmask[3]); #endif #ifdef ALPHAECOFF /* FIXME: What does bldrev mean? */ - bfd_h_put_16(abfd, (bfd_vma) 2, (bfd_byte *) aouthdr_out->bldrev); - bfd_h_put_16(abfd, (bfd_vma) 0, (bfd_byte *) aouthdr_out->padding); - bfd_h_put_64(abfd, aouthdr_in->bss_start, (bfd_byte *) aouthdr_out->bss_start); - bfd_h_put_64(abfd, aouthdr_in->gp_value, (bfd_byte *) aouthdr_out->gp_value); - bfd_h_put_32(abfd, aouthdr_in->gprmask, (bfd_byte *) aouthdr_out->gprmask); - bfd_h_put_32(abfd, aouthdr_in->fprmask, (bfd_byte *) aouthdr_out->fprmask); + H_PUT_16 (abfd, 2, aouthdr_out->bldrev); + H_PUT_16 (abfd, 0, aouthdr_out->padding); + H_PUT_64 (abfd, aouthdr_in->bss_start, aouthdr_out->bss_start); + H_PUT_64 (abfd, aouthdr_in->gp_value, aouthdr_out->gp_value); + H_PUT_32 (abfd, aouthdr_in->gprmask, aouthdr_out->gprmask); + H_PUT_32 (abfd, aouthdr_in->fprmask, aouthdr_out->fprmask); #endif return AOUTSZ; @@ -794,9 +809,9 @@ coff_swap_aouthdr_out (abfd, in, out) static void coff_swap_scnhdr_in (abfd, ext, in) - bfd *abfd; - PTR ext; - PTR in; + bfd *abfd; + PTR ext; + PTR in; { SCNHDR *scnhdr_ext = (SCNHDR *) ext; struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; @@ -805,28 +820,18 @@ coff_swap_scnhdr_in (abfd, ext, in) 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); - scnhdr_int->s_paddr = - GET_SCNHDR_PADDR (abfd, (bfd_byte *) scnhdr_ext->s_paddr); - scnhdr_int->s_size = - GET_SCNHDR_SIZE (abfd, (bfd_byte *) scnhdr_ext->s_size); - - scnhdr_int->s_scnptr = - GET_SCNHDR_SCNPTR (abfd, (bfd_byte *) scnhdr_ext->s_scnptr); - scnhdr_int->s_relptr = - 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 = - 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); + scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr); + scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr); + scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size); + + scnhdr_int->s_scnptr = GET_SCNHDR_SCNPTR (abfd, scnhdr_ext->s_scnptr); + scnhdr_int->s_relptr = GET_SCNHDR_RELPTR (abfd, scnhdr_ext->s_relptr); + scnhdr_int->s_lnnoptr = GET_SCNHDR_LNNOPTR (abfd, scnhdr_ext->s_lnnoptr); + scnhdr_int->s_flags = GET_SCNHDR_FLAGS (abfd, scnhdr_ext->s_flags); + scnhdr_int->s_nreloc = GET_SCNHDR_NRELOC (abfd, scnhdr_ext->s_nreloc); + scnhdr_int->s_nlnno = GET_SCNHDR_NLNNO (abfd, scnhdr_ext->s_nlnno); #ifdef I960 - scnhdr_int->s_align = - GET_SCNHDR_ALIGN (abfd, (bfd_byte *) scnhdr_ext->s_align); + scnhdr_int->s_align = GET_SCNHDR_ALIGN (abfd, scnhdr_ext->s_align); #endif #ifdef COFF_ADJUST_SCNHDR_IN_POST COFF_ADJUST_SCNHDR_IN_POST (abfd, ext, in); @@ -835,42 +840,32 @@ coff_swap_scnhdr_in (abfd, ext, in) static unsigned int coff_swap_scnhdr_out (abfd, in, out) - bfd *abfd; - PTR in; - PTR out; + bfd *abfd; + PTR in; + PTR out; { - struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *)in; - SCNHDR *scnhdr_ext = (SCNHDR *)out; + struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; + SCNHDR *scnhdr_ext = (SCNHDR *) out; unsigned int ret = bfd_coff_scnhsz (abfd); #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, - (bfd_byte *) scnhdr_ext->s_vaddr); - - PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr, - (bfd_byte *) scnhdr_ext->s_paddr); - PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size, - (bfd_byte *) scnhdr_ext->s_size); + memcpy (scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); - PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, - (bfd_byte *) scnhdr_ext->s_scnptr); - PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, - (bfd_byte *) scnhdr_ext->s_relptr); - PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, - (bfd_byte *) scnhdr_ext->s_lnnoptr); - PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags, - (bfd_byte *) scnhdr_ext->s_flags); + PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr, scnhdr_ext->s_vaddr); + PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr, scnhdr_ext->s_paddr); + PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size, scnhdr_ext->s_size); + PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, scnhdr_ext->s_scnptr); + PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr); + PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr); + PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags, 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); + H_PUT_32 (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno); + H_PUT_32 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); #else if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO) - PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno, - (bfd_byte *) scnhdr_ext->s_nlnno); + PUT_SCNHDR_NLNNO (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -881,11 +876,10 @@ coff_swap_scnhdr_out (abfd, in, out) (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), buf, scnhdr_int->s_nlnno); - PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno); } if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) - PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc, - (bfd_byte *) scnhdr_ext->s_nreloc); + PUT_SCNHDR_NRELOC (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -896,13 +890,13 @@ coff_swap_scnhdr_out (abfd, in, out) bfd_get_filename (abfd), buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); - PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc); ret = 0; } #endif #ifdef I960 - PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, (bfd_byte *) scnhdr_ext->s_align); + PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, scnhdr_ext->s_align); #endif #ifdef COFF_ADJUST_SCNHDR_OUT_POST COFF_ADJUST_SCNHDR_OUT_POST (abfd, in, out); diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd index 56025ac..0fe7464 100755 --- a/contrib/binutils/bfd/config.bfd +++ b/contrib/binutils/bfd/config.bfd @@ -5,6 +5,8 @@ # Sets the following shell variables: # targ_defvec Default vector for this target # targ_selvecs Vectors to build for this target +# targ64_selvecs Vectors to build if --enable-64-bit-bfd is given +# or if host is 64 bit. # targ_archs Architectures for this target # targ_cflags $(CFLAGS) for this target (FIXME: pretty bogus) # targ_underscore Whether underscores are used: yes or no @@ -23,34 +25,38 @@ targ_defvec= targ_selvecs= +targ64_selvecs= targ_cflags= 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 ;; -strongarm*) targ_archs=bfd_arm_arch ;; -thumb*) targ_archs=bfd_arm_arch ;; -xscale*) targ_archs=bfd_arm_arch ;; -c30*) targ_archs=bfd_tic30_arch ;; -c54x*) targ_archs=bfd_tic54x_arch ;; -hppa*) targ_archs=bfd_hppa_arch ;; -x86_64) targ_archs=bfd_i386_arch ;; -i[3456]86) targ_archs=bfd_i386_arch ;; -i370) targ_archs=bfd_i370_arch ;; +alpha*) targ_archs=bfd_alpha_arch ;; +arm*) targ_archs=bfd_arm_arch ;; +c30*) targ_archs=bfd_tic30_arch ;; +c54x*) targ_archs=bfd_tic54x_arch ;; +hppa*) targ_archs=bfd_hppa_arch ;; +i[3456]86) targ_archs=bfd_i386_arch ;; +i370) targ_archs=bfd_i370_arch ;; m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;; m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;; -m68*) targ_archs=bfd_m68k_arch ;; -m88*) targ_archs=bfd_m88k_arch ;; -mips*) targ_archs=bfd_mips_arch ;; -pj*) targ_archs="bfd_pj_arch bfd_i386_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 ;; +m68*) targ_archs=bfd_m68k_arch ;; +m88*) targ_archs=bfd_m88k_arch ;; +mips*) targ_archs=bfd_mips_arch ;; +pdp11*) targ_archs=bfd_pdp11_arch ;; +pj*) targ_archs="bfd_pj_arch bfd_i386_arch";; +powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; +rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; +s390*) targ_archs=bfd_s390_arch ;; +sh*) targ_archs=bfd_sh_arch ;; +sparc*) targ_archs=bfd_sparc_arch ;; +strongarm*) targ_archs=bfd_arm_arch ;; +thumb*) targ_archs=bfd_arm_arch ;; +v850*) targ_archs=bfd_v850_arch ;; +x86_64) targ_archs=bfd_i386_arch ;; +xscale*) targ_archs=bfd_arm_arch ;; +z8k*) targ_archs=bfd_z8k_arch ;; +*) targ_archs=bfd_${targ_cpu}_arch ;; esac @@ -84,13 +90,17 @@ case "${targ}" in alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; - ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) + ia64*-*-aix*) + targ_defvec=bfd_elf64_ia64_aix_little_vec + targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec" + ;; + ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) targ_defvec=bfd_elf64_ia64_little_vec targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" ;; ia64*-*-hpux*) - targ_defvec=bfd_elf64_ia64_big_vec - targ_selvecs="bfd_elf32_ia64_big_vec" + targ_defvec=bfd_elf32_ia64_hpux_big_vec + targ_selvecs="bfd_elf64_ia64_hpux_big_vec" ;; sparc64-*-freebsd* | sparc64-*-netbsd*) targ_defvec=bfd_elf64_sparc_vec @@ -103,7 +113,11 @@ case "${targ}" in targ_selvecs=bfd_elf32_bigarc_vec ;; - arm-*-netbsd*) + arm-*-netbsdelf*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec" + ;; + arm-*-netbsd* | arm-*-openbsd*) targ_defvec=armnetbsd_vec targ_underscore=yes ;; @@ -114,6 +128,7 @@ case "${targ}" in targ_defvec=arm_epoc_pe_little_vec targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec" targ_underscore=no + targ_cflags=-DARM_COFF_BUGFIX ;; arm-wince-pe | arm-*-wince) targ_defvec=armpe_little_vec @@ -134,16 +149,16 @@ case "${targ}" in targ_defvec=aout_arm_big_vec targ_selvecs=aout_arm_little_vec ;; - arm-*-coff) + arm-*-vxworks*) targ_defvec=armcoff_little_vec targ_selvecs=armcoff_big_vec targ_underscore=yes + targ_cflags=-DARM_COFF_BUGFIX ;; - arm-*-vxworks*) + arm-*-coff) targ_defvec=armcoff_little_vec targ_selvecs=armcoff_big_vec targ_underscore=yes - targ_cflags=-DVXWORKS ;; arm-*-rtems*) targ_defvec=bfd_elf32_littlearm_vec @@ -157,6 +172,10 @@ case "${targ}" in targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; + arm9e-*-elf) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; arm-*-oabi) targ_defvec=bfd_elf32_littlearm_oabi_vec targ_selvecs=bfd_elf32_bigarm_oabi_vec @@ -251,6 +270,11 @@ case "${targ}" in ;; + h8300*-*-elf) + targ_defvec=bfd_elf32_h8300_vec + targ_underscore=yes + ;; + h8300*-*-*) targ_defvec=h8300coff_vec targ_underscore=yes @@ -369,11 +393,15 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" ;; -#ifdef BFD64 +#ifdef BFD64 x86_64-*-freebsd*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" ;; + x86_64-*-netbsd*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; x86_64-*-linux-gnu*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" @@ -544,7 +572,16 @@ case "${targ}" in targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec" targ_underscore=yes ;; - m68*-*-netbsd* | m68*-*-openbsd*) + m68*-*-netbsdelf*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec" + ;; + m68*-*-netbsdaout* | m68*-*-netbsd*) + targ_defvec=m68knetbsd_vec + targ_selvecs="m68k4knetbsd_vec bfd_elf32_m68k_vec hp300bsd_vec sunos_big_vec" + targ_underscore=yes + ;; + m68*-*-openbsd*) targ_defvec=m68knetbsd_vec targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec" targ_underscore=yes @@ -598,11 +635,11 @@ case "${targ}" in targ_defvec=ecoff_big_vec targ_selvecs=ecoff_little_vec ;; - mips-dec-netbsd* | mips*el*-*-netbsd*) + mips*el-*-netbsd*) targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec" ;; - mips*-*-netbsd*) + mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec" ;; @@ -622,10 +659,12 @@ case "${targ}" in targ_defvec=ecoff_big_vec targ_selvecs=ecoff_little_vec ;; +#ifdef BFD64 mips*-*-irix6*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; +#endif mips*-*-irix5*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec" @@ -667,23 +706,38 @@ 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*-*-openbsd*) + 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*el*-*-linux-gnu*) - targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" - ;; 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" ;; - mips*-*-linux-gnu*) +#ifdef BFD64 + mips64*el-*-linux*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" + ;; + mips64*-*-linux*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + ;; +#endif + mips*el-*-linux*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" + ;; + mips*-*-linux*) targ_defvec=bfd_elf32_tradbigmips_vec targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; - +#ifdef BFD64 + mmix-*-*) + targ_defvec=bfd_elf64_mmix_vec + targ_selvecs=bfd_mmo_vec + ;; +#endif mn10200-*-*) targ_defvec=bfd_elf32_mn10200_vec ;; @@ -701,6 +755,15 @@ case "${targ}" in targ_underscore=yes ;; + openrisc-*-elf) + targ_defvec=bfd_elf32_openrisc_vec + ;; + + pdp11-*-*) + targ_defvec=pdp11_aout_vec + targ_underscore=yes + ;; + pj-*-*) targ_defvec=bfd_elf32_pj_vec targ_selvecs="bfd_elf32_pj_vec bfd_elf32_pjl_vec" @@ -711,15 +774,34 @@ case "${targ}" in targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec" ;; - powerpc-*-aix* | powerpc-*-beos*) + powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*) targ_defvec=rs6000coff_vec - targ_selvecs="rs6000coff64_vec" + targ64_selvecs=rs6000coff64_vec + case "${targ}" in + *-*-aix4.[3456789]* | *-*-aix[56789]*) + want64=true;; + esac + ;; +#ifdef BFD64 + powerpc64-*-aix*) + targ_defvec=rs6000coff64_vec + targ_selvecs=rs6000coff_vec + ;; + powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*) + targ_defvec=bfd_elf64_powerpc_vec + targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" + ;; + powerpc64le-*-elf* | powerpcle-*-elf64*) + targ_defvec=bfd_elf64_powerpcle_vec + targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec" ;; +#endif powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ powerpc-*-chorus* | powerpc-*-vxworks*) targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; powerpc-*-macos* | powerpc-*-mpw*) targ_defvec=pmac_xcoff_vec @@ -733,6 +815,7 @@ case "${targ}" in powerpcle-*-rtems*) targ_defvec=bfd_elf32_powerpcle_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) @@ -740,14 +823,34 @@ case "${targ}" in targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec" ;; - rs6000-*-*) - targ_defvec=rs6000coff_vec + s390-*-linux*) + targ_defvec=bfd_elf32_s390_vec + ;; +#ifdef BFD64 + s390x-*-linux*) + targ_defvec=bfd_elf64_s390_vec ;; +#endif sh-*-linux*) targ_defvec=bfd_elf32_shblin_vec targ_selvecs=bfd_elf32_shlin_vec ;; + sh*eb-*-linux*) + targ_defvec=bfd_elf32_shblin_vec + ;; + sh*-*-linux*) + targ_defvec=bfd_elf32_shlin_vec + ;; + + sh*le-*-netbsdelf*) + targ_defvec=bfd_elf32_shlnbsd_vec + targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" + ;; + sh*-*-netbsdelf*) + targ_defvec=bfd_elf32_shnbsd_vec + targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" + ;; sh-*-elf* | sh-*-rtemself*) targ_defvec=bfd_elf32_sh_vec @@ -895,6 +998,10 @@ case "${targ}" in targ_defvec=w65_vec ;; + xstormy16-*-elf) + targ_defvec=bfd_elf32_xstormy16_vec + ;; + z8k*-*-*) targ_defvec=z8kcoff_vec targ_underscore=yes @@ -926,6 +1033,12 @@ case "${targ}" in ;; esac +case "${host64}${want64}" in + *true*) + targ_selvecs="${targ_selvecs} ${targ64_selvecs}" + ;; +esac + # If we support any ELF target, then automatically add support for the # generic ELF targets. This permits an objdump with some ELF support # to be used on an arbitrary ELF file for anything other than diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure index 75270e2..2176f31 100755 --- a/contrib/binutils/bfd/configure +++ b/contrib/binutils/bfd/configure @@ -57,7 +57,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -172,7 +171,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -343,11 +341,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -513,16 +506,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -561,12 +550,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:565: checking for Cygwin environment" >&5 +echo "configure:554: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -594,19 +583,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:598: checking for mingw32 environment" >&5 +echo "configure:587: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -671,7 +660,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:675: checking host system type" >&5 +echo "configure:664: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -692,7 +681,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:696: checking target system type" >&5 +echo "configure:685: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -710,7 +699,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:714: checking build system type" >&5 +echo "configure:703: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -735,7 +724,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:739: checking for $ac_word" >&5 +echo "configure:728: 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 @@ -765,7 +754,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:769: checking for $ac_word" >&5 +echo "configure:758: 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 @@ -816,7 +805,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:820: checking for $ac_word" >&5 +echo "configure:809: 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 @@ -848,7 +837,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:841: 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. @@ -859,12 +848,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 863 "configure" +#line 852 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -890,12 +879,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:894: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:883: 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:899: checking whether we are using GNU C" >&5 +echo "configure:888: 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 @@ -904,7 +893,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:908: \"$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:897: \"$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 @@ -923,7 +912,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:927: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:916: 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 @@ -955,7 +944,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:959: checking for POSIXized ISC" >&5 +echo "configure:948: 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 @@ -988,7 +977,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:992: checking for a BSD compatible install" >&5 +echo "configure:981: 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 @@ -1041,7 +1030,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1045: checking whether build environment is sane" >&5 +echo "configure:1034: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1098,7 +1087,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1102: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1091: 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 @@ -1127,7 +1116,7 @@ fi PACKAGE=bfd -VERSION=2.11.2 +VERSION=2.11.93 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; } @@ -1144,7 +1133,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1148: checking for working aclocal" >&5 +echo "configure:1137: 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. @@ -1157,7 +1146,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1161: checking for working autoconf" >&5 +echo "configure:1150: 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. @@ -1170,7 +1159,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1174: checking for working automake" >&5 +echo "configure:1163: 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. @@ -1183,7 +1172,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1187: checking for working autoheader" >&5 +echo "configure:1176: 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. @@ -1196,7 +1185,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1200: checking for working makeinfo" >&5 +echo "configure:1189: 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. @@ -1209,6 +1198,19 @@ else fi +# Uncomment the next line to remove the date from the reported bfd version +#is_release=y + +bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'` + +bfd_version_string="\"${VERSION}\"" +bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h` +if test x${is_release} = x; then + bfd_version_string="\"${VERSION} ${bfd_version_date}\"" +fi + + + if test $host != $build; then ac_tool_prefix=${host_alias}- @@ -1219,7 +1221,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:1223: checking for $ac_word" >&5 +echo "configure:1225: 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 @@ -1251,7 +1253,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:1255: checking for $ac_word" >&5 +echo "configure:1257: 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 @@ -1283,7 +1285,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:1287: checking for $ac_word" >&5 +echo "configure:1289: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1320,7 +1322,7 @@ fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -1344,7 +1346,7 @@ fi if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -1367,7 +1369,7 @@ fi if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -1395,10 +1397,10 @@ else fi ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1402: checking for ld used by GCC" >&5 +echo "configure:1404: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1406,7 +1408,7 @@ echo "configure:1402: checking for ld used by GCC" >&5 *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' @@ -1428,12 +1430,12 @@ echo "configure:1402: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1432: checking for GNU ld" >&5 +echo "configure:1434: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1435: checking for non-GNU ld" >&5 +echo "configure:1437: checking for non-GNU ld" >&5 fi -if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1441,11 +1443,11 @@ else for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_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 + if "$lt_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 @@ -1454,11 +1456,11 @@ else done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else @@ -1466,24 +1468,24 @@ else 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:1470: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then +echo "configure:1472: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi fi -echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$ac_cv_prog_gnu_ld +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1487: checking for $LD option to reload object files" >&5 +echo "configure:1489: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1495,13 +1497,13 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1499: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then +echo "configure:1501: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -1513,27 +1515,27 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1537: checking whether ln -s works" >&5 +echo "configure:1539: 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 @@ -1554,7 +1556,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1558: checking how to recognise dependant libraries" >&5 +echo "configure:1560: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1572,8 +1574,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -1582,8 +1584,8 @@ beos*) ;; bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -1592,14 +1594,27 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -1612,29 +1627,28 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) - case "$LD" in + case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all @@ -1642,25 +1656,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in - alpha* | i*86 | powerpc* | sparc* | ia64* ) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; +newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' @@ -1677,14 +1696,18 @@ solaris*) lt_cv_file_magic_test_file=/lib/libc.so ;; +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; @@ -1697,13 +1720,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1701: checking for object suffix" >&5 +echo "configure:1724: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1723,7 +1746,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1727: checking for executable suffix" >&5 +echo "configure:1750: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1733,10 +1756,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1756,15 +1779,15 @@ ac_exeext=$EXEEXT # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # Only perform the check for file, if the check method requires it -case "$deplibs_check_method" in +case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1764: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1787: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1780,7 +1803,7 @@ else if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1822,11 +1845,11 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1826: checking for file" >&5 +echo "configure:1849: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1842,7 +1865,7 @@ else if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1893,7 +1916,7 @@ 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 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1897: checking for $ac_word" >&5 +echo "configure:1920: 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 @@ -1925,7 +1948,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:1929: checking for $ac_word" >&5 +echo "configure:1952: 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 @@ -1960,7 +1983,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1964: checking for $ac_word" >&5 +echo "configure:1987: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1992,7 +2015,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1996: checking for $ac_word" >&5 +echo "configure:2019: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2030,8 +2053,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$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" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. @@ -2056,12 +2079,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2063 "configure"' > conftest.$ac_ext - if { (eval echo configure:2064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case "`/usr/bin/file conftest.o`" in + echo '#line 2086 "configure"' > conftest.$ac_ext + if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -2081,7 +2104,7 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2085: checking whether the C compiler needs -belf" >&5 +echo "configure:2108: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2094,14 +2117,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2211,7 +2234,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - @@ -2260,7 +2282,7 @@ else want_mmap=false fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2290,28 +2312,9 @@ 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:2315: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2318: 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" @@ -2336,7 +2339,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2340: checking for executable suffix" >&5 +echo "configure:2343: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2346,10 +2349,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2369,13 +2372,14 @@ ac_exeext=$EXEEXT host64=false target64=false +bfd_default_target_size=32 # 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:2379: checking for $ac_word" >&5 +echo "configure:2383: 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 @@ -2405,7 +2409,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:2409: checking for $ac_word" >&5 +echo "configure:2413: 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 @@ -2456,7 +2460,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2460: checking for $ac_word" >&5 +echo "configure:2464: 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 @@ -2488,7 +2492,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2492: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2496: 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. @@ -2499,12 +2503,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2503 "configure" +#line 2507 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2530,12 +2534,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:2534: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2538: 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:2539: checking whether we are using GNU C" >&5 +echo "configure:2543: 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 @@ -2544,7 +2548,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2548: \"$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:2552: \"$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 @@ -2563,7 +2567,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2567: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2571: 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 @@ -2595,9 +2599,9 @@ else fi -ALL_LINGUAS= +ALL_LINGUAS="fr tr ja es sv" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2601: checking how to run the C preprocessor" >&5 +echo "configure:2605: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2612,13 +2616,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2629,13 +2633,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2646,13 +2650,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2679,7 +2683,7 @@ echo "$ac_t""$CPP" 1>&6 # 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:2683: checking for $ac_word" >&5 +echo "configure:2687: 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 @@ -2707,12 +2711,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2711: checking for ANSI C header files" >&5 +echo "configure:2715: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2720,7 +2724,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2737,7 +2741,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2755,7 +2759,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2776,7 +2780,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2787,7 +2791,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2811,12 +2815,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2815: checking for working const" >&5 +echo "configure:2819: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2886,21 +2890,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2890: checking for inline" >&5 +echo "configure:2894: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2926,12 +2930,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2930: checking for off_t" >&5 +echo "configure:2934: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2959,12 +2963,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2963: checking for size_t" >&5 +echo "configure:2967: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2994,19 +2998,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:2998: checking for working alloca.h" >&5 +echo "configure:3002: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3027,12 +3031,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3031: checking for alloca" >&5 +echo "configure:3035: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3092,12 +3096,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3096: checking whether alloca needs Cray hooks" >&5 +echo "configure:3100: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3126: checking for $ac_func" >&5 +echo "configure:3130: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3177,7 +3181,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3181: checking stack direction for C alloca" >&5 +echo "configure:3185: 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 @@ -3185,7 +3189,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3229,17 +3233,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:3233: checking for $ac_hdr" >&5 +echo "configure:3237: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3268,12 +3272,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3272: checking for $ac_func" >&5 +echo "configure:3276: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3321,7 +3325,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3325: checking for working mmap" >&5 +echo "configure:3329: 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 @@ -3329,7 +3333,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3497,17 +3501,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3501: checking for $ac_hdr" >&5 +echo "configure:3505: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3537,12 +3541,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3541: checking for $ac_func" >&5 +echo "configure:3545: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3594,12 +3598,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3598: checking for $ac_func" >&5 +echo "configure:3602: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3656,19 +3660,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3660: checking for LC_MESSAGES" >&5 +echo "configure:3664: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3689,7 +3693,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3693: checking whether NLS is requested" >&5 +echo "configure:3697: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3709,7 +3713,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3713: checking whether included gettext is requested" >&5 +echo "configure:3717: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3728,17 +3732,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3732: checking for libintl.h" >&5 +echo "configure:3736: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3755,19 +3759,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3759: checking for gettext in libc" >&5 +echo "configure:3763: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3783,7 +3787,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3787: checking for bindtextdomain in -lintl" >&5 +echo "configure:3791: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3791,7 +3795,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3818,19 +3822,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3822: checking for gettext in libintl" >&5 +echo "configure:3826: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3858,7 +3862,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3862: checking for $ac_word" >&5 +echo "configure:3866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3892,12 +3896,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3896: checking for $ac_func" >&5 +echo "configure:3900: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3947,7 +3951,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3951: checking for $ac_word" >&5 +echo "configure:3955: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3983,7 +3987,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3987: checking for $ac_word" >&5 +echo "configure:3991: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4015,7 +4019,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4055,7 +4059,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4059: checking for $ac_word" >&5 +echo "configure:4063: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4089,7 +4093,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4093: checking for $ac_word" >&5 +echo "configure:4097: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4125,7 +4129,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4129: checking for $ac_word" >&5 +echo "configure:4133: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4215,7 +4219,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4219: checking for catalogs to be installed" >&5 +echo "configure:4223: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4243,17 +4247,17 @@ echo "configure:4219: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4247: checking for linux/version.h" >&5 +echo "configure:4251: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4298,7 +4302,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -4331,7 +4335,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4335: checking for a BSD compatible install" >&5 +echo "configure:4339: 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 @@ -4414,7 +4418,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4418: checking for build system executable suffix" >&5 +echo "configure:4422: 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 @@ -4442,17 +4446,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:4446: checking for $ac_hdr" >&5 +echo "configure:4450: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4482,17 +4486,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:4486: checking for $ac_hdr" >&5 +echo "configure:4490: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4519,12 +4523,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4523: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4527: 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 < #include @@ -4533,7 +4537,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4558,12 +4562,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:4562: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4566: 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 < #include <$ac_hdr> @@ -4571,7 +4575,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4596,7 +4600,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:4600: checking for opendir in -ldir" >&5 +echo "configure:4604: 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 @@ -4604,7 +4608,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4637,7 +4641,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4641: checking for opendir in -lx" >&5 +echo "configure:4645: 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 @@ -4645,7 +4649,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4681,12 +4685,12 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4685: checking for $ac_func" >&5 +echo "configure:4689: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4744,12 +4748,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4748: checking whether strstr must be declared" >&5 +echo "configure:4752: 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 < @@ -4770,7 +4774,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4791,12 +4795,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4795: checking whether malloc must be declared" >&5 +echo "configure:4799: 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 < @@ -4817,7 +4821,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4838,12 +4842,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4842: checking whether realloc must be declared" >&5 +echo "configure:4846: 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 < @@ -4864,7 +4868,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4885,12 +4889,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4889: checking whether free must be declared" >&5 +echo "configure:4893: 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 < @@ -4911,7 +4915,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4932,12 +4936,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4936: checking whether getenv must be declared" >&5 +echo "configure:4940: 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 < @@ -4958,7 +4962,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4995,13 +4999,14 @@ if test "${target}" = "${host}"; then alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;; alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd*) COREFILE='' ;; + arm-*-netbsd*) COREFILE=netbsd-core.lo ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo" COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; - i370-*-*) + i370-*-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i370linux.h"' ;; @@ -5015,6 +5020,9 @@ if test "${target}" = "${host}"; then COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; + i[3456]86-*-bsdi) + COREFILE= + ;; i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' @@ -5136,6 +5144,8 @@ if test "${target}" = "${host}"; then powerpc-*-freebsd*) COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; + s390*-*-*) COREFILE=trad-core.lo ;; + sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -5155,6 +5165,7 @@ if test "${target}" = "${host}"; then COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxbsd.h"' ;; + x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;; esac case "$COREFILE" in @@ -5177,17 +5188,17 @@ if test "${target}" = "${host}"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5181: checking for $ac_hdr" >&5 +echo "configure:5192: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5215,12 +5226,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5219: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5230: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5251,12 +5262,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5255: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5266: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5287,12 +5298,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5291: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5302: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5323,12 +5334,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5327: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5338: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5359,12 +5370,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5363: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5374: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5395,12 +5406,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5399: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5410: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5431,12 +5442,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5435: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5446: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5467,12 +5478,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5471: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5482: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5503,12 +5514,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5507: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5518: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5539,12 +5550,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5543: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5554: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5575,12 +5586,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5579: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5590: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5611,12 +5622,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5615: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5626: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5647,12 +5658,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5651: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5662: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5683,12 +5694,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5687: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5698: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5719,12 +5730,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5723: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5734: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5755,12 +5766,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5759: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5770: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -5811,6 +5822,25 @@ case "${host}" in WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" fi ;; +*-*-linux*) + # We borrow WIN32LIBADD so that the shared libbfd won't depend on + # libiberty.a. + case "${host}" in + mips*-*-linux*) + # Linux/MIPS uses PIC by default. + if test "$enable_shared" = "yes"; then + WIN32LIBADD="-L../libiberty -liberty" + fi + ;; + *) + PICFLAG= + eval `grep "^[ ]*PICFLAG[ ]*=" ../libiberty/Makefile | sed -e "s/[ ]*//g"` + if test -n "$PICFLAG"; then + WIN32LIBADD="-L../libiberty/pic -liberty" + fi + ;; + esac + ;; esac @@ -5883,76 +5913,63 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do + target_size=32 case "$vec" in # This list is alphabetized to make it easy to compare - # with the two vector lists in targets.c. + # with the two vector lists in targets.c. For the same reason, + # use one entry per line, even though this leads to long lines. 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 " ;; - armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; - armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.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" ;; + arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; + armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; + armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; + armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; + armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; + armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; + armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; - bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" - target64=true ;; - bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) - tb="$tb elf64-hppa.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; - bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; + bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; - bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; + bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; - bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.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_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; - bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; - bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec) - tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; + bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; - bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" - target64=true ;; - bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; + bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; + bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.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.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; @@ -5962,38 +5979,57 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_pjl_vec) tb="$tb elf32-pj.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_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_us_cris_vec) tb="$tb elf32-cris.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.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; - bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; + bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; + bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; + bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; - demo_64_vec) tb="$tb demo64.lo aout64.lo" - target64=true ;; + demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; 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 ;; + ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; + ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;; go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;; go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; @@ -6006,82 +6042,76 @@ do 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 peigen.lo cofflink.lo" ;; - i386pei_vec) tb="$tb pei-i386.lo peigen.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" ;; + i386msdos_vec) tb="$tb i386msdos.lo" ;; i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; + i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; + i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.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" ;; + m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;; + m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.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" ;; - mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; - mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; + mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; + mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; + nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" - target64=true ;; - 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.lo riscix.lo" ;; nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.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 peigen.lo cofflink.lo" ;; - bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; + pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + pdp11_aout_vec) tb="$tb pdp11.lo" ;; + pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.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" ;; + riscix_vec) tb="$tb aout32.lo riscix.lo" ;; + rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"; target_size=64 ;; + rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; + shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; + shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; som_vec) tb="$tb som.lo" ;; + sparccoff_vec) tb="$tb coff-sparc.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" ;; - tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; - vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" - target64=true ;; + vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;; we32kcoff_vec) tb="$tb coff-we32k.lo" ;; @@ -6090,6 +6120,13 @@ do "") ;; *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;; esac + + if test ${target_size} = 64; then + target64=true + fi + if test x"${vec}" = x"${defvec}"; then + bfd_default_target_size=${target_size} + fi done # Target architecture .o files. @@ -6139,14 +6176,41 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 + bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2 fi + if test -n "$GCC" ; then + bad_64bit_gcc=no; + echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6 +echo "configure:6189: checking for gcc version with buggy 64-bit support" >&5 + # Add more tests for gcc versions with non-working 64-bit support here. + cat > conftest.$ac_ext <&5 | + egrep ": 2 : 91 : 1 :" >/dev/null 2>&1; then + rm -rf conftest* + bad_64bit_gcc=yes; + echo "$ac_t""yes: egcs-1.1.2 on ix86 spotted" 1>&6 +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + if test $bad_64bit_gcc = yes ; then + { echo "configure: error: A newer version of gcc is needed for the requested 64-bit BFD configuration" 1>&2; exit 1; } + fi + fi ;; false-false-false) wordsize=32 + bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac @@ -6156,6 +6220,8 @@ esac + + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" @@ -6167,17 +6233,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:6171: checking for $ac_hdr" >&5 +echo "configure:6237: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6206,12 +6272,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6210: checking for $ac_func" >&5 +echo "configure:6276: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6259,7 +6325,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6263: checking for working mmap" >&5 +echo "configure:6329: 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 @@ -6267,7 +6333,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6432,12 +6498,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6436: checking for $ac_func" >&5 +echo "configure:6502: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6652,6 +6718,9 @@ s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g +s%@bfd_version@%$bfd_version%g +s%@bfd_version_date@%$bfd_version_date%g +s%@bfd_version_string@%$bfd_version_string%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g s%@LN_S@%$LN_S%g @@ -6698,9 +6767,11 @@ s%@WIN32LDFLAGS@%$WIN32LDFLAGS%g s%@WIN32LIBADD@%$WIN32LIBADD%g s%@TDEFINES@%$TDEFINES%g s%@wordsize@%$wordsize%g +s%@bfd_libs@%$bfd_libs%g s%@all_backends@%$all_backends%g s%@bfd_backends@%$bfd_backends%g s%@bfd_machines@%$bfd_machines%g +s%@bfd_default_target_size@%$bfd_default_target_size%g s%@tdefaults@%$tdefaults%g CEOF diff --git a/contrib/binutils/bfd/configure.host b/contrib/binutils/bfd/configure.host index c72a4b3..207e4c0 100644 --- a/contrib/binutils/bfd/configure.host +++ b/contrib/binutils/bfd/configure.host @@ -21,19 +21,23 @@ case "${host}" in alpha*-*-*) host64=true; HOST_64BIT_TYPE=long ;; +hppa*64*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX; + host64=true; HOST_64BIT_TYPE=long ;; hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;; hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;; +hppa*64*-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;; hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;; hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;; ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; +ia64-*-aix*) host64=true; HOST_64BIT_TYPE=long ;; i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; i[3456]86-sequent-sysv4*) ;; i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; -mips*-dec-netbsd*) ;; +mips*-*-netbsd*) ;; mips*-*-openbsd*) ;; mips*-dec-*) HDEFINES="-G 4" ;; mips*-sgi-irix3*) HDEFINES="-G 4" ;; @@ -42,6 +46,10 @@ mips*-sgi-irix6*) host64=true HOST_64BIT_TYPE="long long"; HOST_U_64BIT_TYPE="unsigned long long"; ;; +mips64*-*-linux*) host64=true + HOST_64BIT_TYPE="long long"; + HOST_U_64BIT_TYPE="unsigned long long"; + ;; mips*-*-sysv4*) ;; mips*-*-sysv*) HDEFINES="-G 4" ;; mips*-*-riscos*) HDEFINES="-G 4" ;; diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in index b639e3b..239bde8 100644 --- a/contrib/binutils/bfd/configure.in +++ b/contrib/binutils/bfd/configure.in @@ -7,7 +7,27 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.11.2) +AM_INIT_AUTOMAKE(bfd, 2.11.93) +# Uncomment the next line to remove the date from the reported bfd version +#is_release=y + +changequote(,)dnl +bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'` +changequote([,])dnl + +bfd_version_string="\"${VERSION}\"" +bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h` +if test x${is_release} = x; then +dnl Sad, but we can't use XSTRING here to pick up the date from version.h +dnl because traditional C doesn't allow it. + bfd_version_string="\"${VERSION} ${bfd_version_date}\"" +fi +dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string, +dnl we may as well substitute for bfd_version_date too. That way we don't +dnl need to #include version.h +AC_SUBST(bfd_version) +AC_SUBST(bfd_version_date) +AC_SUBST(bfd_version_string) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -50,7 +70,7 @@ AC_ARG_WITH(mmap, *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; esac],[want_mmap=false])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -76,19 +96,19 @@ AM_CONFIG_HEADER(config.h:config.in) if test -z "$target" ; then AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) fi -AC_ARG_PROGRAM AM_MAINTAINER_MODE AC_EXEEXT host64=false target64=false +bfd_default_target_size=32 # host stuff: AC_PROG_CC -ALL_LINGUAS= +ALL_LINGUAS="fr tr ja es sv" CY_GNU_GETTEXT # Permit host specific settings. @@ -145,13 +165,14 @@ if test "${target}" = "${host}"; then alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;; alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd*) COREFILE='' ;; + arm-*-netbsd*) COREFILE=netbsd-core.lo ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo" COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; - i370-*-*) + i370-*-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i370linux.h"' ;; @@ -170,6 +191,11 @@ changequote([,])dnl TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl + i[3456]86-*-bsdi) +changequote([,])dnl + COREFILE= + ;; +changequote(,)dnl i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) changequote([,])dnl COREFILE=trad-core.lo @@ -310,6 +336,8 @@ changequote([,])dnl powerpc-*-freebsd*) COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; + s390*-*-*) COREFILE=trad-core.lo ;; + sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -329,6 +357,7 @@ changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxbsd.h"' ;; + x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;; esac case "$COREFILE" in @@ -384,6 +413,27 @@ case "${host}" in WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" fi ;; +*-*-linux*) + # We borrow WIN32LIBADD so that the shared libbfd won't depend on + # libiberty.a. + case "${host}" in + mips*-*-linux*) + # Linux/MIPS uses PIC by default. + if test "$enable_shared" = "yes"; then + WIN32LIBADD="-L../libiberty -liberty" + fi + ;; + *) + PICFLAG= + changequote(,)dnl + eval `grep "^[ ]*PICFLAG[ ]*=" ../libiberty/Makefile | sed -e "s/[ ]*//g"` + changequote([,])dnl + if test -n "$PICFLAG"; then + WIN32LIBADD="-L../libiberty/pic -liberty" + fi + ;; + esac + ;; esac AC_SUBST(WIN32LDFLAGS) AC_SUBST(WIN32LIBADD) @@ -456,76 +506,63 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do + target_size=32 case "$vec" in # This list is alphabetized to make it easy to compare - # with the two vector lists in targets.c. + # with the two vector lists in targets.c. For the same reason, + # use one entry per line, even though this leads to long lines. 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 " ;; - armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; - armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.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" ;; + arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; + armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; + armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; + armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; + armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; + armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; + armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; - bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" - target64=true ;; - bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) - tb="$tb elf64-hppa.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; - bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; + bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; - bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; + bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; - bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.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_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; - bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; - bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec) - tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; + bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; - bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" - target64=true ;; - bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; + bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; + bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.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.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; @@ -535,38 +572,57 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_pjl_vec) tb="$tb elf32-pj.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_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_us_cris_vec) tb="$tb elf32-cris.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.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" - target64=true ;; - bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; - bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; + bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; + bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; + bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; + bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; - demo_64_vec) tb="$tb demo64.lo aout64.lo" - target64=true ;; + demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; 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 ;; + ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; + ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;; go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;; go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; @@ -579,82 +635,76 @@ do 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 peigen.lo cofflink.lo" ;; - i386pei_vec) tb="$tb pei-i386.lo peigen.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" ;; + i386msdos_vec) tb="$tb i386msdos.lo" ;; i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; + i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; + i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.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" ;; + m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;; + m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.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" ;; - mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; - mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; + mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; + mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; + nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" - target64=true ;; - 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.lo riscix.lo" ;; nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.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 peigen.lo cofflink.lo" ;; - bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; + pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + pdp11_aout_vec) tb="$tb pdp11.lo" ;; + pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.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" ;; + riscix_vec) tb="$tb aout32.lo riscix.lo" ;; + rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"; target_size=64 ;; + rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; + shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; + shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; som_vec) tb="$tb som.lo" ;; + sparccoff_vec) tb="$tb coff-sparc.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" ;; - tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; - vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" - target64=true ;; + vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;; we32kcoff_vec) tb="$tb coff-we32k.lo" ;; @@ -663,6 +713,13 @@ do "") ;; *) AC_MSG_ERROR(*** unknown target vector $vec) ;; esac + + if test ${target_size} = 64; then + target64=true + fi + if test x"${vec}" = x"${defvec}"; then + bfd_default_target_size=${target_size} + fi done # Target architecture .o files. @@ -712,22 +769,38 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 + bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) AC_MSG_WARN([your compiler may not have a 64 bit integral type]) fi + if test -n "$GCC" ; then + bad_64bit_gcc=no; + AC_MSG_CHECKING([for gcc version with buggy 64-bit support]) + # Add more tests for gcc versions with non-working 64-bit support here. + AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:], + bad_64bit_gcc=yes; + AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]), + AC_MSG_RESULT(no)) + if test $bad_64bit_gcc = yes ; then + AC_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration]) + fi + fi ;; false-false-false) wordsize=32 + bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac AC_SUBST(wordsize) +AC_SUBST(bfd_libs) AC_SUBST(all_backends) AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) +AC_SUBST(bfd_default_target_size) tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" diff --git a/contrib/binutils/bfd/corefile.c b/contrib/binutils/bfd/corefile.c index 3ce0785..609c4e6 100644 --- a/contrib/binutils/bfd/corefile.c +++ b/contrib/binutils/bfd/corefile.c @@ -1,5 +1,5 @@ /* Core file generic interface routines for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -36,7 +36,7 @@ FUNCTION bfd_core_file_failing_command SYNOPSIS - CONST char *bfd_core_file_failing_command(bfd *abfd); + const char *bfd_core_file_failing_command(bfd *abfd); DESCRIPTION Return a read-only string explaining which program was running diff --git a/contrib/binutils/bfd/cpu-arc.c b/contrib/binutils/bfd/cpu-arc.c index 2904ae3..204eb48 100644 --- a/contrib/binutils/bfd/cpu-arc.c +++ b/contrib/binutils/bfd/cpu-arc.c @@ -55,6 +55,8 @@ const bfd_arch_info_type bfd_arc_arch = /* Given cpu type NAME, return its bfd_mach_arc_xxx value. Returns -1 if not found. */ +int arc_get_mach PARAMS ((char *)); + int arc_get_mach (name) char *name; diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c index 860d91a..8619fbf 100644 --- a/contrib/binutils/bfd/cpu-i386.c +++ b/contrib/binutils/bfd/cpu-i386.c @@ -44,8 +44,8 @@ const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = 8, /* 8 bits in a byte */ bfd_arch_i386, bfd_mach_x86_64_intel_syntax, - "x86_64:intel", - "x86_64:intel", + "x86-64:intel", + "x86-64:intel", 3, true, bfd_default_compatible, @@ -75,8 +75,8 @@ const bfd_arch_info_type bfd_x86_64_arch = 8, /* 8 bits in a byte */ bfd_arch_i386, bfd_mach_x86_64, - "x86_64", - "x86_64", + "x86-64", + "x86-64", 3, true, bfd_default_compatible, diff --git a/contrib/binutils/bfd/cpu-ia64-opc.c b/contrib/binutils/bfd/cpu-ia64-opc.c index 8c22942..a228b1c 100644 --- a/contrib/binutils/bfd/cpu-ia64-opc.c +++ b/contrib/binutils/bfd/cpu-ia64-opc.c @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Logically, this code should be part of libopcode but since some of the operand insertion/extraction functions help bfd to implement - relocations, this code is included as part of elf64-ia64.c. This + relocations, this code is included as part of cpu-ia64.c. This avoids circular dependencies between libopcode and libbfd and also obviates the need for applications to link in libopcode when all they really want is libbfd. diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c index 235ec29..3e7a51c 100644 --- a/contrib/binutils/bfd/cpu-powerpc.c +++ b/contrib/binutils/bfd/cpu-powerpc.c @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright 1994, 1995, 1996, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 2000, 2001 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -128,7 +128,7 @@ static const bfd_arch_info_type arch_info_struct[] = "powerpc", "powerpc:620", 3, - false, /* not the default */ + BFD_DEFAULT_TARGET_SIZE == 64, /* default for 64 bit target */ powerpc_compatible, bfd_default_scan, &arch_info_struct[6] @@ -229,7 +229,7 @@ const bfd_arch_info_type bfd_powerpc_arch = "powerpc", "powerpc:common", 3, - true, /* the default */ + BFD_DEFAULT_TARGET_SIZE != 64, /* default for 32 bit target */ powerpc_compatible, bfd_default_scan, &arch_info_struct[0] diff --git a/contrib/binutils/bfd/demo64.c b/contrib/binutils/bfd/demo64.c index b64499b..a8c0b32 100644 --- a/contrib/binutils/bfd/demo64.c +++ b/contrib/binutils/bfd/demo64.c @@ -1,5 +1,6 @@ /* BFD backend for demonstration 64-bit a.out binaries. - Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,6 +20,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARCH_SIZE 64 -#define MY(OP) CAT(demo_64_,OP) + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (demo_64_,OP) + #define TARGETNAME "demo64" #include "aoutf1.h" diff --git a/contrib/binutils/bfd/dep-in.sed b/contrib/binutils/bfd/dep-in.sed index c3781f2..4a706aa 100644 --- a/contrib/binutils/bfd/dep-in.sed +++ b/contrib/binutils/bfd/dep-in.sed @@ -9,12 +9,13 @@ s!@INCDIR@!$(INCDIR)!g s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g s! hosts/[^ ]*\.h! !g -s/ sysdep.h//g +s! sysdep.h!!g s! \.\./bfd/sysdep.h!!g -s/ libbfd.h//g -s/ config.h//g +s! libbfd.h!!g +s! config.h!!g s! \$(INCDIR)/fopen-[^ ]*\.h!!g s! \$(INCDIR)/ansidecl\.h!!g +s! \$(INCDIR)/symcat\.h!!g s/\\\n */ /g diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog index 363ea91..2f3db6f 100644 --- a/contrib/binutils/bfd/doc/ChangeLog +++ b/contrib/binutils/bfd/doc/ChangeLog @@ -1,7 +1,57 @@ -2001-06-11 Alan Modra +2001-10-30 Hans-Peter Nilsson - * bfdint.texi (BFD target vector miscellaneous): --oformat, not - -oformat. + * doc/bfdint.texi (BFD target vector miscellaneous): Add + bfd_target_mmo_flavour. + * doc/bfd.texinfo (BFD back ends): Add entry for mmo. + * doc/Makefile.am (DOCFILES): Add mmo.texi. + (SRCDOC): Add mmo.c. + (s-mmo, mmo.texi): New rules. + +2001-10-29 Kazu Hirata + + * bfdsumm.texi: Fix a typo. + +2001-10-26 Nick Clifton + + * bfd.texinfo: Change footer to refer to FSF. Change subtitle + to refer to original creation date. + +2001-10-03 Alan Modra + + * Makefile.am (BFD_H_DEP): Add ../version.h. + * Makefile.in: Regenerate. + +2001-10-02 Alan Modra + + * Makefile.in: Regenerate. + +2001-10-01 Alan Modra + + * header.sed: New file, adds header to generated files. + * Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and + bfd.h, using above. Add missing elf.c dependecy for libbfd.h. + * Makefile.in: Regenerate. + +2001-09-21 Alan Modra + + * Makefile.in: Regenerate. + +2001-09-18 Alan Modra + + * bfdint.texi: Replace reference to bfd_read with bfd_bread. + Likewise for bfd_write. + +2001-07-24 Alan Modra + + * Makefile.in: Regenerate. + +2001-06-21 Hans-Peter Nilsson + + * bfdint.texi (BFD relocation functions) : + Mention that the GNU linker is aware of input-output format + restrictions when generating relocatable output. Make new + paragraph for final-link case. + (BFD target vector swap): Fix typo. 2001-01-25 Kazu Hirata @@ -240,7 +290,7 @@ Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com) Wed Jan 12 18:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bfd.texinfo: Added Linker Functions node. - * doc/Makefile.in (DOCFILES): Added linker.texi. + * Makefile.in (DOCFILES): Added linker.texi. (SRCDOC): Added linker.c. (linker.texi): New target. @@ -355,9 +405,9 @@ Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com) Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. - * doc/chew.c (exfunstuff): Eliminate. + * chew.c (exfunstuff): Eliminate. (paramstuff): Replace exfunstuff with function to generate PARAMS. - * doc/proto.str: Use paramstuff rather than exfunstuff. + * proto.str: Use paramstuff rather than exfunstuff. Mon Aug 17 12:40:32 1992 Steve Chamberlain (sac@thepub.cygnus.com) diff --git a/contrib/binutils/bfd/doc/Makefile.am b/contrib/binutils/bfd/doc/Makefile.am index 0d5268e..075c9f3 100644 --- a/contrib/binutils/bfd/doc/Makefile.am +++ b/contrib/binutils/bfd/doc/Makefile.am @@ -6,7 +6,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ core.texi elf.texi elfcode.texi format.texi libbfd.texi \ opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi + syms.texi targets.texi init.texi hash.texi linker.texi \ + mmo.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -27,7 +28,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ $(srcdir)/../reloc.c $(srcdir)/../section.c \ $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c + $(srcdir)/../hash.c $(srcdir)/../linker.c \ + $(srcdir)/../mmo.c SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ @@ -123,6 +125,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str touch s-elfcode elfcode.texi: s-elfcode +s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp + $(srcdir)/../../move-if-change mmo.tmp mmo.texi + touch s-mmo +mmo.texi: s-mmo + s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp $(srcdir)/../../move-if-change format.tmp format.texi @@ -183,30 +191,47 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str touch s-linker linker.texi: s-linker -libbfd.h: $(srcdir)/../libbfd-in.h \ +LIBBFD_H_DEP = \ + $(srcdir)/../libbfd-in.h \ $(srcdir)/../init.c \ $(srcdir)/../libbfd.c \ $(srcdir)/../cache.c \ $(srcdir)/../reloc.c \ $(srcdir)/../archures.c \ + $(srcdir)/../elf.c \ + $(srcdir)/header.sed \ $(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 \ + +libbfd.h: $(LIBBFD_H_DEP) + echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(LIBBFD_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done + +LIBCOFF_H_DEP = \ + $(srcdir)/../libcoff-in.h \ $(srcdir)/../coffcode.h \ + $(srcdir)/header.sed \ $(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 \ +libcoff.h: $(LIBCOFF_H_DEP) + echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(LIBCOFF_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done + +BFD_H_DEP = \ + $(srcdir)/../bfd-in.h \ $(srcdir)/../init.c \ $(srcdir)/../opncls.c \ $(srcdir)/../libbfd.c \ @@ -219,25 +244,24 @@ bfd.h: $(srcdir)/../bfd-in.h \ $(srcdir)/../corefile.c \ $(srcdir)/../targets.c \ $(srcdir)/../format.c \ + $(srcdir)/header.sed \ $(srcdir)/proto.str \ + $(srcdir)/../version.h \ $(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 + +bfd.h: $(BFD_H_DEP) + echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(BFD_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done + echo "#ifdef __cplusplus" >> $@ + echo "}" >> $@ + echo "#endif" >> $@ + echo "#endif" >> $@ noinst_TEXINFOS = bfdint.texi diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in index d4c30a6..dc85d4b 100644 --- a/contrib/binutils/bfd/doc/Makefile.in +++ b/contrib/binutils/bfd/doc/Makefile.in @@ -115,7 +115,11 @@ WIN32LDFLAGS = @WIN32LDFLAGS@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ bfd_backends = @bfd_backends@ +bfd_default_target_size = @bfd_default_target_size@ bfd_machines = @bfd_machines@ +bfd_version = @bfd_version@ +bfd_version_date = @bfd_version_date@ +bfd_version_string = @bfd_version_string@ l = @l@ tdefaults = @tdefaults@ wordsize = @wordsize@ @@ -126,7 +130,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ core.texi elf.texi elfcode.texi format.texi libbfd.texi \ opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi + syms.texi targets.texi init.texi hash.texi linker.texi \ + mmo.texi PROTOS = archive.p archures.p bfd.p \ @@ -149,7 +154,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ $(srcdir)/../reloc.c $(srcdir)/../section.c \ $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c + $(srcdir)/../hash.c $(srcdir)/../linker.c \ + $(srcdir)/../mmo.c SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ @@ -172,6 +178,47 @@ info_TEXINFOS = bfd.texinfo MKDOC = chew$(EXEEXT_FOR_BUILD) +LIBBFD_H_DEP = \ + $(srcdir)/../libbfd-in.h \ + $(srcdir)/../init.c \ + $(srcdir)/../libbfd.c \ + $(srcdir)/../cache.c \ + $(srcdir)/../reloc.c \ + $(srcdir)/../archures.c \ + $(srcdir)/../elf.c \ + $(srcdir)/header.sed \ + $(srcdir)/proto.str \ + $(MKDOC) + + +LIBCOFF_H_DEP = \ + $(srcdir)/../libcoff-in.h \ + $(srcdir)/../coffcode.h \ + $(srcdir)/header.sed \ + $(srcdir)/proto.str \ + $(MKDOC) + + +BFD_H_DEP = \ + $(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)/header.sed \ + $(srcdir)/proto.str \ + $(srcdir)/../version.h \ + $(MKDOC) + + noinst_TEXINFOS = bfdint.texi MOSTLYCLEANFILES = $(MKDOC) *.o @@ -194,7 +241,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -484,6 +531,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str touch s-elfcode elfcode.texi: s-elfcode +s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp + $(srcdir)/../../move-if-change mmo.tmp mmo.texi + touch s-mmo +mmo.texi: s-mmo + s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp $(srcdir)/../../move-if-change format.tmp format.texi @@ -544,61 +597,39 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str 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 +libbfd.h: $(LIBBFD_H_DEP) + echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(LIBBFD_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done -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 +libcoff.h: $(LIBCOFF_H_DEP) + echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(LIBCOFF_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done + +bfd.h: $(BFD_H_DEP) + echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ + for file in $(BFD_H_DEP); do \ + case $$file in \ + *-in.h) cat $$file >> $@ ;; \ + */header.sed) break ;; \ + *) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ + esac; \ + done + echo "#ifdef __cplusplus" >> $@ + echo "}" >> $@ + echo "#endif" >> $@ + echo "#endif" >> $@ # 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. diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo index bcc9c38..380501e 100644 --- a/contrib/binutils/bfd/doc/bfd.texinfo +++ b/contrib/binutils/bfd/doc/bfd.texinfo @@ -30,7 +30,7 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the BFD library. -Copyright (C) 1991, 2000 Free Software Foundation, Inc. +Copyright (C) 1991, 2000, 2001 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -56,18 +56,18 @@ notice identical to this one except for the removal of this paragraph @title{libbfd} @subtitle{The Binary File Descriptor Library} @sp 1 -@subtitle First Edition---BFD version < 3.0 -@subtitle April 1991 +@subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-) +@subtitle Original Document Created: April 1991 @author {Steve Chamberlain} @author {Cygnus Support} @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.2.2.1 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.5 $} % For use in headers, footers too {\parskip=0pt -\hfill Cygnus Support\par -\hfill sac\@cygnus.com\par +\hfill Free Software Foundation\par +\hfill sac\@www.gnu.org\par \hfill {\it BFD}, \manvers\par \hfill \TeX{}info \texinfoversion\par } @@ -75,7 +75,7 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2001 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -298,6 +298,7 @@ structures. * aout :: a.out backends * coff :: coff backends * elf :: elf backends +* mmo :: mmo backend @ignore * oasys :: oasys backends * ieee :: ieee backend @@ -313,11 +314,14 @@ All of BFD lives in one directory. @node coff, elf, aout, BFD back ends @include coffcode.texi -@node elf, , coff, BFD back ends +@node elf, mmo, coff, BFD back ends @include elf.texi @c Leave this out until the file has some actual contents... @c @include elfcode.texi +@node mmo, , elf, BFD back ends +@include mmo.texi + @node GNU Free Documentation License, Index, BFD back ends, Top @chapter GNU Free Documentation License @cindex GNU Free Documentation License diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi index 5aa8ed3..76fd832 100644 --- a/contrib/binutils/bfd/doc/bfdint.texi +++ b/contrib/binutils/bfd/doc/bfdint.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000 +@c 2000, 2001 @c Free Software Foundation, Inc. @setfilename bfdint.info @@ -335,6 +335,8 @@ VERSAdos. MS-DOS. @item bfd_target_evax_flavour openVMS. +@item bfd_target_mmo_flavour +Donald Knuth's MMIXware object format. @end table @item byteorder @@ -379,7 +381,7 @@ vectors which use the same sets of functions. @node BFD target vector swap @subsection Swapping functions -Every target vector has fuction pointers used for swapping information +Every target vector has function pointers used for swapping information in and out of the target representation. There are two sets of functions: one for data information, and one for header information. Each set has three sizes: 64-bit, 32-bit, and 16-bit. Each size has @@ -503,7 +505,7 @@ corresponds to an actual section in an actual BFD. Get the contents of a section. This is called from @samp{bfd_get_section_contents}. Most targets set this to @samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek} -based on the section's @samp{filepos} field and a @samp{bfd_read}. The +based on the section's @samp{filepos} field and a @samp{bfd_bread}. The corresponding field in the target vector is named @samp{_bfd_get_section_contents}. @@ -636,7 +638,7 @@ always uses extended name tables anyhow. The corresponding field in the target vector is named @samp{_bfd_truncate_arname}. @item _write_armap -Write out the archive symbol table using calls to @samp{bfd_write}. +Write out the archive symbol table using calls to @samp{bfd_bwrite}. This is normally called from the archive @samp{write_contents} routine. The corresponding field in the target vector is named @samp{write_armap} (no leading underscore). @@ -1291,10 +1293,13 @@ doing a link in which the output object file format is S-records. @item Using the linker to generate relocateable output in a different object file format is impossible in the general case, so you generally don't -have to worry about that. Linking input files of different object file -formats together is quite unusual, but if you're really dedicated you -may want to consider testing this case, both when the output object file -format is the same as your format, and when it is different. +have to worry about that. The GNU linker makes sure to stop that from +happening when an input file in a different format has relocations. + +Linking input files of different object file formats together is quite +unusual, but if you're really dedicated you may want to consider testing +this case, both when the output object file format is the same as your +format, and when it is different. @end itemize @node BFD relocation codes diff --git a/contrib/binutils/bfd/doc/bfdsumm.texi b/contrib/binutils/bfd/doc/bfdsumm.texi index 844531a..77a5f09 100644 --- a/contrib/binutils/bfd/doc/bfdsumm.texi +++ b/contrib/binutils/bfd/doc/bfdsumm.texi @@ -4,7 +4,7 @@ the format of the input object file. They then build a descriptor in memory with pointers to routines that will be used to access elements of the object file's data structures. -As different information from the the object files is required, +As different information from the object files is required, BFD reads from different sections of the file and processes them. For example, a very common operation for the linker is processing symbol tables. Each BFD back end provides a routine for converting diff --git a/contrib/binutils/bfd/doc/header.sed b/contrib/binutils/bfd/doc/header.sed new file mode 100644 index 0000000..ed27040 --- /dev/null +++ b/contrib/binutils/bfd/doc/header.sed @@ -0,0 +1,12 @@ +s|\(.*\) [^ ]*header.sed.*|\1| +s|[^ ]*/||g +s|^ *|"| +s| |", "|g +s|$|"| +s|, \([^ ]*\)$| and \1| +s|^|/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from | +s|\(.\{60\}[^ ]* \)|\1\ + |g +s|$|.\ + Run "make headers" in your build bfd/ to regenerate. */\ +| diff --git a/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c index 2fef2ef..6531986 100644 --- a/contrib/binutils/bfd/dwarf1.c +++ b/contrib/binutils/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -126,6 +126,18 @@ struct linenumber { /* Find the form of an attr, from the attr field. */ #define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */ +static struct dwarf1_unit *alloc_dwarf1_unit PARAMS ((struct dwarf1_debug *)); +static struct dwarf1_func *alloc_dwarf1_func + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean parse_die PARAMS ((bfd *, struct die_info *, char *, char *)); +static boolean parse_line_table + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean parse_functions_in_unit + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean dwarf1_unit_find_nearest_line + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *, unsigned long, + const char **, const char **, unsigned int *)); + /* Return a newly allocated dwarf1_unit. It should be cleared and then attached into the 'stash' at 'stash->lastUnit'. */ @@ -133,9 +145,9 @@ static struct dwarf1_unit* alloc_dwarf1_unit (stash) struct dwarf1_debug* stash; { - struct dwarf1_unit* x = - (struct dwarf1_unit*) bfd_zalloc (stash->abfd, - sizeof (struct dwarf1_unit)); + bfd_size_type amt = sizeof (struct dwarf1_unit); + + struct dwarf1_unit* x = (struct dwarf1_unit*) bfd_zalloc (stash->abfd, amt); x->prev = stash->lastUnit; stash->lastUnit = x; @@ -150,9 +162,9 @@ alloc_dwarf1_func (stash, aUnit) struct dwarf1_debug* stash; struct dwarf1_unit* aUnit; { - struct dwarf1_func* x = - (struct dwarf1_func*) bfd_zalloc (stash->abfd, - sizeof (struct dwarf1_func)); + bfd_size_type amt = sizeof (struct dwarf1_func); + + struct dwarf1_func* x = (struct dwarf1_func*) bfd_zalloc (stash->abfd, amt); x->prev = aUnit->func_list; aUnit->func_list = x; @@ -167,10 +179,11 @@ alloc_dwarf1_func (stash, aUnit) Return false if the die is invalidly formatted; true otherwise. */ static boolean -parse_die (abfd, aDieInfo, aDiePtr) +parse_die (abfd, aDieInfo, aDiePtr, aDiePtrEnd) bfd* abfd; struct die_info* aDieInfo; char* aDiePtr; + char* aDiePtrEnd; { char* this_die = aDiePtr; char* xptr = this_die; @@ -180,7 +193,8 @@ parse_die (abfd, aDieInfo, aDiePtr) /* First comes the length. */ aDieInfo->length = bfd_get_32 (abfd, (bfd_byte *) xptr); xptr += 4; - if (aDieInfo->length == 0) + if (aDieInfo->length == 0 + || (this_die + aDieInfo->length) >= aDiePtrEnd) return false; if (aDieInfo->length < 6) { @@ -263,7 +277,7 @@ parse_line_table (stash, aUnit) if (stash->line_section == 0) { asection *msec; - unsigned long size; + bfd_size_type size; msec = bfd_get_section_by_name (stash->abfd, ".line"); if (! msec) @@ -275,7 +289,8 @@ parse_line_table (stash, aUnit) if (! stash->line_section) return false; - if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section, 0, size)) + if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section, + (bfd_vma) 0, size)) { stash->line_section = 0; return false; @@ -288,9 +303,9 @@ parse_line_table (stash, aUnit) if (xptr < stash->line_section_end) { unsigned long eachLine; - - char* tblend; + char *tblend; unsigned long base; + bfd_size_type amt; /* First comes the length. */ tblend = bfd_get_32 (stash->abfd, (bfd_byte *) xptr) + xptr; @@ -305,9 +320,9 @@ parse_line_table (stash, aUnit) aUnit->line_count = (tblend - xptr) / 10; /* Allocate an array for the entries. */ - aUnit->linenumber_table = (struct linenumber *) - bfd_alloc (stash->abfd, - sizeof (struct linenumber) * aUnit->line_count); + amt = sizeof (struct linenumber) * aUnit->line_count; + aUnit->linenumber_table = ((struct linenumber *) + bfd_alloc (stash->abfd, amt)); for (eachLine = 0; eachLine < aUnit->line_count; eachLine++) { @@ -348,7 +363,8 @@ parse_functions_in_unit (stash, aUnit) { struct die_info eachDieInfo; - if (! parse_die (stash->abfd, &eachDieInfo, eachDie)) + if (! parse_die (stash->abfd, &eachDieInfo, eachDie, + stash->debug_section_end)) return false; if (eachDieInfo.tag == TAG_global_subroutine @@ -467,10 +483,10 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, if (! stash) { asection *msec; - unsigned long size; + bfd_size_type size = sizeof (struct dwarf1_debug); - stash = elf_tdata (abfd)->dwarf1_find_line_info = - (struct dwarf1_debug*) bfd_zalloc (abfd, sizeof (struct dwarf1_debug)); + stash = elf_tdata (abfd)->dwarf1_find_line_info + = (struct dwarf1_debug *) bfd_zalloc (abfd, size); if (! stash) return false; @@ -490,7 +506,8 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, if (! stash->debug_section) return false; - if (! bfd_get_section_contents (abfd, msec, stash->debug_section, 0, size)) + if (! bfd_get_section_contents (abfd, msec, stash->debug_section, + (bfd_vma) 0, size)) { stash->debug_section = 0; return false; @@ -522,7 +539,8 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, { struct die_info aDieInfo; - if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie)) + if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie, + stash->debug_section_end)) return false; if (aDieInfo.tag == TAG_compile_unit) diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index 2161846..6398d4e 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ struct line_head { - unsigned int total_length; + bfd_vma total_length; unsigned short version; unsigned int prologue_length; unsigned char minimum_instruction_length; @@ -96,6 +96,14 @@ struct dwarf2_debug /* Pointer to the end of the .debug_info section memory buffer. */ char* info_ptr_end; + /* Pointer to the section and address of the beginning of the + section. */ + asection* sec; + char* sec_info_ptr; + + /* Pointer to the symbol table. */ + asymbol** syms; + /* Pointer to the .debug_abbrev section loaded into memory. */ char* dwarf_abbrev_buffer; @@ -107,6 +115,12 @@ struct dwarf2_debug /* Length of the loaded .debug_line section. */ unsigned long dwarf_line_size; + + /* Pointer to the .debug_str section loaded into memory. */ + char* dwarf_str_buffer; + + /* Length of the loaded .debug_str section. */ + unsigned long dwarf_str_size; }; struct arange @@ -161,10 +175,86 @@ struct comp_unit /* A list of the functions found in this comp. unit. */ struct funcinfo* function_table; + /* Pointer to dwarf2_debug structure. */ + struct dwarf2_debug *stash; + /* Address size for this unit - from unit header. */ unsigned char addr_size; + + /* Offset size for this unit - from unit header. */ + unsigned char offset_size; +}; + +/* 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 + +static unsigned int read_1_byte PARAMS ((bfd *, char *)); +static int read_1_signed_byte PARAMS ((bfd *, char *)); +static unsigned int read_2_bytes PARAMS ((bfd *, char *)); +static unsigned int read_4_bytes PARAMS ((bfd *, char *)); +static bfd_vma read_8_bytes PARAMS ((bfd *, char *)); +static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int)); +static char *read_string PARAMS ((bfd *, char *, unsigned int *)); +static char *read_indirect_string PARAMS ((struct comp_unit *, char *, unsigned int *)); +static unsigned int read_unsigned_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static int read_signed_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static bfd_vma read_address PARAMS ((struct comp_unit *, char *)); +static struct abbrev_info *lookup_abbrev + PARAMS ((unsigned int, struct abbrev_info **)); +static struct abbrev_info **read_abbrevs + PARAMS ((bfd *, unsigned int, struct dwarf2_debug *)); +static char *read_attribute + PARAMS ((struct attribute *, struct attr_abbrev *, + struct comp_unit *, char *)); +static char *read_attribute_value + PARAMS ((struct attribute *, unsigned, + struct comp_unit *, char *)); +static void add_line_info + PARAMS ((struct line_info_table *, bfd_vma, char *, + unsigned int, unsigned int, int)); +static char *concat_filename PARAMS ((struct line_info_table *, unsigned int)); +static void arange_add PARAMS ((struct comp_unit *, bfd_vma, bfd_vma)); +static struct line_info_table *decode_line_info + PARAMS ((struct comp_unit *, struct dwarf2_debug *)); +static boolean lookup_address_in_line_info_table + PARAMS ((struct line_info_table *, bfd_vma, const char **, unsigned int *)); +static boolean lookup_address_in_function_table + PARAMS ((struct funcinfo *, bfd_vma, const char **)); +static boolean scan_unit_for_functions PARAMS ((struct comp_unit *)); +static bfd_vma find_rela_addend + PARAMS ((bfd *, asection *, bfd_size_type, asymbol**)); +static struct comp_unit *parse_comp_unit + PARAMS ((bfd *, struct dwarf2_debug *, bfd_vma, unsigned int)); +static boolean comp_unit_contains_address + PARAMS ((struct comp_unit *, bfd_vma)); +static boolean comp_unit_find_nearest_line + PARAMS ((struct comp_unit *, bfd_vma, const char **, const char **, + unsigned int *, struct dwarf2_debug *)); +static asection *find_debug_info PARAMS ((bfd *, asection *)); + /* VERBATIM The following function up to the END VERBATIM mark are copied directly from dwarf2read.c. */ @@ -227,7 +317,7 @@ read_4_signed_bytes (abfd, buf) #endif -static unsigned int +static bfd_vma read_8_bytes (abfd, buf) bfd *abfd; char *buf; @@ -253,9 +343,7 @@ read_string (abfd, buf, bytes_read_ptr) 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. */ + /* Return a pointer to the embedded string. */ if (*buf == '\0') { *bytes_read_ptr = 1; @@ -266,6 +354,59 @@ read_string (abfd, buf, bytes_read_ptr) return buf; } +static char * +read_indirect_string (unit, buf, bytes_read_ptr) + struct comp_unit* unit; + char *buf; + unsigned int *bytes_read_ptr; +{ + bfd_vma offset; + struct dwarf2_debug *stash = unit->stash; + + if (unit->offset_size == 4) + offset = read_4_bytes (unit->abfd, buf); + else + offset = read_8_bytes (unit->abfd, buf); + *bytes_read_ptr = unit->offset_size; + + if (! stash->dwarf_str_buffer) + { + asection *msec; + bfd *abfd = unit->abfd; + + msec = bfd_get_section_by_name (abfd, ".debug_str"); + if (! msec) + { + (*_bfd_error_handler) + (_("Dwarf Error: Can't find .debug_str section.")); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + stash->dwarf_str_size = msec->_raw_size; + stash->dwarf_str_buffer = (char*) bfd_alloc (abfd, msec->_raw_size); + if (! stash->dwarf_abbrev_buffer) + return NULL; + + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_str_buffer, + (bfd_vma) 0, msec->_raw_size)) + return NULL; + } + + if (offset >= stash->dwarf_str_size) + { + (*_bfd_error_handler) (_("Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)."), + offset, stash->dwarf_str_size ); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + buf = stash->dwarf_str_buffer + offset; + if (*buf == '\0') + return NULL; + return buf; +} + static unsigned int read_unsigned_leb128 (abfd, buf, bytes_read_ptr) bfd *abfd ATTRIBUTE_UNUSED; @@ -349,30 +490,6 @@ read_address (unit, buf) } } -/* 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 * @@ -413,6 +530,7 @@ read_abbrevs (abfd, offset, stash) struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; + bfd_size_type amt; if (! stash->dwarf_abbrev_buffer) { @@ -427,13 +545,12 @@ read_abbrevs (abfd, offset, stash) } stash->dwarf_abbrev_size = msec->_raw_size; - stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size); + stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, msec->_raw_size); if (! stash->dwarf_abbrev_buffer) return 0; - if (! bfd_get_section_contents (abfd, msec, - stash->dwarf_abbrev_buffer, 0, - stash->dwarf_abbrev_size)) + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_abbrev_buffer, + (bfd_vma) 0, msec->_raw_size)) return 0; } @@ -445,7 +562,8 @@ read_abbrevs (abfd, offset, stash) return 0; } - abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE); + amt = sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE; + abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, amt); abbrev_ptr = stash->dwarf_abbrev_buffer + offset; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); @@ -454,7 +572,8 @@ read_abbrevs (abfd, offset, stash) /* Loop until we reach an abbrev number of 0. */ while (abbrev_number) { - cur_abbrev = (struct abbrev_info*)bfd_zalloc (abfd, sizeof (struct abbrev_info)); + amt = sizeof (struct abbrev_info); + cur_abbrev = (struct abbrev_info *) bfd_zalloc (abfd, amt); /* Read in abbrev header. */ cur_abbrev->number = abbrev_number; @@ -473,10 +592,10 @@ read_abbrevs (abfd, offset, stash) { 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)); + amt = cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK; + amt *= sizeof (struct attr_abbrev); + cur_abbrev->attrs = ((struct attr_abbrev *) + bfd_realloc (cur_abbrev->attrs, amt)); if (! cur_abbrev->attrs) return 0; } @@ -512,31 +631,33 @@ read_abbrevs (abfd, offset, stash) return abbrevs; } -/* Read an attribute described by an abbreviated attribute. */ +/* Read an attribute value described by an attribute form. */ static char * -read_attribute (attr, abbrev, unit, info_ptr) +read_attribute_value (attr, form, unit, info_ptr) struct attribute *attr; - struct attr_abbrev *abbrev; + unsigned form; struct comp_unit *unit; char *info_ptr; { bfd *abfd = unit->abfd; unsigned int bytes_read; struct dwarf_block *blk; + bfd_size_type amt; - attr->name = abbrev->name; - attr->form = abbrev->form; + attr->form = form; - switch (abbrev->form) + switch (form) { case DW_FORM_addr: + /* FIXME: DWARF3 draft sais DW_FORM_ref_addr is offset_size. */ case DW_FORM_ref_addr: DW_ADDR (attr) = read_address (unit, info_ptr); info_ptr += unit->addr_size; break; case DW_FORM_block2: - blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block)); + amt = sizeof (struct dwarf_block); + blk = (struct dwarf_block *) bfd_alloc (abfd, amt); blk->size = read_2_bytes (abfd, info_ptr); info_ptr += 2; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -544,7 +665,8 @@ read_attribute (attr, abbrev, unit, info_ptr) DW_BLOCK (attr) = blk; break; case DW_FORM_block4: - blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block)); + amt = sizeof (struct dwarf_block); + blk = (struct dwarf_block *) bfd_alloc (abfd, amt); blk->size = read_4_bytes (abfd, info_ptr); info_ptr += 4; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -567,8 +689,13 @@ read_attribute (attr, abbrev, unit, info_ptr) DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; + case DW_FORM_strp: + DW_STRING (attr) = read_indirect_string (unit, info_ptr, &bytes_read); + info_ptr += bytes_read; + break; case DW_FORM_block: - blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block)); + amt = sizeof (struct dwarf_block); + blk = (struct dwarf_block *) bfd_alloc (abfd, amt); blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -576,7 +703,8 @@ read_attribute (attr, abbrev, unit, info_ptr) DW_BLOCK (attr) = blk; break; case DW_FORM_block1: - blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block)); + amt = sizeof (struct dwarf_block); + blk = (struct dwarf_block *) bfd_alloc (abfd, amt); blk->size = read_1_byte (abfd, info_ptr); info_ptr += 1; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -619,16 +747,33 @@ read_attribute (attr, abbrev, unit, info_ptr) DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; - case DW_FORM_strp: case DW_FORM_indirect: + form = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + info_ptr += bytes_read; + info_ptr = read_attribute_value (attr, form, unit, info_ptr); + break; default: (*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %d."), - abbrev->form); + form); bfd_set_error (bfd_error_bad_value); } return info_ptr; } +/* Read an attribute described by an abbreviated attribute. */ + +static char * +read_attribute (attr, abbrev, unit, info_ptr) + struct attribute *attr; + struct attr_abbrev *abbrev; + struct comp_unit *unit; + char *info_ptr; +{ + attr->name = abbrev->name; + info_ptr = read_attribute_value (attr, abbrev->form, unit, info_ptr); + return info_ptr; +} + /* Source line information table routines. */ #define FILE_ALLOC_CHUNK 5 @@ -672,8 +817,8 @@ add_line_info (table, address, filename, line, column, end_sequence) unsigned int column; int end_sequence; { - struct line_info* info = (struct line_info*) - bfd_alloc (table->abfd, sizeof (struct line_info)); + bfd_size_type amt = sizeof (struct line_info); + struct line_info* info = (struct line_info*) bfd_alloc (table->abfd, amt); info->prev_line = table->last_line; table->last_line = info; @@ -749,7 +894,7 @@ arange_add (unit, low_pc, high_pc) } /* Need to allocate a new arange and insert it into the arange list. */ - arange = bfd_zalloc (unit->abfd, sizeof (*arange)); + arange = bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange)); arange->low = low_pc; arange->high = high_pc; @@ -769,9 +914,10 @@ decode_line_info (unit, stash) char *line_ptr; char *line_end; struct line_head lh; - unsigned int i, bytes_read; + unsigned int i, bytes_read, offset_size; char *cur_file, *cur_dir; unsigned char op_code, extended_op, adj_opcode; + bfd_size_type amt; if (! stash->dwarf_line_buffer) { @@ -786,13 +932,12 @@ decode_line_info (unit, stash) } stash->dwarf_line_size = msec->_raw_size; - stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, stash->dwarf_line_size); + stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, msec->_raw_size); if (! stash->dwarf_line_buffer) return 0; - if (! bfd_get_section_contents (abfd, msec, - stash->dwarf_line_buffer, 0, - stash->dwarf_line_size)) + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_line_buffer, + (bfd_vma) 0, msec->_raw_size)) return 0; /* FIXME: We ought to apply the relocs against this section before @@ -810,8 +955,8 @@ decode_line_info (unit, stash) return 0; } - table = (struct line_info_table*) bfd_alloc (abfd, - sizeof (struct line_info_table)); + amt = sizeof (struct line_info_table); + table = (struct line_info_table*) bfd_alloc (abfd, amt); table->abfd = abfd; table->comp_dir = unit->comp_dir; @@ -829,11 +974,21 @@ decode_line_info (unit, stash) /* Read in the prologue. */ lh.total_length = read_4_bytes (abfd, line_ptr); line_ptr += 4; + offset_size = 4; + if (lh.total_length == 0xffffffff) + { + lh.total_length = read_8_bytes (abfd, line_ptr); + line_ptr += 8; + offset_size = 8; + } 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; + if (offset_size == 4) + lh.prologue_length = read_4_bytes (abfd, line_ptr); + else + lh.prologue_length = read_8_bytes (abfd, line_ptr); + line_ptr += offset_size; lh.minimum_instruction_length = read_1_byte (abfd, line_ptr); line_ptr += 1; lh.default_is_stmt = read_1_byte (abfd, line_ptr); @@ -844,8 +999,8 @@ decode_line_info (unit, stash) 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)); + amt = lh.opcode_base * sizeof (unsigned char); + lh.standard_opcode_lengths = (unsigned char *) bfd_alloc (abfd, amt); lh.standard_opcode_lengths[0] = 1; @@ -862,9 +1017,9 @@ decode_line_info (unit, stash) if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0) { - table->dirs = (char **) - bfd_realloc (table->dirs, - (table->num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *)); + amt = table->num_dirs + DIR_ALLOC_CHUNK; + amt *= sizeof (char *); + table->dirs = (char **) bfd_realloc (table->dirs, amt); if (! table->dirs) return 0; } @@ -881,10 +1036,9 @@ decode_line_info (unit, stash) 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)); + amt = table->num_files + FILE_ALLOC_CHUNK; + amt *= sizeof (struct fileinfo); + table->files = (struct fileinfo *) bfd_realloc (table->files, amt); if (! table->files) return 0; } @@ -923,7 +1077,22 @@ decode_line_info (unit, stash) op_code = read_1_byte (abfd, line_ptr); line_ptr += 1; - switch (op_code) + if (op_code >= lh.opcode_base) + { /* 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, 0); + basic_block = 1; + if (need_low_pc) + { + need_low_pc = 0; + low_pc = address; + } + } + else switch (op_code) { case DW_LNS_extended_op: line_ptr += 1; /* Ignore length. */ @@ -951,10 +1120,10 @@ decode_line_info (unit, stash) 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)); + amt = table->num_files + FILE_ALLOC_CHUNK; + amt *= sizeof (struct fileinfo); + table->files = + (struct fileinfo *) bfd_realloc (table->files, amt); if (! table->files) return 0; } @@ -1023,19 +1192,15 @@ decode_line_info (unit, stash) 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, 0); - basic_block = 1; - if (need_low_pc) - { - need_low_pc = 0; - low_pc = address; - } + default: + { /* Unknown standard opcode, ignore it. */ + int i; + for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++) + { + (void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read); + line_ptr += bytes_read; + } + } } } } @@ -1158,7 +1323,8 @@ scan_unit_for_functions (unit) if (abbrev->tag == DW_TAG_subprogram) { - func = (struct funcinfo*) bfd_zalloc (abfd, sizeof (struct funcinfo)); + bfd_size_type amt = sizeof (struct funcinfo); + func = (struct funcinfo *) bfd_zalloc (abfd, amt); func->prev_func = unit->function_table; unit->function_table = func; } @@ -1219,22 +1385,75 @@ scan_unit_for_functions (unit) return true; } +/* Look for a RELA relocation to be applied on OFFSET of section SEC, + and return the addend if such a relocation is found. Since this is + only used to find relocations referring to the .debug_abbrev + section, we make sure the relocation refers to this section, but + this is not strictly necessary, and it can probably be safely + removed if needed. However, it is important to note that this + function only returns the addend, it doesn't serve the purpose of + applying a generic relocation. + + If no suitable relocation is found, or if it is not a real RELA + relocation, this function returns 0. */ + +static bfd_vma +find_rela_addend (abfd, sec, offset, syms) + bfd* abfd; + asection* sec; + bfd_size_type offset; + asymbol** syms; +{ + long reloc_size = bfd_get_reloc_upper_bound (abfd, sec); + arelent **relocs = NULL; + long reloc_count, relc; + + if (reloc_size <= 0) + return 0; + + relocs = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); + if (relocs == NULL) + return 0; + + reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, syms); + + if (reloc_count <= 0) + { + free (relocs); + return 0; + } + + for (relc = 0; relc < reloc_count; relc++) + if (relocs[relc]->address == offset + && (*relocs[relc]->sym_ptr_ptr)->flags & BSF_SECTION_SYM + && strcmp ((*relocs[relc]->sym_ptr_ptr)->name, + ".debug_abbrev") == 0) + { + bfd_vma addend = (relocs[relc]->howto->partial_inplace + ? 0 : relocs[relc]->addend); + free (relocs); + return addend; + } + + free (relocs); + return 0; +} + /* 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. - If ABBREV_LENGTH is 0, then the length of the abbreviation offset - is assumed to be four bytes. Otherwise, it it is the size given. + OFFSET_SIZE is the size of DWARF2 offsets (either 4 or 8 bytes). 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, stash, unit_length, abbrev_length) +parse_comp_unit (abfd, stash, unit_length, offset_size) bfd* abfd; struct dwarf2_debug *stash; bfd_vma unit_length; - unsigned int abbrev_length; + unsigned int offset_size; { struct comp_unit* unit; @@ -1249,17 +1468,23 @@ parse_comp_unit (abfd, stash, unit_length, abbrev_length) char *info_ptr = stash->info_ptr; char *end_ptr = info_ptr + unit_length; + bfd_size_type amt; + bfd_size_type off; version = read_2_bytes (abfd, info_ptr); info_ptr += 2; - BFD_ASSERT (abbrev_length == 0 - || abbrev_length == 4 - || abbrev_length == 8); - if (abbrev_length == 0 || abbrev_length == 4) + BFD_ASSERT (offset_size == 4 || offset_size == 8); + if (offset_size == 4) abbrev_offset = read_4_bytes (abfd, info_ptr); - else if (abbrev_length == 8) + else abbrev_offset = read_8_bytes (abfd, info_ptr); - info_ptr += abbrev_length; + /* The abbrev offset is generally a relocation pointing to + .debug_abbrev+offset. On RELA targets, we have to find the + relocation and extract the addend to obtain the actual + abbrev_offset, so do it here. */ + off = info_ptr - stash->sec_info_ptr; + abbrev_offset += find_rela_addend (abfd, stash->sec, off, stash->syms); + info_ptr += offset_size; addr_size = read_1_byte (abfd, info_ptr); info_ptr += 1; @@ -1310,11 +1535,14 @@ parse_comp_unit (abfd, stash, unit_length, abbrev_length) return 0; } - unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit)); + amt = sizeof (struct comp_unit); + unit = (struct comp_unit*) bfd_zalloc (abfd, amt); unit->abfd = abfd; unit->addr_size = addr_size; + unit->offset_size = offset_size; unit->abbrevs = abbrevs; unit->end_ptr = end_ptr; + unit->stash = stash; for (i = 0; i < abbrev->num_attrs; ++i) { @@ -1499,7 +1727,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, addr_size, pinfo) bfd *abfd; asection *section; - asymbol **symbols ATTRIBUTE_UNUSED; + asymbol **symbols; bfd_vma offset; const char **filename_ptr; const char **functionname_ptr; @@ -1535,11 +1763,11 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (! stash) { - unsigned long total_size; + bfd_size_type total_size; asection *msec; + bfd_size_type amt = sizeof (struct dwarf2_debug); - stash = - (struct dwarf2_debug*) bfd_zalloc (abfd, sizeof (struct dwarf2_debug)); + stash = (struct dwarf2_debug*) bfd_zalloc (abfd, amt); if (! stash) return false; @@ -1570,8 +1798,8 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, msec; msec = find_debug_info (abfd, msec)) { - unsigned long size; - unsigned long start; + bfd_size_type size; + bfd_size_type start; size = msec->_raw_size; if (size == 0) @@ -1579,13 +1807,18 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, start = stash->info_ptr_end - stash->info_ptr; - if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, 0, size)) + if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, + (bfd_vma) 0, size)) continue; stash->info_ptr_end = stash->info_ptr + start + size; } - BFD_ASSERT (stash->info_ptr_end = stash->info_ptr + total_size); + BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); + + stash->sec = find_debug_info (abfd, NULL); + stash->sec_info_ptr = stash->info_ptr; + stash->syms = symbols; } /* FIXME: There is a problem with the contents of the @@ -1618,21 +1851,36 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, /* Read each remaining comp. units checking each as they are read. */ while (stash->info_ptr < stash->info_ptr_end) { - struct comp_unit* each; bfd_vma length; boolean found; + unsigned int offset_size = addr_size; if (addr_size == 4) - length = read_4_bytes (abfd, stash->info_ptr); + { + length = read_4_bytes (abfd, stash->info_ptr); + if (length == 0xffffffff) + { + offset_size = 8; + length = read_8_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + } else length = read_8_bytes (abfd, stash->info_ptr); stash->info_ptr += addr_size; if (length > 0) { - each = parse_comp_unit (abfd, stash, length, addr_size); + each = parse_comp_unit (abfd, stash, length, offset_size); stash->info_ptr += length; + if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) + == stash->sec->_raw_size) + { + stash->sec = find_debug_info (abfd, stash->sec); + stash->sec_info_ptr = stash->info_ptr; + } + if (each) { each->next_unit = stash->all_comp_units; diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c index db60638..1e3b6a9 100644 --- a/contrib/binutils/bfd/ecoff.c +++ b/contrib/binutils/bfd/ecoff.c @@ -65,7 +65,7 @@ static boolean ecoff_compute_section_file_positions PARAMS ((bfd *abfd)); static bfd_size_type ecoff_compute_reloc_file_positions PARAMS ((bfd *abfd)); static boolean ecoff_get_extr PARAMS ((asymbol *, EXTR *)); static void ecoff_set_index PARAMS ((asymbol *, bfd_size_type)); -static unsigned int ecoff_armap_hash PARAMS ((CONST char *s, +static unsigned int ecoff_armap_hash PARAMS ((const char *s, unsigned int *rehash, unsigned int size, unsigned int hlog)); @@ -78,7 +78,7 @@ static asection bfd_debug_section = "*DEBUG*", 0, 0, NULL, 0, 0, 0, /* linker_mark, linker_has_input, gc_mark, segment_mark, */ 0, 0, 0, 0, - /* vma, lma, _cooked_size, _raw_size, */ + /* vma, lma, _cooked_size, _raw_size, */ 0, 0, 0, 0, /* output_offset, output_section, alignment_power, */ 0, NULL, 0, @@ -86,8 +86,8 @@ static asection bfd_debug_section = NULL, NULL, 0, 0, 0, /* line_filepos, userdata, contents, lineno, lineno_count, */ 0, NULL, NULL, NULL, 0, - /* comdat, kept_section, moving_line_filepos, */ - NULL, NULL, 0, + /* entsize, comdat, moving_line_filepos, */ + 0, NULL, 0, /* target_index, used_by_bfd, constructor_chain, owner, */ 0, NULL, NULL, NULL, /* symbol, */ @@ -104,8 +104,8 @@ boolean _bfd_ecoff_mkobject (abfd) bfd *abfd; { - abfd->tdata.ecoff_obj_data = ((struct ecoff_tdata *) - bfd_zalloc (abfd, sizeof (ecoff_data_type))); + bfd_size_type amt = sizeof (ecoff_data_type); + abfd->tdata.ecoff_obj_data = (struct ecoff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.ecoff_obj_data == NULL) return false; @@ -371,16 +371,17 @@ ecoff_sec_to_styp_flags (name, flags) /* Get the BFD flags to use for a section. */ -flagword -_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section) +boolean +_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd ATTRIBUTE_UNUSED; PTR hdr; const char *name ATTRIBUTE_UNUSED; asection *section ATTRIBUTE_UNUSED; + flagword * flags_ptr; { struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; long styp_flags = internal_s->s_flags; - flagword sec_flags=0; + flagword sec_flags = 0; if (styp_flags & STYP_NOLOAD) sec_flags |= SEC_NEVER_LOAD; @@ -422,29 +423,20 @@ _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section) } else if ((styp_flags & STYP_BSS) || (styp_flags & STYP_SBSS)) - { - sec_flags |= SEC_ALLOC; - } + sec_flags |= SEC_ALLOC; else if ((styp_flags & STYP_INFO) || styp_flags == STYP_COMMENT) - { - sec_flags |= SEC_NEVER_LOAD; - } + sec_flags |= SEC_NEVER_LOAD; else if ((styp_flags & STYP_LITA) || (styp_flags & STYP_LIT8) || (styp_flags & STYP_LIT4)) - { - sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY; - } + sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY; else if (styp_flags & STYP_ECOFF_LIB) - { - sec_flags |= SEC_COFF_SHARED_LIBRARY; - } + sec_flags |= SEC_COFF_SHARED_LIBRARY; else - { - sec_flags |= SEC_ALLOC | SEC_LOAD; - } + sec_flags |= SEC_ALLOC | SEC_LOAD; - return sec_flags; + * flags_ptr = sec_flags; + return true; } /* Read in the symbolic header for an ECOFF object file. */ @@ -482,13 +474,12 @@ ecoff_slurp_symbolic_header (abfd) } /* Read the symbolic information header. */ - raw = (PTR) bfd_malloc ((size_t) external_hdr_size); + raw = (PTR) bfd_malloc (external_hdr_size); if (raw == NULL) goto error_return; - if (bfd_seek (abfd, ecoff_data (abfd)->sym_filepos, SEEK_SET) == -1 - || (bfd_read (raw, external_hdr_size, 1, abfd) - != external_hdr_size)) + if (bfd_seek (abfd, ecoff_data (abfd)->sym_filepos, SEEK_SET) != 0 + || bfd_bread (raw, external_hdr_size, abfd) != external_hdr_size) goto error_return; internal_symhdr = &ecoff_data (abfd)->debug_info.symbolic_header; (*backend->debug_swap.swap_hdr_in) (abfd, raw, internal_symhdr); @@ -533,6 +524,8 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) struct fdr *fdr_ptr; bfd_size_type raw_end; bfd_size_type cb_end; + bfd_size_type amt; + file_ptr pos; BFD_ASSERT (debug == &ecoff_data (abfd)->debug_info); @@ -591,11 +584,11 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) raw = (PTR) bfd_alloc (abfd, raw_size); if (raw == NULL) return false; - if (bfd_seek (abfd, - (ecoff_data (abfd)->sym_filepos - + backend->debug_swap.external_hdr_size), - SEEK_SET) != 0 - || bfd_read (raw, raw_size, 1, abfd) != raw_size) + + pos = ecoff_data (abfd)->sym_filepos; + pos += backend->debug_swap.external_hdr_size; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread (raw, raw_size, abfd) != raw_size) { bfd_release (abfd, raw); return false; @@ -632,9 +625,9 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) We need to look at the fdr to deal with a lot of information in the symbols, so we swap them here. */ - debug->fdr = (struct fdr *) bfd_alloc (abfd, - (internal_symhdr->ifdMax * - sizeof (struct fdr))); + amt = internal_symhdr->ifdMax; + amt *= sizeof (struct fdr); + debug->fdr = (struct fdr *) bfd_alloc (abfd, amt); if (debug->fdr == NULL) return false; external_fdr_size = backend->debug_swap.external_fdr_size; @@ -666,8 +659,9 @@ _bfd_ecoff_make_empty_symbol (abfd) bfd *abfd; { ecoff_symbol_type *new; + bfd_size_type amt = sizeof (ecoff_symbol_type); - new = (ecoff_symbol_type *) bfd_alloc (abfd, sizeof (ecoff_symbol_type)); + new = (ecoff_symbol_type *) bfd_alloc (abfd, amt); if (new == (ecoff_symbol_type *) NULL) return (asymbol *) NULL; memset ((PTR) new, 0, sizeof *new); @@ -866,6 +860,7 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) asection *section; arelent_chain *reloc_chain; unsigned int bitsize; + bfd_size_type amt; /* Get a section with the same name as the symbol (usually __CTOR_LIST__ or __DTOR_LIST__). FIXME: gcc uses the @@ -885,7 +880,8 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) { char *copy; - copy = (char *) bfd_alloc (abfd, strlen (name) + 1); + amt = strlen (name) + 1; + copy = (char *) bfd_alloc (abfd, amt); if (!copy) return false; strcpy (copy, name); @@ -893,8 +889,8 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) } /* Build a reloc pointing to this constructor. */ - reloc_chain = - (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain)); + amt = sizeof (arelent_chain); + reloc_chain = (arelent_chain *) bfd_alloc (abfd, amt); if (!reloc_chain) return false; reloc_chain->relent.sym_ptr_ptr = @@ -966,7 +962,8 @@ _bfd_ecoff_slurp_symbol_table (abfd) if (bfd_get_symcount (abfd) == 0) return true; - internal_size = bfd_get_symcount (abfd) * sizeof (ecoff_symbol_type); + internal_size = bfd_get_symcount (abfd); + internal_size *= sizeof (ecoff_symbol_type); internal = (ecoff_symbol_type *) bfd_alloc (abfd, internal_size); if (internal == NULL) return false; @@ -1671,7 +1668,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) const struct ecoff_backend_data * const backend = ecoff_backend (abfd); arelent *internal_relocs; bfd_size_type external_reloc_size; - bfd_size_type external_relocs_size; + bfd_size_type amt; char *external_relocs; arelent *rptr; unsigned int i; @@ -1684,19 +1681,19 @@ ecoff_slurp_reloc_table (abfd, section, symbols) if (_bfd_ecoff_slurp_symbol_table (abfd) == false) return false; - internal_relocs = (arelent *) bfd_alloc (abfd, - (sizeof (arelent) - * section->reloc_count)); + amt = section->reloc_count; + amt *= sizeof (arelent); + internal_relocs = (arelent *) bfd_alloc (abfd, amt); + external_reloc_size = backend->external_reloc_size; - external_relocs_size = external_reloc_size * section->reloc_count; - external_relocs = (char *) bfd_alloc (abfd, external_relocs_size); + amt = external_reloc_size * section->reloc_count; + external_relocs = (char *) bfd_alloc (abfd, amt); if (internal_relocs == (arelent *) NULL || external_relocs == (char *) NULL) return false; if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0) return false; - if (bfd_read (external_relocs, 1, external_relocs_size, abfd) - != external_relocs_size) + if (bfd_bread (external_relocs, amt, abfd) != amt) return false; for (i = 0, rptr = internal_relocs; i < section->reloc_count; i++, rptr++) @@ -1725,7 +1722,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) } else { - CONST char *sec_name; + const char *sec_name; asection *sec; /* r_symndx is a section key. */ @@ -1822,8 +1819,8 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, asection *section; asymbol **ignore_symbols ATTRIBUTE_UNUSED; bfd_vma offset; - CONST char **filename_ptr; - CONST char **functionname_ptr; + const char **filename_ptr; + const char **functionname_ptr; unsigned int *retline_ptr; { const struct ecoff_debug_swap * const debug_swap @@ -1838,9 +1835,9 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, if (ecoff_data (abfd)->find_line_info == NULL) { - ecoff_data (abfd)->find_line_info = - ((struct ecoff_find_line *) - bfd_zalloc (abfd, sizeof (struct ecoff_find_line))); + bfd_size_type amt = sizeof (struct ecoff_find_line); + ecoff_data (abfd)->find_line_info + = (struct ecoff_find_line *) bfd_zalloc (abfd, amt); if (ecoff_data (abfd)->find_line_info == NULL) return false; } @@ -2065,13 +2062,15 @@ ecoff_compute_section_file_positions (abfd) boolean rdata_in_text; boolean first_data, first_nonalloc; const bfd_vma round = ecoff_backend (abfd)->round; + bfd_size_type amt; sofar = _bfd_ecoff_sizeof_headers (abfd, false); file_sofar = sofar; /* Sort the sections by VMA. */ - sorted_hdrs = (asection **) bfd_malloc (abfd->section_count - * sizeof (asection *)); + amt = abfd->section_count; + amt *= sizeof (asection *); + sorted_hdrs = (asection **) bfd_malloc (amt); if (sorted_hdrs == NULL) return false; for (current = abfd->sections, i = 0; @@ -2265,6 +2264,8 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { + file_ptr pos; + /* This must be done first, because bfd_set_section_contents is going to set output_has_begun to true. */ if (abfd->output_has_begun == false) @@ -2293,8 +2294,9 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count) if (count == 0) return true; - if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0 - || bfd_write (location, 1, count, abfd) != count) + pos = section->filepos + offset; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bwrite (location, count, abfd) != count) return false; return true; @@ -2521,7 +2523,7 @@ _bfd_ecoff_write_object_contents (abfd) siz = filhsz; if (siz < aoutsz) siz = aoutsz; - buff = (PTR) bfd_malloc ((size_t) siz); + buff = (PTR) bfd_malloc (siz); if (buff == NULL) goto error_return; } @@ -2581,7 +2583,7 @@ _bfd_ecoff_write_object_contents (abfd) current->flags); if (bfd_coff_swap_scnhdr_out (abfd, (PTR) §ion, buff) == 0 - || bfd_write (buff, 1, scnhsz, abfd) != scnhsz) + || bfd_bwrite (buff, scnhsz, abfd) != scnhsz) goto error_return; if ((section.s_flags & STYP_TEXT) != 0 @@ -2732,11 +2734,11 @@ _bfd_ecoff_write_object_contents (abfd) goto error_return; bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, buff); - if (bfd_write (buff, 1, filhsz, abfd) != filhsz) + if (bfd_bwrite (buff, filhsz, abfd) != filhsz) goto error_return; bfd_coff_swap_aouthdr_out (abfd, (PTR) &internal_a, buff); - if (bfd_write (buff, 1, aoutsz, abfd) != aoutsz) + if (bfd_bwrite (buff, aoutsz, abfd) != aoutsz) goto error_return; /* Build the external symbol information. This must be done before @@ -2764,12 +2766,13 @@ _bfd_ecoff_write_object_contents (abfd) arelent **reloc_ptr_ptr; arelent **reloc_end; char *out_ptr; + bfd_size_type amt; if (current->reloc_count == 0) continue; - reloc_buff = - bfd_alloc (abfd, current->reloc_count * external_reloc_size); + amt = current->reloc_count * external_reloc_size; + reloc_buff = bfd_alloc (abfd, amt); if (reloc_buff == NULL) goto error_return; @@ -2800,7 +2803,7 @@ _bfd_ecoff_write_object_contents (abfd) } else { - CONST char *name; + const char *name; name = bfd_get_section_name (abfd, bfd_get_section (sym)); if (strcmp (name, ".text") == 0) @@ -2845,9 +2848,8 @@ _bfd_ecoff_write_object_contents (abfd) if (bfd_seek (abfd, current->rel_filepos, SEEK_SET) != 0) goto error_return; - if (bfd_write (reloc_buff, - external_reloc_size, current->reloc_count, abfd) - != external_reloc_size * current->reloc_count) + amt = current->reloc_count * external_reloc_size; + if (bfd_bwrite (reloc_buff, amt, abfd) != amt) goto error_return; bfd_release (abfd, reloc_buff); reloc_buff = NULL; @@ -2877,12 +2879,12 @@ _bfd_ecoff_write_object_contents (abfd) if (bfd_seek (abfd, (file_ptr) ecoff_data (abfd)->sym_filepos - 1, SEEK_SET) != 0) goto error_return; - if (bfd_read (&c, 1, 1, abfd) == 0) + if (bfd_bread (&c, (bfd_size_type) 1, abfd) == 0) c = 0; if (bfd_seek (abfd, (file_ptr) ecoff_data (abfd)->sym_filepos - 1, SEEK_SET) != 0) goto error_return; - if (bfd_write (&c, 1, 1, abfd) != 1) + if (bfd_bwrite (&c, (bfd_size_type) 1, abfd) != 1) goto error_return; } @@ -2950,7 +2952,7 @@ _bfd_ecoff_write_object_contents (abfd) static unsigned int ecoff_armap_hash (s, rehash, size, hlog) - CONST char *s; + const char *s; unsigned int *rehash; unsigned int size; unsigned int hlog; @@ -2983,9 +2985,10 @@ _bfd_ecoff_slurp_armap (abfd) char *raw_ptr; struct symdef *symdef_ptr; char *stringbase; + bfd_size_type amt; /* Get the name of the first element. */ - i = bfd_read ((PTR) nextname, 1, 16, abfd); + i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); if (i == 0) return true; if (i != 16) @@ -3040,7 +3043,7 @@ _bfd_ecoff_slurp_armap (abfd) if (raw_armap == (char *) NULL) return false; - if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size) + if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -3050,7 +3053,7 @@ _bfd_ecoff_slurp_armap (abfd) ardata->tdata = (PTR) raw_armap; - count = bfd_h_get_32 (abfd, (PTR) raw_armap); + count = H_GET_32 (abfd, raw_armap); ardata->symdef_count = 0; ardata->cache = (struct ar_cache *) NULL; @@ -3077,8 +3080,8 @@ _bfd_ecoff_slurp_armap (abfd) unsigned int name_offset, file_offset; unsigned int hash, rehash, srch; - name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr); - file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)); + name_offset = H_GET_32 (abfd, raw_ptr); + file_offset = H_GET_32 (abfd, (raw_ptr + 4)); if (file_offset == 0) continue; hash = ecoff_armap_hash (stringbase + name_offset, &rehash, count, @@ -3090,8 +3093,7 @@ _bfd_ecoff_slurp_armap (abfd) for (srch = (hash + rehash) & (count - 1); srch != hash && srch != i; srch = (srch + rehash) & (count - 1)) - BFD_ASSERT (bfd_h_get_32 (abfd, (PTR) (raw_armap + 8 + srch * 8)) - != 0); + BFD_ASSERT (H_GET_32 (abfd, (raw_armap + 8 + srch * 8)) != 0); BFD_ASSERT (srch == i); } } @@ -3100,12 +3102,12 @@ _bfd_ecoff_slurp_armap (abfd) raw_ptr = raw_armap + 4; for (i = 0; i < count; i++, raw_ptr += 8) - if (bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)) != 0) + if (H_GET_32 (abfd, (raw_ptr + 4)) != 0) ++ardata->symdef_count; - symdef_ptr = ((struct symdef *) - bfd_alloc (abfd, - ardata->symdef_count * sizeof (struct symdef))); + amt = ardata->symdef_count; + amt *= sizeof (struct symdef); + symdef_ptr = (struct symdef *) bfd_alloc (abfd, amt); if (!symdef_ptr) return false; @@ -3116,10 +3118,10 @@ _bfd_ecoff_slurp_armap (abfd) { unsigned int name_offset, file_offset; - file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)); + file_offset = H_GET_32 (abfd, (raw_ptr + 4)); if (file_offset == 0) continue; - name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr); + name_offset = H_GET_32 (abfd, raw_ptr); symdef_ptr->s.name = stringbase + name_offset; symdef_ptr->file_offset = file_offset; ++symdef_ptr; @@ -3145,7 +3147,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) int stridx; { unsigned int hashsize, hashlog; - unsigned int symdefsize; + bfd_size_type symdefsize; int padit; unsigned int stringsize; unsigned int mapsize; @@ -3218,12 +3220,12 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd) + if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) return false; - bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp); - if (bfd_write ((PTR) temp, 1, 4, abfd) != 4) + H_PUT_32 (abfd, hashsize, temp); + if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) return false; hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize); @@ -3238,7 +3240,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) /* Advance firstreal to the file position of this archive element. */ - if (((bfd *) map[i].pos) != last_elt) + if (map[i].u.abfd != last_elt) { do { @@ -3246,13 +3248,13 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) firstreal += firstreal % 2; current = current->next; } - while (current != (bfd *) map[i].pos); + while (current != map[i].u.abfd); } last_elt = current; hash = ecoff_armap_hash (*map[i].name, &rehash, hashsize, hashlog); - if (bfd_h_get_32 (abfd, (PTR) (hashtable + (hash * 8) + 4)) != 0) + if (H_GET_32 (abfd, (hashtable + (hash * 8) + 4)) != 0) { unsigned int srch; @@ -3260,7 +3262,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) for (srch = (hash + rehash) & (hashsize - 1); srch != hash; srch = (srch + rehash) & (hashsize - 1)) - if (bfd_h_get_32 (abfd, (PTR) (hashtable + (srch * 8) + 4)) == 0) + if (H_GET_32 (abfd, (hashtable + (srch * 8) + 4)) == 0) break; BFD_ASSERT (srch != hash); @@ -3268,27 +3270,25 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) hash = srch; } - bfd_h_put_32 (abfd, (bfd_vma) map[i].namidx, - (PTR) (hashtable + hash * 8)); - bfd_h_put_32 (abfd, (bfd_vma) firstreal, - (PTR) (hashtable + hash * 8 + 4)); + H_PUT_32 (abfd, map[i].namidx, (hashtable + hash * 8)); + H_PUT_32 (abfd, firstreal, (hashtable + hash * 8 + 4)); } - if (bfd_write ((PTR) hashtable, 1, symdefsize, abfd) != symdefsize) + if (bfd_bwrite ((PTR) hashtable, symdefsize, abfd) != symdefsize) return false; bfd_release (abfd, hashtable); /* Now write the strings. */ - bfd_h_put_32 (abfd, (bfd_vma) stringsize, temp); - if (bfd_write ((PTR) temp, 1, 4, abfd) != 4) + H_PUT_32 (abfd, stringsize, temp); + if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) return false; for (i = 0; i < orl_count; i++) { bfd_size_type len; len = strlen (*map[i].name) + 1; - if (bfd_write ((PTR) (*map[i].name), 1, len, abfd) != len) + if (bfd_bwrite ((PTR) (*map[i].name), len, abfd) != len) return false; } @@ -3296,7 +3296,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) bug-compatible for DECstation ar we use a null. */ if (padit) { - if (bfd_write ("", 1, 1, abfd) != 1) + if (bfd_bwrite ("", (bfd_size_type) 1, abfd) != 1) return false; } @@ -3312,10 +3312,11 @@ _bfd_ecoff_archive_p (abfd) { struct artdata *tdata_hold; char armag[SARMAG + 1]; + bfd_size_type amt; tdata_hold = abfd->tdata.aout_ar_data; - if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG) + if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -3331,8 +3332,8 @@ _bfd_ecoff_archive_p (abfd) /* We are setting bfd_ardata(abfd) here, but since bfd_ardata involves a cast, we can't do it as the left operand of assignment. */ - abfd->tdata.aout_ar_data = - (struct artdata *) bfd_zalloc (abfd, sizeof (struct artdata)); + amt = sizeof (struct artdata); + abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == (struct artdata *) NULL) { @@ -3449,9 +3450,9 @@ _bfd_ecoff_bfd_link_hash_table_create (abfd) bfd *abfd; { struct ecoff_link_hash_table *ret; + bfd_size_type amt = sizeof (struct ecoff_link_hash_table); - ret = ((struct ecoff_link_hash_table *) - bfd_alloc (abfd, sizeof (struct ecoff_link_hash_table))); + ret = (struct ecoff_link_hash_table *) bfd_alloc (abfd, amt); if (ret == NULL) return NULL; if (! _bfd_link_hash_table_init (&ret->root, abfd, @@ -3541,7 +3542,7 @@ ecoff_link_add_archive_symbols (abfd, info) return (_bfd_generic_link_add_archive_symbols (abfd, info, ecoff_link_check_archive_element)); - armap_count = bfd_h_get_32 (abfd, raw_armap); + armap_count = H_GET_32 (abfd, raw_armap); armap_log = 0; for (i = 1; i < armap_count; i <<= 1) @@ -3594,7 +3595,7 @@ ecoff_link_add_archive_symbols (abfd, info) hash = ecoff_armap_hash (h->root.string, &rehash, armap_count, armap_log); - file_offset = bfd_h_get_32 (abfd, hashtable + (hash * 8) + 4); + file_offset = H_GET_32 (abfd, hashtable + (hash * 8) + 4); if (file_offset == 0) { /* Nothing in this slot. */ @@ -3602,7 +3603,7 @@ ecoff_link_add_archive_symbols (abfd, info) continue; } - name = stringbase + bfd_h_get_32 (abfd, hashtable + (hash * 8)); + name = stringbase + H_GET_32 (abfd, hashtable + (hash * 8)); if (name[0] != h->root.string[0] || strcmp (name, h->root.string) != 0) { @@ -3615,10 +3616,10 @@ ecoff_link_add_archive_symbols (abfd, info) srch != hash; srch = (srch + rehash) & (armap_count - 1)) { - file_offset = bfd_h_get_32 (abfd, hashtable + (srch * 8) + 4); + file_offset = H_GET_32 (abfd, hashtable + (srch * 8) + 4); if (file_offset == 0) break; - name = stringbase + bfd_h_get_32 (abfd, hashtable + (srch * 8)); + name = stringbase + H_GET_32 (abfd, hashtable + (srch * 8)); if (name[0] == h->root.string[0] && strcmp (name, h->root.string) == 0) { @@ -3636,7 +3637,7 @@ ecoff_link_add_archive_symbols (abfd, info) hash = srch; } - element = (*backend->get_elt_at_filepos) (abfd, file_offset); + element = (*backend->get_elt_at_filepos) (abfd, (file_ptr) file_offset); if (element == (bfd *) NULL) return false; @@ -3672,7 +3673,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded) HDRR *symhdr; bfd_size_type external_ext_size; PTR external_ext = NULL; - size_t esize; + bfd_size_type esize; char *ssext = NULL; char *ext_ptr; char *ext_end; @@ -3695,17 +3696,17 @@ ecoff_link_check_archive_element (abfd, info, pneeded) if (external_ext == NULL && esize != 0) goto error_return; - if (bfd_seek (abfd, symhdr->cbExtOffset, SEEK_SET) != 0 - || bfd_read (external_ext, 1, esize, abfd) != esize) + if (bfd_seek (abfd, (file_ptr) symhdr->cbExtOffset, SEEK_SET) != 0 + || bfd_bread (external_ext, esize, abfd) != esize) goto error_return; - ssext = (char *) bfd_malloc (symhdr->issExtMax); + ssext = (char *) bfd_malloc ((bfd_size_type) symhdr->issExtMax); if (ssext == NULL && symhdr->issExtMax != 0) goto error_return; - if (bfd_seek (abfd, symhdr->cbSsExtOffset, SEEK_SET) != 0 - || (bfd_read (ssext, 1, symhdr->issExtMax, abfd) != - (bfd_size_type) symhdr->issExtMax)) + if (bfd_seek (abfd, (file_ptr) symhdr->cbSsExtOffset, SEEK_SET) != 0 + || (bfd_bread (ssext, (bfd_size_type) symhdr->issExtMax, abfd) + != (bfd_size_type) symhdr->issExtMax)) goto error_return; /* Look through the external symbols to see if they define some @@ -3795,7 +3796,7 @@ ecoff_link_add_object_symbols (abfd, info) HDRR *symhdr; bfd_size_type external_ext_size; PTR external_ext = NULL; - size_t esize; + bfd_size_type esize; char *ssext = NULL; boolean result; @@ -3815,16 +3816,16 @@ ecoff_link_add_object_symbols (abfd, info) if (external_ext == NULL && esize != 0) goto error_return; - if (bfd_seek (abfd, symhdr->cbExtOffset, SEEK_SET) != 0 - || bfd_read (external_ext, 1, esize, abfd) != esize) + if (bfd_seek (abfd, (file_ptr) symhdr->cbExtOffset, SEEK_SET) != 0 + || bfd_bread (external_ext, esize, abfd) != esize) goto error_return; - ssext = (char *) bfd_malloc (symhdr->issExtMax); + ssext = (char *) bfd_malloc ((bfd_size_type) symhdr->issExtMax); if (ssext == NULL && symhdr->issExtMax != 0) goto error_return; - if (bfd_seek (abfd, symhdr->cbSsExtOffset, SEEK_SET) != 0 - || (bfd_read (ssext, 1, symhdr->issExtMax, abfd) + if (bfd_seek (abfd, (file_ptr) symhdr->cbSsExtOffset, SEEK_SET) != 0 + || (bfd_bread (ssext, (bfd_size_type) symhdr->issExtMax, abfd) != (bfd_size_type) symhdr->issExtMax)) goto error_return; @@ -3865,12 +3866,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) struct ecoff_link_hash_entry **sym_hash; char *ext_ptr; char *ext_end; + bfd_size_type amt; ext_count = ecoff_data (abfd)->debug_info.symbolic_header.iextMax; - sym_hash = ((struct ecoff_link_hash_entry **) - bfd_alloc (abfd, - ext_count * sizeof (struct bfd_link_hash_entry *))); + amt = ext_count; + amt *= sizeof (struct bfd_link_hash_entry *); + sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt); if (!sym_hash) return false; ecoff_data (abfd)->sym_hashes = sym_hash; @@ -4007,7 +4009,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) h = NULL; if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, - esym.weakext ? BSF_WEAK : BSF_GLOBAL, + (flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL), section, value, (const char *) NULL, true, true, (struct bfd_link_hash_entry **) &h))) return false; @@ -4296,25 +4298,24 @@ ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle) HDRR *symhdr = &debug->symbolic_header; boolean ret; -#define READ(ptr, offset, count, size, type) \ - if (symhdr->count == 0) \ - debug->ptr = NULL; \ - else \ - { \ - debug->ptr = (type) bfd_malloc ((size_t) (size * symhdr->count)); \ - if (debug->ptr == NULL) \ - { \ - ret = false; \ - goto return_something; \ - } \ - if ((bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) \ - != 0) \ - || (bfd_read (debug->ptr, size, symhdr->count, \ - input_bfd) != size * symhdr->count)) \ - { \ - ret = false; \ - goto return_something; \ - } \ +#define READ(ptr, offset, count, size, type) \ + if (symhdr->count == 0) \ + debug->ptr = NULL; \ + else \ + { \ + bfd_size_type amt = (bfd_size_type) size * symhdr->count; \ + debug->ptr = (type) bfd_malloc (amt); \ + if (debug->ptr == NULL) \ + { \ + ret = false; \ + goto return_something; \ + } \ + if (bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ + || bfd_bread (debug->ptr, amt, input_bfd) != amt) \ + { \ + ret = false; \ + goto return_something; \ + } \ } /* If raw_syments is not NULL, then the data was already by read by @@ -4536,6 +4537,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) bfd_size_type external_reloc_size; bfd_size_type external_relocs_size; PTR external_relocs = NULL; + bfd_size_type amt; BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0); @@ -4557,10 +4559,9 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) /* Get the section contents. We allocate memory for the larger of the size before relocating and the size after relocating. */ - contents = (bfd_byte *) bfd_malloc (raw_size >= cooked_size - ? (size_t) raw_size - : (size_t) cooked_size); - if (contents == NULL && raw_size != 0) + amt = raw_size >= cooked_size ? raw_size : cooked_size; + contents = (bfd_byte *) bfd_malloc (amt); + if (contents == NULL && amt != 0) goto error_return; /* If we are relaxing, the contents may have already been read into @@ -4587,12 +4588,12 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) external_relocs = section_tdata->external_relocs; else { - external_relocs = (PTR) bfd_malloc ((size_t) external_relocs_size); + external_relocs = (PTR) bfd_malloc (external_relocs_size); if (external_relocs == NULL && external_relocs_size != 0) goto error_return; if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 - || (bfd_read (external_relocs, 1, external_relocs_size, input_bfd) + || (bfd_bread (external_relocs, external_relocs_size, input_bfd) != external_relocs_size)) goto error_return; } @@ -4607,7 +4608,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) if (! bfd_set_section_contents (output_bfd, output_section, (PTR) contents, - input_section->output_offset, + (file_ptr) input_section->output_offset, cooked_size)) goto error_return; @@ -4617,11 +4618,10 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) have output so far. */ if (info->relocateable) { - if (bfd_seek (output_bfd, - (output_section->rel_filepos + - output_section->reloc_count * external_reloc_size), - SEEK_SET) != 0 - || (bfd_write (external_relocs, 1, external_relocs_size, output_bfd) + file_ptr pos = (output_section->rel_filepos + + output_section->reloc_count * external_reloc_size); + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 + || (bfd_bwrite (external_relocs, external_relocs_size, output_bfd) != external_relocs_size)) goto error_return; output_section->reloc_count += input_section->reloc_count; @@ -4661,6 +4661,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) bfd_size_type external_reloc_size; bfd_byte *rbuf; boolean ok; + file_ptr pos; type = link_order->type; section = NULL; @@ -4720,13 +4721,13 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) bfd_size_type size; bfd_reloc_status_type rstat; bfd_byte *buf; - boolean ok; size = bfd_get_reloc_size (rel.howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) return false; - rstat = _bfd_relocate_contents (rel.howto, output_bfd, addend, buf); + rstat = _bfd_relocate_contents (rel.howto, output_bfd, + (bfd_vma) addend, buf); switch (rstat) { case bfd_reloc_ok: @@ -4757,7 +4758,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) rel.addend = 0; - /* Move the information into a internal_reloc structure. */ + /* Move the information into an internal_reloc structure. */ in.r_vaddr = (rel.address + bfd_get_section_vma (output_bfd, output_section)); in.r_type = rel.howto->type; @@ -4785,7 +4786,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) } else { - CONST char *name; + const char *name; name = bfd_get_section_name (output_bfd, section); if (strcmp (name, ".text") == 0) @@ -4828,17 +4829,16 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) /* Get some memory and swap out the reloc. */ external_reloc_size = ecoff_backend (output_bfd)->external_reloc_size; - rbuf = (bfd_byte *) bfd_malloc ((size_t) external_reloc_size); + rbuf = (bfd_byte *) bfd_malloc (external_reloc_size); if (rbuf == (bfd_byte *) NULL) return false; (*ecoff_backend (output_bfd)->swap_reloc_out) (output_bfd, &in, (PTR) rbuf); - ok = (bfd_seek (output_bfd, - (output_section->rel_filepos + - output_section->reloc_count * external_reloc_size), - SEEK_SET) == 0 - && (bfd_write ((PTR) rbuf, 1, external_reloc_size, output_bfd) + pos = (output_section->rel_filepos + + output_section->reloc_count * external_reloc_size); + ok = (bfd_seek (output_bfd, pos, SEEK_SET) == 0 + && (bfd_bwrite ((PTR) rbuf, external_reloc_size, output_bfd) == external_reloc_size)); if (ok) diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c index 37b3538..53d6544 100644 --- a/contrib/binutils/bfd/ecofflink.c +++ b/contrib/binutils/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 1994, 1995, 1996, 1997, 2000 + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . @@ -272,7 +272,7 @@ ecoff_add_bytes (buf, bufend, need) if (want < ALLOC_SIZE) want = ALLOC_SIZE; } - newbuf = (char *) bfd_realloc (*buf, have + want); + newbuf = (char *) bfd_realloc (*buf, (bfd_size_type) have + want); if (newbuf == NULL) return false; *buf = newbuf; @@ -497,8 +497,9 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) struct bfd_link_info *info; { struct accumulate *ainfo; + bfd_size_type amt = sizeof (struct accumulate); - ainfo = (struct accumulate *) bfd_malloc (sizeof (struct accumulate)); + ainfo = (struct accumulate *) bfd_malloc (amt); if (!ainfo) return NULL; if (! bfd_hash_table_init_n (&ainfo->fdr_hash.table, string_hash_newfunc, @@ -621,6 +622,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, long newrfdbase = 0; long oldrfdbase = 0; bfd_byte *fdr_out; + bfd_size_type amt; /* Use section_adjust to hold the value to add to a symbol in a particular section. */ @@ -661,9 +663,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, } fdr_end = fdr_start + input_symhdr->ifdMax * fdr_add; - input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd, - (input_symhdr->ifdMax - * sizeof (RFDT))); + amt = input_symhdr->ifdMax; + amt *= sizeof (RFDT); + input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd, amt); sz = (input_symhdr->crfd + input_symhdr->ifdMax) * external_rfd_size; rfd_out = (bfd_byte *) objalloc_alloc (ainfo->memory, sz); @@ -712,7 +714,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, merged. */ name = input_debug->ss + fdr.issBase + fdr.rss; - lookup = (char *) bfd_malloc (strlen (name) + 20); + lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20); if (lookup == NULL) return false; sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux); @@ -937,10 +939,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, stabs are adjusted correctly. */ if (fdr.cbLine > 0) { + file_ptr pos = input_symhdr->cbLineOffset + fdr.cbLineOffset; if (!add_file_shuffle (ainfo, &ainfo->line, &ainfo->line_end, - input_bfd, - input_symhdr->cbLineOffset + fdr.cbLineOffset, - fdr.cbLine)) + input_bfd, pos, (unsigned long) fdr.cbLine)) return false; fdr.ilineBase = output_symhdr->ilineMax; fdr.cbLineOffset = output_symhdr->cbLine; @@ -949,10 +950,10 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, } if (fdr.caux > 0) { + file_ptr pos = (input_symhdr->cbAuxOffset + + fdr.iauxBase * sizeof (union aux_ext)); if (!add_file_shuffle (ainfo, &ainfo->aux, &ainfo->aux_end, - input_bfd, - (input_symhdr->cbAuxOffset - + fdr.iauxBase * sizeof (union aux_ext)), + input_bfd, pos, fdr.caux * sizeof (union aux_ext))) return false; fdr.iauxBase = output_symhdr->iauxMax; @@ -970,10 +971,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, } else if (fdr.cbSs > 0) { + file_ptr pos = input_symhdr->cbSsOffset + fdr.issBase; if (!add_file_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, - input_bfd, - input_symhdr->cbSsOffset + fdr.issBase, - fdr.cbSs)) + input_bfd, pos, (unsigned long) fdr.cbSs)) return false; fdr.issBase = output_symhdr->issMax; output_symhdr->issMax += fdr.cbSs; @@ -989,21 +989,21 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, BFD_ASSERT (external_pdr_size == input_swap->external_pdr_size); if (fdr.cpd > 0) { + file_ptr pos = (input_symhdr->cbPdOffset + + fdr.ipdFirst * external_pdr_size); + unsigned long size = fdr.cpd * external_pdr_size; if (!add_file_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, - input_bfd, - (input_symhdr->cbPdOffset - + fdr.ipdFirst * external_pdr_size), - fdr.cpd * external_pdr_size)) + input_bfd, pos, size)) return false; } BFD_ASSERT (external_opt_size == input_swap->external_opt_size); if (fdr.copt > 0) { + file_ptr pos = (input_symhdr->cbOptOffset + + fdr.ioptBase * external_opt_size); + unsigned long size = fdr.copt * external_opt_size; if (!add_file_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, - input_bfd, - (input_symhdr->cbOptOffset - + fdr.ioptBase * external_opt_size), - fdr.copt * external_opt_size)) + input_bfd, pos, size)) return false; } } @@ -1201,7 +1201,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, fdr.issBase = output_symhdr->issMax; fdr.cbSs = 0; fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr, - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); if (fdr.rss == -1) return false; fdr.isymBase = output_symhdr->isymMax; @@ -1210,7 +1210,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, symsize = bfd_get_symtab_upper_bound (input_bfd); if (symsize < 0) return false; - symbols = (asymbol **) bfd_alloc (output_bfd, symsize); + symbols = (asymbol **) bfd_alloc (output_bfd, (bfd_size_type) symsize); if (symbols == (asymbol **) NULL) return false; symcount = bfd_canonicalize_symtab (input_bfd, symbols); @@ -1254,7 +1254,8 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, } (*swap_sym_out) (output_bfd, &internal_sym, external_sym); add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, - external_sym, output_swap->external_sym_size); + external_sym, + (unsigned long) output_swap->external_sym_size); ++fdr.csym; ++output_symhdr->isymMax; } @@ -1274,7 +1275,8 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, } (*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr); add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, - external_fdr, output_swap->external_fdr_size); + external_fdr, + (unsigned long) output_swap->external_fdr_size); ++output_symhdr->ifdMax; @@ -1386,7 +1388,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) { if (ecoff_add_bytes ((char **) &debug->external_ext, (char **) &debug->external_ext_end, - (symhdr->iextMax + 1) * external_ext_size) + (symhdr->iextMax + 1) * (size_t) external_ext_size) == false) return false; } @@ -1546,12 +1548,12 @@ ecoff_write_symhdr (abfd, debug, swap, where) SET (cbExtOffset, iextMax, swap->external_ext_size); #undef SET - buff = (PTR) bfd_malloc ((size_t) swap->external_hdr_size); + buff = (PTR) bfd_malloc (swap->external_hdr_size); if (buff == NULL && swap->external_hdr_size != 0) goto error_return; (*swap->swap_hdr_out) (abfd, symhdr, buff); - if (bfd_write (buff, 1, swap->external_hdr_size, abfd) + if (bfd_bwrite (buff, swap->external_hdr_size, abfd) != swap->external_hdr_size) goto error_return; @@ -1585,7 +1587,7 @@ bfd_ecoff_write_debug (abfd, debug, swap, where) #define WRITE(ptr, count, size, offset) \ BFD_ASSERT (symhdr->offset == 0 \ || (bfd_vma) bfd_tell (abfd) == symhdr->offset); \ - if (bfd_write ((PTR) debug->ptr, size, symhdr->count, abfd) \ + if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\ != size * symhdr->count) \ return false; @@ -1594,7 +1596,8 @@ bfd_ecoff_write_debug (abfd, debug, swap, where) WRITE (external_pdr, ipdMax, swap->external_pdr_size, cbPdOffset); WRITE (external_sym, isymMax, swap->external_sym_size, cbSymOffset); WRITE (external_opt, ioptMax, swap->external_opt_size, cbOptOffset); - WRITE (external_aux, iauxMax, sizeof (union aux_ext), cbAuxOffset); + WRITE (external_aux, iauxMax, (bfd_size_type) sizeof (union aux_ext), + cbAuxOffset); WRITE (ss, issMax, sizeof (char), cbSsOffset); WRITE (ssext, issExtMax, sizeof (char), cbSsExtOffset); WRITE (external_fdr, ifdMax, swap->external_fdr_size, cbFdOffset); @@ -1626,14 +1629,16 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) { if (! l->filep) { - if (bfd_write (l->u.memory, 1, l->size, abfd) != l->size) + if (bfd_bwrite (l->u.memory, (bfd_size_type) l->size, abfd) + != l->size) return false; } else { if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0 - || bfd_read (space, 1, l->size, l->u.file.input_bfd) != l->size - || bfd_write (space, 1, l->size, abfd) != l->size) + || bfd_bread (space, (bfd_size_type) l->size, + l->u.file.input_bfd) != l->size + || bfd_bwrite (space, (bfd_size_type) l->size, abfd) != l->size) return false; } total += l->size; @@ -1645,12 +1650,12 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) bfd_byte *s; i = swap->debug_align - (total & (swap->debug_align - 1)); - s = (bfd_byte *) bfd_malloc (i); + s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); if (s == NULL && i != 0) return false; memset ((PTR) s, 0, i); - if (bfd_write ((PTR) s, 1, i, abfd) != i) + if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); return false; @@ -1675,11 +1680,13 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) { struct accumulate *ainfo = (struct accumulate *) handle; PTR space = NULL; + bfd_size_type amt; if (! ecoff_write_symhdr (abfd, debug, swap, where)) goto error_return; - space = (PTR) bfd_malloc (ainfo->largest_file_shuffle); + amt = ainfo->largest_file_shuffle; + space = (PTR) bfd_malloc (amt); if (space == NULL && ainfo->largest_file_shuffle != 0) goto error_return; @@ -1706,7 +1713,7 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL); null = 0; - if (bfd_write ((PTR) &null, 1, 1, abfd) != 1) + if (bfd_bwrite ((PTR) &null, (bfd_size_type) 1, abfd) != 1) goto error_return; total = 1; BFD_ASSERT (ainfo->ss_hash == NULL || ainfo->ss_hash->val == 1); @@ -1717,7 +1724,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) size_t len; len = strlen (sh->root.string); - if (bfd_write ((PTR) sh->root.string, 1, len + 1, abfd) != len + 1) + amt = len + 1; + if (bfd_bwrite ((PTR) sh->root.string, amt, abfd) != amt) goto error_return; total += len + 1; } @@ -1728,11 +1736,11 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) bfd_byte *s; i = swap->debug_align - (total & (swap->debug_align - 1)); - s = (bfd_byte *) bfd_malloc (i); + s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); if (s == NULL && i != 0) goto error_return; memset ((PTR) s, 0, i); - if (bfd_write ((PTR) s, 1, i, abfd) != i) + if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); goto error_return; @@ -1743,8 +1751,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) /* The external strings and symbol are not converted over to using shuffles. FIXME: They probably should be. */ - if (bfd_write (debug->ssext, 1, debug->symbolic_header.issExtMax, abfd) - != (bfd_size_type) debug->symbolic_header.issExtMax) + amt = debug->symbolic_header.issExtMax; + if (bfd_bwrite (debug->ssext, amt, abfd) != amt) goto error_return; if ((debug->symbolic_header.issExtMax & (swap->debug_align - 1)) != 0) { @@ -1753,11 +1761,11 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) i = (swap->debug_align - (debug->symbolic_header.issExtMax & (swap->debug_align - 1))); - s = (bfd_byte *) bfd_malloc (i); + s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); if (s == NULL && i != 0) goto error_return; memset ((PTR) s, 0, i); - if (bfd_write ((PTR) s, 1, i, abfd) != i) + if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); goto error_return; @@ -1773,9 +1781,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) || (debug->symbolic_header.cbExtOffset == (bfd_vma) bfd_tell (abfd))); - if (bfd_write (debug->external_ext, swap->external_ext_size, - debug->symbolic_header.iextMax, abfd) - != debug->symbolic_header.iextMax * swap->external_ext_size) + amt = debug->symbolic_header.iextMax * swap->external_ext_size; + if (bfd_bwrite (debug->external_ext, amt, abfd) != amt) goto error_return; if (space != NULL) @@ -1829,6 +1836,7 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) FDR *fdr_end; boolean stabs; long len; + bfd_size_type amt; fdr_start = debug_info->fdr; fdr_end = fdr_start + debug_info->symbolic_header.ifdMax; @@ -1843,9 +1851,8 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) /* Now, create and fill in the table: */ - line_info->fdrtab = ((struct ecoff_fdrtab_entry*) - bfd_zalloc (abfd, - len * sizeof (struct ecoff_fdrtab_entry))); + amt = (bfd_size_type) len * sizeof (struct ecoff_fdrtab_entry); + line_info->fdrtab = (struct ecoff_fdrtab_entry*) bfd_zalloc (abfd, amt); if (line_info->fdrtab == NULL) return false; line_info->fdrtab_len = len; @@ -1902,7 +1909,7 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) The table is mostly sorted already, but there are cases (e.g., static functions in include files), where this does not hold. Use "odump -PFv" to verify... */ - qsort ((PTR) line_info->fdrtab, len, + qsort ((PTR) line_info->fdrtab, (size_t) len, sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry); return true; @@ -2004,7 +2011,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) char *pdr_ptr; char *best_pdr = NULL; FDR *best_fdr; - bfd_vma best_dist = ~0; + bfd_vma best_dist = ~(bfd_vma) 0; PDR pdr; unsigned char *line_ptr; unsigned char *line_end; @@ -2330,7 +2337,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) { if (line_info->find_buffer != NULL) free (line_info->find_buffer); - buffer = (char *) bfd_malloc (len); + buffer = (char *) bfd_malloc ((bfd_size_type) len); if (buffer == NULL) return false; line_info->find_buffer = buffer; @@ -2429,7 +2436,8 @@ ecoff_collect_shuffle (l, buff) else { if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0 - || bfd_read (buff, 1, l->size, l->u.file.input_bfd) != l->size) + || (bfd_bread (buff, (bfd_size_type) l->size, l->u.file.input_bfd) + != l->size)) return false; } total += l->size; diff --git a/contrib/binutils/bfd/ecoffswap.h b/contrib/binutils/bfd/ecoffswap.h index dd6fa6f..24627d0 100644 --- a/contrib/binutils/bfd/ecoffswap.h +++ b/contrib/binutils/bfd/ecoffswap.h @@ -45,20 +45,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ with the proper byte sex and such. */ #ifdef ECOFF_32 -#define ecoff_get_off bfd_h_get_32 -#define ecoff_put_off bfd_h_put_32 +#define ECOFF_GET_OFF H_GET_32 +#define ECOFF_PUT_OFF H_PUT_32 #endif #ifdef ECOFF_64 -#define ecoff_get_off bfd_h_get_64 -#define ecoff_put_off bfd_h_put_64 +#define ECOFF_GET_OFF H_GET_64 +#define ECOFF_PUT_OFF H_PUT_64 #endif #ifdef ECOFF_SIGNED_32 -#define ecoff_get_off bfd_h_get_signed_32 -#define ecoff_put_off bfd_h_put_signed_32 +#define ECOFF_GET_OFF H_GET_S32 +#define ECOFF_PUT_OFF H_PUT_S32 #endif #ifdef ECOFF_SIGNED_64 -#define ecoff_get_off bfd_h_get_signed_64 -#define ecoff_put_off bfd_h_put_signed_64 +#define ECOFF_GET_OFF H_GET_S64 +#define ECOFF_PUT_OFF H_PUT_S64 #endif /* ECOFF auxiliary information swapping routines. These are the same @@ -104,31 +104,31 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern) *ext = *(struct hdr_ext *) ext_copy; - intern->magic = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->h_magic); - intern->vstamp = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->h_vstamp); - intern->ilineMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ilineMax); - intern->cbLine = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbLine); - intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbLineOffset); - intern->idnMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_idnMax); - intern->cbDnOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbDnOffset); - intern->ipdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ipdMax); - intern->cbPdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbPdOffset); - intern->isymMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_isymMax); - intern->cbSymOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSymOffset); - intern->ioptMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ioptMax); - intern->cbOptOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbOptOffset); - intern->iauxMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iauxMax); - intern->cbAuxOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbAuxOffset); - intern->issMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issMax); - intern->cbSsOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSsOffset); - intern->issExtMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issExtMax); - intern->cbSsExtOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSsExtOffset); - intern->ifdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ifdMax); - intern->cbFdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbFdOffset); - intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_crfd); - intern->cbRfdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbRfdOffset); - intern->iextMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iextMax); - intern->cbExtOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbExtOffset); + intern->magic = H_GET_S16 (abfd, ext->h_magic); + intern->vstamp = H_GET_S16 (abfd, ext->h_vstamp); + intern->ilineMax = H_GET_32 (abfd, ext->h_ilineMax); + intern->cbLine = ECOFF_GET_OFF (abfd, ext->h_cbLine); + intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->h_cbLineOffset); + intern->idnMax = H_GET_32 (abfd, ext->h_idnMax); + intern->cbDnOffset = ECOFF_GET_OFF (abfd, ext->h_cbDnOffset); + intern->ipdMax = H_GET_32 (abfd, ext->h_ipdMax); + intern->cbPdOffset = ECOFF_GET_OFF (abfd, ext->h_cbPdOffset); + intern->isymMax = H_GET_32 (abfd, ext->h_isymMax); + intern->cbSymOffset = ECOFF_GET_OFF (abfd, ext->h_cbSymOffset); + intern->ioptMax = H_GET_32 (abfd, ext->h_ioptMax); + intern->cbOptOffset = ECOFF_GET_OFF (abfd, ext->h_cbOptOffset); + intern->iauxMax = H_GET_32 (abfd, ext->h_iauxMax); + intern->cbAuxOffset = ECOFF_GET_OFF (abfd, ext->h_cbAuxOffset); + intern->issMax = H_GET_32 (abfd, ext->h_issMax); + intern->cbSsOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsOffset); + intern->issExtMax = H_GET_32 (abfd, ext->h_issExtMax); + intern->cbSsExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsExtOffset); + intern->ifdMax = H_GET_32 (abfd, ext->h_ifdMax); + intern->cbFdOffset = ECOFF_GET_OFF (abfd, ext->h_cbFdOffset); + intern->crfd = H_GET_32 (abfd, ext->h_crfd); + intern->cbRfdOffset = ECOFF_GET_OFF (abfd, ext->h_cbRfdOffset); + intern->iextMax = H_GET_32 (abfd, ext->h_iextMax); + intern->cbExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbExtOffset); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -149,34 +149,34 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; - bfd_h_put_signed_16 (abfd, intern->magic, (bfd_byte *)ext->h_magic); - bfd_h_put_signed_16 (abfd, intern->vstamp, (bfd_byte *)ext->h_vstamp); - bfd_h_put_32 (abfd, intern->ilineMax, (bfd_byte *)ext->h_ilineMax); - ecoff_put_off (abfd, intern->cbLine, (bfd_byte *)ext->h_cbLine); - ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->h_cbLineOffset); - bfd_h_put_32 (abfd, intern->idnMax, (bfd_byte *)ext->h_idnMax); - ecoff_put_off (abfd, intern->cbDnOffset, (bfd_byte *)ext->h_cbDnOffset); - bfd_h_put_32 (abfd, intern->ipdMax, (bfd_byte *)ext->h_ipdMax); - ecoff_put_off (abfd, intern->cbPdOffset, (bfd_byte *)ext->h_cbPdOffset); - bfd_h_put_32 (abfd, intern->isymMax, (bfd_byte *)ext->h_isymMax); - ecoff_put_off (abfd, intern->cbSymOffset, (bfd_byte *)ext->h_cbSymOffset); - bfd_h_put_32 (abfd, intern->ioptMax, (bfd_byte *)ext->h_ioptMax); - ecoff_put_off (abfd, intern->cbOptOffset, (bfd_byte *)ext->h_cbOptOffset); - bfd_h_put_32 (abfd, intern->iauxMax, (bfd_byte *)ext->h_iauxMax); - ecoff_put_off (abfd, intern->cbAuxOffset, (bfd_byte *)ext->h_cbAuxOffset); - bfd_h_put_32 (abfd, intern->issMax, (bfd_byte *)ext->h_issMax); - ecoff_put_off (abfd, intern->cbSsOffset, (bfd_byte *)ext->h_cbSsOffset); - bfd_h_put_32 (abfd, intern->issExtMax, (bfd_byte *)ext->h_issExtMax); - ecoff_put_off (abfd, intern->cbSsExtOffset, (bfd_byte *)ext->h_cbSsExtOffset); - bfd_h_put_32 (abfd, intern->ifdMax, (bfd_byte *)ext->h_ifdMax); - ecoff_put_off (abfd, intern->cbFdOffset, (bfd_byte *)ext->h_cbFdOffset); - bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->h_crfd); - ecoff_put_off (abfd, intern->cbRfdOffset, (bfd_byte *)ext->h_cbRfdOffset); - bfd_h_put_32 (abfd, intern->iextMax, (bfd_byte *)ext->h_iextMax); - ecoff_put_off (abfd, intern->cbExtOffset, (bfd_byte *)ext->h_cbExtOffset); + H_PUT_S16 (abfd, intern->magic, ext->h_magic); + H_PUT_S16 (abfd, intern->vstamp, ext->h_vstamp); + H_PUT_32 (abfd, intern->ilineMax, ext->h_ilineMax); + ECOFF_PUT_OFF (abfd, intern->cbLine, ext->h_cbLine); + ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->h_cbLineOffset); + H_PUT_32 (abfd, intern->idnMax, ext->h_idnMax); + ECOFF_PUT_OFF (abfd, intern->cbDnOffset, ext->h_cbDnOffset); + H_PUT_32 (abfd, intern->ipdMax, ext->h_ipdMax); + ECOFF_PUT_OFF (abfd, intern->cbPdOffset, ext->h_cbPdOffset); + H_PUT_32 (abfd, intern->isymMax, ext->h_isymMax); + ECOFF_PUT_OFF (abfd, intern->cbSymOffset, ext->h_cbSymOffset); + H_PUT_32 (abfd, intern->ioptMax, ext->h_ioptMax); + ECOFF_PUT_OFF (abfd, intern->cbOptOffset, ext->h_cbOptOffset); + H_PUT_32 (abfd, intern->iauxMax, ext->h_iauxMax); + ECOFF_PUT_OFF (abfd, intern->cbAuxOffset, ext->h_cbAuxOffset); + H_PUT_32 (abfd, intern->issMax, ext->h_issMax); + ECOFF_PUT_OFF (abfd, intern->cbSsOffset, ext->h_cbSsOffset); + H_PUT_32 (abfd, intern->issExtMax, ext->h_issExtMax); + ECOFF_PUT_OFF (abfd, intern->cbSsExtOffset, ext->h_cbSsExtOffset); + H_PUT_32 (abfd, intern->ifdMax, ext->h_ifdMax); + ECOFF_PUT_OFF (abfd, intern->cbFdOffset, ext->h_cbFdOffset); + H_PUT_32 (abfd, intern->crfd, ext->h_crfd); + ECOFF_PUT_OFF (abfd, intern->cbRfdOffset, ext->h_cbRfdOffset); + H_PUT_32 (abfd, intern->iextMax, ext->h_iextMax); + ECOFF_PUT_OFF (abfd, intern->cbExtOffset, ext->h_cbExtOffset); #ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) + if (memcmp ((char *) ext, (char *) intern, sizeof (*intern)) != 0) abort (); #endif } @@ -193,55 +193,58 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) *ext = *(struct fdr_ext *) ext_copy; - intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->f_adr); - intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss); + intern->adr = ECOFF_GET_OFF (abfd, ext->f_adr); + intern->rss = H_GET_32 (abfd, ext->f_rss); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) if (intern->rss == (signed long) 0xffffffff) intern->rss = -1; #endif - intern->issBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_issBase); - intern->cbSs = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbSs); - intern->isymBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_isymBase); - intern->csym = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_csym); - intern->ilineBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ilineBase); - intern->cline = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cline); - intern->ioptBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ioptBase); - intern->copt = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_copt); + intern->issBase = H_GET_32 (abfd, ext->f_issBase); + intern->cbSs = ECOFF_GET_OFF (abfd, ext->f_cbSs); + intern->isymBase = H_GET_32 (abfd, ext->f_isymBase); + intern->csym = H_GET_32 (abfd, ext->f_csym); + intern->ilineBase = H_GET_32 (abfd, ext->f_ilineBase); + intern->cline = H_GET_32 (abfd, ext->f_cline); + intern->ioptBase = H_GET_32 (abfd, ext->f_ioptBase); + intern->copt = H_GET_32 (abfd, ext->f_copt); #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) - intern->ipdFirst = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_ipdFirst); - intern->cpd = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_cpd); + intern->ipdFirst = H_GET_16 (abfd, ext->f_ipdFirst); + intern->cpd = H_GET_16 (abfd, ext->f_cpd); #endif #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - intern->ipdFirst = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ipdFirst); - intern->cpd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cpd); + intern->ipdFirst = H_GET_32 (abfd, ext->f_ipdFirst); + intern->cpd = H_GET_32 (abfd, ext->f_cpd); #endif - intern->iauxBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_iauxBase); - intern->caux = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_caux); - intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase); - intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd); + intern->iauxBase = H_GET_32 (abfd, ext->f_iauxBase); + intern->caux = H_GET_32 (abfd, ext->f_caux); + intern->rfdBase = H_GET_32 (abfd, ext->f_rfdBase); + intern->crfd = H_GET_32 (abfd, ext->f_crfd); /* now the fun stuff... */ - if (bfd_header_big_endian (abfd)) { - intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG) - >> FDR_BITS1_LANG_SH_BIG; - intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_BIG); - intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_BIG); - intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_BIG); - intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_BIG) - >> FDR_BITS2_GLEVEL_SH_BIG; - } else { - intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_LITTLE) - >> FDR_BITS1_LANG_SH_LITTLE; - intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_LITTLE); - intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_LITTLE); - intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_LITTLE); - intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_LITTLE) - >> FDR_BITS2_GLEVEL_SH_LITTLE; - } + if (bfd_header_big_endian (abfd)) + { + intern->lang = ((ext->f_bits1[0] & FDR_BITS1_LANG_BIG) + >> FDR_BITS1_LANG_SH_BIG); + intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_BIG); + intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_BIG); + intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_BIG); + intern->glevel = ((ext->f_bits2[0] & FDR_BITS2_GLEVEL_BIG) + >> FDR_BITS2_GLEVEL_SH_BIG); + } + else + { + intern->lang = ((ext->f_bits1[0] & FDR_BITS1_LANG_LITTLE) + >> FDR_BITS1_LANG_SH_LITTLE); + intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_LITTLE); + intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_LITTLE); + intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_LITTLE); + intern->glevel = ((ext->f_bits2[0] & FDR_BITS2_GLEVEL_LITTLE) + >> FDR_BITS2_GLEVEL_SH_LITTLE); + } intern->reserved = 0; - intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbLineOffset); - intern->cbLine = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbLine); + intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->f_cbLineOffset); + intern->cbLine = ECOFF_GET_OFF (abfd, ext->f_cbLine); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -262,54 +265,57 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; /* Make it reasonable to do in-place. */ - ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->f_adr); - bfd_h_put_32 (abfd, intern->rss, (bfd_byte *)ext->f_rss); - bfd_h_put_32 (abfd, intern->issBase, (bfd_byte *)ext->f_issBase); - ecoff_put_off (abfd, intern->cbSs, (bfd_byte *)ext->f_cbSs); - bfd_h_put_32 (abfd, intern->isymBase, (bfd_byte *)ext->f_isymBase); - bfd_h_put_32 (abfd, intern->csym, (bfd_byte *)ext->f_csym); - bfd_h_put_32 (abfd, intern->ilineBase, (bfd_byte *)ext->f_ilineBase); - bfd_h_put_32 (abfd, intern->cline, (bfd_byte *)ext->f_cline); - bfd_h_put_32 (abfd, intern->ioptBase, (bfd_byte *)ext->f_ioptBase); - bfd_h_put_32 (abfd, intern->copt, (bfd_byte *)ext->f_copt); + ECOFF_PUT_OFF (abfd, intern->adr, ext->f_adr); + H_PUT_32 (abfd, intern->rss, ext->f_rss); + H_PUT_32 (abfd, intern->issBase, ext->f_issBase); + ECOFF_PUT_OFF (abfd, intern->cbSs, ext->f_cbSs); + H_PUT_32 (abfd, intern->isymBase, ext->f_isymBase); + H_PUT_32 (abfd, intern->csym, ext->f_csym); + H_PUT_32 (abfd, intern->ilineBase, ext->f_ilineBase); + H_PUT_32 (abfd, intern->cline, ext->f_cline); + H_PUT_32 (abfd, intern->ioptBase, ext->f_ioptBase); + H_PUT_32 (abfd, intern->copt, ext->f_copt); #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) - bfd_h_put_16 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst); - bfd_h_put_16 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd); + H_PUT_16 (abfd, intern->ipdFirst, ext->f_ipdFirst); + H_PUT_16 (abfd, intern->cpd, ext->f_cpd); #endif #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - bfd_h_put_32 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst); - bfd_h_put_32 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd); + H_PUT_32 (abfd, intern->ipdFirst, ext->f_ipdFirst); + H_PUT_32 (abfd, intern->cpd, ext->f_cpd); #endif - bfd_h_put_32 (abfd, intern->iauxBase, (bfd_byte *)ext->f_iauxBase); - bfd_h_put_32 (abfd, intern->caux, (bfd_byte *)ext->f_caux); - bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase); - bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd); + H_PUT_32 (abfd, intern->iauxBase, ext->f_iauxBase); + H_PUT_32 (abfd, intern->caux, ext->f_caux); + H_PUT_32 (abfd, intern->rfdBase, ext->f_rfdBase); + H_PUT_32 (abfd, intern->crfd, ext->f_crfd); /* now the fun stuff... */ - if (bfd_header_big_endian (abfd)) { - ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG) - & FDR_BITS1_LANG_BIG) - | (intern->fMerge ? FDR_BITS1_FMERGE_BIG : 0) - | (intern->fReadin ? FDR_BITS1_FREADIN_BIG : 0) - | (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_BIG : 0)); - ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_BIG) - & FDR_BITS2_GLEVEL_BIG); - ext->f_bits2[1] = 0; - ext->f_bits2[2] = 0; - } else { - ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_LITTLE) - & FDR_BITS1_LANG_LITTLE) - | (intern->fMerge ? FDR_BITS1_FMERGE_LITTLE : 0) - | (intern->fReadin ? FDR_BITS1_FREADIN_LITTLE : 0) - | (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_LITTLE : 0)); - ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_LITTLE) - & FDR_BITS2_GLEVEL_LITTLE); - ext->f_bits2[1] = 0; - ext->f_bits2[2] = 0; - } + if (bfd_header_big_endian (abfd)) + { + ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG) + & FDR_BITS1_LANG_BIG) + | (intern->fMerge ? FDR_BITS1_FMERGE_BIG : 0) + | (intern->fReadin ? FDR_BITS1_FREADIN_BIG : 0) + | (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_BIG : 0)); + ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_BIG) + & FDR_BITS2_GLEVEL_BIG); + ext->f_bits2[1] = 0; + ext->f_bits2[2] = 0; + } + else + { + ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_LITTLE) + & FDR_BITS1_LANG_LITTLE) + | (intern->fMerge ? FDR_BITS1_FMERGE_LITTLE : 0) + | (intern->fReadin ? FDR_BITS1_FREADIN_LITTLE : 0) + | (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_LITTLE : 0)); + ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_LITTLE) + & FDR_BITS2_GLEVEL_LITTLE); + ext->f_bits2[1] = 0; + ext->f_bits2[2] = 0; + } - ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->f_cbLineOffset); - ecoff_put_off (abfd, intern->cbLine, (bfd_byte *)ext->f_cbLine); + ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->f_cbLineOffset); + ECOFF_PUT_OFF (abfd, intern->cbLine, ext->f_cbLine); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -333,26 +339,23 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) memset ((PTR) intern, 0, sizeof (*intern)); - intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr); - intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym); - intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline); - intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask); - intern->regoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_regoffset); - intern->iopt = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->p_iopt); - intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask); - intern->fregoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_fregoffset); - intern->frameoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_frameoffset); - intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg); - intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg); - intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow); - intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh); - intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset); + intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr); + intern->isym = H_GET_32 (abfd, ext->p_isym); + intern->iline = H_GET_32 (abfd, ext->p_iline); + intern->regmask = H_GET_32 (abfd, ext->p_regmask); + intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset); + intern->iopt = H_GET_S32 (abfd, ext->p_iopt); + intern->fregmask = H_GET_32 (abfd, ext->p_fregmask); + intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset); + intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset); + intern->framereg = H_GET_16 (abfd, ext->p_framereg); + intern->pcreg = H_GET_16 (abfd, ext->p_pcreg); + intern->lnLow = H_GET_32 (abfd, ext->p_lnLow); + intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh); + intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - intern->gp_prologue = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_gp_prologue); + intern->gp_prologue = H_GET_8 (abfd, ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { intern->gp_used = 0 != (ext->p_bits1[0] & PDR_BITS1_GP_USED_BIG); @@ -373,7 +376,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) | ((ext->p_bits2[0] & PDR_BITS2_RESERVED_LITTLE) << PDR_BITS2_RESERVED_SH_LEFT_LITTLE)); } - intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff); + intern->localoff = H_GET_8 (abfd, ext->p_localoff); #endif #ifdef TEST @@ -395,23 +398,24 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; /* Make it reasonable to do in-place. */ - ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); - bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); - bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); - bfd_h_put_32 (abfd, intern->regmask, (bfd_byte *)ext->p_regmask); - bfd_h_put_32 (abfd, intern->regoffset, (bfd_byte *)ext->p_regoffset); - bfd_h_put_32 (abfd, intern->iopt, (bfd_byte *)ext->p_iopt); - bfd_h_put_32 (abfd, intern->fregmask, (bfd_byte *)ext->p_fregmask); - bfd_h_put_32 (abfd, intern->fregoffset, (bfd_byte *)ext->p_fregoffset); - bfd_h_put_32 (abfd, intern->frameoffset, (bfd_byte *)ext->p_frameoffset); - bfd_h_put_16 (abfd, intern->framereg, (bfd_byte *)ext->p_framereg); - bfd_h_put_16 (abfd, intern->pcreg, (bfd_byte *)ext->p_pcreg); - bfd_h_put_32 (abfd, intern->lnLow, (bfd_byte *)ext->p_lnLow); - bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh); - ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset); + ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr); + H_PUT_32 (abfd, intern->isym, ext->p_isym); + H_PUT_32 (abfd, intern->iline, ext->p_iline); + H_PUT_32 (abfd, intern->regmask, ext->p_regmask); + H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset); + H_PUT_32 (abfd, intern->iopt, ext->p_iopt); + H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask); + H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset); + H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset); + H_PUT_16 (abfd, intern->framereg, ext->p_framereg); + H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg); + H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow); + H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh); + ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - bfd_h_put_8 (abfd, intern->gp_prologue, (bfd_byte *) ext->p_gp_prologue); + H_PUT_8 (abfd, intern->gp_prologue, ext->p_gp_prologue); + if (bfd_header_big_endian (abfd)) { ext->p_bits1[0] = ((intern->gp_used ? PDR_BITS1_GP_USED_BIG : 0) @@ -434,7 +438,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR_BITS2_RESERVED_SH_LEFT_LITTLE) & PDR_BITS2_RESERVED_LITTLE); } - bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff); + H_PUT_8 (abfd, intern->localoff, ext->p_localoff); #endif #ifdef TEST @@ -458,23 +462,20 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) *ext = *(struct pdr_ext *) ext_copy; - intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr); - intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym); - intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline); - intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask); - intern->regoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_regoffset); - intern->iopt = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->p_iopt); - intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask); - intern->fregoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_fregoffset); - intern->frameoffset = bfd_h_get_signed_32 (abfd, - (bfd_byte *)ext->p_frameoffset); - intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg); - intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg); - intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow); - intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh); - intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset); + intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr); + intern->isym = H_GET_32 (abfd, ext->p_isym); + intern->iline = H_GET_32 (abfd, ext->p_iline); + intern->regmask = H_GET_32 (abfd, ext->p_regmask); + intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset); + intern->iopt = H_GET_S32 (abfd, ext->p_iopt); + intern->fregmask = H_GET_32 (abfd, ext->p_fregmask); + intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset); + intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset); + intern->framereg = H_GET_16 (abfd, ext->p_framereg); + intern->pcreg = H_GET_16 (abfd, ext->p_pcreg); + intern->lnLow = H_GET_32 (abfd, ext->p_lnLow); + intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh); + intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -495,20 +496,20 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; /* Make it reasonable to do in-place. */ - ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); - bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); - bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); - bfd_h_put_32 (abfd, intern->regmask, (bfd_byte *)ext->p_regmask); - bfd_h_put_32 (abfd, intern->regoffset, (bfd_byte *)ext->p_regoffset); - bfd_h_put_32 (abfd, intern->iopt, (bfd_byte *)ext->p_iopt); - bfd_h_put_32 (abfd, intern->fregmask, (bfd_byte *)ext->p_fregmask); - bfd_h_put_32 (abfd, intern->fregoffset, (bfd_byte *)ext->p_fregoffset); - bfd_h_put_32 (abfd, intern->frameoffset, (bfd_byte *)ext->p_frameoffset); - bfd_h_put_16 (abfd, intern->framereg, (bfd_byte *)ext->p_framereg); - bfd_h_put_16 (abfd, intern->pcreg, (bfd_byte *)ext->p_pcreg); - bfd_h_put_32 (abfd, intern->lnLow, (bfd_byte *)ext->p_lnLow); - bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh); - ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset); + ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr); + H_PUT_32 (abfd, intern->isym, ext->p_isym); + H_PUT_32 (abfd, intern->iline, ext->p_iline); + H_PUT_32 (abfd, intern->regmask, ext->p_regmask); + H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset); + H_PUT_32 (abfd, intern->iopt, ext->p_iopt); + H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask); + H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset); + H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset); + H_PUT_16 (abfd, intern->framereg, ext->p_framereg); + H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg); + H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow); + H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh); + ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -529,8 +530,8 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) *ext = *(struct sym_ext *) ext_copy; - intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss); - intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value); + intern->iss = H_GET_32 (abfd, ext->s_iss); + intern->value = ECOFF_GET_OFF (abfd, ext->s_value); /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { @@ -579,8 +580,8 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; /* Make it reasonable to do in-place. */ - bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss); - ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value); + H_PUT_32 (abfd, intern->iss, ext->s_iss); + ECOFF_PUT_OFF (abfd, intern->value, ext->s_value); /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { @@ -640,10 +641,10 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) intern->reserved = 0; #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) - intern->ifd = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->es_ifd); + intern->ifd = H_GET_S16 (abfd, ext->es_ifd); #endif #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - intern->ifd = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->es_ifd); + intern->ifd = H_GET_S32 (abfd, ext->es_ifd); #endif ecoff_swap_sym_in (abfd, &ext->es_asym, &intern->asym); @@ -689,10 +690,10 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) } #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) - bfd_h_put_signed_16 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); + H_PUT_S16 (abfd, intern->ifd, ext->es_ifd); #endif #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - bfd_h_put_signed_32 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); + H_PUT_S32 (abfd, intern->ifd, ext->es_ifd); #endif ecoff_swap_sym_out (abfd, &intern->asym, &ext->es_asym); @@ -713,7 +714,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern) { struct rfd_ext *ext = (struct rfd_ext *) ext_ptr; - *intern = bfd_h_get_32 (abfd, (bfd_byte *)ext->rfd); + *intern = H_GET_32 (abfd, ext->rfd); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -731,7 +732,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr) { struct rfd_ext *ext = (struct rfd_ext *) ext_ptr; - bfd_h_put_32 (abfd, *intern, (bfd_byte *)ext->rfd); + H_PUT_32 (abfd, *intern, ext->rfd); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -772,7 +773,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern) _bfd_ecoff_swap_rndx_in (bfd_header_big_endian (abfd), &ext->o_rndx, &intern->rndx); - intern->offset = bfd_h_get_32 (abfd, (bfd_byte *) ext->o_offset); + intern->offset = H_GET_32 (abfd, ext->o_offset); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -811,7 +812,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr) _bfd_ecoff_swap_rndx_out (bfd_header_big_endian (abfd), &intern->rndx, &ext->o_rndx); - bfd_h_put_32 (abfd, intern->value, (bfd_byte *) ext->o_offset); + H_PUT_32 (abfd, intern->value, ext->o_offset); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -831,8 +832,8 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern) *ext = *(struct dnr_ext *) ext_copy; - intern->rfd = bfd_h_get_32 (abfd, (bfd_byte *) ext->d_rfd); - intern->index = bfd_h_get_32 (abfd, (bfd_byte *) ext->d_index); + intern->rfd = H_GET_32 (abfd, ext->d_rfd); + intern->index = H_GET_32 (abfd, ext->d_index); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -853,8 +854,8 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr) *intern = *intern_copy; /* Make it reasonable to do in-place. */ - bfd_h_put_32 (abfd, intern->rfd, (bfd_byte *) ext->d_rfd); - bfd_h_put_32 (abfd, intern->index, (bfd_byte *) ext->d_index); + H_PUT_32 (abfd, intern->rfd, ext->d_rfd); + H_PUT_32 (abfd, intern->index, ext->d_index); #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h index b162290..0bd559f 100644 --- a/contrib/binutils/bfd/elf-bfd.h +++ b/contrib/binutils/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -28,22 +28,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfdlink.h" /* The number of entries in a section is its size divided by the size - of a single entry. This is normally only applicaable to reloc and + of a single entry. This is normally only applicable to reloc and symbol table sections. */ #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) /* If size isn't specified as 64 or 32, NAME macro should fail. */ +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ #ifndef NAME #if ARCH_SIZE==64 -#define NAME(x,y) CAT4(x,64,_,y) +#define NAME(x,y) CONCAT4 (x,64,_,y) #endif #if ARCH_SIZE==32 -#define NAME(x,y) CAT4(x,32,_,y) +#define NAME(x,y) CONCAT4 (x,32,_,y) #endif #endif #ifndef NAME -#define NAME(x,y) CAT4(x,NOSIZE,_,y) +#define NAME(x,y) CONCAT4 (x,NOSIZE,_,y) #endif #define ElfNAME(X) NAME(Elf,X) @@ -76,6 +79,8 @@ typedef struct } elf_symbol_type; +struct elf_strtab_hash; + /* ELF linker hash table entries. */ struct elf_link_hash_entry @@ -86,9 +91,6 @@ struct elf_link_hash_entry set to -2 if the symbol is used by a reloc. */ long indx; - /* Symbol size. */ - bfd_size_type size; - /* Symbol index as a dynamic symbol. Initialized to -1, and remains -1 if this is not a dynamic symbol. */ /* ??? Note that this is consistently used as a synonym for tests @@ -106,31 +108,14 @@ struct elf_link_hash_entry /* String table index in .dynstr if this is a dynamic symbol. */ unsigned long dynstr_index; + /* Hash value of the name computed using the ELF hash function. */ + unsigned long elf_hash_value; + /* If this is a weak defined symbol from a dynamic object, this field points to a defined symbol with the same value, if there is one. Otherwise it is NULL. */ struct elf_link_hash_entry *weakdef; - /* If this symbol requires an entry in the global offset table, the - processor specific backend uses this field to track usage and - final offset. We use a union and two names primarily to document - the intent of any particular piece of code. The field should be - used as a count until size_dynamic_sections, at which point the - contents of the .got is fixed. Afterward, if this field is -1, - then the symbol does not require a global offset table entry. */ - union - { - bfd_signed_vma refcount; - bfd_vma offset; - } got; - - /* Same, but tracks a procedure linkage table entry. */ - union - { - bfd_signed_vma refcount; - bfd_vma offset; - } plt; - /* If this symbol is used in the linker created sections, the processor specific backend uses this field to map the field into the offset from the beginning of the section. */ @@ -159,15 +144,35 @@ struct elf_link_hash_entry /* Virtual table derivation info. */ struct elf_link_hash_entry *vtable_parent; + /* If this symbol requires an entry in the global offset table, the + processor specific backend uses this field to track usage and + final offset. We use a union and two names primarily to document + the intent of any particular piece of code. The field should be + used as a count until size_dynamic_sections, at which point the + contents of the .got is fixed. Afterward, if this field is -1, + then the symbol does not require a global offset table entry. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } got; + + /* Same, but tracks a procedure linkage table entry. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } plt; + + /* Symbol size. */ + bfd_size_type size; + /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */ char type; /* Symbol st_other value, symbol visibility. */ unsigned char other; - /* Hash value of the name computed using the ELF hash function. */ - unsigned long elf_hash_value; - /* Some flags; legal values follow. */ unsigned short elf_link_hash_flags; /* Symbol is referenced by a non-shared object. */ @@ -218,36 +223,65 @@ struct elf_link_local_dynamic_entry Elf_Internal_Sym isym; }; +enum elf_link_info_type +{ + ELF_INFO_TYPE_NONE, + ELF_INFO_TYPE_STABS, + ELF_INFO_TYPE_MERGE, + ELF_INFO_TYPE_EH_FRAME, + ELF_INFO_TYPE_EH_FRAME_HDR, + ELF_INFO_TYPE_LAST +}; + /* ELF linker hash table. */ struct elf_link_hash_table { struct bfd_link_hash_table root; + /* Whether we have created the special dynamic sections required when linking against or generating a shared object. */ boolean dynamic_sections_created; + /* The BFD used to hold special sections created by the linker. This will be the first BFD found which requires these sections to be created. */ bfd *dynobj; + + /* The value to use when initialising got.refcount/offset and + plt.refcount/offset in an elf_link_hash_entry. Set to zero when + the values are refcounts. Set to -1 in size_dynamic_sections + when the values may be offsets. */ + bfd_signed_vma init_refcount; + /* The number of symbols found in the link which must be put into the .dynsym section. */ bfd_size_type dynsymcount; + /* The string table of dynamic symbols, which becomes the .dynstr section. */ - struct bfd_strtab_hash *dynstr; + struct elf_strtab_hash *dynstr; + /* The number of buckets in the hash table in the .hash section. This is based on the number of dynamic symbols. */ bfd_size_type bucketcount; + /* A linked list of DT_NEEDED names found in dynamic objects included in the link. */ struct bfd_link_needed_list *needed; + /* The _GLOBAL_OFFSET_TABLE_ symbol. */ struct elf_link_hash_entry *hgot; + /* A pointer to information used to link stabs in sections. */ PTR stab_info; + + /* A pointer to information used to merge SEC_MERGE sections. */ + PTR merge_info; + /* A linked list of local symbols to be added to .dynsym. */ struct elf_link_local_dynamic_entry *dynlocal; + /* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic objects included in the link. */ struct bfd_link_needed_list *runpath; @@ -271,6 +305,20 @@ struct elf_link_hash_table /* Get the ELF linker hash table from a link_info structure. */ #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash)) + +/* Returns true if the hash table is a struct elf_link_hash_table. */ +#define is_elf_hash_table(p) \ + ((p)->hash->type == bfd_link_elf_hash_table) + +/* Used by bfd_section_from_r_symndx to cache a small number of local + symbol to section mappings. */ +#define LOCAL_SYM_CACHE_SIZE 32 +struct sym_sec_cache +{ + bfd *abfd; + unsigned long indx[LOCAL_SYM_CACHE_SIZE]; + asection *sec[LOCAL_SYM_CACHE_SIZE]; +}; /* Constant information held for an ELF backend. */ @@ -287,15 +335,22 @@ struct elf_size_info { unsigned char arch_size, file_align; unsigned char elfclass, ev_current; - int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); - boolean (*write_shdrs_and_ehdr) PARAMS ((bfd *)); - void (*write_relocs) PARAMS ((bfd *, asection *, PTR)); - void (*swap_symbol_out) PARAMS ((bfd *, const Elf_Internal_Sym *, PTR)); + int (*write_out_phdrs) + PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); + boolean (*write_shdrs_and_ehdr) + PARAMS ((bfd *)); + void (*write_relocs) + PARAMS ((bfd *, asection *, PTR)); + void (*swap_symbol_out) + PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); boolean (*slurp_reloc_table) PARAMS ((bfd *, asection *, asymbol **, boolean)); - long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean)); - void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); - void (*swap_dyn_out) PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + long (*slurp_symbol_table) + PARAMS ((bfd *, asymbol **, boolean)); + void (*swap_dyn_in) + PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + void (*swap_dyn_out) + PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); /* This function, if defined, is called to swap in a REL relocation. If an external relocation corresponds to more than @@ -329,6 +384,25 @@ struct elf_size_info { ? (elf_symbol_type *) (S) \ : 0) +enum elf_reloc_type_class { + reloc_class_normal, + reloc_class_relative, + reloc_class_plt, + reloc_class_copy +}; + +struct elf_reloc_cookie +{ + Elf_Internal_Rela *rels, *rel, *relend; + PTR locsyms; + PTR locsym_shndx; + bfd *abfd; + size_t locsymcount; + size_t extsymoff; + struct elf_link_hash_entry **sym_hashes; + boolean bad_symtab; +}; + struct elf_backend_data { /* The architecture for this backend. */ @@ -342,20 +416,21 @@ struct elf_backend_data /* A function to translate an ELF RELA relocation to a BFD arelent structure. */ - void (*elf_info_to_howto) PARAMS ((bfd *, arelent *, - Elf_Internal_Rela *)); + void (*elf_info_to_howto) + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); /* A function to translate an ELF REL relocation to a BFD arelent structure. */ - void (*elf_info_to_howto_rel) PARAMS ((bfd *, arelent *, - Elf_Internal_Rel *)); + void (*elf_info_to_howto_rel) + PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); /* A function to determine whether a symbol is global when partitioning the symbol table into local and global symbols. This should be NULL for most targets, in which case the correct thing will be done. MIPS ELF, at least on the Irix 5, has special requirements. */ - boolean (*elf_backend_sym_is_global) PARAMS ((bfd *, asymbol *)); + boolean (*elf_backend_sym_is_global) + PARAMS ((bfd *, asymbol *)); /* The remaining functions are hooks which are called only if they are not NULL. */ @@ -366,59 +441,59 @@ struct elf_backend_data this is called elf_elfheader is set, but anything else should be used with caution. If this returns false, the check_format routine will return a bfd_error_wrong_format error. */ - boolean (*elf_backend_object_p) PARAMS ((bfd *)); + boolean (*elf_backend_object_p) + PARAMS ((bfd *)); /* A function to do additional symbol processing when reading the ELF symbol table. This is where any processor-specific special section indices are handled. */ - void (*elf_backend_symbol_processing) PARAMS ((bfd *, asymbol *)); + void (*elf_backend_symbol_processing) + PARAMS ((bfd *, asymbol *)); /* A function to do additional symbol processing after reading the entire ELF symbol table. */ - boolean (*elf_backend_symbol_table_processing) PARAMS ((bfd *, - elf_symbol_type *, - unsigned int)); + boolean (*elf_backend_symbol_table_processing) + PARAMS ((bfd *, elf_symbol_type *, unsigned int)); /* A function to set the type of the info field. Processor-specific types should be handled here. */ - int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int)); + int (*elf_backend_get_symbol_type) + PARAMS (( Elf_Internal_Sym *, int)); /* A function to do additional processing on the ELF section header just before writing it out. This is used to set the flags and type fields for some sections, or to actually write out data for unusual sections. */ - boolean (*elf_backend_section_processing) PARAMS ((bfd *, - Elf32_Internal_Shdr *)); + boolean (*elf_backend_section_processing) + PARAMS ((bfd *, Elf32_Internal_Shdr *)); /* A function to handle unusual section types when creating BFD sections from ELF sections. */ - boolean (*elf_backend_section_from_shdr) PARAMS ((bfd *, - Elf32_Internal_Shdr *, - char *)); + boolean (*elf_backend_section_from_shdr) + PARAMS ((bfd *, Elf32_Internal_Shdr *, char *)); /* A function to convert machine dependent section header flags to BFD internal section header flags. */ - boolean (*elf_backend_section_flags) PARAMS ((flagword *, - Elf32_Internal_Shdr *)); + boolean (*elf_backend_section_flags) + PARAMS ((flagword *, Elf32_Internal_Shdr *)); /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ - boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *, - Elf32_Internal_Phdr *, - int)); + boolean (*elf_backend_section_from_phdr) + PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); /* A function to set up the ELF section header for a BFD section in preparation for writing it out. This is where the flags and type fields are set for unusual sections. */ - boolean (*elf_backend_fake_sections) PARAMS ((bfd *, Elf32_Internal_Shdr *, - asection *)); + boolean (*elf_backend_fake_sections) + PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); /* A function to get the ELF section index for a BFD section. If this returns true, the section was found. If it is a normal ELF section, *RETVAL should be left unchanged. If it is not a normal ELF section *RETVAL should be set to the SHN_xxxx index. */ boolean (*elf_backend_section_from_bfd_section) - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *retval)); + PARAMS ((bfd *, asection *, int *retval)); /* If this field is not NULL, it is called by the add_symbols phase of a link just before adding a symbol to the global linker hash @@ -565,11 +640,13 @@ struct elf_backend_data /* This function is called by get_program_header_size. It should return the number of additional program segments which this BFD will need. It should return -1 on error. */ - int (*elf_backend_additional_program_headers) PARAMS ((bfd *)); + int (*elf_backend_additional_program_headers) + PARAMS ((bfd *)); /* This function is called to modify an existing segment map in a backend specific fashion. */ - boolean (*elf_backend_modify_segment_map) PARAMS ((bfd *)); + boolean (*elf_backend_modify_segment_map) + PARAMS ((bfd *)); /* This function is called during section gc to discover the section a particular relocation refers to. It need not be defined for hosts @@ -603,18 +680,65 @@ struct elf_backend_data not handled in the hash table. */ boolean (*elf_backend_output_arch_syms) PARAMS ((bfd *, struct bfd_link_info *, PTR, - boolean (*) PARAMS ((PTR, const char *, - Elf_Internal_Sym *, asection *)))); + boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); - /* Copy any information related to dynamic linking from a pre-existing - symbol IND to a newly created symbol DIR. */ + /* Copy any information related to dynamic linking from a pre-existing + symbol to a newly created symbol. Also called to copy flags and + other back-end info to a weakdef, in which case the symbol is not + newly created and plt/got refcounts and dynamic indices should not + be copied. */ void (*elf_backend_copy_indirect_symbol) PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); /* Modify any information related to dynamic linking such that the symbol is not exported. */ void (*elf_backend_hide_symbol) - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); + + /* Emit relocations. Overrides default routine for emitting relocs, + except during a relocatable link, or if all relocs are being emitted. */ + void (*elf_backend_emit_relocs) + PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); + + /* Count relocations. Not called for relocatable links + or if all relocs are being preserved in the output. */ + unsigned int (*elf_backend_count_relocs) + PARAMS ((asection *, Elf_Internal_Rela *)); + + /* This function, if defined, is called when an NT_PRSTATUS note is found + in a core file. */ + boolean (*elf_backend_grok_prstatus) + PARAMS ((bfd *, Elf_Internal_Note *)); + + /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO + note is found in a core file. */ + boolean (*elf_backend_grok_psinfo) + PARAMS ((bfd *, Elf_Internal_Note *)); + + /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ + void (* elf_backend_sprintf_vma) + PARAMS ((bfd *, char *, bfd_vma)); + void (* elf_backend_fprintf_vma) + PARAMS ((bfd *, PTR, bfd_vma)); + + /* This function returns class of a reloc type. */ + enum elf_reloc_type_class (*elf_backend_reloc_type_class) + PARAMS ((const Elf_Internal_Rela *)); + + /* This function, if defined, removes information about discarded functions + from other sections which mention them. */ + boolean (*elf_backend_discard_info) + PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); + + /* This function, if defined, signals that the function above has removed + the discarded relocations for this section. */ + boolean (*elf_backend_ignore_discarded_relocs) + PARAMS ((asection *)); + + /* This function, if defined, may write out the given section. + Returns true if it did so and false if the caller should. */ + boolean (*elf_backend_write_section) + PARAMS ((bfd *, asection *, bfd_byte *)); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -674,6 +798,8 @@ struct elf_backend_data unsigned plt_not_loaded : 1; unsigned plt_alignment : 4; unsigned can_gc_sections : 1; + unsigned can_refcount : 1; + unsigned want_got_sym : 1; unsigned want_dynbss : 1; }; @@ -684,46 +810,84 @@ struct bfd_elf_section_data { /* The ELF header for this section. */ Elf_Internal_Shdr this_hdr; + /* The ELF header for the reloc section associated with this section, if any. */ Elf_Internal_Shdr rel_hdr; + /* If there is a second reloc section associated with this section, as can happen on Irix 6, this field points to the header. */ Elf_Internal_Shdr *rel_hdr2; + /* The number of relocations currently assigned to REL_HDR. */ unsigned int rel_count; + /* The number of relocations currently assigned to REL_HDR2. */ unsigned int rel_count2; + + /* A pointer to a linked list tracking dynamic relocs copied for + local symbols. */ + PTR local_dynrel; + + /* A pointer to the bfd section used for dynamic relocs. */ + asection *sreloc; + /* The ELF section number of this section. Only used for an output file. */ int this_idx; + /* The ELF section number of the reloc section indicated by REL_HDR if any. Only used for an output file. */ int rel_idx; + /* The ELF section number of the reloc section indicated by REL_HDR2 if any. Only used for an output file. */ int rel_idx2; + /* Used by the backend linker to store the symbol hash table entries associated with relocs against global symbols. */ struct elf_link_hash_entry **rel_hashes; + /* A pointer to the swapped relocs. If the section uses REL relocs, rather than RELA, all the r_addend fields will be zero. This pointer may be NULL. It is used by the backend linker. */ Elf_Internal_Rela *relocs; + /* Used by the backend linker when generating a shared library to record the dynamic symbol index for a section symbol corresponding to this section. A value of 0 means that there is no dynamic symbol for this section. */ long dynindx; - /* A pointer used for .stab linking optimizations. */ - PTR stab_info; + + /* A pointer used for various section optimizations. */ + PTR sec_info; + + /* Type of that information. */ + enum elf_link_info_type sec_info_type; + + /* Group name, if this section is part of a group. */ + const char *group_name; + + /* A linked list of sections in the group. Circular when used by + the linker. */ + asection *next_in_group; + /* A pointer available for the processor specific ELF backend. */ PTR tdata; + /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; }; #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) +#define elf_group_name(sec) (elf_section_data(sec)->group_name) +#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) + +/* Return true if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section(sec) \ + && bfd_is_abs_section((sec)->output_section) \ + && elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE) #define get_elf_backend_data(abfd) \ ((struct elf_backend_data *) (abfd)->xvec->backend_data) @@ -769,7 +933,7 @@ typedef struct elf_linker_section_pointers { struct elf_linker_section_pointers *next; /* next allocated pointer for this symbol */ bfd_vma offset; /* offset of pointer from beginning of section */ - bfd_signed_vma addend; /* addend used */ + bfd_vma addend; /* addend used */ elf_linker_section_enum_t which; /* which linker section this is */ boolean written_address_p; /* whether address was written yet */ } elf_linker_section_pointers_t; @@ -783,9 +947,11 @@ struct elf_obj_tdata Elf_Internal_Shdr **elf_sect_ptr; Elf_Internal_Phdr *phdr; struct elf_segment_map *segment_map; - struct bfd_strtab_hash *strtab_ptr; + struct elf_strtab_hash *strtab_ptr; int num_locals; int num_globals; + unsigned int num_elf_sections; /* elf_sect_ptr size */ + int num_section_syms; asymbol **section_syms; /* STT_SECTION symbols for each section */ Elf_Internal_Shdr symtab_hdr; Elf_Internal_Shdr shstrtab_hdr; @@ -795,8 +961,10 @@ struct elf_obj_tdata Elf_Internal_Shdr dynversym_hdr; Elf_Internal_Shdr dynverref_hdr; Elf_Internal_Shdr dynverdef_hdr; + Elf_Internal_Shdr symtab_shndx_hdr; unsigned int symtab_section, shstrtab_section; unsigned int strtab_section, dynsymtab_section; + unsigned int symtab_shndx_section; unsigned int dynversym_section, dynverdef_section, dynverref_section; file_ptr next_file_pos; #if 0 @@ -805,8 +973,11 @@ struct elf_obj_tdata void *prstatus; /* The raw /proc prstatus structure */ void *prpsinfo; /* The raw /proc prpsinfo structure */ #endif - bfd_vma gp; /* The gp value (MIPS only, for now) */ - unsigned int gp_size; /* The gp size (MIPS only, for now) */ + bfd_vma gp; /* The gp value */ + unsigned int gp_size; /* The gp size */ + + Elf_Internal_Shdr **group_sect_ptr; + int num_group; /* Information grabbed from an elf core file. */ int core_signal; @@ -892,6 +1063,10 @@ struct elf_obj_tdata /* Used to determine if the e_flags field has been initialized */ boolean flags_init; + /* Used to determine if PT_GNU_EH_FRAME segment header should be + created. */ + boolean eh_frame_hdr; + /* Number of symbol version definitions we are about to emit. */ unsigned int cverdefs; @@ -918,8 +1093,10 @@ struct elf_obj_tdata #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) #define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header) #define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr) +#define elf_numsections(bfd) (elf_tdata(bfd) -> num_elf_sections) #define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr) #define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section) +#define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section) #define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section) #define elf_dynversym(bfd) (elf_tdata(bfd) -> dynversym_section) #define elf_dynverdef(bfd) (elf_tdata(bfd) -> dynverdef_section) @@ -927,6 +1104,7 @@ struct elf_obj_tdata #define elf_num_locals(bfd) (elf_tdata(bfd) -> num_locals) #define elf_num_globals(bfd) (elf_tdata(bfd) -> num_globals) #define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms) +#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> num_section_syms) #define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo) #define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus) #define elf_gp(bfd) (elf_tdata(bfd) -> gp) @@ -962,36 +1140,56 @@ extern void _bfd_elf_swap_versym_in extern void _bfd_elf_swap_versym_out PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *)); -extern int _bfd_elf_section_from_bfd_section PARAMS ((bfd *, asection *)); +extern int _bfd_elf_section_from_bfd_section + PARAMS ((bfd *, asection *)); extern char *bfd_elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned)); -extern char *bfd_elf_get_str_section PARAMS ((bfd *, unsigned)); +extern char *bfd_elf_get_str_section + PARAMS ((bfd *, unsigned)); + +extern boolean _bfd_elf_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); +extern boolean _bfd_elf_print_private_bfd_data + PARAMS ((bfd *, PTR)); +extern void bfd_elf_print_symbol + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); -extern boolean _bfd_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); -extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *, - bfd_print_symbol_type)); -#define elf_string_from_elf_strtab(abfd,strindex) \ - bfd_elf_string_from_elf_section(abfd,elf_elfheader(abfd)->e_shstrndx,strindex) +#define elf_string_from_elf_strtab(abfd, strindex) \ + bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \ + strindex) #define bfd_elf32_print_symbol bfd_elf_print_symbol #define bfd_elf64_print_symbol bfd_elf_print_symbol -extern unsigned long bfd_elf_hash PARAMS ((const char *)); - -extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *, - arelent *, - asymbol *, - PTR, - asection *, - bfd *, - char **)); -extern boolean bfd_elf_mkobject PARAMS ((bfd *)); -extern boolean bfd_elf_mkcorefile PARAMS ((bfd *)); -extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *)); +extern void _bfd_elf_sprintf_vma + PARAMS ((bfd *, char *, bfd_vma)); +extern void _bfd_elf_fprintf_vma + PARAMS ((bfd *, PTR, bfd_vma)); + +extern enum elf_reloc_type_class _bfd_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +extern bfd_vma _bfd_elf_rela_local_sym + PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *)); +extern bfd_vma _bfd_elf_rel_local_sym + PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma)); +extern bfd_vma _bfd_elf_section_offset + PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma)); + +extern unsigned long bfd_elf_hash + PARAMS ((const char *)); + +extern bfd_reloc_status_type bfd_elf_generic_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +extern boolean bfd_elf_mkobject + PARAMS ((bfd *)); +extern boolean bfd_elf_mkcorefile + PARAMS ((bfd *)); +extern Elf_Internal_Shdr *bfd_elf_find_section + PARAMS ((bfd *, char *)); extern boolean _bfd_elf_make_section_from_shdr - PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name)); + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); extern boolean _bfd_elf_make_section_from_phdr - PARAMS ((bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename)); + PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *)); extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create @@ -999,147 +1197,187 @@ extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create extern void _bfd_elf_link_hash_copy_indirect PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); extern void _bfd_elf_link_hash_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); extern boolean _bfd_elf_link_hash_table_init PARAMS ((struct elf_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *))); -extern boolean _bfd_elf_slurp_version_tables PARAMS ((bfd *)); +extern boolean _bfd_elf_slurp_version_tables + PARAMS ((bfd *)); + +extern boolean _bfd_elf_merge_sections + PARAMS ((bfd *, struct bfd_link_info *)); extern boolean _bfd_elf_copy_private_symbol_data PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); extern boolean _bfd_elf_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); -extern boolean _bfd_elf_write_object_contents PARAMS ((bfd *)); -extern boolean _bfd_elf_write_corefile_contents PARAMS ((bfd *)); -extern boolean _bfd_elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, - bfd_size_type)); -extern long _bfd_elf_get_symtab_upper_bound PARAMS ((bfd *)); -extern long _bfd_elf_get_symtab PARAMS ((bfd *, asymbol **)); -extern long _bfd_elf_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); -extern long _bfd_elf_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); -extern long _bfd_elf_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); -extern long _bfd_elf_canonicalize_reloc PARAMS ((bfd *, sec_ptr, - arelent **, asymbol **)); -extern long _bfd_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); -extern long _bfd_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, - asymbol **)); -extern asymbol *_bfd_elf_make_empty_symbol PARAMS ((bfd *)); -extern void _bfd_elf_get_symbol_info PARAMS ((bfd *, asymbol *, - symbol_info *)); -extern boolean _bfd_elf_is_local_label_name PARAMS ((bfd *, const char *)); -extern alent *_bfd_elf_get_lineno PARAMS ((bfd *, asymbol *)); -extern boolean _bfd_elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); -extern boolean _bfd_elf_find_nearest_line PARAMS ((bfd *, asection *, - asymbol **, - bfd_vma, const char **, - const char **, - unsigned int *)); +extern boolean _bfd_elf_write_object_contents + PARAMS ((bfd *)); +extern boolean _bfd_elf_write_corefile_contents + PARAMS ((bfd *)); +extern boolean _bfd_elf_set_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +extern long _bfd_elf_get_symtab_upper_bound + PARAMS ((bfd *)); +extern long _bfd_elf_get_symtab + PARAMS ((bfd *, asymbol **)); +extern long _bfd_elf_get_dynamic_symtab_upper_bound + PARAMS ((bfd *)); +extern long _bfd_elf_canonicalize_dynamic_symtab + PARAMS ((bfd *, asymbol **)); +extern long _bfd_elf_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +extern long _bfd_elf_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +extern long _bfd_elf_get_dynamic_reloc_upper_bound + PARAMS ((bfd *)); +extern long _bfd_elf_canonicalize_dynamic_reloc + PARAMS ((bfd *, arelent **, asymbol **)); +extern asymbol *_bfd_elf_make_empty_symbol + PARAMS ((bfd *)); +extern void _bfd_elf_get_symbol_info + PARAMS ((bfd *, asymbol *, symbol_info *)); +extern boolean _bfd_elf_is_local_label_name + PARAMS ((bfd *, const char *)); +extern alent *_bfd_elf_get_lineno + PARAMS ((bfd *, asymbol *)); +extern boolean _bfd_elf_set_arch_mach + PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +extern boolean _bfd_elf_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean)); -extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *)); +extern int _bfd_elf_sizeof_headers + PARAMS ((bfd *, boolean)); +extern boolean _bfd_elf_new_section_hook + PARAMS ((bfd *, asection *)); extern boolean _bfd_elf_init_reloc_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean)); /* If the target doesn't have reloc handling written yet: */ -extern void _bfd_elf_no_info_to_howto PARAMS ((bfd *, arelent *, - Elf_Internal_Rela *)); - -extern boolean bfd_section_from_shdr PARAMS ((bfd *, unsigned int shindex)); -extern boolean bfd_section_from_phdr PARAMS ((bfd *, Elf_Internal_Phdr *, int)); - -extern int _bfd_elf_symbol_from_bfd_symbol PARAMS ((bfd *, asymbol **)); - -asection *bfd_section_from_elf_index PARAMS ((bfd *, unsigned int)); -boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, - struct bfd_link_info *)); -struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void)); -boolean -_bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *, - struct elf_link_hash_entry *)); -long -_bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *, - bfd *, long)); -boolean -_bfd_elf_compute_section_file_positions PARAMS ((bfd *, - struct bfd_link_info *)); -void _bfd_elf_assign_file_positions_for_relocs PARAMS ((bfd *)); -file_ptr _bfd_elf_assign_file_position_for_section PARAMS ((Elf_Internal_Shdr *, - file_ptr, - boolean)); - -extern boolean _bfd_elf_validate_reloc PARAMS ((bfd *, arelent *)); - -boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, - struct bfd_link_info *)); -boolean _bfd_elf_create_got_section PARAMS ((bfd *, - struct bfd_link_info *)); -unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *, - struct bfd_link_info *)); - -elf_linker_section_t *_bfd_elf_create_linker_section - PARAMS ((bfd *abfd, - struct bfd_link_info *info, - enum elf_linker_section_enum, - elf_linker_section_t *defaults)); - -elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section - PARAMS ((elf_linker_section_pointers_t *linker_pointers, - bfd_signed_vma addend, - elf_linker_section_enum_t which)); - -boolean bfd_elf32_create_pointer_linker_section - PARAMS ((bfd *abfd, - struct bfd_link_info *info, - elf_linker_section_t *lsect, - struct elf_link_hash_entry *h, - const Elf32_Internal_Rela *rel)); - -bfd_vma bfd_elf32_finish_pointer_linker_section - PARAMS ((bfd *output_abfd, - bfd *input_bfd, - struct bfd_link_info *info, - elf_linker_section_t *lsect, - struct elf_link_hash_entry *h, - bfd_vma relocation, - const Elf32_Internal_Rela *rel, - int relative_reloc)); - -boolean bfd_elf64_create_pointer_linker_section - PARAMS ((bfd *abfd, - struct bfd_link_info *info, - elf_linker_section_t *lsect, - struct elf_link_hash_entry *h, - const Elf64_Internal_Rela *rel)); - -bfd_vma bfd_elf64_finish_pointer_linker_section - PARAMS ((bfd *output_abfd, - bfd *input_bfd, - struct bfd_link_info *info, - elf_linker_section_t *lsect, - struct elf_link_hash_entry *h, - bfd_vma relocation, - const Elf64_Internal_Rela *rel, - int relative_reloc)); - -boolean _bfd_elf_make_linker_section_rela - PARAMS ((bfd *dynobj, - elf_linker_section_t *lsect, - int alignment)); - -boolean _bfd_elfcore_section_from_phdr +extern void _bfd_elf_no_info_to_howto + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + +extern boolean bfd_section_from_shdr + PARAMS ((bfd *, unsigned int shindex)); +extern boolean bfd_section_from_phdr PARAMS ((bfd *, Elf_Internal_Phdr *, int)); -extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *)); -extern const bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *)); -extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *)); -extern int bfd_elf32_core_file_failing_signal PARAMS ((bfd *)); -extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *, - bfd *)); +extern int _bfd_elf_symbol_from_bfd_symbol + PARAMS ((bfd *, asymbol **)); + +extern asection *bfd_section_from_r_symndx + PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long)); +extern asection *bfd_section_from_elf_index + PARAMS ((bfd *, unsigned int)); +extern boolean _bfd_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern struct bfd_strtab_hash *_bfd_elf_stringtab_init + PARAMS ((void)); + +extern struct elf_strtab_hash * _bfd_elf_strtab_init + PARAMS ((void)); +extern void _bfd_elf_strtab_free + PARAMS ((struct elf_strtab_hash *)); +extern bfd_size_type _bfd_elf_strtab_add + PARAMS ((struct elf_strtab_hash *, const char *, boolean)); +extern void _bfd_elf_strtab_addref + PARAMS ((struct elf_strtab_hash *, bfd_size_type)); +extern void _bfd_elf_strtab_delref + PARAMS ((struct elf_strtab_hash *, bfd_size_type)); +extern void _bfd_elf_strtab_clear_all_refs + PARAMS ((struct elf_strtab_hash *)); +extern bfd_size_type _bfd_elf_strtab_size + PARAMS ((struct elf_strtab_hash *)); +extern bfd_size_type _bfd_elf_strtab_offset + PARAMS ((struct elf_strtab_hash *, bfd_size_type)); +extern boolean _bfd_elf_strtab_emit + PARAMS ((bfd *, struct elf_strtab_hash *)); +extern void _bfd_elf_strtab_finalize + PARAMS ((struct elf_strtab_hash *)); + +extern boolean _bfd_elf_discard_section_eh_frame + PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, + boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *)); +extern boolean _bfd_elf_discard_section_eh_frame_hdr + PARAMS ((bfd *, struct bfd_link_info *, asection *)); +extern bfd_vma _bfd_elf_eh_frame_section_offset + PARAMS ((bfd *, asection *, bfd_vma)); +extern boolean _bfd_elf_write_section_eh_frame + PARAMS ((bfd *, asection *, asection *, bfd_byte *)); +extern boolean _bfd_elf_write_section_eh_frame_hdr + PARAMS ((bfd *, asection *)); +extern boolean _bfd_elf_maybe_strip_eh_frame_hdr + PARAMS ((struct bfd_link_info *)); + +extern boolean _bfd_elf_link_record_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +extern long _bfd_elf_link_lookup_local_dynindx + PARAMS ((struct bfd_link_info *, bfd *, long)); +extern boolean _bfd_elf_compute_section_file_positions + PARAMS ((bfd *, struct bfd_link_info *)); +extern void _bfd_elf_assign_file_positions_for_relocs + PARAMS ((bfd *)); +extern file_ptr _bfd_elf_assign_file_position_for_section + PARAMS ((Elf_Internal_Shdr *, file_ptr, boolean)); + +extern boolean _bfd_elf_validate_reloc + PARAMS ((bfd *, arelent *)); + +extern boolean _bfd_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_elf_create_got_section + PARAMS ((bfd *, struct bfd_link_info *)); +extern unsigned long _bfd_elf_link_renumber_dynsyms + PARAMS ((bfd *, struct bfd_link_info *)); + +extern boolean _bfd_elfcore_make_pseudosection + PARAMS ((bfd *, char *, size_t, ufile_ptr)); +extern char *_bfd_elfcore_strndup + PARAMS ((bfd *, char *, size_t)); + +extern elf_linker_section_t *_bfd_elf_create_linker_section + PARAMS ((bfd *, struct bfd_link_info *, enum elf_linker_section_enum, + elf_linker_section_t *)); + +extern elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section + PARAMS ((elf_linker_section_pointers_t *, bfd_vma, + elf_linker_section_enum_t)); + +extern boolean bfd_elf32_create_pointer_linker_section + PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, + struct elf_link_hash_entry *, const Elf32_Internal_Rela *)); + +extern bfd_vma bfd_elf32_finish_pointer_linker_section + PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, + struct elf_link_hash_entry *, bfd_vma, + const Elf32_Internal_Rela *, int)); + +extern boolean bfd_elf64_create_pointer_linker_section + PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, + struct elf_link_hash_entry *, const Elf64_Internal_Rela *)); + +extern bfd_vma bfd_elf64_finish_pointer_linker_section + PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, + struct elf_link_hash_entry *, bfd_vma, + const Elf64_Internal_Rela *, int)); + +extern boolean _bfd_elf_make_linker_section_rela + PARAMS ((bfd *, elf_linker_section_t *, int)); + +extern const bfd_target *bfd_elf32_object_p + PARAMS ((bfd *)); +extern const bfd_target *bfd_elf32_core_file_p + PARAMS ((bfd *)); +extern char *bfd_elf32_core_file_failing_command + PARAMS ((bfd *)); +extern int bfd_elf32_core_file_failing_signal + PARAMS ((bfd *)); +extern boolean bfd_elf32_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); extern boolean bfd_elf32_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); @@ -1147,9 +1385,10 @@ extern boolean bfd_elf32_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void bfd_elf32_swap_symbol_in - PARAMS ((bfd *, const Elf32_External_Sym *, Elf_Internal_Sym *)); + PARAMS ((bfd *, const Elf32_External_Sym *, const Elf_External_Sym_Shndx *, + Elf_Internal_Sym *)); extern void bfd_elf32_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR)); + PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); extern void bfd_elf32_swap_reloc_in PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *)); extern void bfd_elf32_swap_reloc_out @@ -1168,9 +1407,10 @@ extern void bfd_elf32_swap_dyn_out PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); extern long bfd_elf32_slurp_symbol_table PARAMS ((bfd *, asymbol **, boolean)); -extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *)); +extern boolean bfd_elf32_write_shdrs_and_ehdr + PARAMS ((bfd *)); extern int bfd_elf32_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); + PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); extern void bfd_elf32_write_relocs PARAMS ((bfd *, asection *, PTR)); extern boolean bfd_elf32_slurp_reloc_table @@ -1182,21 +1422,26 @@ extern boolean bfd_elf32_link_create_dynamic_sections extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean)); -extern const bfd_target *bfd_elf64_object_p PARAMS ((bfd *)); -extern const bfd_target *bfd_elf64_core_file_p PARAMS ((bfd *)); -extern char *bfd_elf64_core_file_failing_command PARAMS ((bfd *)); -extern int bfd_elf64_core_file_failing_signal PARAMS ((bfd *)); -extern boolean bfd_elf64_core_file_matches_executable_p PARAMS ((bfd *, - bfd *)); +extern const bfd_target *bfd_elf64_object_p + PARAMS ((bfd *)); +extern const bfd_target *bfd_elf64_core_file_p + PARAMS ((bfd *)); +extern char *bfd_elf64_core_file_failing_command + PARAMS ((bfd *)); +extern int bfd_elf64_core_file_failing_signal + PARAMS ((bfd *)); +extern boolean bfd_elf64_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); extern boolean bfd_elf64_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); extern boolean bfd_elf64_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void bfd_elf64_swap_symbol_in - PARAMS ((bfd *, const Elf64_External_Sym *, Elf_Internal_Sym *)); + PARAMS ((bfd *, const Elf64_External_Sym *, const Elf_External_Sym_Shndx *, + Elf_Internal_Sym *)); extern void bfd_elf64_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR)); + PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); extern void bfd_elf64_swap_reloc_in PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *)); extern void bfd_elf64_swap_reloc_out @@ -1215,9 +1460,10 @@ extern void bfd_elf64_swap_dyn_out PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); extern long bfd_elf64_slurp_symbol_table PARAMS ((bfd *, asymbol **, boolean)); -extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *)); +extern boolean bfd_elf64_write_shdrs_and_ehdr + PARAMS ((bfd *)); extern int bfd_elf64_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); + PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); extern void bfd_elf64_write_relocs PARAMS ((bfd *, asection *, PTR)); extern boolean bfd_elf64_slurp_reloc_table @@ -1234,53 +1480,76 @@ extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs #define bfd_elf64_link_record_dynamic_symbol \ _bfd_elf_link_record_dynamic_symbol -boolean _bfd_elf32_link_record_local_dynamic_symbol +extern boolean _bfd_elf32_link_record_local_dynamic_symbol PARAMS ((struct bfd_link_info *, bfd *, long)); -boolean _bfd_elf64_link_record_local_dynamic_symbol +extern boolean _bfd_elf64_link_record_local_dynamic_symbol PARAMS ((struct bfd_link_info *, bfd *, long)); -extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *)); +extern boolean _bfd_elf_close_and_cleanup + PARAMS ((bfd *)); extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, bfd *, char **)); -boolean _bfd_elf32_gc_sections - PARAMS ((bfd *abfd, struct bfd_link_info *info)); -boolean _bfd_elf32_gc_common_finalize_got_offsets - PARAMS ((bfd *abfd, struct bfd_link_info *info)); -boolean _bfd_elf32_gc_common_final_link +extern boolean _bfd_elf32_gc_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_elf32_gc_common_finalize_got_offsets + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_elf32_gc_common_final_link PARAMS ((bfd *, struct bfd_link_info *)); -boolean _bfd_elf32_gc_record_vtinherit +extern boolean _bfd_elf32_gc_record_vtinherit PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); -boolean _bfd_elf32_gc_record_vtentry +extern boolean _bfd_elf32_gc_record_vtentry PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); -boolean _bfd_elf64_gc_sections - PARAMS ((bfd *abfd, struct bfd_link_info *info)); -boolean _bfd_elf64_gc_common_finalize_got_offsets - PARAMS ((bfd *abfd, struct bfd_link_info *info)); -boolean _bfd_elf64_gc_common_final_link +extern boolean _bfd_elf64_gc_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_elf64_gc_common_finalize_got_offsets + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_elf64_gc_common_final_link PARAMS ((bfd *, struct bfd_link_info *)); -boolean _bfd_elf64_gc_record_vtinherit +extern boolean _bfd_elf64_gc_record_vtinherit PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); -boolean _bfd_elf64_gc_record_vtentry +extern boolean _bfd_elf64_gc_record_vtentry PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); +extern boolean _bfd_elf32_reloc_symbol_deleted_p + PARAMS ((bfd_vma, PTR)); +extern boolean _bfd_elf64_reloc_symbol_deleted_p + PARAMS ((bfd_vma, PTR)); + +/* Exported interface for writing elf corefile notes. */ +extern char *elfcore_write_note + PARAMS ((bfd *, char *, int *, char *, int, void *, int)); +extern char *elfcore_write_prpsinfo + PARAMS ((bfd *, char *, int *, char *, char *)); +extern char *elfcore_write_prstatus + PARAMS ((bfd *, char *, int *, long, int, void *)); +extern char * elfcore_write_pstatus + PARAMS ((bfd *, char *, int *, long, int, void *)); +extern char *elfcore_write_prfpreg + PARAMS ((bfd *, char *, int *, void *, int)); +extern char *elfcore_write_prxfpreg + PARAMS ((bfd *, char *, int *, void *, int)); + /* MIPS ELF specific routines. */ -extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *)); +extern boolean _bfd_mips_elf_object_p + PARAMS ((bfd *)); extern boolean _bfd_mips_elf_section_from_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); extern boolean _bfd_mips_elf_fake_sections PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); extern boolean _bfd_mips_elf_section_from_bfd_section - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, int *)); + PARAMS ((bfd *, asection *, int *)); extern boolean _bfd_mips_elf_section_processing PARAMS ((bfd *, Elf_Internal_Shdr *)); -extern void _bfd_mips_elf_symbol_processing PARAMS ((bfd *, asymbol *)); +extern void _bfd_mips_elf_symbol_processing + PARAMS ((bfd *, asymbol *)); extern boolean _bfd_mips_elf_read_ecoff_info PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); -extern void _bfd_mips_elf_final_write_processing PARAMS ((bfd *, boolean)); +extern void _bfd_mips_elf_final_write_processing + PARAMS ((bfd *, boolean)); extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc @@ -1291,9 +1560,10 @@ extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); extern bfd_reloc_status_type _bfd_mips_elf_gprel32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -extern boolean _bfd_mips_elf_set_private_flags PARAMS ((bfd *, flagword)); -extern boolean _bfd_mips_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -extern boolean _bfd_mips_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +extern boolean _bfd_mips_elf_set_private_flags + PARAMS ((bfd *, flagword)); +extern boolean _bfd_mips_elf_merge_private_bfd_data + PARAMS ((bfd *, bfd *)); extern boolean _bfd_mips_elf_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); @@ -1333,14 +1603,17 @@ extern boolean _bfd_mips_elf_link_output_symbol_hook asection *)); extern boolean _bfd_mips_elf_final_link PARAMS ((bfd *, struct bfd_link_info *)); -extern int _bfd_mips_elf_additional_program_headers PARAMS ((bfd *)); -extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *)); +extern int _bfd_mips_elf_additional_program_headers + PARAMS ((bfd *)); +extern boolean _bfd_mips_elf_modify_segment_map + PARAMS ((bfd *)); extern boolean _bfd_mips_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); /* SH ELF specific routine. */ -extern boolean _sh_elf_set_mach_from_flags PARAMS ((bfd *)); +extern boolean _sh_elf_set_mach_from_flags + PARAMS ((bfd *)); #endif /* _LIBELF_H_ */ diff --git a/contrib/binutils/bfd/elf-eh-frame.c b/contrib/binutils/bfd/elf-eh-frame.c new file mode 100644 index 0000000..b479c00 --- /dev/null +++ b/contrib/binutils/bfd/elf-eh-frame.c @@ -0,0 +1,1212 @@ +/* .eh_frame section optimization. + Copyright 2001, 2002 Free Software Foundation, Inc. + Written by Jakub Jelinek . + +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/dwarf2.h" + +#define EH_FRAME_HDR_SIZE 8 + +struct cie_header +{ + unsigned int length; + unsigned int id; +}; + +struct cie +{ + struct cie_header hdr; + unsigned char version; + unsigned char augmentation[20]; + unsigned int code_align; + int data_align; + unsigned int ra_column; + unsigned int augmentation_size; + struct elf_link_hash_entry *personality; + unsigned char per_encoding; + unsigned char lsda_encoding; + unsigned char fde_encoding; + unsigned char initial_insn_length; + unsigned char make_relative; + unsigned char make_lsda_relative; + unsigned char initial_instructions[50]; +}; + +struct eh_cie_fde +{ + unsigned int offset; + unsigned int size; + asection *sec; + unsigned int new_offset; + unsigned char fde_encoding; + unsigned char lsda_encoding; + unsigned char lsda_offset; + unsigned char cie : 1; + unsigned char removed : 1; + unsigned char make_relative : 1; + unsigned char make_lsda_relative : 1; +}; + +struct eh_frame_sec_info +{ + unsigned int count; + unsigned int alloced; + struct eh_cie_fde entry[1]; +}; + +struct eh_frame_array_ent +{ + bfd_vma initial_loc; + bfd_vma fde; +}; + +struct eh_frame_hdr_info +{ + struct cie last_cie; + asection *last_cie_sec; + unsigned int last_cie_offset; + unsigned int fde_count, array_count; + struct eh_frame_array_ent *array; + /* TRUE if .eh_frame_hdr should contain the sorted search table. + We build it if we successfully read all .eh_frame input sections + and recognize them. */ + boolean table; + boolean strip; +}; + +static bfd_vma read_unsigned_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static bfd_signed_vma read_signed_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static int get_DW_EH_PE_width + PARAMS ((int, int)); +static bfd_vma read_value + PARAMS ((bfd *, bfd_byte *, int)); +static void write_value + PARAMS ((bfd *, bfd_byte *, bfd_vma, int)); +static int cie_compare + PARAMS ((struct cie *, struct cie *)); +static int vma_compare + PARAMS ((const PTR a, const PTR b)); + +/* Helper function for reading uleb128 encoded data. */ + +static bfd_vma +read_unsigned_leb128 (abfd, buf, bytes_read_ptr) + bfd *abfd ATTRIBUTE_UNUSED; + char *buf; + unsigned int *bytes_read_ptr; +{ + bfd_vma result; + unsigned int num_read; + int shift; + unsigned char byte; + + result = 0; + shift = 0; + num_read = 0; + do + { + byte = bfd_get_8 (abfd, (bfd_byte *) buf); + buf ++; + num_read ++; + result |= (((bfd_vma) byte & 0x7f) << shift); + shift += 7; + } + while (byte & 0x80); + * bytes_read_ptr = num_read; + return result; +} + +/* Helper function for reading sleb128 encoded data. */ + +static bfd_signed_vma +read_signed_leb128 (abfd, buf, bytes_read_ptr) + bfd *abfd ATTRIBUTE_UNUSED; + char *buf; + unsigned int * bytes_read_ptr; +{ + bfd_vma result; + int shift; + int num_read; + unsigned char byte; + + result = 0; + shift = 0; + num_read = 0; + do + { + byte = bfd_get_8 (abfd, (bfd_byte *) buf); + buf ++; + num_read ++; + result |= (((bfd_vma) byte & 0x7f) << shift); + shift += 7; + } + while (byte & 0x80); + if (byte & 0x40) + result |= (((bfd_vma) -1) << (shift - 7)) << 7; + * bytes_read_ptr = num_read; + return result; +} + +#define read_uleb128(VAR, BUF) \ +do \ + { \ + (VAR) = read_unsigned_leb128 (abfd, buf, &leb128_tmp); \ + (BUF) += leb128_tmp; \ + } \ +while (0) + +#define read_sleb128(VAR, BUF) \ +do \ + { \ + (VAR) = read_signed_leb128 (abfd, buf, &leb128_tmp); \ + (BUF) += leb128_tmp; \ + } \ +while (0) + +/* Return 0 if either encoding is variable width, or not yet known to bfd. */ + +static +int get_DW_EH_PE_width (encoding, ptr_size) + int encoding, ptr_size; +{ + /* DW_EH_PE_ values of 0x60 and 0x70 weren't defined at the time .eh_frame + was added to bfd. */ + if ((encoding & 0x60) == 0x60) + return 0; + + switch (encoding & 7) + { + case DW_EH_PE_udata2: return 2; + case DW_EH_PE_udata4: return 4; + case DW_EH_PE_udata8: return 8; + case DW_EH_PE_absptr: return ptr_size; + default: + break; + } + + return 0; +} + +/* Read a width sized value from memory. */ + +static bfd_vma +read_value (abfd, buf, width) + bfd *abfd; + bfd_byte *buf; + int width; +{ + bfd_vma value; + + switch (width) + { + case 2: value = bfd_get_16 (abfd, buf); break; + case 4: value = bfd_get_32 (abfd, buf); break; + case 8: value = bfd_get_64 (abfd, buf); break; + default: BFD_FAIL (); return 0; + } + + return value; +} + +/* Store a width sized value to memory. */ + +static void +write_value (abfd, buf, value, width) + bfd *abfd; + bfd_byte *buf; + bfd_vma value; + int width; +{ + switch (width) + { + case 2: bfd_put_16 (abfd, value, buf); break; + case 4: bfd_put_32 (abfd, value, buf); break; + case 8: bfd_put_64 (abfd, value, buf); break; + default: BFD_FAIL (); + } +} + +/* Return zero if C1 and C2 CIEs can be merged. */ + +static +int cie_compare (c1, c2) + struct cie *c1, *c2; +{ + if (c1->hdr.length == c2->hdr.length + && c1->version == c2->version + && strcmp (c1->augmentation, c2->augmentation) == 0 + && strcmp (c1->augmentation, "eh") != 0 + && c1->code_align == c2->code_align + && c1->data_align == c2->data_align + && c1->ra_column == c2->ra_column + && c1->augmentation_size == c2->augmentation_size + && c1->personality == c2->personality + && c1->per_encoding == c2->per_encoding + && c1->lsda_encoding == c2->lsda_encoding + && c1->fde_encoding == c2->fde_encoding + && (c1->initial_insn_length + == c2->initial_insn_length) + && memcmp (c1->initial_instructions, + c2->initial_instructions, + c1->initial_insn_length) == 0) + return 0; + + return 1; +} + +/* This function is called for each input file before the .eh_frame + section is relocated. It discards duplicate CIEs and FDEs for discarded + functions. The function returns true iff any entries have been + deleted. */ + +boolean +_bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, + reloc_symbol_deleted_p, cookie) + bfd *abfd; + struct bfd_link_info *info; + asection *sec, *ehdrsec; + boolean (*reloc_symbol_deleted_p) (bfd_vma, PTR); + struct elf_reloc_cookie *cookie; +{ + bfd_byte *ehbuf = NULL, *buf; + bfd_byte *last_cie, *last_fde; + struct cie_header hdr; + struct cie cie; + struct eh_frame_hdr_info *hdr_info; + struct eh_frame_sec_info *sec_info = NULL; + unsigned int leb128_tmp; + unsigned int cie_usage_count, last_cie_ndx, i, offset; + unsigned int make_relative, make_lsda_relative; + Elf_Internal_Rela *rel; + bfd_size_type new_size; + unsigned int ptr_size; + + if (sec->_raw_size == 0) + { + /* This file does not contain .eh_frame information. */ + return false; + } + + if ((sec->output_section != NULL + && bfd_is_abs_section (sec->output_section))) + { + /* At least one of the sections is being discarded from the + link, so we should just ignore them. */ + return false; + } + + BFD_ASSERT (elf_section_data (ehdrsec)->sec_info_type + == ELF_INFO_TYPE_EH_FRAME_HDR); + hdr_info = (struct eh_frame_hdr_info *) + elf_section_data (ehdrsec)->sec_info; + + /* Read the frame unwind information from abfd. */ + + ehbuf = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (ehbuf == NULL) + goto free_no_table; + + if (! bfd_get_section_contents (abfd, sec, ehbuf, (bfd_vma) 0, + sec->_raw_size)) + goto free_no_table; + + if (sec->_raw_size >= 4 + && bfd_get_32 (abfd, ehbuf) == 0 + && cookie->rel == cookie->relend) + { + /* Empty .eh_frame section. */ + free (ehbuf); + return false; + } + + /* If .eh_frame section size doesn't fit into int, we cannot handle + it (it would need to use 64-bit .eh_frame format anyway). */ + if (sec->_raw_size != (unsigned int) sec->_raw_size) + goto free_no_table; + + ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS] + == ELFCLASS64) ? 8 : 4; + buf = ehbuf; + last_cie = NULL; + last_cie_ndx = 0; + memset (&cie, 0, sizeof (cie)); + cie_usage_count = 0; + new_size = sec->_raw_size; + make_relative = hdr_info->last_cie.make_relative; + make_lsda_relative = hdr_info->last_cie.make_lsda_relative; + sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info) + + 99 * sizeof (struct eh_cie_fde)); + if (sec_info == NULL) + goto free_no_table; + sec_info->alloced = 100; + +#define ENSURE_NO_RELOCS(buf) \ + if (cookie->rel < cookie->relend \ + && (cookie->rel->r_offset \ + < (bfd_size_type) ((buf) - ehbuf))) \ + goto free_no_table + +#define SKIP_RELOCS(buf) \ + while (cookie->rel < cookie->relend \ + && (cookie->rel->r_offset \ + < (bfd_size_type) ((buf) - ehbuf))) \ + cookie->rel++ + +#define GET_RELOC(buf) \ + ((cookie->rel < cookie->relend \ + && (cookie->rel->r_offset \ + == (bfd_size_type) ((buf) - ehbuf))) \ + ? cookie->rel : NULL) + + for (;;) + { + unsigned char *aug; + + if (sec_info->count == sec_info->alloced) + { + sec_info = bfd_realloc (sec_info, + sizeof (struct eh_frame_sec_info) + + (sec_info->alloced + 99) + * sizeof (struct eh_cie_fde)); + if (sec_info == NULL) + goto free_no_table; + + memset (&sec_info->entry[sec_info->alloced], 0, + 100 * sizeof (struct eh_cie_fde)); + sec_info->alloced += 100; + } + + last_fde = buf; + /* If we are at the end of the section, we still need to decide + on whether to output or discard last encountered CIE (if any). */ + if ((bfd_size_type) (buf - ehbuf) == sec->_raw_size) + hdr.id = (unsigned int) -1; + else + { + if ((bfd_size_type) (buf + 4 - ehbuf) > sec->_raw_size) + /* No space for CIE/FDE header length. */ + goto free_no_table; + + hdr.length = bfd_get_32 (abfd, buf); + if (hdr.length == 0xffffffff) + /* 64-bit .eh_frame is not supported. */ + goto free_no_table; + buf += 4; + if ((buf - ehbuf) + hdr.length > sec->_raw_size) + /* CIE/FDE not contained fully in this .eh_frame input section. */ + goto free_no_table; + + sec_info->entry[sec_info->count].offset = last_fde - ehbuf; + sec_info->entry[sec_info->count].size = 4 + hdr.length; + + if (hdr.length == 0) + { + /* CIE with length 0 must be only the last in the section. */ + if ((bfd_size_type) (buf - ehbuf) < sec->_raw_size) + goto free_no_table; + ENSURE_NO_RELOCS (buf); + sec_info->count++; + /* Now just finish last encountered CIE processing and break + the loop. */ + hdr.id = (unsigned int) -1; + } + else + { + hdr.id = bfd_get_32 (abfd, buf); + buf += 4; + if (hdr.id == (unsigned int) -1) + goto free_no_table; + } + } + + if (hdr.id == 0 || hdr.id == (unsigned int) -1) + { + unsigned int initial_insn_length; + + /* CIE */ + if (last_cie != NULL) + { + /* Now check if this CIE is identical to last CIE, in which case + we can remove it, provided we adjust all FDEs. + Also, it can be removed if we have removed all FDEs using + that. */ + if (cie_compare (&cie, &hdr_info->last_cie) == 0 + || cie_usage_count == 0) + { + new_size -= cie.hdr.length + 4; + sec_info->entry[last_cie_ndx].removed = 1; + sec_info->entry[last_cie_ndx].sec = hdr_info->last_cie_sec; + sec_info->entry[last_cie_ndx].new_offset + = hdr_info->last_cie_offset; + } + else + { + hdr_info->last_cie = cie; + hdr_info->last_cie_sec = sec; + hdr_info->last_cie_offset = last_cie - ehbuf; + sec_info->entry[last_cie_ndx].make_relative + = cie.make_relative; + sec_info->entry[last_cie_ndx].make_lsda_relative + = cie.make_lsda_relative; + } + } + + if (hdr.id == (unsigned int) -1) + break; + + last_cie_ndx = sec_info->count; + sec_info->entry[sec_info->count].cie = 1; + + cie_usage_count = 0; + memset (&cie, 0, sizeof (cie)); + cie.hdr = hdr; + cie.version = *buf++; + + /* Cannot handle unknown versions. */ + if (cie.version != 1) + goto free_no_table; + if (strlen (buf) > sizeof (cie.augmentation) - 1) + goto free_no_table; + + strcpy (cie.augmentation, buf); + buf = strchr (buf, '\0') + 1; + ENSURE_NO_RELOCS (buf); + if (buf[0] == 'e' && buf[1] == 'h') + { + /* GCC < 3.0 .eh_frame CIE */ + /* We cannot merge "eh" CIEs because __EXCEPTION_TABLE__ + is private to each CIE, so we don't need it for anything. + Just skip it. */ + buf += ptr_size; + SKIP_RELOCS (buf); + } + read_uleb128 (cie.code_align, buf); + read_sleb128 (cie.data_align, buf); + read_uleb128 (cie.ra_column, buf); + ENSURE_NO_RELOCS (buf); + cie.lsda_encoding = DW_EH_PE_omit; + cie.fde_encoding = DW_EH_PE_omit; + cie.per_encoding = DW_EH_PE_omit; + aug = cie.augmentation; + if (aug[0] != 'e' || aug[1] != 'h') + { + if (*aug == 'z') + { + aug++; + read_uleb128 (cie.augmentation_size, buf); + ENSURE_NO_RELOCS (buf); + } + + while (*aug != '\0') + switch (*aug++) + { + case 'L': + cie.lsda_encoding = *buf++; + ENSURE_NO_RELOCS (buf); + if (get_DW_EH_PE_width (cie.lsda_encoding, ptr_size) == 0) + goto free_no_table; + break; + case 'R': + cie.fde_encoding = *buf++; + ENSURE_NO_RELOCS (buf); + if (get_DW_EH_PE_width (cie.fde_encoding, ptr_size) == 0) + goto free_no_table; + break; + case 'P': + { + int per_width; + + cie.per_encoding = *buf++; + per_width = get_DW_EH_PE_width (cie.per_encoding, + ptr_size); + if (per_width == 0) + goto free_no_table; + if ((cie.per_encoding & 0xf0) == DW_EH_PE_aligned) + buf = (ehbuf + + ((buf - ehbuf + per_width - 1) + & ~((bfd_size_type) per_width - 1))); + ENSURE_NO_RELOCS (buf); + rel = GET_RELOC (buf); + /* Ensure we have a reloc here, against + a global symbol. */ + if (rel != NULL) + { + unsigned long r_symndx; + +#ifdef BFD64 + if (ptr_size == 8) + r_symndx = ELF64_R_SYM (cookie->rel->r_info); + else +#endif + r_symndx = ELF32_R_SYM (cookie->rel->r_info); + if (r_symndx >= cookie->locsymcount) + { + struct elf_link_hash_entry *h; + + r_symndx -= cookie->extsymoff; + h = cookie->sym_hashes[r_symndx]; + + 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; + + cie.personality = h; + } + cookie->rel++; + } + buf += per_width; + } + break; + default: + /* Unrecognized augmentation. Better bail out. */ + goto free_no_table; + } + } + + /* For shared libraries, try to get rid of as many RELATIVE relocs + as possible. + FIXME: For this to work, ELF backends need to perform the + relocation if omitting dynamic relocs, not skip it. */ + if (0 + && info->shared + && (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr) + cie.make_relative = 1; + + if (0 + && info->shared + && (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr) + cie.make_lsda_relative = 1; + + /* If FDE encoding was not specified, it defaults to + DW_EH_absptr. */ + if (cie.fde_encoding == DW_EH_PE_omit) + cie.fde_encoding = DW_EH_PE_absptr; + + initial_insn_length = cie.hdr.length - (buf - last_fde - 4); + if (initial_insn_length <= 50) + { + cie.initial_insn_length = initial_insn_length; + memcpy (cie.initial_instructions, buf, initial_insn_length); + } + buf += initial_insn_length; + ENSURE_NO_RELOCS (buf); + last_cie = last_fde; + } + else + { + /* Ensure this FDE uses the last CIE encountered. */ + if (last_cie == NULL + || hdr.id != (unsigned int) (buf - 4 - last_cie)) + goto free_no_table; + + ENSURE_NO_RELOCS (buf); + rel = GET_RELOC (buf); + if (rel == NULL) + /* This should not happen. */ + goto free_no_table; + if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie)) + { + cookie->rel = rel; + /* This is a FDE against discarded section, it should + be deleted. */ + new_size -= hdr.length + 4; + sec_info->entry[sec_info->count].removed = 1; + } + else + { + cie_usage_count++; + hdr_info->fde_count++; + } + cookie->rel = rel; + if (cie.lsda_encoding != DW_EH_PE_omit) + { + unsigned int dummy; + + aug = buf; + buf += 2 * get_DW_EH_PE_width (cie.fde_encoding, ptr_size); + if (cie.augmentation[0] == 'z') + read_uleb128 (dummy, buf); + /* If some new augmentation data is added before LSDA + in FDE augmentation area, this need to be adjusted. */ + sec_info->entry[sec_info->count].lsda_offset = (buf - aug); + } + buf = last_fde + 4 + hdr.length; + SKIP_RELOCS (buf); + } + + sec_info->entry[sec_info->count].fde_encoding = cie.fde_encoding; + sec_info->entry[sec_info->count].lsda_encoding = cie.lsda_encoding; + sec_info->count++; + } + + elf_section_data (sec)->sec_info = sec_info; + elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME; + + /* Ok, now we can assign new offsets. */ + offset = 0; + last_cie_ndx = 0; + for (i = 0; i < sec_info->count; i++) + { + if (! sec_info->entry[i].removed) + { + sec_info->entry[i].new_offset = offset; + offset += sec_info->entry[i].size; + if (sec_info->entry[i].cie) + { + last_cie_ndx = i; + make_relative = sec_info->entry[i].make_relative; + make_lsda_relative = sec_info->entry[i].make_lsda_relative; + } + else + { + sec_info->entry[i].make_relative = make_relative; + sec_info->entry[i].make_lsda_relative = make_lsda_relative; + } + } + else if (sec_info->entry[i].cie && sec_info->entry[i].sec == sec) + { + /* Need to adjust new_offset too. */ + BFD_ASSERT (sec_info->entry[last_cie_ndx].offset + == sec_info->entry[i].new_offset); + sec_info->entry[i].new_offset + = sec_info->entry[last_cie_ndx].new_offset; + } + } + if (hdr_info->last_cie_sec == sec) + { + BFD_ASSERT (sec_info->entry[last_cie_ndx].offset + == hdr_info->last_cie_offset); + hdr_info->last_cie_offset = sec_info->entry[last_cie_ndx].new_offset; + } + + /* FIXME: Currently it is not possible to shrink sections to zero size at + this point, so build a fake minimal CIE. */ + if (new_size == 0) + new_size = 16; + + /* Shrink the sec as needed. */ + sec->_cooked_size = new_size; + if (sec->_cooked_size == 0) + sec->flags |= SEC_EXCLUDE; + + free (ehbuf); + return new_size != sec->_raw_size; + +free_no_table: + if (ehbuf) + free (ehbuf); + if (sec_info) + free (sec_info); + hdr_info->table = false; + hdr_info->last_cie.hdr.length = 0; + return false; +} + +/* This function is called for .eh_frame_hdr section after + _bfd_elf_discard_section_eh_frame has been called on all .eh_frame + input sections. It finalizes the size of .eh_frame_hdr section. */ + +boolean +_bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; +{ + struct eh_frame_hdr_info *hdr_info; + unsigned int ptr_size; + + ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS] + == ELFCLASS64) ? 8 : 4; + + if ((elf_section_data (sec)->sec_info_type + != ELF_INFO_TYPE_EH_FRAME_HDR) + || ! info->eh_frame_hdr) + { + _bfd_strip_section_from_output (info, sec); + return false; + } + + hdr_info = (struct eh_frame_hdr_info *) + elf_section_data (sec)->sec_info; + if (hdr_info->strip) + return false; + sec->_cooked_size = EH_FRAME_HDR_SIZE; + if (hdr_info->table) + sec->_cooked_size += 4 + hdr_info->fde_count * 8; + + /* Request program headers to be recalculated. */ + elf_tdata (abfd)->program_header_size = 0; + elf_tdata (abfd)->eh_frame_hdr = true; + return true; +} + +/* This function is called from size_dynamic_sections. + It needs to decide whether .eh_frame_hdr should be output or not, + because later on it is too late for calling _bfd_strip_section_from_output, + since dynamic symbol table has been sized. */ + +boolean +_bfd_elf_maybe_strip_eh_frame_hdr (info) + struct bfd_link_info *info; +{ + asection *sec, *o; + bfd *abfd; + struct eh_frame_hdr_info *hdr_info; + + sec = bfd_get_section_by_name (elf_hash_table (info)->dynobj, ".eh_frame_hdr"); + if (sec == NULL) + return true; + + hdr_info + = bfd_zmalloc (sizeof (struct eh_frame_hdr_info)); + if (hdr_info == NULL) + return false; + + elf_section_data (sec)->sec_info = hdr_info; + elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME_HDR; + + abfd = NULL; + if (info->eh_frame_hdr) + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + { + /* Count only sections which have at least a single CIE or FDE. + There cannot be any CIE or FDE <= 8 bytes. */ + o = bfd_get_section_by_name (abfd, ".eh_frame"); + if (o && o->_raw_size > 8) + break; + } + + if (abfd == NULL) + { + _bfd_strip_section_from_output (info, sec); + hdr_info->strip = true; + } + else + hdr_info->table = true; + return true; +} + +/* Adjust an address in the .eh_frame section. Given OFFSET within + SEC, this returns the new offset in the adjusted .eh_frame section, + or -1 if the address refers to a CIE/FDE which has been removed + or to offset with dynamic relocation which is no longer needed. */ + +bfd_vma +_bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) + bfd *output_bfd ATTRIBUTE_UNUSED; + asection *sec; + bfd_vma offset; +{ + struct eh_frame_sec_info *sec_info; + unsigned int lo, hi, mid; + + if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_EH_FRAME) + return offset; + sec_info = (struct eh_frame_sec_info *) + elf_section_data (sec)->sec_info; + + if (offset >= sec->_raw_size) + return offset - (sec->_cooked_size - sec->_raw_size); + + lo = 0; + hi = sec_info->count; + mid = 0; + while (lo < hi) + { + mid = (lo + hi) / 2; + if (offset < sec_info->entry[mid].offset) + hi = mid; + else if (offset + >= sec_info->entry[mid].offset + sec_info->entry[mid].size) + lo = mid + 1; + else + break; + } + + BFD_ASSERT (lo < hi); + + /* FDE or CIE was removed. */ + if (sec_info->entry[mid].removed) + return (bfd_vma) -1; + + /* If converting to DW_EH_PE_pcrel, there will be no need for run-time + relocation against FDE's initial_location field. */ + if (sec_info->entry[mid].make_relative + && ! sec_info->entry[mid].cie + && offset == sec_info->entry[mid].offset + 8) + return (bfd_vma) -1; + + /* If converting LSDA pointers to DW_EH_PE_pcrel, there will be no need + for run-time relocation against LSDA field. */ + if (sec_info->entry[mid].make_lsda_relative + && ! sec_info->entry[mid].cie + && (offset + == (sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].lsda_offset))) + return (bfd_vma) -1; + + return (offset + sec_info->entry[mid].new_offset + - sec_info->entry[mid].offset); +} + +/* Write out .eh_frame section. This is called with the relocated + contents. */ + +boolean +_bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) + bfd *abfd; + asection *sec, *ehdrsec; + bfd_byte *contents; +{ + struct eh_frame_sec_info *sec_info; + struct eh_frame_hdr_info *hdr_info; + unsigned int i; + bfd_byte *p, *buf; + unsigned int leb128_tmp; + unsigned int cie_offset = 0; + unsigned int ptr_size; + + ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS] + == ELFCLASS64) ? 8 : 4; + + if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_EH_FRAME) + return bfd_set_section_contents (abfd, sec->output_section, + contents, + (file_ptr) sec->output_offset, + sec->_raw_size); + sec_info = (struct eh_frame_sec_info *) + elf_section_data (sec)->sec_info; + hdr_info = NULL; + if (ehdrsec + && (elf_section_data (ehdrsec)->sec_info_type + == ELF_INFO_TYPE_EH_FRAME_HDR)) + { + hdr_info = (struct eh_frame_hdr_info *) + elf_section_data (ehdrsec)->sec_info; + if (hdr_info->table && hdr_info->array == NULL) + hdr_info->array + = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array)); + if (hdr_info->array == NULL) + hdr_info = NULL; + } + + p = contents; + for (i = 0; i < sec_info->count; ++i) + { + if (sec_info->entry[i].removed) + { + if (sec_info->entry[i].cie) + { + /* If CIE is removed due to no remaining FDEs referencing it + and there were no CIEs kept before it, sec_info->entry[i].sec + will be zero. */ + if (sec_info->entry[i].sec == NULL) + cie_offset = 0; + else + { + cie_offset = sec_info->entry[i].new_offset; + cie_offset += (sec_info->entry[i].sec->output_section->vma + + sec_info->entry[i].sec->output_offset + - sec->output_section->vma + - sec->output_offset); + } + } + continue; + } + + if (sec_info->entry[i].cie) + { + /* CIE */ + cie_offset = sec_info->entry[i].new_offset; + if (sec_info->entry[i].make_relative + || sec_info->entry[i].make_lsda_relative) + { + unsigned char *aug; + unsigned int action; + unsigned int dummy, per_width, per_encoding; + + /* Need to find 'R' or 'L' augmentation's argument and modify + DW_EH_PE_* value. */ + action = (sec_info->entry[i].make_relative ? 1 : 0) + | (sec_info->entry[i].make_lsda_relative ? 2 : 0); + buf = contents + sec_info->entry[i].offset; + /* Skip length, id and version. */ + buf += 9; + aug = buf; + buf = strchr (buf, '\0') + 1; + read_uleb128 (dummy, buf); + read_sleb128 (dummy, buf); + read_uleb128 (dummy, buf); + if (*aug == 'z') + { + read_uleb128 (dummy, buf); + aug++; + } + + while (action) + switch (*aug++) + { + case 'L': + if (action & 2) + { + BFD_ASSERT (*buf == sec_info->entry[i].lsda_encoding); + *buf |= DW_EH_PE_pcrel; + action &= ~2; + } + buf++; + break; + case 'P': + per_encoding = *buf++; + per_width = get_DW_EH_PE_width (per_encoding, + ptr_size); + BFD_ASSERT (per_width != 0); + if ((per_encoding & 0xf0) == DW_EH_PE_aligned) + buf = (contents + + ((buf - contents + per_width - 1) + & ~((bfd_size_type) per_width - 1))); + buf += per_width; + break; + case 'R': + if (action & 1) + { + BFD_ASSERT (*buf == sec_info->entry[i].fde_encoding); + *buf |= DW_EH_PE_pcrel; + action &= ~1; + } + buf++; + break; + default: + BFD_FAIL (); + } + } + } + else + { + /* FDE */ + bfd_vma value = 0, address; + unsigned int width; + + buf = contents + sec_info->entry[i].offset; + /* Skip length. */ + buf += 4; + bfd_put_32 (abfd, + sec_info->entry[i].new_offset + 4 - cie_offset, buf); + buf += 4; + width = get_DW_EH_PE_width (sec_info->entry[i].fde_encoding, + ptr_size); + address = value = read_value (abfd, buf, width); + if (value) + { + switch (sec_info->entry[i].fde_encoding & 0xf0) + { + case DW_EH_PE_indirect: + case DW_EH_PE_textrel: + BFD_ASSERT (hdr_info == NULL); + break; + case DW_EH_PE_datarel: + { + asection *got = bfd_get_section_by_name (abfd, ".got"); + + BFD_ASSERT (got != NULL); + address += got->vma; + } + break; + case DW_EH_PE_pcrel: + value += (sec_info->entry[i].offset + - sec_info->entry[i].new_offset); + address += (sec->output_section->vma + sec->output_offset + + sec_info->entry[i].offset + 8); + break; + } + if (sec_info->entry[i].make_relative) + value -= (sec->output_section->vma + sec->output_offset + + sec_info->entry[i].new_offset + 8); + write_value (abfd, buf, value, width); + } + + if (hdr_info) + { + hdr_info->array[hdr_info->array_count].initial_loc = address; + hdr_info->array[hdr_info->array_count++].fde + = (sec->output_section->vma + sec->output_offset + + sec_info->entry[i].new_offset); + } + + if ((sec_info->entry[i].lsda_encoding & 0xf0) == DW_EH_PE_pcrel + || sec_info->entry[i].make_lsda_relative) + { + buf += sec_info->entry[i].lsda_offset; + width = get_DW_EH_PE_width (sec_info->entry[i].lsda_encoding, + ptr_size); + value = read_value (abfd, buf, width); + if (value) + { + if ((sec_info->entry[i].lsda_encoding & 0xf0) + == DW_EH_PE_pcrel) + value += (sec_info->entry[i].offset + - sec_info->entry[i].new_offset); + else if (sec_info->entry[i].make_lsda_relative) + value -= (sec->output_section->vma + sec->output_offset + + sec_info->entry[i].new_offset + 8 + + sec_info->entry[i].lsda_offset); + write_value (abfd, buf, value, width); + } + } + } + + BFD_ASSERT (p == contents + sec_info->entry[i].new_offset); + memmove (p, contents + sec_info->entry[i].offset, + sec_info->entry[i].size); + p += sec_info->entry[i].size; + } + + /* FIXME: Once _bfd_elf_discard_section_eh_frame will be able to + shrink sections to zero size, this won't be needed any more. */ + if (p == contents && sec->_cooked_size == 16) + { + bfd_put_32 (abfd, 12, p); /* Fake CIE length */ + bfd_put_32 (abfd, 0, p + 4); /* Fake CIE id */ + p[8] = 1; /* Fake CIE version */ + memset (p + 9, 0, 7); /* Fake CIE augmentation, 3xleb128 + and 3xDW_CFA_nop as pad */ + p += 16; + } + + BFD_ASSERT ((bfd_size_type) (p - contents) == sec->_cooked_size); + + return bfd_set_section_contents (abfd, sec->output_section, + contents, (file_ptr) sec->output_offset, + sec->_cooked_size); +} + +/* Helper function used to sort .eh_frame_hdr search table by increasing + VMA of FDE initial location. */ + +static int +vma_compare (a, b) + const PTR a; + const PTR b; +{ + struct eh_frame_array_ent *p = (struct eh_frame_array_ent *) a; + struct eh_frame_array_ent *q = (struct eh_frame_array_ent *) b; + if (p->initial_loc > q->initial_loc) + return 1; + if (p->initial_loc < q->initial_loc) + return -1; + return 0; +} + +/* Write out .eh_frame_hdr section. This must be called after + _bfd_elf_write_section_eh_frame has been called on all input + .eh_frame sections. + .eh_frame_hdr format: + ubyte version (currently 1) + ubyte eh_frame_ptr_enc (DW_EH_PE_* encoding of pointer to start of + .eh_frame section) + ubyte fde_count_enc (DW_EH_PE_* encoding of total FDE count + number (or DW_EH_PE_omit if there is no + binary search table computed)) + ubyte table_enc (DW_EH_PE_* encoding of binary search table, + or DW_EH_PE_omit if not present. + DW_EH_PE_datarel is using address of + .eh_frame_hdr section start as base) + [encoded] eh_frame_ptr (pointer to start of .eh_frame section) + optionally followed by: + [encoded] fde_count (total number of FDEs in .eh_frame section) + fde_count x [encoded] initial_loc, fde + (array of encoded pairs containing + FDE initial_location field and FDE address, + sorted by increasing initial_loc) */ + +boolean +_bfd_elf_write_section_eh_frame_hdr (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct eh_frame_hdr_info *hdr_info; + unsigned int ptr_size; + bfd_byte *contents; + asection *eh_frame_sec; + bfd_size_type size; + + ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS] + == ELFCLASS64) ? 8 : 4; + + BFD_ASSERT (elf_section_data (sec)->sec_info_type + == ELF_INFO_TYPE_EH_FRAME_HDR); + hdr_info = (struct eh_frame_hdr_info *) + elf_section_data (sec)->sec_info; + if (hdr_info->strip) + return true; + + size = EH_FRAME_HDR_SIZE; + if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count) + size += 4 + hdr_info->fde_count * 8; + contents = bfd_malloc (size); + if (contents == NULL) + return false; + + eh_frame_sec = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh_frame_sec == NULL) + return false; + + memset (contents, 0, EH_FRAME_HDR_SIZE); + contents[0] = 1; /* Version */ + contents[1] = DW_EH_PE_pcrel | DW_EH_PE_sdata4; /* .eh_frame offset */ + if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count) + { + contents[2] = DW_EH_PE_udata4; /* FDE count encoding */ + contents[3] = DW_EH_PE_datarel | DW_EH_PE_sdata4; /* search table enc */ + } + else + { + contents[2] = DW_EH_PE_omit; + contents[3] = DW_EH_PE_omit; + } + bfd_put_32 (abfd, eh_frame_sec->vma - sec->output_section->vma - 4, + contents + 4); + if (contents[2] != DW_EH_PE_omit) + { + unsigned int i; + + bfd_put_32 (abfd, hdr_info->fde_count, contents + EH_FRAME_HDR_SIZE); + qsort (hdr_info->array, hdr_info->fde_count, sizeof (*hdr_info->array), + vma_compare); + for (i = 0; i < hdr_info->fde_count; i++) + { + bfd_put_32 (abfd, + hdr_info->array[i].initial_loc + - sec->output_section->vma, + contents + EH_FRAME_HDR_SIZE + i * 8 + 4); + bfd_put_32 (abfd, + hdr_info->array[i].fde - sec->output_section->vma, + contents + EH_FRAME_HDR_SIZE + i * 8 + 8); + } + } + + return bfd_set_section_contents (abfd, sec->output_section, + contents, (file_ptr) sec->output_offset, + sec->_cooked_size); +} diff --git a/contrib/binutils/bfd/elf-strtab.c b/contrib/binutils/bfd/elf-strtab.c new file mode 100644 index 0000000..ff7d9a4 --- /dev/null +++ b/contrib/binutils/bfd/elf-strtab.c @@ -0,0 +1,449 @@ +/* ELF strtab with GC and suffix merging support. + Copyright 2001 Free Software Foundation, Inc. + Written by Jakub Jelinek . + +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 "hashtab.h" + +/* An entry in the strtab hash table. */ + +struct elf_strtab_hash_entry +{ + struct bfd_hash_entry root; + /* Length of this entry. */ + unsigned int len; + unsigned int refcount; + union { + /* Index within the merged section. */ + bfd_size_type index; + /* Entry this is a suffix of (if len is 0). */ + struct elf_strtab_hash_entry *suffix; + struct elf_strtab_hash_entry *next; + } u; +}; + +/* The strtab hash table. */ + +struct elf_strtab_hash +{ + struct bfd_hash_table table; + /* Next available index. */ + bfd_size_type size; + /* Number of array entries alloced. */ + bfd_size_type alloced; + /* Final strtab size. */ + bfd_size_type sec_size; + /* Array of pointers to strtab entries. */ + struct elf_strtab_hash_entry **array; +}; + +static struct bfd_hash_entry *elf_strtab_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static int cmplengthentry PARAMS ((const PTR, const PTR)); +static int last4_eq PARAMS ((const PTR, const PTR)); + +/* Routine to create an entry in a section merge hashtab. */ + +static struct bfd_hash_entry * +elf_strtab_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf_strtab_hash_entry *ret = (struct elf_strtab_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == (struct elf_strtab_hash_entry *) NULL) + ret = ((struct elf_strtab_hash_entry *) + bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry))); + if (ret == (struct elf_strtab_hash_entry *) NULL) + return NULL; + + /* Call the allocation method of the superclass. */ + ret = ((struct elf_strtab_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + if (ret) + { + /* Initialize the local fields. */ + ret->u.index = -1; + ret->refcount = 0; + ret->len = 0; + } + + return (struct bfd_hash_entry *)ret; +} + +/* Create a new hash table. */ + +struct elf_strtab_hash * +_bfd_elf_strtab_init () +{ + struct elf_strtab_hash *table; + bfd_size_type amt = sizeof (struct elf_strtab_hash); + + table = (struct elf_strtab_hash *) bfd_malloc (amt); + if (table == NULL) + return NULL; + + if (! bfd_hash_table_init (&table->table, elf_strtab_hash_newfunc)) + { + free (table); + return NULL; + } + + table->sec_size = 0; + table->size = 1; + table->alloced = 64; + amt = sizeof (struct elf_strtab_hasn_entry *); + table->array = (struct elf_strtab_hash_entry **) + bfd_malloc (table->alloced * amt); + if (table->array == NULL) + { + free (table); + return NULL; + } + + table->array[0] = NULL; + + return table; +} + +/* Free a strtab. */ + +void +_bfd_elf_strtab_free (tab) + struct elf_strtab_hash *tab; +{ + bfd_hash_table_free (&tab->table); + free (tab->array); + free (tab); +} + +/* Get the index of an entity in a hash table, adding it if it is not + already present. */ + +bfd_size_type +_bfd_elf_strtab_add (tab, str, copy) + struct elf_strtab_hash *tab; + const char *str; + boolean copy; +{ + register struct elf_strtab_hash_entry *entry; + + /* We handle this specially, since we don't want to do refcounting + on it. */ + if (*str == '\0') + return 0; + + BFD_ASSERT (tab->sec_size == 0); + entry = (struct elf_strtab_hash_entry *) + bfd_hash_lookup (&tab->table, str, true, copy); + + if (entry == NULL) + return (bfd_size_type) -1; + + entry->refcount++; + if (entry->len == 0) + { + entry->len = strlen (str) + 1; + if (tab->size == tab->alloced) + { + bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *); + tab->alloced *= 2; + tab->array = (struct elf_strtab_hash_entry **) + bfd_realloc (tab->array, tab->alloced * amt); + if (tab->array == NULL) + return (bfd_size_type) -1; + } + + entry->u.index = tab->size++; + tab->array[entry->u.index] = entry; + } + return entry->u.index; +} + +void +_bfd_elf_strtab_addref (tab, idx) + struct elf_strtab_hash *tab; + bfd_size_type idx; +{ + if (idx == 0 || idx == (bfd_size_type) -1) + return; + BFD_ASSERT (tab->sec_size == 0); + BFD_ASSERT (idx < tab->size); + ++tab->array[idx]->refcount; +} + +void +_bfd_elf_strtab_delref (tab, idx) + struct elf_strtab_hash *tab; + bfd_size_type idx; +{ + if (idx == 0 || idx == (bfd_size_type) -1) + return; + BFD_ASSERT (tab->sec_size == 0); + BFD_ASSERT (idx < tab->size); + BFD_ASSERT (tab->array[idx]->refcount > 0); + --tab->array[idx]->refcount; +} + +void +_bfd_elf_strtab_clear_all_refs (tab) + struct elf_strtab_hash *tab; +{ + bfd_size_type idx; + + for (idx = 1; idx < tab->size; ++idx) + tab->array[idx]->refcount = 0; +} + +bfd_size_type +_bfd_elf_strtab_size (tab) + struct elf_strtab_hash *tab; +{ + return tab->sec_size ? tab->sec_size : tab->size; +} + +bfd_size_type +_bfd_elf_strtab_offset (tab, idx) + struct elf_strtab_hash *tab; + bfd_size_type idx; +{ + struct elf_strtab_hash_entry *entry; + + if (idx == 0) + return 0; + BFD_ASSERT (idx < tab->size); + BFD_ASSERT (tab->sec_size); + entry = tab->array[idx]; + BFD_ASSERT (entry->refcount > 0); + entry->refcount--; + return tab->array[idx]->u.index; +} + +boolean +_bfd_elf_strtab_emit (abfd, tab) + register bfd *abfd; + struct elf_strtab_hash *tab; +{ + bfd_size_type off = 1, i; + + if (bfd_bwrite ("", 1, abfd) != 1) + return false; + + for (i = 1; i < tab->size; ++i) + { + register const char *str; + register size_t len; + + str = tab->array[i]->root.string; + len = tab->array[i]->len; + BFD_ASSERT (tab->array[i]->refcount == 0); + if (len == 0) + continue; + + if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) + return false; + + off += len; + } + + BFD_ASSERT (off == tab->sec_size); + return true; +} + +/* Compare two elf_strtab_hash_entry structures. This is called via qsort. */ + +static int +cmplengthentry (a, b) + const PTR a; + const PTR b; +{ + struct elf_strtab_hash_entry * A = *(struct elf_strtab_hash_entry **) a; + struct elf_strtab_hash_entry * B = *(struct elf_strtab_hash_entry **) b; + + if (A->len < B->len) + return 1; + else if (A->len > B->len) + return -1; + + return memcmp (A->root.string, B->root.string, A->len); +} + +static int +last4_eq (a, b) + const PTR a; + const PTR b; +{ + struct elf_strtab_hash_entry * A = (struct elf_strtab_hash_entry *) a; + struct elf_strtab_hash_entry * B = (struct elf_strtab_hash_entry *) b; + + if (memcmp (A->root.string + A->len - 5, B->root.string + B->len - 5, 4) + != 0) + /* This was a hashtable collision. */ + return 0; + + if (A->len <= B->len) + /* B cannot be a suffix of A unless A is equal to B, which is guaranteed + not to be equal by the hash table. */ + return 0; + + return memcmp (A->root.string + (A->len - B->len), + B->root.string, B->len - 5) == 0; +} + +/* This function assigns final string table offsets for used strings, + merging strings matching suffixes of longer strings if possible. */ + +void +_bfd_elf_strtab_finalize (tab) + struct elf_strtab_hash *tab; +{ + struct elf_strtab_hash_entry **array, **a, **end, *e; + htab_t last4tab = NULL; + bfd_size_type size, amt; + struct elf_strtab_hash_entry *last[256], **last_ptr[256]; + + /* GCC 2.91.66 (egcs-1.1.2) on i386 miscompiles this function when i is + a 64-bit bfd_size_type: a 64-bit target or --enable-64-bit-bfd. + Besides, indexing with a long long wouldn't give anything but extra + cycles. */ + size_t i; + + /* Now sort the strings by length, longest first. */ + array = NULL; + amt = tab->size * sizeof (struct elf_strtab_hash_entry *); + array = (struct elf_strtab_hash_entry **) bfd_malloc (amt); + if (array == NULL) + goto alloc_failure; + + memset (last, 0, sizeof (last)); + for (i = 0; i < 256; ++i) + last_ptr[i] = &last[i]; + for (i = 1, a = array; i < tab->size; ++i) + if (tab->array[i]->refcount) + *a++ = tab->array[i]; + else + tab->array[i]->len = 0; + + size = a - array; + + qsort (array, size, sizeof (struct elf_strtab_hash_entry *), cmplengthentry); + + last4tab = htab_create (size * 4, NULL, last4_eq, NULL); + if (last4tab == NULL) + goto alloc_failure; + + /* Now insert the strings into hash tables (strings with last 4 characters + and strings with last character equal), look for longer strings which + we're suffix of. */ + for (a = array, end = array + size; a < end; a++) + { + register hashval_t hash; + unsigned int c; + unsigned int j; + const unsigned char *s; + PTR *p; + + e = *a; + if (e->len > 4) + { + s = e->root.string + e->len - 1; + hash = 0; + for (j = 0; j < 4; j++) + { + c = *--s; + hash += c + (c << 17); + hash ^= hash >> 2; + } + p = htab_find_slot_with_hash (last4tab, e, hash, INSERT); + if (p == NULL) + goto alloc_failure; + if (*p) + { + struct elf_strtab_hash_entry *ent; + + ent = (struct elf_strtab_hash_entry *) *p; + e->u.suffix = ent; + e->len = 0; + continue; + } + else + *p = (PTR) e; + } + else + { + struct elf_strtab_hash_entry *tem; + + c = e->root.string[e->len - 2] & 0xff; + + for (tem = last[c]; tem; tem = tem->u.next) + if (tem->len > e->len + && memcmp (tem->root.string + (tem->len - e->len), + e->root.string, e->len - 1) == 0) + break; + if (tem) + { + e->u.suffix = tem; + e->len = 0; + continue; + } + } + + c = e->root.string[e->len - 2] & 0xff; + /* Put longest strings first. */ + *last_ptr[c] = e; + last_ptr[c] = &e->u.next; + e->u.next = NULL; + } + +alloc_failure: + if (array) + free (array); + if (last4tab) + htab_delete (last4tab); + + /* Now assign positions to the strings we want to keep. */ + size = 1; + for (i = 1; i < tab->size; ++i) + { + e = tab->array[i]; + if (e->refcount && e->len) + { + e->u.index = size; + size += e->len; + } + } + + tab->sec_size = size; + + /* And now adjust the rest. */ + for (i = 1; i < tab->size; ++i) + { + e = tab->array[i]; + if (e->refcount && ! e->len) + e->u.index = e->u.suffix->u.index + + (e->u.suffix->len - strlen (e->root.string) - 1); + } +} diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c index f98b49c..29c08d7 100644 --- a/contrib/binutils/bfd/elf.c +++ b/contrib/binutils/bfd/elf.c @@ -1,5 +1,5 @@ /* ELF executable support for BFD. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -40,6 +40,7 @@ SECTION #include "libbfd.h" #define ARCH_SIZE 0 #include "elf-bfd.h" +#include "libiberty.h" static INLINE struct elf_segment_map *make_mapping PARAMS ((bfd *, asection **, unsigned int, unsigned int, boolean)); @@ -50,17 +51,31 @@ static boolean assign_file_positions_except_relocs PARAMS ((bfd *)); static boolean prep_headers PARAMS ((bfd *)); static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int)); static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static char *elf_read PARAMS ((bfd *, long, unsigned int)); +static char *elf_read PARAMS ((bfd *, file_ptr, bfd_size_type)); +static boolean setup_group PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); +static void merge_sections_remove_hook PARAMS ((bfd *, asection *)); static void elf_fake_sections PARAMS ((bfd *, asection *, PTR)); +static void set_group_contents PARAMS ((bfd *, asection *, PTR)); static boolean assign_section_numbers PARAMS ((bfd *)); static INLINE int sym_is_global PARAMS ((bfd *, asymbol *)); static boolean elf_map_symbols PARAMS ((bfd *)); static bfd_size_type get_program_header_size PARAMS ((bfd *)); -static boolean elfcore_read_notes PARAMS ((bfd *, bfd_vma, bfd_vma)); -static boolean elf_find_function PARAMS ((bfd *, asection *, - asymbol **, - bfd_vma, const char **, - const char **)); +static boolean elfcore_read_notes PARAMS ((bfd *, file_ptr, bfd_size_type)); +static boolean elf_find_function PARAMS ((bfd *, asection *, asymbol **, + bfd_vma, const char **, + const char **)); +static int elfcore_make_pid PARAMS ((bfd *)); +static boolean elfcore_maybe_make_sect PARAMS ((bfd *, char *, asection *)); +static boolean elfcore_make_note_pseudosection PARAMS ((bfd *, char *, + Elf_Internal_Note *)); +static boolean elfcore_grok_prfpreg PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean elfcore_grok_prxfpreg PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean elfcore_grok_note PARAMS ((bfd *, Elf_Internal_Note *)); + +static boolean elfcore_netbsd_get_lwpid PARAMS ((Elf_Internal_Note *, int *)); +static boolean elfcore_grok_netbsd_procinfo PARAMS ((bfd *, + Elf_Internal_Note *)); +static boolean elfcore_grok_netbsd_note PARAMS ((bfd *, Elf_Internal_Note *)); /* Swap version information in and out. The version information is currently size independent. If that ever changes, this code will @@ -74,13 +89,13 @@ _bfd_elf_swap_verdef_in (abfd, src, dst) const Elf_External_Verdef *src; Elf_Internal_Verdef *dst; { - dst->vd_version = bfd_h_get_16 (abfd, src->vd_version); - dst->vd_flags = bfd_h_get_16 (abfd, src->vd_flags); - dst->vd_ndx = bfd_h_get_16 (abfd, src->vd_ndx); - dst->vd_cnt = bfd_h_get_16 (abfd, src->vd_cnt); - dst->vd_hash = bfd_h_get_32 (abfd, src->vd_hash); - dst->vd_aux = bfd_h_get_32 (abfd, src->vd_aux); - dst->vd_next = bfd_h_get_32 (abfd, src->vd_next); + dst->vd_version = H_GET_16 (abfd, src->vd_version); + dst->vd_flags = H_GET_16 (abfd, src->vd_flags); + dst->vd_ndx = H_GET_16 (abfd, src->vd_ndx); + dst->vd_cnt = H_GET_16 (abfd, src->vd_cnt); + dst->vd_hash = H_GET_32 (abfd, src->vd_hash); + dst->vd_aux = H_GET_32 (abfd, src->vd_aux); + dst->vd_next = H_GET_32 (abfd, src->vd_next); } /* Swap out a Verdef structure. */ @@ -91,13 +106,13 @@ _bfd_elf_swap_verdef_out (abfd, src, dst) const Elf_Internal_Verdef *src; Elf_External_Verdef *dst; { - bfd_h_put_16 (abfd, src->vd_version, dst->vd_version); - bfd_h_put_16 (abfd, src->vd_flags, dst->vd_flags); - bfd_h_put_16 (abfd, src->vd_ndx, dst->vd_ndx); - bfd_h_put_16 (abfd, src->vd_cnt, dst->vd_cnt); - bfd_h_put_32 (abfd, src->vd_hash, dst->vd_hash); - bfd_h_put_32 (abfd, src->vd_aux, dst->vd_aux); - bfd_h_put_32 (abfd, src->vd_next, dst->vd_next); + H_PUT_16 (abfd, src->vd_version, dst->vd_version); + H_PUT_16 (abfd, src->vd_flags, dst->vd_flags); + H_PUT_16 (abfd, src->vd_ndx, dst->vd_ndx); + H_PUT_16 (abfd, src->vd_cnt, dst->vd_cnt); + H_PUT_32 (abfd, src->vd_hash, dst->vd_hash); + H_PUT_32 (abfd, src->vd_aux, dst->vd_aux); + H_PUT_32 (abfd, src->vd_next, dst->vd_next); } /* Swap in a Verdaux structure. */ @@ -108,8 +123,8 @@ _bfd_elf_swap_verdaux_in (abfd, src, dst) const Elf_External_Verdaux *src; Elf_Internal_Verdaux *dst; { - dst->vda_name = bfd_h_get_32 (abfd, src->vda_name); - dst->vda_next = bfd_h_get_32 (abfd, src->vda_next); + dst->vda_name = H_GET_32 (abfd, src->vda_name); + dst->vda_next = H_GET_32 (abfd, src->vda_next); } /* Swap out a Verdaux structure. */ @@ -120,8 +135,8 @@ _bfd_elf_swap_verdaux_out (abfd, src, dst) const Elf_Internal_Verdaux *src; Elf_External_Verdaux *dst; { - bfd_h_put_32 (abfd, src->vda_name, dst->vda_name); - bfd_h_put_32 (abfd, src->vda_next, dst->vda_next); + H_PUT_32 (abfd, src->vda_name, dst->vda_name); + H_PUT_32 (abfd, src->vda_next, dst->vda_next); } /* Swap in a Verneed structure. */ @@ -132,11 +147,11 @@ _bfd_elf_swap_verneed_in (abfd, src, dst) const Elf_External_Verneed *src; Elf_Internal_Verneed *dst; { - dst->vn_version = bfd_h_get_16 (abfd, src->vn_version); - dst->vn_cnt = bfd_h_get_16 (abfd, src->vn_cnt); - dst->vn_file = bfd_h_get_32 (abfd, src->vn_file); - dst->vn_aux = bfd_h_get_32 (abfd, src->vn_aux); - dst->vn_next = bfd_h_get_32 (abfd, src->vn_next); + dst->vn_version = H_GET_16 (abfd, src->vn_version); + dst->vn_cnt = H_GET_16 (abfd, src->vn_cnt); + dst->vn_file = H_GET_32 (abfd, src->vn_file); + dst->vn_aux = H_GET_32 (abfd, src->vn_aux); + dst->vn_next = H_GET_32 (abfd, src->vn_next); } /* Swap out a Verneed structure. */ @@ -147,11 +162,11 @@ _bfd_elf_swap_verneed_out (abfd, src, dst) const Elf_Internal_Verneed *src; Elf_External_Verneed *dst; { - bfd_h_put_16 (abfd, src->vn_version, dst->vn_version); - bfd_h_put_16 (abfd, src->vn_cnt, dst->vn_cnt); - bfd_h_put_32 (abfd, src->vn_file, dst->vn_file); - bfd_h_put_32 (abfd, src->vn_aux, dst->vn_aux); - bfd_h_put_32 (abfd, src->vn_next, dst->vn_next); + H_PUT_16 (abfd, src->vn_version, dst->vn_version); + H_PUT_16 (abfd, src->vn_cnt, dst->vn_cnt); + H_PUT_32 (abfd, src->vn_file, dst->vn_file); + H_PUT_32 (abfd, src->vn_aux, dst->vn_aux); + H_PUT_32 (abfd, src->vn_next, dst->vn_next); } /* Swap in a Vernaux structure. */ @@ -162,11 +177,11 @@ _bfd_elf_swap_vernaux_in (abfd, src, dst) const Elf_External_Vernaux *src; Elf_Internal_Vernaux *dst; { - dst->vna_hash = bfd_h_get_32 (abfd, src->vna_hash); - dst->vna_flags = bfd_h_get_16 (abfd, src->vna_flags); - dst->vna_other = bfd_h_get_16 (abfd, src->vna_other); - dst->vna_name = bfd_h_get_32 (abfd, src->vna_name); - dst->vna_next = bfd_h_get_32 (abfd, src->vna_next); + dst->vna_hash = H_GET_32 (abfd, src->vna_hash); + dst->vna_flags = H_GET_16 (abfd, src->vna_flags); + dst->vna_other = H_GET_16 (abfd, src->vna_other); + dst->vna_name = H_GET_32 (abfd, src->vna_name); + dst->vna_next = H_GET_32 (abfd, src->vna_next); } /* Swap out a Vernaux structure. */ @@ -177,11 +192,11 @@ _bfd_elf_swap_vernaux_out (abfd, src, dst) const Elf_Internal_Vernaux *src; Elf_External_Vernaux *dst; { - bfd_h_put_32 (abfd, src->vna_hash, dst->vna_hash); - bfd_h_put_16 (abfd, src->vna_flags, dst->vna_flags); - bfd_h_put_16 (abfd, src->vna_other, dst->vna_other); - bfd_h_put_32 (abfd, src->vna_name, dst->vna_name); - bfd_h_put_32 (abfd, src->vna_next, dst->vna_next); + H_PUT_32 (abfd, src->vna_hash, dst->vna_hash); + H_PUT_16 (abfd, src->vna_flags, dst->vna_flags); + H_PUT_16 (abfd, src->vna_other, dst->vna_other); + H_PUT_32 (abfd, src->vna_name, dst->vna_name); + H_PUT_32 (abfd, src->vna_next, dst->vna_next); } /* Swap in a Versym structure. */ @@ -192,7 +207,7 @@ _bfd_elf_swap_versym_in (abfd, src, dst) const Elf_External_Versym *src; Elf_Internal_Versym *dst; { - dst->vs_vers = bfd_h_get_16 (abfd, src->vs_vers); + dst->vs_vers = H_GET_16 (abfd, src->vs_vers); } /* Swap out a Versym structure. */ @@ -203,7 +218,7 @@ _bfd_elf_swap_versym_out (abfd, src, dst) const Elf_Internal_Versym *src; Elf_External_Versym *dst; { - bfd_h_put_16 (abfd, src->vs_vers, dst->vs_vers); + H_PUT_16 (abfd, src->vs_vers, dst->vs_vers); } /* Standard ELF hash function. Do not change this function; you will @@ -239,16 +254,16 @@ bfd_elf_hash (namearg) static char * elf_read (abfd, offset, size) bfd *abfd; - long offset; - unsigned int size; + file_ptr offset; + bfd_size_type size; { char *buf; if ((buf = bfd_alloc (abfd, size)) == NULL) return NULL; - if (bfd_seek (abfd, offset, SEEK_SET) == -1) + if (bfd_seek (abfd, offset, SEEK_SET) != 0) return NULL; - if (bfd_read ((PTR) buf, size, 1, abfd) != size) + if (bfd_bread ((PTR) buf, size, abfd) != size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_file_truncated); @@ -263,8 +278,8 @@ bfd_elf_mkobject (abfd) { /* This just does initialization. */ /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ - elf_tdata (abfd) = (struct elf_obj_tdata *) - bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); + bfd_size_type amt = sizeof (struct elf_obj_tdata); + elf_tdata (abfd) = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); if (elf_tdata (abfd) == 0) return false; /* Since everything is done at close time, do we need any @@ -288,8 +303,8 @@ bfd_elf_get_str_section (abfd, shindex) { Elf_Internal_Shdr **i_shdrp; char *shstrtab = NULL; - unsigned int offset; - unsigned int shstrtabsize; + file_ptr offset; + bfd_size_type shstrtabsize; i_shdrp = elf_elfsections (abfd); if (i_shdrp == 0 || i_shdrp[shindex] == 0) @@ -328,7 +343,7 @@ bfd_elf_string_from_elf_section (abfd, shindex, strindex) { (*_bfd_error_handler) (_("%s: invalid string offset %u >= %lu for section `%s'"), - bfd_get_filename (abfd), strindex, (unsigned long) hdr->sh_size, + bfd_archive_filename (abfd), strindex, (unsigned long) hdr->sh_size, ((shindex == elf_elfheader(abfd)->e_shstrndx && strindex == hdr->sh_name) ? ".shstrtab" @@ -339,6 +354,186 @@ bfd_elf_string_from_elf_section (abfd, shindex, strindex) return ((char *) hdr->contents) + strindex; } +/* Elf_Internal_Shdr->contents is an array of these for SHT_GROUP + sections. The first element is the flags, the rest are section + pointers. */ + +typedef union elf_internal_group { + Elf_Internal_Shdr *shdr; + unsigned int flags; +} Elf_Internal_Group; + +/* Set next_in_group list pointer, and group name for NEWSECT. */ + +static boolean +setup_group (abfd, hdr, newsect) + bfd *abfd; + Elf_Internal_Shdr *hdr; + asection *newsect; +{ + unsigned int num_group = elf_tdata (abfd)->num_group; + + /* If num_group is zero, read in all SHT_GROUP sections. The count + is set to -1 if there are no SHT_GROUP sections. */ + if (num_group == 0) + { + unsigned int i, shnum; + + /* First count the number of groups. If we have a SHT_GROUP + section with just a flag word (ie. sh_size is 4), ignore it. */ + shnum = elf_numsections (abfd); + num_group = 0; + for (i = 0; i < shnum; i++) + { + Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; + if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + num_group += 1; + } + + if (num_group == 0) + num_group = (unsigned) -1; + elf_tdata (abfd)->num_group = num_group; + + if (num_group > 0) + { + /* We keep a list of elf section headers for group sections, + so we can find them quickly. */ + bfd_size_type amt = num_group * sizeof (Elf_Internal_Shdr *); + elf_tdata (abfd)->group_sect_ptr = bfd_alloc (abfd, amt); + if (elf_tdata (abfd)->group_sect_ptr == NULL) + return false; + + num_group = 0; + for (i = 0; i < shnum; i++) + { + Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; + if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + { + unsigned char *src; + Elf_Internal_Group *dest; + + /* Add to list of sections. */ + elf_tdata (abfd)->group_sect_ptr[num_group] = shdr; + num_group += 1; + + /* Read the raw contents. */ + BFD_ASSERT (sizeof (*dest) >= 4); + amt = shdr->sh_size * sizeof (*dest) / 4; + shdr->contents = bfd_alloc (abfd, amt); + if (shdr->contents == NULL + || bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 + || (bfd_bread (shdr->contents, shdr->sh_size, abfd) + != shdr->sh_size)) + return false; + + /* Translate raw contents, a flag word followed by an + array of elf section indices all in target byte order, + to the flag word followed by an array of elf section + pointers. */ + src = shdr->contents + shdr->sh_size; + dest = (Elf_Internal_Group *) (shdr->contents + amt); + while (1) + { + unsigned int idx; + + src -= 4; + --dest; + idx = H_GET_32 (abfd, src); + if (src == shdr->contents) + { + dest->flags = idx; + break; + } + if (idx >= shnum) + { + ((*_bfd_error_handler) + (_("%s: invalid SHT_GROUP entry"), + bfd_archive_filename (abfd))); + idx = 0; + } + dest->shdr = elf_elfsections (abfd)[idx]; + } + } + } + } + } + + if (num_group != (unsigned) -1) + { + unsigned int i; + + for (i = 0; i < num_group; i++) + { + Elf_Internal_Shdr *shdr = elf_tdata (abfd)->group_sect_ptr[i]; + Elf_Internal_Group *idx = (Elf_Internal_Group *) shdr->contents; + unsigned int n_elt = shdr->sh_size / 4; + + /* Look through this group's sections to see if current + section is a member. */ + while (--n_elt != 0) + if ((++idx)->shdr == hdr) + { + asection *s = NULL; + + /* We are a member of this group. Go looking through + other members to see if any others are linked via + next_in_group. */ + idx = (Elf_Internal_Group *) shdr->contents; + n_elt = shdr->sh_size / 4; + while (--n_elt != 0) + if ((s = (++idx)->shdr->bfd_section) != NULL + && elf_next_in_group (s) != NULL) + break; + if (n_elt != 0) + { + /* Snarf the group name from other member, and + insert current section in circular list. */ + elf_group_name (newsect) = elf_group_name (s); + elf_next_in_group (newsect) = elf_next_in_group (s); + elf_next_in_group (s) = newsect; + } + else + { + struct elf_backend_data *bed; + file_ptr pos; + unsigned char ename[4]; + unsigned long iname; + const char *gname; + + /* Humbug. Get the name from the group signature + symbol. Why isn't the signature just a string? + Fortunately, the name index is at the same + place in the external symbol for both 32 and 64 + bit ELF. */ + bed = get_elf_backend_data (abfd); + pos = elf_tdata (abfd)->symtab_hdr.sh_offset; + pos += shdr->sh_info * bed->s->sizeof_sym; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread (ename, (bfd_size_type) 4, abfd) != 4) + return false; + iname = H_GET_32 (abfd, ename); + gname = elf_string_from_elf_strtab (abfd, iname); + elf_group_name (newsect) = gname; + + /* Start a circular list with one element. */ + elf_next_in_group (newsect) = newsect; + } + if (shdr->bfd_section != NULL) + elf_next_in_group (shdr->bfd_section) = newsect; + i = num_group - 1; + break; + } + } + } + + if (elf_group_name (newsect) == NULL) + { + (*_bfd_error_handler) (_("%s: no group info for section %s"), + bfd_archive_filename (abfd), newsect->name); + } + return true; +} + /* Make a BFD section from an ELF section. We store a pointer to the BFD section in the bfd_section field of the header. */ @@ -368,12 +563,14 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) if (! bfd_set_section_vma (abfd, newsect, hdr->sh_addr) || ! bfd_set_section_size (abfd, newsect, hdr->sh_size) || ! bfd_set_section_alignment (abfd, newsect, - bfd_log2 (hdr->sh_addralign))) + bfd_log2 ((bfd_vma) hdr->sh_addralign))) return false; flags = SEC_NO_FLAGS; if (hdr->sh_type != SHT_NOBITS) flags |= SEC_HAS_CONTENTS; + if (hdr->sh_type == SHT_GROUP) + flags |= SEC_GROUP | SEC_EXCLUDE; if ((hdr->sh_flags & SHF_ALLOC) != 0) { flags |= SEC_ALLOC; @@ -386,6 +583,16 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) flags |= SEC_CODE; else if ((flags & SEC_LOAD) != 0) flags |= SEC_DATA; + if ((hdr->sh_flags & SHF_MERGE) != 0) + { + flags |= SEC_MERGE; + newsect->entsize = hdr->sh_entsize; + if ((hdr->sh_flags & SHF_STRINGS) != 0) + flags |= SEC_STRINGS; + } + if (hdr->sh_flags & SHF_GROUP) + if (!setup_group (abfd, hdr, newsect)) + return false; /* The debugging sections appear to be recognized only by name, not any sort of flag. */ @@ -399,7 +606,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) }; int i; - for (i = sizeof (debug_sec_names) / sizeof (debug_sec_names[0]); i--;) + for (i = ARRAY_SIZE (debug_sec_names); i--;) if (strncmp (name, debug_sec_names[i], strlen (debug_sec_names[i])) == 0) break; @@ -443,17 +650,30 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) phdr = elf_tdata (abfd)->phdr; for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++) { + /* This section is part of this segment if its file + offset plus size lies within the segment's memory + span and, if the section is loaded, the extent of the + loaded data lies within the extent of the segment. + If the p_paddr field is not set, we don't alter the + LMA. */ if (phdr->p_type == PT_LOAD - && phdr->p_vaddr != phdr->p_paddr - && phdr->p_vaddr <= hdr->sh_addr - && (phdr->p_vaddr + phdr->p_memsz - >= hdr->sh_addr + hdr->sh_size) + && phdr->p_paddr + && (bfd_vma) hdr->sh_offset >= phdr->p_offset + && (hdr->sh_offset + hdr->sh_size + <= phdr->p_offset + phdr->p_memsz) && ((flags & SEC_LOAD) == 0 - || (phdr->p_offset <= (bfd_vma) hdr->sh_offset - && (phdr->p_offset + phdr->p_filesz - >= hdr->sh_offset + hdr->sh_size)))) + || (phdr->p_offset + phdr->p_filesz + >= hdr->sh_offset + hdr->sh_size))) { - newsect->lma += phdr->p_paddr - phdr->p_vaddr; + /* We used to do a relative adjustment here, but + that doesn't work if the segment is packed with + code from multiple VMAs. Instead we calculate + the LMA absoultely, based on the LMA of the + segment (it is assumed that the segment will + contain sections with contiguous LMAs, even if + the VMAs are not). */ + newsect->lma = phdr->p_paddr + + hdr->sh_offset - phdr->p_offset; break; } } @@ -494,11 +714,11 @@ bfd_elf_find_section (abfd, name) i_shdrp = elf_elfsections (abfd); if (i_shdrp != NULL) { - shstrtab = bfd_elf_get_str_section - (abfd, elf_elfheader (abfd)->e_shstrndx); + shstrtab = bfd_elf_get_str_section (abfd, + elf_elfheader (abfd)->e_shstrndx); if (shstrtab != NULL) { - max = elf_elfheader (abfd)->e_shnum; + max = elf_numsections (abfd); for (i = 1; i < max; i++) if (!strcmp (&shstrtab[i_shdrp[i]->sh_name], name)) return i_shdrp[i]; @@ -551,6 +771,57 @@ bfd_elf_generic_reloc (abfd, return bfd_reloc_continue; } +/* Make sure sec_info_type is cleared if sec_info is cleared too. */ + +static void +merge_sections_remove_hook (abfd, sec) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; +{ + struct bfd_elf_section_data *sec_data; + + sec_data = elf_section_data (sec); + BFD_ASSERT (sec_data->sec_info_type == ELF_INFO_TYPE_MERGE); + sec_data->sec_info_type = ELF_INFO_TYPE_NONE; +} + +/* Finish SHF_MERGE section merging. */ + +boolean +_bfd_elf_merge_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + if (!is_elf_hash_table (info)) + return false; + if (elf_hash_table (info)->merge_info) + _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info, + merge_sections_remove_hook); + return true; +} + +/* Copy the program header and other data from one object module to + another. */ + +boolean +_bfd_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; +} + /* Print out the program headers. */ boolean @@ -572,37 +843,38 @@ _bfd_elf_print_private_bfd_data (abfd, farg) c = elf_elfheader (abfd)->e_phnum; for (i = 0; i < c; i++, p++) { - const char *s; + const char *pt; char buf[20]; switch (p->p_type) { - case PT_NULL: s = "NULL"; break; - case PT_LOAD: s = "LOAD"; break; - case PT_DYNAMIC: s = "DYNAMIC"; break; - case PT_INTERP: s = "INTERP"; break; - case PT_NOTE: s = "NOTE"; break; - case PT_SHLIB: s = "SHLIB"; break; - case PT_PHDR: s = "PHDR"; break; - default: sprintf (buf, "0x%lx", p->p_type); s = buf; break; + case PT_NULL: pt = "NULL"; break; + case PT_LOAD: pt = "LOAD"; break; + case PT_DYNAMIC: pt = "DYNAMIC"; break; + case PT_INTERP: pt = "INTERP"; break; + case PT_NOTE: pt = "NOTE"; break; + case PT_SHLIB: pt = "SHLIB"; break; + case PT_PHDR: pt = "PHDR"; break; + case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break; + default: sprintf (buf, "0x%lx", p->p_type); pt = buf; break; } - fprintf (f, "%8s off 0x", s); - fprintf_vma (f, p->p_offset); + fprintf (f, "%8s off 0x", pt); + bfd_fprintf_vma (abfd, f, p->p_offset); fprintf (f, " vaddr 0x"); - fprintf_vma (f, p->p_vaddr); + bfd_fprintf_vma (abfd, f, p->p_vaddr); fprintf (f, " paddr 0x"); - fprintf_vma (f, p->p_paddr); + bfd_fprintf_vma (abfd, f, p->p_paddr); fprintf (f, " align 2**%u\n", bfd_log2 (p->p_align)); fprintf (f, " filesz 0x"); - fprintf_vma (f, p->p_filesz); + bfd_fprintf_vma (abfd, f, p->p_filesz); fprintf (f, " memsz 0x"); - fprintf_vma (f, p->p_memsz); + bfd_fprintf_vma (abfd, f, p->p_memsz); fprintf (f, " flags %c%c%c", (p->p_flags & PF_R) != 0 ? 'r' : '-', (p->p_flags & PF_W) != 0 ? 'w' : '-', (p->p_flags & PF_X) != 0 ? 'x' : '-'); - if ((p->p_flags &~ (PF_R | PF_W | PF_X)) != 0) - fprintf (f, " %lx", p->p_flags &~ (PF_R | PF_W | PF_X)); + if ((p->p_flags &~ (unsigned) (PF_R | PF_W | PF_X)) != 0) + fprintf (f, " %lx", p->p_flags &~ (unsigned) (PF_R | PF_W | PF_X)); fprintf (f, "\n"); } } @@ -611,7 +883,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) if (s != NULL) { int elfsec; - unsigned long link; + unsigned long shlink; bfd_byte *extdyn, *extdynend; size_t extdynsize; void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); @@ -628,7 +900,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) elfsec = _bfd_elf_section_from_bfd_section (abfd, s); if (elfsec == -1) goto error_return; - link = elf_elfsections (abfd)[elfsec]->sh_link; + shlink = elf_elfsections (abfd)[elfsec]->sh_link; extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; @@ -720,9 +992,9 @@ _bfd_elf_print_private_bfd_data (abfd, farg) else { const char *string; + unsigned int tagv = dyn.d_un.d_val; - string = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + string = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (string == NULL) goto error_return; fprintf (f, "%s", string); @@ -805,7 +1077,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) break; case bfd_print_symbol_more: fprintf (file, "elf "); - fprintf_vma (file, symbol->value); + bfd_fprintf_vma (abfd, file, symbol->value); fprintf (file, " %lx", (long) symbol->flags); break; case bfd_print_symbol_all: @@ -814,6 +1086,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) const char *name = NULL; struct elf_backend_data *bed; unsigned char st_other; + bfd_vma val; section_name = symbol->section ? symbol->section->name : "(*none*)"; @@ -824,7 +1097,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) if (name == NULL) { name = symbol->name; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); } fprintf (file, " %s\t", section_name); @@ -832,10 +1105,11 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) we've already printed the size; now print the alignment. For other symbols, we have no specified alignment, and we've printed the address; now print the size. */ - fprintf_vma (file, - (bfd_is_com_section (symbol->section) - ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value - : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size)); + if (bfd_is_com_section (symbol->section)) + val = ((elf_symbol_type *) symbol)->internal_elf_sym.st_value; + else + val = ((elf_symbol_type *) symbol)->internal_elf_sym.st_size; + bfd_fprintf_vma (abfd, file, val); /* If we have version information, print it. */ if (elf_tdata (abfd)->dynversym_section != 0 @@ -917,31 +1191,31 @@ _bfd_elf_link_hash_newfunc (entry, table, string) struct bfd_hash_table *table; const char *string; { - struct elf_link_hash_entry *ret = (struct elf_link_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct elf_link_hash_entry *) NULL) - ret = ((struct elf_link_hash_entry *) - bfd_hash_allocate (table, sizeof (struct elf_link_hash_entry))); - if (ret == (struct elf_link_hash_entry *) NULL) - return (struct bfd_hash_entry *) ret; + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct elf_link_hash_entry)); + if (entry == NULL) + return entry; + } /* Call the allocation method of the superclass. */ - ret = ((struct elf_link_hash_entry *) - _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret, - table, string)); - if (ret != (struct elf_link_hash_entry *) NULL) + entry = _bfd_link_hash_newfunc (entry, table, string); + if (entry != NULL) { + struct elf_link_hash_entry *ret = (struct elf_link_hash_entry *) entry; + struct elf_link_hash_table *htab = (struct elf_link_hash_table *) table; + /* Set local fields. */ ret->indx = -1; ret->size = 0; ret->dynindx = -1; ret->dynstr_index = 0; ret->weakdef = NULL; - ret->got.offset = (bfd_vma) -1; - ret->plt.offset = (bfd_vma) -1; - ret->linker_section_pointer = (elf_linker_section_pointers_t *)0; + ret->got.refcount = htab->init_refcount; + ret->plt.refcount = htab->init_refcount; + ret->linker_section_pointer = NULL; ret->verinfo.verdef = NULL; ret->vtable_entries_used = NULL; ret->vtable_entries_size = 0; @@ -955,16 +1229,18 @@ _bfd_elf_link_hash_newfunc (entry, table, string) ret->elf_link_hash_flags = ELF_LINK_NON_ELF; } - return (struct bfd_hash_entry *) ret; + return entry; } /* Copy data from an indirect symbol to its direct symbol, hiding the - old indirect symbol. */ + old indirect symbol. Also used for copying flags to a weakdef. */ void _bfd_elf_link_hash_copy_indirect (dir, ind) struct elf_link_hash_entry *dir, *ind; { + bfd_signed_vma tmp; + /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -975,21 +1251,28 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF)); - /* Copy over the global and procedure linkage table offset entries. + if (ind->root.type != bfd_link_hash_indirect) + return; + + /* Copy over the global and procedure linkage table refcount entries. These may have been already set up by a check_relocs routine. */ - if (dir->got.offset == (bfd_vma) -1) + tmp = dir->got.refcount; + if (tmp <= 0) { - dir->got.offset = ind->got.offset; - ind->got.offset = (bfd_vma) -1; + dir->got.refcount = ind->got.refcount; + ind->got.refcount = tmp; } - BFD_ASSERT (ind->got.offset == (bfd_vma) -1); + else + BFD_ASSERT (ind->got.refcount <= 0); - if (dir->plt.offset == (bfd_vma) -1) + tmp = dir->plt.refcount; + if (tmp <= 0) { - dir->plt.offset = ind->plt.offset; - ind->plt.offset = (bfd_vma) -1; + dir->plt.refcount = ind->plt.refcount; + ind->plt.refcount = tmp; } - BFD_ASSERT (ind->plt.offset == (bfd_vma) -1); + else + BFD_ASSERT (ind->plt.refcount <= 0); if (dir->dynindx == -1) { @@ -998,18 +1281,28 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) ind->dynindx = -1; ind->dynstr_index = 0; } - BFD_ASSERT (ind->dynindx == -1); + else + BFD_ASSERT (ind->dynindx == -1); } void -_bfd_elf_link_hash_hide_symbol (info, h) - struct bfd_link_info *info ATTRIBUTE_UNUSED; +_bfd_elf_link_hash_hide_symbol (info, h, force_local) + struct bfd_link_info *info; struct elf_link_hash_entry *h; + boolean force_local; { - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; h->plt.offset = (bfd_vma) -1; - if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - h->dynindx = -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + if (force_local) + { + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + if (h->dynindx != -1) + { + h->dynindx = -1; + _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, + h->dynstr_index); + } + } } /* Initialize an ELF linker hash table. */ @@ -1022,8 +1315,11 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) struct bfd_hash_table *, const char *)); { + boolean ret; + table->dynamic_sections_created = false; table->dynobj = NULL; + table->init_refcount = get_elf_backend_data (abfd)->can_refcount - 1; /* The first dynamic symbol is a dummy. */ table->dynsymcount = 1; table->dynstr = NULL; @@ -1032,8 +1328,12 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) table->runpath = NULL; table->hgot = NULL; table->stab_info = NULL; + table->merge_info = NULL; table->dynlocal = NULL; - return _bfd_link_hash_table_init (&table->root, abfd, newfunc); + ret = _bfd_link_hash_table_init (& table->root, abfd, newfunc); + table->root.type = bfd_link_elf_hash_table; + + return ret; } /* Create an ELF linker hash table. */ @@ -1043,9 +1343,9 @@ _bfd_elf_link_hash_table_create (abfd) bfd *abfd; { struct elf_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf_link_hash_table); - ret = ((struct elf_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf_link_hash_table))); + ret = (struct elf_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct elf_link_hash_table *) NULL) return NULL; @@ -1134,7 +1434,7 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) asection *s; bfd_byte *dynbuf = NULL; int elfsec; - unsigned long link; + unsigned long shlink; bfd_byte *extdyn, *extdynend; size_t extdynsize; void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); @@ -1161,7 +1461,7 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) if (elfsec == -1) goto error_return; - link = elf_elfsections (abfd)[elfsec]->sh_link; + shlink = elf_elfsections (abfd)[elfsec]->sh_link; extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; @@ -1181,13 +1481,15 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) { const char *string; struct bfd_link_needed_list *l; + unsigned int tagv = dyn.d_un.d_val; + bfd_size_type amt; - string = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + string = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (string == NULL) goto error_return; - l = (struct bfd_link_needed_list *) bfd_alloc (abfd, sizeof *l); + amt = sizeof *l; + l = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); if (l == NULL) goto error_return; @@ -1299,6 +1601,20 @@ bfd_section_from_shdr (abfd, shindex) section, so that objcopy can handle it. */ return _bfd_elf_make_section_from_shdr (abfd, hdr, name); + case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections */ + if (elf_symtab_shndx (abfd) == shindex) + return true; + + /* Get the associated symbol table. */ + if (! bfd_section_from_shdr (abfd, hdr->sh_link) + || hdr->sh_link != elf_onesymtab (abfd)) + return false; + + elf_symtab_shndx (abfd) = shindex; + elf_tdata (abfd)->symtab_shndx_hdr = *hdr; + elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_shndx_hdr; + return true; + case SHT_STRTAB: /* A string table */ if (hdr->bfd_section != NULL) return true; @@ -1309,9 +1625,10 @@ bfd_section_from_shdr (abfd, shindex) return true; } { - unsigned int i; + unsigned int i, num_sec; - for (i = 1; i < ehdr->e_shnum; i++) + num_sec = elf_numsections (abfd); + for (i = 1; i < num_sec; i++) { Elf_Internal_Shdr *hdr2 = elf_elfsections (abfd)[i]; if (hdr2->sh_link == shindex) @@ -1357,13 +1674,15 @@ bfd_section_from_shdr (abfd, shindex) { asection *target_sect; Elf_Internal_Shdr *hdr2; + unsigned int num_sec = elf_numsections (abfd); /* Check for a bogus link to avoid crashing. */ - if (hdr->sh_link >= ehdr->e_shnum) + if ((hdr->sh_link >= SHN_LORESERVE && hdr->sh_link <= SHN_HIRESERVE) + || hdr->sh_link >= num_sec) { ((*_bfd_error_handler) (_("%s: invalid link %lu for reloc section %s (index %u)"), - bfd_get_filename (abfd), hdr->sh_link, name, shindex)); + bfd_archive_filename (abfd), hdr->sh_link, name, shindex)); return _bfd_elf_make_section_from_shdr (abfd, hdr, name); } @@ -1377,11 +1696,11 @@ bfd_section_from_shdr (abfd, shindex) if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_SYMTAB && elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_DYNSYM) { - int scan; + unsigned int scan; int found; found = 0; - for (scan = 1; scan < ehdr->e_shnum; scan++) + for (scan = 1; scan < num_sec; scan++) { if (elf_elfsections (abfd)[scan]->sh_type == SHT_SYMTAB || elf_elfsections (abfd)[scan]->sh_type == SHT_DYNSYM) @@ -1423,8 +1742,10 @@ bfd_section_from_shdr (abfd, shindex) hdr2 = &elf_section_data (target_sect)->rel_hdr; else { + bfd_size_type amt; BFD_ASSERT (elf_section_data (target_sect)->rel_hdr2 == NULL); - hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, sizeof (*hdr2)); + amt = sizeof (*hdr2); + hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); elf_section_data (target_sect)->rel_hdr2 = hdr2; } *hdr2 = *hdr; @@ -1464,6 +1785,26 @@ bfd_section_from_shdr (abfd, shindex) case SHT_SHLIB: return true; + case SHT_GROUP: + /* Make a section for objcopy and relocatable links. */ + if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + if (hdr->contents != NULL) + { + Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; + unsigned int n_elt = hdr->sh_size / 4; + asection *s; + + while (--n_elt != 0) + if ((s = (++idx)->shdr->bfd_section) != NULL + && elf_next_in_group (s) != NULL) + { + elf_next_in_group (hdr->bfd_section) = s; + break; + } + } + break; + default: /* Check for any processor-specific section types. */ { @@ -1476,6 +1817,78 @@ bfd_section_from_shdr (abfd, shindex) return true; } +/* Return the section for the local symbol specified by ABFD, R_SYMNDX. + Return SEC for sections that have no elf section, and NULL on error. */ + +asection * +bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) + bfd *abfd; + struct sym_sec_cache *cache; + asection *sec; + unsigned long r_symndx; +{ + unsigned char esym_shndx[4]; + unsigned int isym_shndx; + Elf_Internal_Shdr *symtab_hdr; + file_ptr pos; + bfd_size_type amt; + unsigned int ent = r_symndx % LOCAL_SYM_CACHE_SIZE; + + if (cache->abfd == abfd && cache->indx[ent] == r_symndx) + return cache->sec[ent]; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + pos = symtab_hdr->sh_offset; + if (get_elf_backend_data (abfd)->s->sizeof_sym + == sizeof (Elf64_External_Sym)) + { + pos += r_symndx * sizeof (Elf64_External_Sym); + pos += offsetof (Elf64_External_Sym, st_shndx); + amt = sizeof (((Elf64_External_Sym *) 0)->st_shndx); + } + else + { + pos += r_symndx * sizeof (Elf32_External_Sym); + pos += offsetof (Elf32_External_Sym, st_shndx); + amt = sizeof (((Elf32_External_Sym *) 0)->st_shndx); + } + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) esym_shndx, amt, abfd) != amt) + return NULL; + isym_shndx = H_GET_16 (abfd, esym_shndx); + + if (isym_shndx == SHN_XINDEX) + { + Elf_Internal_Shdr *shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (shndx_hdr->sh_size != 0) + { + pos = shndx_hdr->sh_offset; + pos += r_symndx * sizeof (Elf_External_Sym_Shndx); + amt = sizeof (Elf_External_Sym_Shndx); + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) esym_shndx, amt, abfd) != amt) + return NULL; + isym_shndx = H_GET_32 (abfd, esym_shndx); + } + } + + if (cache->abfd != abfd) + { + memset (cache->indx, -1, sizeof (cache->indx)); + cache->abfd = abfd; + } + cache->indx[ent] = r_symndx; + cache->sec[ent] = sec; + if (isym_shndx < SHN_LORESERVE || isym_shndx > SHN_HIRESERVE) + { + asection *s; + s = bfd_section_from_elf_index (abfd, isym_shndx); + if (s != NULL) + cache->sec[ent] = s; + } + return cache->sec[ent]; +} + /* Given an ELF section number, retrieve the corresponding BFD section. */ @@ -1484,8 +1897,7 @@ bfd_section_from_elf_index (abfd, index) bfd *abfd; unsigned int index; { - BFD_ASSERT (index > 0 && index < SHN_LORESERVE); - if (index >= elf_elfheader (abfd)->e_shnum) + if (index >= elf_numsections (abfd)) return NULL; return elf_elfsections (abfd)[index]->bfd_section; } @@ -1496,8 +1908,9 @@ _bfd_elf_new_section_hook (abfd, sec) asection *sec; { struct bfd_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, sizeof (*sdata)); + sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt); if (!sdata) return false; sec->used_by_bfd = (PTR) sdata; @@ -1547,7 +1960,7 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) && (hdr->p_filesz > 0) && (hdr->p_memsz > hdr->p_filesz)); sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : ""); - name = bfd_alloc (abfd, strlen (namebuf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); if (!name) return false; strcpy (name, namebuf); @@ -1578,7 +1991,7 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) if (split) { sprintf (namebuf, "%s%db", typename, index); - name = bfd_alloc (abfd, strlen (namebuf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); if (!name) return false; strcpy (name, namebuf); @@ -1626,7 +2039,7 @@ bfd_section_from_phdr (abfd, hdr, index) case PT_NOTE: if (! _bfd_elf_make_section_from_phdr (abfd, hdr, index, "note")) return false; - if (! elfcore_read_notes (abfd, hdr->p_offset, hdr->p_filesz)) + if (! elfcore_read_notes (abfd, (file_ptr) hdr->p_offset, hdr->p_filesz)) return false; return true; @@ -1659,16 +2072,16 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p) boolean use_rela_p; { char *name; - struct elf_backend_data *bed; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + bfd_size_type amt = sizeof ".rela" + strlen (asect->name); - bed = get_elf_backend_data (abfd); - name = bfd_alloc (abfd, sizeof ".rela" + strlen (asect->name)); + name = bfd_alloc (abfd, amt); if (name == NULL) return false; sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name); rel_hdr->sh_name = - (unsigned int) _bfd_stringtab_add (elf_shstrtab (abfd), name, - true, false); + (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), name, + false); if (rel_hdr->sh_name == (unsigned int) -1) return false; rel_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL; @@ -1705,9 +2118,8 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr = &elf_section_data (asect)->this_hdr; - this_hdr->sh_name = (unsigned long) _bfd_stringtab_add (elf_shstrtab (abfd), - asect->name, - true, false); + this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd), + asect->name, false); if (this_hdr->sh_name == (unsigned long) -1) { *failedptr = true; @@ -1798,6 +2210,11 @@ elf_fake_sections (abfd, asect, failedptrarg) BFD_ASSERT (elf_tdata (abfd)->cverrefs == 0 || this_hdr->sh_info == elf_tdata (abfd)->cverrefs); } + else if ((asect->flags & SEC_GROUP) != 0) + { + this_hdr->sh_type = SHT_GROUP; + this_hdr->sh_entsize = 4; + } else if ((asect->flags & SEC_ALLOC) != 0 && ((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)) this_hdr->sh_type = SHT_NOBITS; @@ -1810,10 +2227,20 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr->sh_flags |= SHF_WRITE; if ((asect->flags & SEC_CODE) != 0) this_hdr->sh_flags |= SHF_EXECINSTR; + if ((asect->flags & SEC_MERGE) != 0) + { + this_hdr->sh_flags |= SHF_MERGE; + this_hdr->sh_entsize = asect->entsize; + if ((asect->flags & SEC_STRINGS) != 0) + this_hdr->sh_flags |= SHF_STRINGS; + } + if (elf_group_name (asect) != NULL) + this_hdr->sh_flags |= SHF_GROUP; /* Check for processor-specific section types. */ - if (bed->elf_backend_fake_sections) - (*bed->elf_backend_fake_sections) (abfd, this_hdr, asect); + if (bed->elf_backend_fake_sections + && !(*bed->elf_backend_fake_sections) (abfd, this_hdr, asect)) + *failedptr = true; /* If the section has relocs, set up a section header for the SHT_REL[A] section. If two relocation sections are required for @@ -1827,6 +2254,83 @@ elf_fake_sections (abfd, asect, failedptrarg) *failedptr = true; } +/* Fill in the contents of a SHT_GROUP section. */ + +static void +set_group_contents (abfd, sec, failedptrarg) + bfd *abfd; + asection *sec; + PTR failedptrarg ATTRIBUTE_UNUSED; +{ + boolean *failedptr = (boolean *) failedptrarg; + unsigned long symindx; + asection *elt; + unsigned char *loc; + struct bfd_link_order *l; + + if (elf_section_data (sec)->this_hdr.sh_type != SHT_GROUP + || *failedptr) + return; + + /* If called from the assembler, swap_out_syms will have set up + elf_section_syms; If called for "ld -r", the symbols won't yet + be mapped, so emulate elf_bfd_final_link. */ + if (elf_section_syms (abfd) != NULL) + symindx = elf_section_syms (abfd)[sec->index]->udata.i; + else + symindx = elf_section_data (sec)->this_idx; + elf_section_data (sec)->this_hdr.sh_info = symindx; + + /* Nor will the contents be allocated for "ld -r". */ + if (sec->contents == NULL) + { + sec->contents = bfd_alloc (abfd, sec->_raw_size); + if (sec->contents == NULL) + { + *failedptr = true; + return; + } + } + + loc = sec->contents + sec->_raw_size; + + /* Get the pointer to the first section in the group that we + squirreled away here. */ + elt = elf_next_in_group (sec); + + /* First element is a flag word. Rest of section is elf section + indices for all the sections of the group. Write them backwards + just to keep the group in the same order as given in .section + directives, not that it matters. */ + while (elt != NULL) + { + loc -= 4; + H_PUT_32 (abfd, elf_section_data (elt)->this_idx, loc); + elt = elf_next_in_group (elt); + } + + /* If this is a relocatable link, then the above did nothing because + SEC is the output section. Look through the input sections + instead. */ + for (l = sec->link_order_head; l != NULL; l = l->next) + if (l->type == bfd_indirect_link_order + && (elt = elf_next_in_group (l->u.indirect.section)) != NULL) + do + { + loc -= 4; + H_PUT_32 (abfd, + elf_section_data (elt->output_section)->this_idx, loc); + elt = elf_next_in_group (elt); + /* During a relocatable link, the lists are circular. */ + } + while (elt != elf_next_in_group (l->u.indirect.section)); + + loc -= 4; + H_PUT_32 (abfd, 0, loc); + + BFD_ASSERT (loc == sec->contents); +} + /* Assign all ELF section numbers. The dummy first section is handled here too. The link/info pointers for the standard section types are filled in here too, while we're at it. */ @@ -1837,48 +2341,89 @@ assign_section_numbers (abfd) { struct elf_obj_tdata *t = elf_tdata (abfd); asection *sec; - unsigned int section_number; + unsigned int section_number, secn; Elf_Internal_Shdr **i_shdrp; + bfd_size_type amt; section_number = 1; + _bfd_elf_strtab_clear_all_refs (elf_shstrtab (abfd)); + for (sec = abfd->sections; sec; sec = sec->next) { struct bfd_elf_section_data *d = elf_section_data (sec); + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; d->this_idx = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->this_hdr.sh_name); if ((sec->flags & SEC_RELOC) == 0) d->rel_idx = 0; else - d->rel_idx = section_number++; + { + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; + d->rel_idx = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rel_hdr.sh_name); + } if (d->rel_hdr2) - d->rel_idx2 = section_number++; + { + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; + d->rel_idx2 = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->rel_hdr2->sh_name); + } else d->rel_idx2 = 0; } + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; t->shstrtab_section = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->shstrtab_hdr.sh_name); elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section; - t->shstrtab_hdr.sh_size = _bfd_stringtab_size (elf_shstrtab (abfd)); if (bfd_get_symcount (abfd) > 0) { + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; t->symtab_section = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->symtab_hdr.sh_name); + if (section_number > SHN_LORESERVE - 2) + { + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; + t->symtab_shndx_section = section_number++; + t->symtab_shndx_hdr.sh_name + = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), + ".symtab_shndx", false); + if (t->symtab_shndx_hdr.sh_name == (unsigned int) -1) + return false; + } + if (section_number == SHN_LORESERVE) + section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; t->strtab_section = section_number++; + _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->strtab_hdr.sh_name); } + _bfd_elf_strtab_finalize (elf_shstrtab (abfd)); + t->shstrtab_hdr.sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd)); + + elf_numsections (abfd) = section_number; elf_elfheader (abfd)->e_shnum = section_number; + if (section_number > SHN_LORESERVE) + elf_elfheader (abfd)->e_shnum -= SHN_HIRESERVE + 1 - SHN_LORESERVE; /* Set up the list of section header pointers, in agreement with the indices. */ - i_shdrp = ((Elf_Internal_Shdr **) - bfd_alloc (abfd, section_number * sizeof (Elf_Internal_Shdr *))); + amt = section_number * sizeof (Elf_Internal_Shdr *); + i_shdrp = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt); if (i_shdrp == NULL) return false; - i_shdrp[0] = ((Elf_Internal_Shdr *) - bfd_alloc (abfd, sizeof (Elf_Internal_Shdr))); + amt = sizeof (Elf_Internal_Shdr); + i_shdrp[0] = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); if (i_shdrp[0] == NULL) { bfd_release (abfd, i_shdrp); @@ -1892,6 +2437,11 @@ assign_section_numbers (abfd) if (bfd_get_symcount (abfd) > 0) { i_shdrp[t->symtab_section] = &t->symtab_hdr; + if (elf_numsections (abfd) > SHN_LORESERVE) + { + i_shdrp[t->symtab_shndx_section] = &t->symtab_shndx_hdr; + t->symtab_shndx_hdr.sh_link = t->symtab_section; + } i_shdrp[t->strtab_section] = &t->strtab_hdr; t->symtab_hdr.sh_link = t->strtab_section; } @@ -1960,7 +2510,7 @@ assign_section_numbers (abfd) char *alc; len = strlen (sec->name); - alc = (char *) bfd_malloc (len - 2); + alc = (char *) bfd_malloc ((bfd_size_type) len - 2); if (alc == NULL) return false; strncpy (alc, sec->name, len - 3); @@ -1998,9 +2548,18 @@ assign_section_numbers (abfd) if (s != NULL) d->this_hdr.sh_link = elf_section_data (s)->this_idx; break; + + case SHT_GROUP: + d->this_hdr.sh_link = t->symtab_section; } } + for (secn = 1; secn < section_number; ++secn) + if (i_shdrp[secn] == NULL) + i_shdrp[secn] = i_shdrp[0]; + else + i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd), + i_shdrp[secn]->sh_name); return true; } @@ -2026,27 +2585,24 @@ static boolean elf_map_symbols (abfd) bfd *abfd; { - int symcount = bfd_get_symcount (abfd); + unsigned int symcount = bfd_get_symcount (abfd); asymbol **syms = bfd_get_outsymbols (abfd); asymbol **sect_syms; - int num_locals = 0; - int num_globals = 0; - int num_locals2 = 0; - int num_globals2 = 0; + unsigned int num_locals = 0; + unsigned int num_globals = 0; + unsigned int num_locals2 = 0; + unsigned int num_globals2 = 0; int max_index = 0; - int num_sections = 0; - int idx; + unsigned int idx; asection *asect; asymbol **new_syms; - asymbol *sym; + bfd_size_type amt; #ifdef DEBUG fprintf (stderr, "elf_map_symbols\n"); fflush (stderr); #endif - /* Add a section symbol for each BFD section. FIXME: Is this really - necessary? */ for (asect = abfd->sections; asect; asect = asect->next) { if (max_index < asect->index) @@ -2054,14 +2610,18 @@ elf_map_symbols (abfd) } max_index++; - sect_syms = (asymbol **) bfd_zalloc (abfd, max_index * sizeof (asymbol *)); + amt = max_index * sizeof (asymbol *); + sect_syms = (asymbol **) bfd_zalloc (abfd, amt); if (sect_syms == NULL) return false; elf_section_syms (abfd) = sect_syms; + elf_num_section_syms (abfd) = max_index; + /* Init sect_syms entries for any section symbols we have already + decided to output. */ for (idx = 0; idx < symcount; idx++) { - sym = syms[idx]; + asymbol *sym = syms[idx]; if ((sym->flags & BSF_SECTION_SYM) != 0 && sym->value == 0) @@ -2079,15 +2639,16 @@ elf_map_symbols (abfd) sec = sec->output_section; - /* Empty sections in the input files may have had a section - symbol created for them. (See the comment near the end of - _bfd_generic_link_output_symbols in linker.c). If the linker - script discards such sections then we will reach this point. - Since we know that we cannot avoid this case, we detect it - and skip the abort and the assignment to the sect_syms array. - To reproduce this particular case try running the linker - testsuite test ld-scripts/weak.exp for an ELF port that uses - the generic linker. */ + /* Empty sections in the input files may have had a + section symbol created for them. (See the comment + near the end of _bfd_generic_link_output_symbols in + linker.c). If the linker script discards such + sections then we will reach this point. Since we know + that we cannot avoid this case, we detect it and skip + the abort and the assignment to the sect_syms array. + To reproduce this particular case try running the + linker testsuite test ld-scripts/weak.exp for an ELF + port that uses the generic linker. */ if (sec->owner == NULL) continue; @@ -2098,29 +2659,6 @@ elf_map_symbols (abfd) } } - for (asect = abfd->sections; asect; asect = asect->next) - { - if (sect_syms[asect->index] != NULL) - continue; - - sym = bfd_make_empty_symbol (abfd); - if (sym == NULL) - return false; - sym->the_bfd = abfd; - sym->name = asect->name; - sym->value = 0; - /* Set the flags to 0 to indicate that this one was newly added. */ - sym->flags = 0; - sym->section = asect; - sect_syms[asect->index] = sym; - num_sections++; -#ifdef DEBUG - fprintf (stderr, - _("creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n"), - asect->name, (long) asect->vma, asect->index, (long) asect); -#endif - } - /* Classify all of the symbols. */ for (idx = 0; idx < symcount; idx++) { @@ -2129,31 +2667,33 @@ elf_map_symbols (abfd) else num_globals++; } + + /* We will be adding a section symbol for each BFD section. Most normal + sections will already have a section symbol in outsymbols, but + eg. SHT_GROUP sections will not, and we need the section symbol mapped + at least in that case. */ for (asect = abfd->sections; asect; asect = asect->next) { - if (sect_syms[asect->index] != NULL - && sect_syms[asect->index]->flags == 0) + if (sect_syms[asect->index] == NULL) { - sect_syms[asect->index]->flags = BSF_SECTION_SYM; - if (!sym_is_global (abfd, sect_syms[asect->index])) + if (!sym_is_global (abfd, asect->symbol)) num_locals++; else num_globals++; - sect_syms[asect->index]->flags = 0; } } /* Now sort the symbols so the local symbols are first. */ - new_syms = ((asymbol **) - bfd_alloc (abfd, - (num_locals + num_globals) * sizeof (asymbol *))); + amt = (num_locals + num_globals) * sizeof (asymbol *); + new_syms = (asymbol **) bfd_alloc (abfd, amt); + if (new_syms == NULL) return false; for (idx = 0; idx < symcount; idx++) { asymbol *sym = syms[idx]; - int i; + unsigned int i; if (!sym_is_global (abfd, sym)) i = num_locals2++; @@ -2164,13 +2704,12 @@ elf_map_symbols (abfd) } for (asect = abfd->sections; asect; asect = asect->next) { - if (sect_syms[asect->index] != NULL - && sect_syms[asect->index]->flags == 0) + if (sect_syms[asect->index] == NULL) { - asymbol *sym = sect_syms[asect->index]; - int i; + asymbol *sym = asect->symbol; + unsigned int i; - sym->flags = BSF_SECTION_SYM; + sect_syms[asect->index] = sym; if (!sym_is_global (abfd, sym)) i = num_locals2++; else @@ -2270,12 +2809,19 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) return false; } + if (link_info == NULL || link_info->relocateable) + { + bfd_map_over_sections (abfd, set_group_contents, &failed); + if (failed) + return false; + } + shstrtab_hdr = &elf_tdata (abfd)->shstrtab_hdr; /* sh_name was set in prep_headers. */ shstrtab_hdr->sh_type = SHT_STRTAB; shstrtab_hdr->sh_flags = 0; shstrtab_hdr->sh_addr = 0; - shstrtab_hdr->sh_size = _bfd_stringtab_size (elf_shstrtab (abfd)); + shstrtab_hdr->sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd)); shstrtab_hdr->sh_entsize = 0; shstrtab_hdr->sh_link = 0; shstrtab_hdr->sh_info = 0; @@ -2295,6 +2841,10 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) hdr = &elf_tdata (abfd)->symtab_hdr; off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (hdr->sh_size != 0) + off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + hdr = &elf_tdata (abfd)->strtab_hdr; off = _bfd_elf_assign_file_position_for_section (hdr, off, true); @@ -2326,11 +2876,11 @@ make_mapping (abfd, sections, from, to, phdr) struct elf_segment_map *m; unsigned int i; asection **hdrpp; + bfd_size_type amt; - m = ((struct elf_segment_map *) - bfd_zalloc (abfd, - (sizeof (struct elf_segment_map) - + (to - from - 1) * sizeof (asection *)))); + amt = sizeof (struct elf_segment_map); + amt += (to - from - 1) * sizeof (asection *); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) return NULL; m->next = NULL; @@ -2368,7 +2918,8 @@ map_sections_to_segments (abfd) asection **hdrpp; boolean phdr_in_segment = true; boolean writable; - asection *dynsec; + asection *dynsec, *eh_frame_hdr; + bfd_size_type amt; if (elf_tdata (abfd)->segment_map != NULL) return true; @@ -2378,8 +2929,8 @@ map_sections_to_segments (abfd) /* Select the allocated sections, and sort them. */ - sections = (asection **) bfd_malloc (bfd_count_sections (abfd) - * sizeof (asection *)); + amt = bfd_count_sections (abfd) * sizeof (asection *); + sections = (asection **) bfd_malloc (amt); if (sections == NULL) goto error_return; @@ -2408,8 +2959,8 @@ map_sections_to_segments (abfd) s = bfd_get_section_by_name (abfd, ".interp"); if (s != NULL && (s->flags & SEC_LOAD) != 0) { - m = ((struct elf_segment_map *) - bfd_zalloc (abfd, sizeof (struct elf_segment_map))); + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -2422,8 +2973,8 @@ map_sections_to_segments (abfd) *pm = m; pm = &m->next; - m = ((struct elf_segment_map *) - bfd_zalloc (abfd, sizeof (struct elf_segment_map))); + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -2570,8 +3121,8 @@ map_sections_to_segments (abfd) /* If there is a .dynamic section, throw in a PT_DYNAMIC segment. */ if (dynsec != NULL) { - m = ((struct elf_segment_map *) - bfd_zalloc (abfd, sizeof (struct elf_segment_map))); + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -2593,8 +3144,8 @@ map_sections_to_segments (abfd) if ((s->flags & SEC_LOAD) != 0 && strncmp (s->name, ".note", 5) == 0) { - m = ((struct elf_segment_map *) - bfd_zalloc (abfd, sizeof (struct elf_segment_map))); + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -2607,6 +3158,26 @@ map_sections_to_segments (abfd) } } + /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME + segment. */ + eh_frame_hdr = NULL; + if (elf_tdata (abfd)->eh_frame_hdr) + eh_frame_hdr = bfd_get_section_by_name (abfd, ".eh_frame_hdr"); + if (eh_frame_hdr != NULL && (eh_frame_hdr->flags & SEC_LOAD)) + { + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_EH_FRAME; + m->count = 1; + m->sections[0] = eh_frame_hdr; + + *pm = m; + pm = &m->next; + } + free (sections); sections = NULL; @@ -2650,18 +3221,22 @@ elf_sort_sections (arg1, arg2) if (TOEND (sec1)) { if (TOEND (sec2)) - return sec1->target_index - sec2->target_index; + { + /* If the indicies are the same, do not return 0 + here, but continue to try the next comparison. */ + if (sec1->target_index - sec2->target_index != 0) + return sec1->target_index - sec2->target_index; + } else return 1; } - - if (TOEND (sec2)) + else if (TOEND (sec2)) return -1; #undef TOEND - /* Sort by size, to put zero sized sections before others at the - same address. */ + /* Sort by size, to put zero sized sections + before others at the same address. */ if (sec1->_raw_size < sec2->_raw_size) return -1; @@ -2688,6 +3263,7 @@ assign_file_positions_for_segments (abfd) bfd_vma filehdr_vaddr, filehdr_paddr; bfd_vma phdrs_vaddr, phdrs_paddr; Elf_Internal_Phdr *p; + bfd_size_type amt; if (elf_tdata (abfd)->segment_map == NULL) { @@ -2728,8 +3304,8 @@ assign_file_positions_for_segments (abfd) if (alloc == 0) alloc = count; - phdrs = ((Elf_Internal_Phdr *) - bfd_alloc (abfd, alloc * sizeof (Elf_Internal_Phdr))); + amt = alloc * sizeof (Elf_Internal_Phdr); + phdrs = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); if (phdrs == NULL) return false; @@ -2749,8 +3325,13 @@ assign_file_positions_for_segments (abfd) asection **secpp; /* If elf_segment_map is not from map_sections_to_segments, the - sections may not be correctly ordered. */ - if (m->count > 0) + sections may not be correctly ordered. NOTE: sorting should + not be done to the PT_NOTE section of a corefile, which may + contain several pseudo-sections artificially created by bfd. + Sorting these pseudo-sections breaks things badly. */ + if (m->count > 1 + && !(elf_elfheader (abfd)->e_type == ET_CORE + && m->p_type == PT_NOTE)) qsort (m->sections, (size_t) m->count, sizeof (asection *), elf_sort_sections); @@ -2902,10 +3483,10 @@ assign_file_positions_for_segments (abfd) /* The section may have artificial alignment forced by a link script. Notice this case by the gap between the - cumulative phdr vma and the section's vma. */ - if (p->p_vaddr + p->p_memsz < sec->vma) + cumulative phdr lma and the section's lma. */ + if (p->p_paddr + p->p_memsz < sec->lma) { - bfd_vma adjust = sec->vma - (p->p_vaddr + p->p_memsz); + bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); p->p_memsz += adjust; off += adjust; @@ -2943,13 +3524,11 @@ assign_file_positions_for_segments (abfd) { if (i == 0) { - (* _bfd_error_handler) - (_("Error: First section in segment (%s) starts at 0x%x"), - bfd_section_name (abfd, sec), sec->lma); - (* _bfd_error_handler) - (_(" whereas segment starts at 0x%x"), - p->p_paddr); - + (* _bfd_error_handler) (_("\ +Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x"), + bfd_section_name (abfd, sec), + sec->lma, + p->p_paddr); return false; } p->p_memsz += adjust; @@ -3057,7 +3636,7 @@ assign_file_positions_for_segments (abfd) elf_tdata (abfd)->next_file_pos = off; /* Write out the program headers. */ - if (bfd_seek (abfd, bed->s->sizeof_ehdr, SEEK_SET) != 0 + if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 || bed->s->write_out_phdrs (abfd, phdrs, alloc) != 0) return false; @@ -3118,6 +3697,13 @@ get_program_header_size (abfd) ++segs; } + if (elf_tdata (abfd)->eh_frame_hdr + && bfd_get_section_by_name (abfd, ".eh_frame_hdr") != NULL) + { + /* We need a PT_GNU_EH_FRAME segment. */ + ++segs; + } + for (s = abfd->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LOAD) != 0 @@ -3161,6 +3747,7 @@ assign_file_positions_except_relocs (abfd) struct elf_obj_tdata * const tdata = elf_tdata (abfd); Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd); Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); + unsigned int num_sec = elf_numsections (abfd); file_ptr off; struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -3176,24 +3763,27 @@ assign_file_positions_except_relocs (abfd) /* We are not creating an executable, which means that we are not creating a program header, and that the actual order of the sections in the file is unimportant. */ - for (i = 1, hdrpp = i_shdrpp + 1; i < i_ehdrp->e_shnum; i++, hdrpp++) + for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) { Elf_Internal_Shdr *hdr; hdr = *hdrpp; - if (hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA) - { - hdr->sh_offset = -1; - continue; - } - if (i == tdata->symtab_section + if (hdr->sh_type == SHT_REL + || hdr->sh_type == SHT_RELA + || i == tdata->symtab_section + || i == tdata->symtab_shndx_section || i == tdata->strtab_section) { hdr->sh_offset = -1; - continue; } + else + off = _bfd_elf_assign_file_position_for_section (hdr, off, true); - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + if (i == SHN_LORESERVE - 1) + { + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; + hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } } } else @@ -3209,7 +3799,7 @@ assign_file_positions_except_relocs (abfd) /* Assign file positions for the other sections. */ off = elf_tdata (abfd)->next_file_pos; - for (i = 1, hdrpp = i_shdrpp + 1; i < i_ehdrp->e_shnum; i++, hdrpp++) + for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) { Elf_Internal_Shdr *hdr; @@ -3235,10 +3825,17 @@ assign_file_positions_except_relocs (abfd) else if (hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA || hdr == i_shdrpp[tdata->symtab_section] + || hdr == i_shdrpp[tdata->symtab_shndx_section] || hdr == i_shdrpp[tdata->strtab_section]) hdr->sh_offset = -1; else off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + + if (i == SHN_LORESERVE - 1) + { + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; + hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } } } @@ -3260,13 +3857,13 @@ prep_headers (abfd) Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */ Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */ int count; - struct bfd_strtab_hash *shstrtab; + struct elf_strtab_hash *shstrtab; struct elf_backend_data *bed = get_elf_backend_data (abfd); i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); - shstrtab = _bfd_elf_stringtab_init (); + shstrtab = _bfd_elf_strtab_init (); if (shstrtab == NULL) return false; @@ -3302,104 +3899,22 @@ prep_headers (abfd) case bfd_arch_unknown: i_ehdrp->e_machine = EM_NONE; break; - case bfd_arch_sparc: - if (bfd_get_arch_size (abfd) == 64) - i_ehdrp->e_machine = EM_SPARCV9; - else - i_ehdrp->e_machine = EM_SPARC; - break; - case bfd_arch_i370: - i_ehdrp->e_machine = EM_S370; - break; - case bfd_arch_i386: - if (bfd_get_arch_size (abfd) == 64) - i_ehdrp->e_machine = EM_X86_64; + + /* There used to be a long list of cases here, each one setting + e_machine to the same EM_* macro #defined as ELF_MACHINE_CODE + in the corresponding bfd definition. To avoid duplication, + the switch was removed. Machines that need special handling + can generally do it in elf_backend_final_write_processing(), + unless they need the information earlier than the final write. + Such need can generally be supplied by replacing the tests for + e_machine with the conditions used to determine it. */ + default: + if (get_elf_backend_data (abfd) != NULL) + i_ehdrp->e_machine = get_elf_backend_data (abfd)->elf_machine_code; else - i_ehdrp->e_machine = EM_386; - break; - case bfd_arch_ia64: - i_ehdrp->e_machine = EM_IA_64; - break; - case bfd_arch_m68hc11: - i_ehdrp->e_machine = EM_68HC11; - break; - case bfd_arch_m68hc12: - i_ehdrp->e_machine = EM_68HC12; - break; - case bfd_arch_m68k: - i_ehdrp->e_machine = EM_68K; - break; - case bfd_arch_m88k: - i_ehdrp->e_machine = EM_88K; - break; - case bfd_arch_i860: - i_ehdrp->e_machine = EM_860; - break; - case bfd_arch_i960: - i_ehdrp->e_machine = EM_960; - break; - case bfd_arch_mips: /* MIPS Rxxxx */ - i_ehdrp->e_machine = EM_MIPS; /* only MIPS R3000 */ - break; - case bfd_arch_hppa: - i_ehdrp->e_machine = EM_PARISC; - break; - case bfd_arch_powerpc: - i_ehdrp->e_machine = EM_PPC; - break; - case bfd_arch_alpha: - i_ehdrp->e_machine = EM_ALPHA; - break; - case bfd_arch_sh: - i_ehdrp->e_machine = EM_SH; - break; - case bfd_arch_d10v: - i_ehdrp->e_machine = EM_CYGNUS_D10V; - break; - case bfd_arch_d30v: - i_ehdrp->e_machine = EM_CYGNUS_D30V; - break; - case bfd_arch_fr30: - i_ehdrp->e_machine = EM_CYGNUS_FR30; - break; - case bfd_arch_mcore: - i_ehdrp->e_machine = EM_MCORE; - break; - case bfd_arch_avr: - i_ehdrp->e_machine = EM_AVR; - break; - case bfd_arch_v850: - switch (bfd_get_mach (abfd)) - { - default: - case 0: i_ehdrp->e_machine = EM_CYGNUS_V850; break; - } - break; - case bfd_arch_arc: - i_ehdrp->e_machine = EM_CYGNUS_ARC; - break; - case bfd_arch_arm: - i_ehdrp->e_machine = EM_ARM; - break; - case bfd_arch_m32r: - i_ehdrp->e_machine = EM_CYGNUS_M32R; - break; - case bfd_arch_mn10200: - i_ehdrp->e_machine = EM_CYGNUS_MN10200; - break; - case bfd_arch_mn10300: - i_ehdrp->e_machine = EM_CYGNUS_MN10300; - break; - case bfd_arch_pj: - i_ehdrp->e_machine = EM_PJ; - break; - case bfd_arch_cris: - i_ehdrp->e_machine = EM_CRIS; - break; - /* Also note that EM_M32, AT&T WE32100 is unknown to bfd. */ - default: - i_ehdrp->e_machine = EM_NONE; - } + i_ehdrp->e_machine = EM_NONE; + } + i_ehdrp->e_version = bed->s->ev_current; i_ehdrp->e_ehsize = bed->s->sizeof_ehdr; @@ -3434,11 +3949,11 @@ prep_headers (abfd) } elf_tdata (abfd)->symtab_hdr.sh_name = - (unsigned int) _bfd_stringtab_add (shstrtab, ".symtab", true, false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".symtab", false); elf_tdata (abfd)->strtab_hdr.sh_name = - (unsigned int) _bfd_stringtab_add (shstrtab, ".strtab", true, false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".strtab", false); elf_tdata (abfd)->shstrtab_hdr.sh_name = - (unsigned int) _bfd_stringtab_add (shstrtab, ".shstrtab", true, false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", false); if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1) @@ -3455,14 +3970,13 @@ _bfd_elf_assign_file_positions_for_relocs (abfd) bfd *abfd; { file_ptr off; - unsigned int i; + unsigned int i, num_sec; Elf_Internal_Shdr **shdrpp; off = elf_tdata (abfd)->next_file_pos; - for (i = 1, shdrpp = elf_elfsections (abfd) + 1; - i < elf_elfheader (abfd)->e_shnum; - i++, shdrpp++) + num_sec = elf_numsections (abfd); + for (i = 1, shdrpp = elf_elfsections (abfd) + 1; i < num_sec; i++, shdrpp++) { Elf_Internal_Shdr *shdrp; @@ -3483,7 +3997,7 @@ _bfd_elf_write_object_contents (abfd) Elf_Internal_Ehdr *i_ehdrp; Elf_Internal_Shdr **i_shdrp; boolean failed; - unsigned int count; + unsigned int count, num_sec; if (! abfd->output_has_begun && ! _bfd_elf_compute_section_file_positions @@ -3501,23 +4015,26 @@ _bfd_elf_write_object_contents (abfd) _bfd_elf_assign_file_positions_for_relocs (abfd); /* After writing the headers, we need to write the sections too... */ - for (count = 1; count < i_ehdrp->e_shnum; count++) + num_sec = elf_numsections (abfd); + for (count = 1; count < num_sec; count++) { if (bed->elf_backend_section_processing) (*bed->elf_backend_section_processing) (abfd, i_shdrp[count]); if (i_shdrp[count]->contents) { + bfd_size_type amt = i_shdrp[count]->sh_size; + if (bfd_seek (abfd, i_shdrp[count]->sh_offset, SEEK_SET) != 0 - || (bfd_write (i_shdrp[count]->contents, i_shdrp[count]->sh_size, - 1, abfd) - != i_shdrp[count]->sh_size)) + || bfd_bwrite (i_shdrp[count]->contents, amt, abfd) != amt) return false; } + if (count == SHN_LORESERVE - 1) + count += SHN_HIRESERVE + 1 - SHN_LORESERVE; } /* Write out the section header names. */ if (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 - || ! _bfd_stringtab_emit (abfd, elf_shstrtab (abfd))) + || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))) return false; if (bed->elf_backend_final_write_processing) @@ -3542,43 +4059,47 @@ _bfd_elf_section_from_bfd_section (abfd, asect) bfd *abfd; struct sec *asect; { - struct elf_backend_data *bed = get_elf_backend_data (abfd); - Elf_Internal_Shdr **i_shdrp = elf_elfsections (abfd); + struct elf_backend_data *bed; int index; - Elf_Internal_Shdr *hdr; - int maxindex = elf_elfheader (abfd)->e_shnum; - for (index = 0; index < maxindex; index++) - { - hdr = i_shdrp[index]; - if (hdr->bfd_section == asect) - return index; - } + if (elf_section_data (asect) != NULL + && elf_section_data (asect)->this_idx != 0) + return elf_section_data (asect)->this_idx; - if (bed->elf_backend_section_from_bfd_section) + if (bfd_is_abs_section (asect)) + index = SHN_ABS; + else if (bfd_is_com_section (asect)) + index = SHN_COMMON; + else if (bfd_is_und_section (asect)) + index = SHN_UNDEF; + else { - for (index = 0; index < maxindex; index++) + Elf_Internal_Shdr **i_shdrp = elf_elfsections (abfd); + int maxindex = elf_numsections (abfd); + + for (index = 1; index < maxindex; index++) { - int retval; + Elf_Internal_Shdr *hdr = i_shdrp[index]; - hdr = i_shdrp[index]; - retval = index; - if ((*bed->elf_backend_section_from_bfd_section) - (abfd, hdr, asect, &retval)) - return retval; + if (hdr != NULL && hdr->bfd_section == asect) + return index; } + index = -1; } - if (bfd_is_abs_section (asect)) - return SHN_ABS; - if (bfd_is_com_section (asect)) - return SHN_COMMON; - if (bfd_is_und_section (asect)) - return SHN_UNDEF; + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_section_from_bfd_section) + { + int retval = index; + + if ((*bed->elf_backend_section_from_bfd_section) (abfd, asect, &retval)) + return retval; + } - bfd_set_error (bfd_error_nonrepresentable_section); + if (index == -1) + bfd_set_error (bfd_error_nonrepresentable_section); - return -1; + return index; } /* Given a BFD symbol, return the index in the ELF symbol table, or -1 @@ -3608,7 +4129,8 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr) indx = asym_ptr->section->output_section->index; else indx = asym_ptr->section->index; - if (elf_section_syms (abfd)[indx]) + if (indx < elf_num_section_syms (abfd) + && elf_section_syms (abfd)[indx] != NULL) asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i; } @@ -3620,7 +4142,7 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr) which is used in a relocation entry. */ (*_bfd_error_handler) (_("%s: symbol `%s' required but not present"), - bfd_get_filename (abfd), bfd_asymbol_name (asym_ptr)); + bfd_archive_filename (abfd), bfd_asymbol_name (asym_ptr)); bfd_set_error (bfd_error_no_symbols); return -1; } @@ -3715,16 +4237,19 @@ copy_private_bfd_data (ibfd, obfd) /* Decide if the given section should be included in the given segment. A section will be included if: - 1. It is within the address space of the segment, + 1. It is within the address space of the segment -- we use the LMA + if that is set for the segment and the VMA otherwise, 2. It is an allocated segment, 3. There is an output section associated with it, 4. The section has not already been allocated to a previous segment. */ -#define INCLUDE_SECTION_IN_SEGMENT(section, segment) \ - ((((IS_CONTAINED_BY_VMA (section, segment) \ - || IS_SOLARIS_PT_INTERP (segment, section)) \ - && (section->flags & SEC_ALLOC) != 0) \ - || IS_COREFILE_NOTE (segment, section)) \ - && section->output_section != NULL \ +#define INCLUDE_SECTION_IN_SEGMENT(section, segment) \ + (((((segment->p_paddr \ + ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ + : IS_CONTAINED_BY_VMA (section, segment)) \ + || IS_SOLARIS_PT_INTERP (segment, section)) \ + && (section->flags & SEC_ALLOC) != 0) \ + || IS_COREFILE_NOTE (segment, section)) \ + && section->output_section != NULL \ && section->segment_mark == false) /* Returns true iff seg1 starts after the end of seg2. */ @@ -3741,7 +4266,7 @@ copy_private_bfd_data (ibfd, obfd) /* Scan through the segments specified in the program header of the input BFD. For this first scan we look for overlaps - in the loadable segments. These can be created by wierd + in the loadable segments. These can be created by weird parameters to objcopy. */ for (i = 0, segment = elf_tdata (ibfd)->phdr; i < num_segments; @@ -3815,6 +4340,7 @@ copy_private_bfd_data (ibfd, obfd) bfd_vma matching_lma; bfd_vma suggested_lma; unsigned int j; + bfd_size_type amt; if (segment->p_type == PT_NULL) continue; @@ -3827,10 +4353,9 @@ copy_private_bfd_data (ibfd, obfd) /* Allocate a segment map big enough to contain all of the sections we have selected. */ - map = ((struct elf_segment_map *) - bfd_alloc (obfd, - (sizeof (struct elf_segment_map) - + ((size_t) section_count - 1) * sizeof (asection *)))); + amt = sizeof (struct elf_segment_map); + amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); + map = (struct elf_segment_map *) bfd_alloc (obfd, amt); if (map == NULL) return false; @@ -3870,7 +4395,7 @@ copy_private_bfd_data (ibfd, obfd) if (segment->p_type == PT_LOAD) _bfd_error_handler (_("%s: warning: Empty loadable segment detected\n"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); map->count = 0; *pointer_to_map = map; @@ -3907,8 +4432,8 @@ copy_private_bfd_data (ibfd, obfd) pointers that we are interested in. As these sections get assigned to a segment, they are removed from this array. */ - sections = (asection **) bfd_malloc - (sizeof (asection *) * section_count); + amt = (bfd_size_type) section_count * sizeof (asection *); + sections = (asection **) bfd_malloc (amt); if (sections == NULL) return false; @@ -3944,7 +4469,8 @@ copy_private_bfd_data (ibfd, obfd) ? iehdr->e_ehsize : 0) + (map->includes_phdrs - ? iehdr->e_phnum * iehdr->e_phentsize + ? (iehdr->e_phnum + * iehdr->e_phentsize) : 0)))) map->p_paddr = segment->p_vaddr; @@ -4069,9 +4595,11 @@ copy_private_bfd_data (ibfd, obfd) /* If the gap between the end of the previous section and the start of this section is more than maxpagesize then we need to start a new segment. */ - if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, maxpagesize) + if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, + maxpagesize) < BFD_ALIGN (output_section->lma, maxpagesize)) - || ((prev_sec->lma + prev_sec->_raw_size) > output_section->lma)) + || ((prev_sec->lma + prev_sec->_raw_size) + > output_section->lma)) { if (suggested_lma == 0) suggested_lma = output_section->lma; @@ -4100,11 +4628,9 @@ copy_private_bfd_data (ibfd, obfd) /* We still have not allocated all of the sections to segments. Create a new segment here, initialise it and carry on looping. */ - map = ((struct elf_segment_map *) - bfd_alloc (obfd, - (sizeof (struct elf_segment_map) - + ((size_t) section_count - 1) - * sizeof (asection *)))); + amt = sizeof (struct elf_segment_map); + amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); + map = (struct elf_segment_map *) bfd_alloc (obfd, amt); if (map == NULL) return false; @@ -4142,7 +4668,7 @@ copy_private_bfd_data (ibfd, obfd) elf_tdata (obfd)->segment_map = map_first; /* If we had to estimate the number of program headers that were - going to be needed, then check our estimate know and adjust + going to be needed, then check our estimate now and adjust the offset if necessary. */ if (phdr_adjust_seg != NULL) { @@ -4255,10 +4781,11 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) section indices; these definitions are interpreted by the swap_out_syms function. */ -#define MAP_ONESYMTAB (SHN_LORESERVE - 1) -#define MAP_DYNSYMTAB (SHN_LORESERVE - 2) -#define MAP_STRTAB (SHN_LORESERVE - 3) -#define MAP_SHSTRTAB (SHN_LORESERVE - 4) +#define MAP_ONESYMTAB (SHN_HIOS + 1) +#define MAP_DYNSYMTAB (SHN_HIOS + 2) +#define MAP_STRTAB (SHN_HIOS + 3) +#define MAP_SHSTRTAB (SHN_HIOS + 4) +#define MAP_SYM_SHNDX (SHN_HIOS + 5) boolean _bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg) @@ -4291,6 +4818,8 @@ _bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg) shndx = MAP_STRTAB; else if (shndx == elf_tdata (ibfd)->shstrtab_section) shndx = MAP_SHSTRTAB; + else if (shndx == elf_tdata (ibfd)->symtab_shndx_section) + shndx = MAP_SYM_SHNDX; osym->internal_elf_sym.st_shndx = shndx; } @@ -4305,217 +4834,250 @@ swap_out_syms (abfd, sttp, relocatable_p) struct bfd_strtab_hash **sttp; int relocatable_p; { - struct elf_backend_data *bed = get_elf_backend_data (abfd); + struct elf_backend_data *bed; + int symcount; + asymbol **syms; + struct bfd_strtab_hash *stt; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *symtab_shndx_hdr; + Elf_Internal_Shdr *symstrtab_hdr; + char *outbound_syms; + char *outbound_shndx; + int idx; + bfd_size_type amt; if (!elf_map_symbols (abfd)) return false; /* Dump out the symtabs. */ - { - int symcount = bfd_get_symcount (abfd); - asymbol **syms = bfd_get_outsymbols (abfd); - struct bfd_strtab_hash *stt; - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *symstrtab_hdr; - char *outbound_syms; - int idx; - - stt = _bfd_elf_stringtab_init (); - if (stt == NULL) - return false; + stt = _bfd_elf_stringtab_init (); + if (stt == NULL) + return false; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - symtab_hdr->sh_type = SHT_SYMTAB; - symtab_hdr->sh_entsize = bed->s->sizeof_sym; - symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1); - symtab_hdr->sh_info = elf_num_locals (abfd) + 1; - symtab_hdr->sh_addralign = bed->s->file_align; + bed = get_elf_backend_data (abfd); + symcount = bfd_get_symcount (abfd); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + symtab_hdr->sh_type = SHT_SYMTAB; + symtab_hdr->sh_entsize = bed->s->sizeof_sym; + symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1); + symtab_hdr->sh_info = elf_num_locals (abfd) + 1; + symtab_hdr->sh_addralign = bed->s->file_align; + + symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; + symstrtab_hdr->sh_type = SHT_STRTAB; + + amt = (bfd_size_type) (1 + symcount) * bed->s->sizeof_sym; + outbound_syms = bfd_alloc (abfd, amt); + if (outbound_syms == NULL) + return false; + symtab_hdr->contents = (PTR) outbound_syms; - symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; - symstrtab_hdr->sh_type = SHT_STRTAB; + outbound_shndx = NULL; + symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (symtab_shndx_hdr->sh_name != 0) + { + amt = (bfd_size_type) (1 + symcount) * sizeof (Elf_External_Sym_Shndx); + outbound_shndx = bfd_alloc (abfd, amt); + if (outbound_shndx == NULL) + return false; + memset (outbound_shndx, 0, (unsigned long) amt); + symtab_shndx_hdr->contents = outbound_shndx; + symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; + symtab_shndx_hdr->sh_size = amt; + symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx); + symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); + } - outbound_syms = bfd_alloc (abfd, - (1 + symcount) * bed->s->sizeof_sym); - if (outbound_syms == NULL) - return false; - symtab_hdr->contents = (PTR) outbound_syms; + /* now generate the data (for "contents") */ + { + /* Fill in zeroth symbol and swap it out. */ + Elf_Internal_Sym sym; + sym.st_name = 0; + sym.st_value = 0; + sym.st_size = 0; + sym.st_info = 0; + sym.st_other = 0; + sym.st_shndx = SHN_UNDEF; + bed->s->swap_symbol_out (abfd, &sym, outbound_syms, outbound_shndx); + outbound_syms += bed->s->sizeof_sym; + if (outbound_shndx != NULL) + outbound_shndx += sizeof (Elf_External_Sym_Shndx); + } - /* now generate the data (for "contents") */ + syms = bfd_get_outsymbols (abfd); + for (idx = 0; idx < symcount; idx++) { - /* Fill in zeroth symbol and swap it out. */ Elf_Internal_Sym sym; - sym.st_name = 0; - sym.st_value = 0; - sym.st_size = 0; - sym.st_info = 0; - sym.st_other = 0; - sym.st_shndx = SHN_UNDEF; - bed->s->swap_symbol_out (abfd, &sym, (PTR) outbound_syms); - outbound_syms += bed->s->sizeof_sym; - } - for (idx = 0; idx < symcount; idx++) - { - Elf_Internal_Sym sym; - bfd_vma value = syms[idx]->value; - elf_symbol_type *type_ptr; - flagword flags = syms[idx]->flags; - int type; + bfd_vma value = syms[idx]->value; + elf_symbol_type *type_ptr; + flagword flags = syms[idx]->flags; + int type; - if ((flags & BSF_SECTION_SYM) != 0) - { - /* Section symbols have no name. */ - sym.st_name = 0; - } - else - { - sym.st_name = (unsigned long) _bfd_stringtab_add (stt, - syms[idx]->name, - true, false); - if (sym.st_name == (unsigned long) -1) - return false; - } + if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM) + { + /* Local section symbols have no name. */ + sym.st_name = 0; + } + else + { + sym.st_name = (unsigned long) _bfd_stringtab_add (stt, + syms[idx]->name, + true, false); + if (sym.st_name == (unsigned long) -1) + return false; + } - type_ptr = elf_symbol_from (abfd, syms[idx]); + type_ptr = elf_symbol_from (abfd, syms[idx]); - if ((flags & BSF_SECTION_SYM) == 0 - && bfd_is_com_section (syms[idx]->section)) - { - /* ELF common symbols put the alignment into the `value' field, - and the size into the `size' field. This is backwards from - how BFD handles it, so reverse it here. */ - sym.st_size = value; - if (type_ptr == NULL - || type_ptr->internal_elf_sym.st_value == 0) - sym.st_value = value >= 16 ? 16 : (1 << bfd_log2 (value)); - else - sym.st_value = type_ptr->internal_elf_sym.st_value; - sym.st_shndx = _bfd_elf_section_from_bfd_section - (abfd, syms[idx]->section); - } - else - { - asection *sec = syms[idx]->section; - int shndx; + if ((flags & BSF_SECTION_SYM) == 0 + && bfd_is_com_section (syms[idx]->section)) + { + /* ELF common symbols put the alignment into the `value' field, + and the size into the `size' field. This is backwards from + how BFD handles it, so reverse it here. */ + sym.st_size = value; + if (type_ptr == NULL + || type_ptr->internal_elf_sym.st_value == 0) + sym.st_value = value >= 16 ? 16 : (1 << bfd_log2 (value)); + else + sym.st_value = type_ptr->internal_elf_sym.st_value; + sym.st_shndx = _bfd_elf_section_from_bfd_section + (abfd, syms[idx]->section); + } + else + { + asection *sec = syms[idx]->section; + int shndx; - if (sec->output_section) - { - value += sec->output_offset; - sec = sec->output_section; - } - /* Don't add in the section vma for relocatable output. */ - if (! relocatable_p) - value += sec->vma; - sym.st_value = value; - sym.st_size = type_ptr ? type_ptr->internal_elf_sym.st_size : 0; - - if (bfd_is_abs_section (sec) - && type_ptr != NULL - && type_ptr->internal_elf_sym.st_shndx != 0) - { - /* This symbol is in a real ELF section which we did - not create as a BFD section. Undo the mapping done - by copy_private_symbol_data. */ - shndx = type_ptr->internal_elf_sym.st_shndx; - switch (shndx) - { - case MAP_ONESYMTAB: - shndx = elf_onesymtab (abfd); - break; - case MAP_DYNSYMTAB: - shndx = elf_dynsymtab (abfd); - break; - case MAP_STRTAB: - shndx = elf_tdata (abfd)->strtab_section; - break; - case MAP_SHSTRTAB: - shndx = elf_tdata (abfd)->shstrtab_section; - break; - default: - break; - } - } - else - { - shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + if (sec->output_section) + { + value += sec->output_offset; + sec = sec->output_section; + } + /* Don't add in the section vma for relocatable output. */ + if (! relocatable_p) + value += sec->vma; + sym.st_value = value; + sym.st_size = type_ptr ? type_ptr->internal_elf_sym.st_size : 0; + + if (bfd_is_abs_section (sec) + && type_ptr != NULL + && type_ptr->internal_elf_sym.st_shndx != 0) + { + /* This symbol is in a real ELF section which we did + not create as a BFD section. Undo the mapping done + by copy_private_symbol_data. */ + shndx = type_ptr->internal_elf_sym.st_shndx; + switch (shndx) + { + case MAP_ONESYMTAB: + shndx = elf_onesymtab (abfd); + break; + case MAP_DYNSYMTAB: + shndx = elf_dynsymtab (abfd); + break; + case MAP_STRTAB: + shndx = elf_tdata (abfd)->strtab_section; + break; + case MAP_SHSTRTAB: + shndx = elf_tdata (abfd)->shstrtab_section; + break; + case MAP_SYM_SHNDX: + shndx = elf_tdata (abfd)->symtab_shndx_section; + break; + default: + break; + } + } + else + { + shndx = _bfd_elf_section_from_bfd_section (abfd, sec); - if (shndx == -1) - { - asection *sec2; - - /* Writing this would be a hell of a lot easier if - we had some decent documentation on bfd, and - knew what to expect of the library, and what to - demand of applications. For example, it - appears that `objcopy' might not set the - section of a symbol to be a section that is - actually in the output file. */ - sec2 = bfd_get_section_by_name (abfd, sec->name); - BFD_ASSERT (sec2 != 0); - shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); - BFD_ASSERT (shndx != -1); - } - } + if (shndx == -1) + { + asection *sec2; + + /* Writing this would be a hell of a lot easier if + we had some decent documentation on bfd, and + knew what to expect of the library, and what to + demand of applications. For example, it + appears that `objcopy' might not set the + section of a symbol to be a section that is + actually in the output file. */ + sec2 = bfd_get_section_by_name (abfd, sec->name); + BFD_ASSERT (sec2 != 0); + shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); + BFD_ASSERT (shndx != -1); + } + } - sym.st_shndx = shndx; - } + sym.st_shndx = shndx; + } - if ((flags & BSF_FUNCTION) != 0) - type = STT_FUNC; - else if ((flags & BSF_OBJECT) != 0) - type = STT_OBJECT; - else - type = STT_NOTYPE; - - /* Processor-specific types */ - if (type_ptr != NULL - && bed->elf_backend_get_symbol_type) - type = (*bed->elf_backend_get_symbol_type) (&type_ptr->internal_elf_sym, type); - - if (flags & BSF_SECTION_SYM) - sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); - else if (bfd_is_com_section (syms[idx]->section)) - sym.st_info = ELF_ST_INFO (STB_GLOBAL, type); - else if (bfd_is_und_section (syms[idx]->section)) - sym.st_info = ELF_ST_INFO (((flags & BSF_WEAK) - ? STB_WEAK - : STB_GLOBAL), - type); - else if (flags & BSF_FILE) - sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE); - else - { - int bind = STB_LOCAL; + if ((flags & BSF_FUNCTION) != 0) + type = STT_FUNC; + else if ((flags & BSF_OBJECT) != 0) + type = STT_OBJECT; + else + type = STT_NOTYPE; - if (flags & BSF_LOCAL) - bind = STB_LOCAL; - else if (flags & BSF_WEAK) - bind = STB_WEAK; - else if (flags & BSF_GLOBAL) - bind = STB_GLOBAL; + /* Processor-specific types */ + if (type_ptr != NULL + && bed->elf_backend_get_symbol_type) + type = ((*bed->elf_backend_get_symbol_type) + (&type_ptr->internal_elf_sym, type)); - sym.st_info = ELF_ST_INFO (bind, type); - } + if (flags & BSF_SECTION_SYM) + { + if (flags & BSF_GLOBAL) + sym.st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + else + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); + } + else if (bfd_is_com_section (syms[idx]->section)) + sym.st_info = ELF_ST_INFO (STB_GLOBAL, type); + else if (bfd_is_und_section (syms[idx]->section)) + sym.st_info = ELF_ST_INFO (((flags & BSF_WEAK) + ? STB_WEAK + : STB_GLOBAL), + type); + else if (flags & BSF_FILE) + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE); + else + { + int bind = STB_LOCAL; - if (type_ptr != NULL) - sym.st_other = type_ptr->internal_elf_sym.st_other; - else - sym.st_other = 0; + if (flags & BSF_LOCAL) + bind = STB_LOCAL; + else if (flags & BSF_WEAK) + bind = STB_WEAK; + else if (flags & BSF_GLOBAL) + bind = STB_GLOBAL; - bed->s->swap_symbol_out (abfd, &sym, (PTR) outbound_syms); - outbound_syms += bed->s->sizeof_sym; - } + sym.st_info = ELF_ST_INFO (bind, type); + } - *sttp = stt; - symstrtab_hdr->sh_size = _bfd_stringtab_size (stt); - symstrtab_hdr->sh_type = SHT_STRTAB; + if (type_ptr != NULL) + sym.st_other = type_ptr->internal_elf_sym.st_other; + else + sym.st_other = 0; - symstrtab_hdr->sh_flags = 0; - symstrtab_hdr->sh_addr = 0; - symstrtab_hdr->sh_entsize = 0; - symstrtab_hdr->sh_link = 0; - symstrtab_hdr->sh_info = 0; - symstrtab_hdr->sh_addralign = 1; - } + bed->s->swap_symbol_out (abfd, &sym, outbound_syms, outbound_shndx); + outbound_syms += bed->s->sizeof_sym; + if (outbound_shndx != NULL) + outbound_shndx += sizeof (Elf_External_Sym_Shndx); + } + + *sttp = stt; + symstrtab_hdr->sh_size = _bfd_stringtab_size (stt); + symstrtab_hdr->sh_type = SHT_STRTAB; + + symstrtab_hdr->sh_flags = 0; + symstrtab_hdr->sh_addr = 0; + symstrtab_hdr->sh_entsize = 0; + symstrtab_hdr->sh_link = 0; + symstrtab_hdr->sh_info = 0; + symstrtab_hdr->sh_addralign = 1; return true; } @@ -4579,11 +5141,9 @@ _bfd_elf_canonicalize_reloc (abfd, section, relptr, symbols) { arelent *tblptr; unsigned int i; + struct elf_backend_data *bed = get_elf_backend_data (abfd); - if (! get_elf_backend_data (abfd)->s->slurp_reloc_table (abfd, - section, - symbols, - false)) + if (! bed->s->slurp_reloc_table (abfd, section, symbols, false)) return -1; tblptr = section->relocation; @@ -4600,8 +5160,8 @@ _bfd_elf_get_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { - long symcount = get_elf_backend_data (abfd)->s->slurp_symbol_table - (abfd, alocation, false); + struct elf_backend_data *bed = get_elf_backend_data (abfd); + long symcount = bed->s->slurp_symbol_table (abfd, alocation, false); if (symcount >= 0) bfd_get_symcount (abfd) = symcount; @@ -4613,8 +5173,8 @@ _bfd_elf_canonicalize_dynamic_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { - return get_elf_backend_data (abfd)->s->slurp_symbol_table - (abfd, alocation, true); + struct elf_backend_data *bed = get_elf_backend_data (abfd); + return bed->s->slurp_symbol_table (abfd, alocation, true); } /* Return the size required for the dynamic reloc entries. Any @@ -4704,6 +5264,7 @@ _bfd_elf_slurp_version_tables (abfd) bfd *abfd; { bfd_byte *contents = NULL; + bfd_size_type amt; if (elf_dynverdef (abfd) != 0) { @@ -4721,7 +5282,7 @@ _bfd_elf_slurp_version_tables (abfd) if (contents == NULL) goto error_return; if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 - || bfd_read ((PTR) contents, 1, hdr->sh_size, abfd) != hdr->sh_size) + || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; /* We know the number of entries in the section but not the maximum @@ -4740,9 +5301,8 @@ _bfd_elf_slurp_version_tables (abfd) ((bfd_byte *) everdef + iverdefmem.vd_next)); } - elf_tdata (abfd)->verdef = - ((Elf_Internal_Verdef *) - bfd_zalloc (abfd, maxidx * sizeof (Elf_Internal_Verdef))); + amt = (bfd_size_type) maxidx * sizeof (Elf_Internal_Verdef); + elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); if (elf_tdata (abfd)->verdef == NULL) goto error_return; @@ -4763,10 +5323,8 @@ _bfd_elf_slurp_version_tables (abfd) iverdef->vd_bfd = abfd; - iverdef->vd_auxptr = ((Elf_Internal_Verdaux *) - bfd_alloc (abfd, - (iverdef->vd_cnt - * sizeof (Elf_Internal_Verdaux)))); + amt = (bfd_size_type) iverdef->vd_cnt * sizeof (Elf_Internal_Verdaux); + iverdef->vd_auxptr = (Elf_Internal_Verdaux *) bfd_alloc (abfd, amt); if (iverdef->vd_auxptr == NULL) goto error_return; @@ -4816,9 +5374,9 @@ _bfd_elf_slurp_version_tables (abfd) hdr = &elf_tdata (abfd)->dynverref_hdr; + amt = (bfd_size_type) hdr->sh_info * sizeof (Elf_Internal_Verneed); elf_tdata (abfd)->verref = - ((Elf_Internal_Verneed *) - bfd_zalloc (abfd, hdr->sh_info * sizeof (Elf_Internal_Verneed))); + (Elf_Internal_Verneed *) bfd_zalloc (abfd, amt); if (elf_tdata (abfd)->verref == NULL) goto error_return; @@ -4828,7 +5386,7 @@ _bfd_elf_slurp_version_tables (abfd) if (contents == NULL) goto error_return; if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 - || bfd_read ((PTR) contents, 1, hdr->sh_size, abfd) != hdr->sh_size) + || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; everneed = (Elf_External_Verneed *) contents; @@ -4849,10 +5407,9 @@ _bfd_elf_slurp_version_tables (abfd) if (iverneed->vn_filename == NULL) goto error_return; - iverneed->vn_auxptr = - ((Elf_Internal_Vernaux *) - bfd_alloc (abfd, - iverneed->vn_cnt * sizeof (Elf_Internal_Vernaux))); + amt = iverneed->vn_cnt; + amt *= sizeof (Elf_Internal_Vernaux); + iverneed->vn_auxptr = (Elf_Internal_Vernaux *) bfd_alloc (abfd, amt); evernaux = ((Elf_External_Vernaux *) ((bfd_byte *) everneed + iverneed->vn_aux)); @@ -4902,8 +5459,9 @@ _bfd_elf_make_empty_symbol (abfd) bfd *abfd; { elf_symbol_type *newsym; + bfd_size_type amt = sizeof (elf_symbol_type); - newsym = (elf_symbol_type *) bfd_zalloc (abfd, sizeof (elf_symbol_type)); + newsym = (elf_symbol_type *) bfd_zalloc (abfd, amt); if (!newsym) return NULL; else @@ -5121,6 +5679,7 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count) bfd_size_type count; { Elf_Internal_Shdr *hdr; + bfd_signed_vma pos; if (! abfd->output_has_begun && ! _bfd_elf_compute_section_file_positions @@ -5128,10 +5687,9 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count) return false; hdr = &elf_section_data (section)->this_hdr; - - if (bfd_seek (abfd, hdr->sh_offset + offset, SEEK_SET) == -1) - return false; - if (bfd_write (location, 1, count, abfd) != count) + pos = hdr->sh_offset + offset; + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bwrite (location, count, abfd) != count) return false; return true; @@ -5250,7 +5808,7 @@ _bfd_elf_validate_reloc (abfd, areloc) fail: (*_bfd_error_handler) (_("%s: unsupported relocation type %s"), - bfd_get_filename (abfd), areloc->howto->name); + bfd_archive_filename (abfd), areloc->howto->name); bfd_set_error (bfd_error_bad_value); return false; } @@ -5262,7 +5820,7 @@ _bfd_elf_close_and_cleanup (abfd) if (bfd_get_format (abfd) == bfd_object) { if (elf_shstrtab (abfd) != NULL) - _bfd_stringtab_free (elf_shstrtab (abfd)); + _bfd_elf_strtab_free (elf_shstrtab (abfd)); } return _bfd_generic_close_and_cleanup (abfd); @@ -5295,12 +5853,6 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg) # include #endif -/* Define offsetof for those systems which lack it. */ - -#ifndef offsetof -# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - /* FIXME: this is kinda wrong, but it's what gdb wants. */ static int @@ -5338,6 +5890,43 @@ elfcore_maybe_make_sect (abfd, name, sect) return true; } +/* Create a pseudosection containing SIZE bytes at FILEPOS. This + actually creates up to two pseudosections: + - For the single-threaded case, a section named NAME, unless + such a section already exists. + - For the multi-threaded case, a section named "NAME/PID", where + PID is elfcore_make_pid (abfd). + Both pseudosections have identical contents. */ +boolean +_bfd_elfcore_make_pseudosection (abfd, name, size, filepos) + bfd *abfd; + char *name; + size_t size; + ufile_ptr filepos; +{ + char buf[100]; + char *threaded_name; + asection *sect; + + /* Build the section name. */ + + sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd)); + threaded_name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + if (threaded_name == NULL) + return false; + strcpy (threaded_name, buf); + + sect = bfd_make_section (abfd, threaded_name); + if (sect == NULL) + return false; + sect->_raw_size = size; + sect->filepos = filepos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 2; + + return elfcore_maybe_make_sect (abfd, name, sect); +} + /* prstatus_t exists on: solaris 2.5+ linux 2.[01] + glibc @@ -5345,15 +5934,14 @@ elfcore_maybe_make_sect (abfd, name, sect) */ #if defined (HAVE_PRSTATUS_T) +static boolean elfcore_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); + static boolean elfcore_grok_prstatus (abfd, note) bfd *abfd; Elf_Internal_Note *note; { - char buf[100]; - char *name; - asection *sect; - int raw_size; + size_t raw_size; int offset; if (note->descsz == sizeof (prstatus_t)) @@ -5364,7 +5952,10 @@ elfcore_grok_prstatus (abfd, note) offset = offsetof (prstatus_t, pr_reg); memcpy (&prstat, note->descdata, sizeof (prstat)); - elf_tdata (abfd)->core_signal = prstat.pr_cursig; + /* Do not overwrite the core signal if it + has already been set by another thread. */ + if (elf_tdata (abfd)->core_signal == 0) + elf_tdata (abfd)->core_signal = prstat.pr_cursig; elf_tdata (abfd)->core_pid = prstat.pr_pid; /* pr_who exists on: @@ -5387,7 +5978,10 @@ elfcore_grok_prstatus (abfd, note) offset = offsetof (prstatus32_t, pr_reg); memcpy (&prstat, note->descdata, sizeof (prstat)); - elf_tdata (abfd)->core_signal = prstat.pr_cursig; + /* Do not overwrite the core signal if it + has already been set by another thread. */ + if (elf_tdata (abfd)->core_signal == 0) + elf_tdata (abfd)->core_signal = prstat.pr_cursig; elf_tdata (abfd)->core_pid = prstat.pr_pid; /* pr_who exists on: @@ -5408,69 +6002,21 @@ elfcore_grok_prstatus (abfd, note) return true; } - /* Make a ".reg/999" section. */ - - sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); - name = bfd_alloc (abfd, strlen (buf) + 1); - if (name == NULL) - return false; - strcpy (name, buf); - - sect = bfd_make_section (abfd, name); - if (sect == NULL) - return false; - - sect->_raw_size = raw_size; - sect->filepos = note->descpos + offset; - - sect->flags = SEC_HAS_CONTENTS; - sect->alignment_power = 2; - - if (! elfcore_maybe_make_sect (abfd, ".reg", sect)) - return false; - - return true; + /* Make a ".reg/999" section and a ".reg" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + raw_size, note->descpos + offset); } #endif /* defined (HAVE_PRSTATUS_T) */ -/* Create a pseudosection containing the exact contents of NOTE. This - actually creates up to two pseudosections: - - For the single-threaded case, a section named NAME, unless - such a section already exists. - - For the multi-threaded case, a section named "NAME/PID", where - PID is elfcore_make_pid (abfd). - Both pseudosections have identical contents: the contents of NOTE. */ - +/* Create a pseudosection containing the exact contents of NOTE. */ static boolean elfcore_make_note_pseudosection (abfd, name, note) bfd *abfd; char *name; Elf_Internal_Note *note; { - char buf[100]; - char *threaded_name; - asection *sect; - - /* Build the section name. */ - - sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd)); - threaded_name = bfd_alloc (abfd, strlen (buf) + 1); - if (threaded_name == NULL) - return false; - strcpy (threaded_name, buf); - - sect = bfd_make_section (abfd, threaded_name); - if (sect == NULL) - return false; - sect->_raw_size = note->descsz; - sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; - sect->alignment_power = 2; - - if (! elfcore_maybe_make_sect (abfd, name, sect)) - return false; - - return true; + return _bfd_elfcore_make_pseudosection (abfd, name, + note->descsz, note->descpos); } /* There isn't a consistent prfpregset_t across platforms, @@ -5511,37 +6057,38 @@ typedef psinfo32_t elfcore_psinfo32_t; #endif #endif -#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) - /* return a malloc'ed copy of a string at START which is at most MAX bytes long, possibly without a terminating '\0'. the copy will always have a terminating '\0'. */ -static char* -elfcore_strndup (abfd, start, max) +char * +_bfd_elfcore_strndup (abfd, start, max) bfd *abfd; char *start; - int max; + size_t max; { - char *dup; + char *dups; char *end = memchr (start, '\0', max); - int len; + size_t len; if (end == NULL) len = max; else len = end - start; - dup = bfd_alloc (abfd, len + 1); - if (dup == NULL) + dups = bfd_alloc (abfd, (bfd_size_type) len + 1); + if (dups == NULL) return NULL; - memcpy (dup, start, len); - dup[len] = '\0'; + memcpy (dups, start, len); + dups[len] = '\0'; - return dup; + return dups; } +#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) +static boolean elfcore_grok_psinfo PARAMS ((bfd *, Elf_Internal_Note *)); + static boolean elfcore_grok_psinfo (abfd, note) bfd *abfd; @@ -5554,10 +6101,12 @@ elfcore_grok_psinfo (abfd, note) memcpy (&psinfo, note->descdata, sizeof (psinfo)); elf_tdata (abfd)->core_program - = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); + = _bfd_elfcore_strndup (abfd, psinfo.pr_fname, + sizeof (psinfo.pr_fname)); elf_tdata (abfd)->core_command - = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); + = _bfd_elfcore_strndup (abfd, psinfo.pr_psargs, + sizeof (psinfo.pr_psargs)); } #if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) else if (note->descsz == sizeof (elfcore_psinfo32_t)) @@ -5568,10 +6117,12 @@ elfcore_grok_psinfo (abfd, note) memcpy (&psinfo, note->descdata, sizeof (psinfo)); elf_tdata (abfd)->core_program - = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); + = _bfd_elfcore_strndup (abfd, psinfo.pr_fname, + sizeof (psinfo.pr_fname)); elf_tdata (abfd)->core_command - = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); + = _bfd_elfcore_strndup (abfd, psinfo.pr_psargs, + sizeof (psinfo.pr_psargs)); } #endif @@ -5661,7 +6212,7 @@ elfcore_grok_lwpstatus (abfd, note) /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); - name = bfd_alloc (abfd, strlen (buf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); if (name == NULL) return false; strcpy (name, buf); @@ -5690,7 +6241,7 @@ elfcore_grok_lwpstatus (abfd, note) /* Make a ".reg2/999" section */ sprintf (buf, ".reg2/%d", elfcore_make_pid (abfd)); - name = bfd_alloc (abfd, strlen (buf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); if (name == NULL) return false; strcpy (name, buf); @@ -5713,10 +6264,7 @@ elfcore_grok_lwpstatus (abfd, note) sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; - if (!elfcore_maybe_make_sect (abfd, ".reg2", sect)) - return false; - - return true; + return elfcore_maybe_make_sect (abfd, ".reg2", sect); } #endif /* defined (HAVE_LWPSTATUS_T) */ @@ -5734,7 +6282,7 @@ elfcore_grok_win32pstatus (abfd, note) if (note->descsz < sizeof (pstatus)) return true; - memcpy (&pstatus, note->descdata, note->descsz); + memcpy (&pstatus, note->descdata, sizeof (pstatus)); switch (pstatus.data_type) { @@ -5748,7 +6296,7 @@ elfcore_grok_win32pstatus (abfd, note) /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid); - name = bfd_alloc (abfd, strlen (buf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); if (name == NULL) return false; @@ -5759,8 +6307,9 @@ elfcore_grok_win32pstatus (abfd, note) return false; sect->_raw_size = sizeof (pstatus.data.thread_info.thread_context); - sect->filepos = note->descpos + offsetof (struct win32_pstatus, - data.thread_info.thread_context); + sect->filepos = (note->descpos + + offsetof (struct win32_pstatus, + data.thread_info.thread_context)); sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; @@ -5773,7 +6322,7 @@ elfcore_grok_win32pstatus (abfd, note) /* Make a ".module/xxxxxxxx" section. */ sprintf (buf, ".module/%08x", pstatus.data.module_info.base_address); - name = bfd_alloc (abfd, strlen (buf) + 1); + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); if (name == NULL) return false; @@ -5803,14 +6352,21 @@ elfcore_grok_note (abfd, note) bfd *abfd; Elf_Internal_Note *note; { + struct elf_backend_data *bed = get_elf_backend_data (abfd); + switch (note->type) { default: return true; -#if defined (HAVE_PRSTATUS_T) case NT_PRSTATUS: + if (bed->elf_backend_grok_prstatus) + if ((*bed->elf_backend_grok_prstatus) (abfd, note)) + return true; +#if defined (HAVE_PRSTATUS_T) return elfcore_grok_prstatus (abfd, note); +#else + return true; #endif #if defined (HAVE_PSTATUS_T) @@ -5838,19 +6394,264 @@ elfcore_grok_note (abfd, note) else return true; -#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) case NT_PRPSINFO: case NT_PSINFO: + if (bed->elf_backend_grok_psinfo) + if ((*bed->elf_backend_grok_psinfo) (abfd, note)) + return true; +#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) return elfcore_grok_psinfo (abfd, note); +#else + return true; #endif } } static boolean +elfcore_netbsd_get_lwpid (note, lwpidp) + Elf_Internal_Note *note; + int *lwpidp; +{ + char *cp; + + cp = strchr (note->namedata, '@'); + if (cp != NULL) + { + *lwpidp = atoi(cp); + return true; + } + return false; +} + +static boolean +elfcore_grok_netbsd_procinfo (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + + /* Signal number at offset 0x08. */ + elf_tdata (abfd)->core_signal + = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08); + + /* Process ID at offset 0x50. */ + elf_tdata (abfd)->core_pid + = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x50); + + /* Command name at 0x7c (max 32 bytes, including nul). */ + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 0x7c, 31); + + return true; +} + +static boolean +elfcore_grok_netbsd_note (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + int lwp; + + if (elfcore_netbsd_get_lwpid (note, &lwp)) + elf_tdata (abfd)->core_lwpid = lwp; + + if (note->type == NT_NETBSDCORE_PROCINFO) + { + /* NetBSD-specific core "procinfo". Note that we expect to + find this note before any of the others, which is fine, + since the kernel writes this note out first when it + creates a core file. */ + + return elfcore_grok_netbsd_procinfo (abfd, note); + } + + /* As of Jan 2002 there are no other machine-independent notes + defined for NetBSD core files. If the note type is less + than the start of the machine-dependent note types, we don't + understand it. */ + + if (note->type < NT_NETBSDCORE_FIRSTMACH) + return true; + + + switch (bfd_get_arch (abfd)) + { + /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and + PT_GETFPREGS == mach+2. */ + + case bfd_arch_alpha: + case bfd_arch_sparc: + switch (note->type) + { + case NT_NETBSDCORE_FIRSTMACH+0: + return elfcore_make_note_pseudosection (abfd, ".reg", note); + + case NT_NETBSDCORE_FIRSTMACH+2: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); + + default: + return true; + } + + /* On all other arch's, PT_GETREGS == mach+1 and + PT_GETFPREGS == mach+3. */ + + default: + switch (note->type) + { + case NT_NETBSDCORE_FIRSTMACH+1: + return elfcore_make_note_pseudosection (abfd, ".reg", note); + + case NT_NETBSDCORE_FIRSTMACH+3: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); + + default: + return true; + } + } + /* NOTREACHED */ +} + +/* Function: elfcore_write_note + + Inputs: + buffer to hold note + name of note + type of note + data for note + size of data for note + + Return: + End of buffer containing note. */ + +char * +elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) + bfd *abfd; + char *buf; + int *bufsiz; + char *name; + int type; + void *input; + int size; +{ + Elf_External_Note *xnp; + int namesz = strlen (name); + int newspace = BFD_ALIGN (sizeof (Elf_External_Note) + size + namesz - 1, 4); + char *p, *dest; + + p = realloc (buf, *bufsiz + newspace); + dest = p + *bufsiz; + *bufsiz += newspace; + xnp = (Elf_External_Note *) dest; + H_PUT_32 (abfd, namesz, xnp->namesz); + H_PUT_32 (abfd, size, xnp->descsz); + H_PUT_32 (abfd, type, xnp->type); + strcpy (xnp->name, name); + memcpy (xnp->name + BFD_ALIGN (namesz, 4), input, size); + return p; +} + +#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) +char * +elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs) + bfd *abfd; + char *buf; + int *bufsiz; + char *fname; + char *psargs; +{ + int note_type; + char *note_name = "CORE"; + +#if defined (HAVE_PSINFO_T) + psinfo_t data; + note_type = NT_PSINFO; +#else + prpsinfo_t data; + note_type = NT_PRPSINFO; +#endif + + memset (&data, 0, sizeof (data)); + strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); + strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, note_type, &data, sizeof (data)); +} +#endif /* PSINFO_T or PRPSINFO_T */ + +#if defined (HAVE_PRSTATUS_T) +char * +elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs) + bfd *abfd; + char *buf; + int *bufsiz; + long pid; + int cursig; + void *gregs; +{ + prstatus_t prstat; + char *note_name = "CORE"; + + memset (&prstat, 0, sizeof (prstat)); + prstat.pr_pid = pid; + prstat.pr_cursig = cursig; + memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_PRSTATUS, &prstat, sizeof (prstat)); +} +#endif /* HAVE_PRSTATUS_T */ + +#if defined (HAVE_PSTATUS_T) +char * +elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs) + bfd *abfd; + char *buf; + int *bufsiz; + long pid; + int cursig; + void *gregs; +{ + pstatus_t pstat; + char *note_name = "CORE"; + + memset (&pstat, 0, sizeof (prstat)); + pstat.pr_pid = pid; + memcpy (pstat.pr_reg, gregs, sizeof (pstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_PSTATUS, &pstat, sizeof (pstat)); +} +#endif /* HAVE_PSTATUS_T */ + +char * +elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size) + bfd *abfd; + char *buf; + int *bufsiz; + void *fpregs; + int size; +{ + char *note_name = "CORE"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_FPREGSET, fpregs, size); +} + +char * +elfcore_write_prxfpreg (abfd, buf, bufsiz, xfpregs, size) + bfd *abfd; + char *buf; + int *bufsiz; + void *xfpregs; + int size; +{ + char *note_name = "LINUX"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_PRXFPREG, xfpregs, size); +} + +static boolean elfcore_read_notes (abfd, offset, size) bfd *abfd; - bfd_vma offset; - bfd_vma size; + file_ptr offset; + bfd_size_type size; { char *buf; char *p; @@ -5858,14 +6659,14 @@ elfcore_read_notes (abfd, offset, size) if (size <= 0) return true; - if (bfd_seek (abfd, offset, SEEK_SET) == -1) + if (bfd_seek (abfd, offset, SEEK_SET) != 0) return false; - buf = bfd_malloc ((size_t) size); + buf = bfd_malloc (size); if (buf == NULL) return false; - if (bfd_read (buf, size, 1, abfd) != size) + if (bfd_bread (buf, size, abfd) != size) { error: free (buf); @@ -5879,17 +6680,25 @@ elfcore_read_notes (abfd, offset, size) Elf_External_Note *xnp = (Elf_External_Note *) p; Elf_Internal_Note in; - in.type = bfd_h_get_32 (abfd, (bfd_byte *) xnp->type); + in.type = H_GET_32 (abfd, xnp->type); - in.namesz = bfd_h_get_32 (abfd, (bfd_byte *) xnp->namesz); + in.namesz = H_GET_32 (abfd, xnp->namesz); in.namedata = xnp->name; - in.descsz = bfd_h_get_32 (abfd, (bfd_byte *) xnp->descsz); + in.descsz = H_GET_32 (abfd, xnp->descsz); in.descdata = in.namedata + BFD_ALIGN (in.namesz, 4); in.descpos = offset + (in.descdata - buf); - if (! elfcore_grok_note (abfd, &in)) - goto error; + if (strncmp (in.namedata, "NetBSD-CORE", 11) == 0) + { + if (! elfcore_grok_netbsd_note (abfd, &in)) + goto error; + } + else + { + if (! elfcore_grok_note (abfd, &in)) + goto error; + } p = in.descdata + BFD_ALIGN (in.descsz, 4); } @@ -5897,21 +6706,6 @@ elfcore_read_notes (abfd, offset, size) free (buf); return true; } - -/* FIXME: This function is now unnecessary. Callers can just call - bfd_section_from_phdr directly. */ - -boolean -_bfd_elfcore_section_from_phdr (abfd, phdr, sec_num) - bfd *abfd; - Elf_Internal_Phdr* phdr; - int sec_num; -{ - if (! bfd_section_from_phdr (abfd, phdr, sec_num)) - return false; - - return true; -} /* Providing external access to the ELF program header table. */ @@ -5929,8 +6723,7 @@ bfd_get_elf_phdr_upper_bound (abfd) return -1; } - return (elf_elfheader (abfd)->e_phnum - * sizeof (Elf_Internal_Phdr)); + return elf_elfheader (abfd)->e_phnum * sizeof (Elf_Internal_Phdr); } /* Copy ABFD's program header table entries to *PHDRS. The entries @@ -5960,3 +6753,146 @@ bfd_get_elf_phdrs (abfd, phdrs) return num_phdrs; } + +void +_bfd_elf_sprintf_vma (abfd, buf, value) + bfd *abfd ATTRIBUTE_UNUSED; + char *buf; + bfd_vma value; +{ +#ifdef BFD64 + Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ + + i_ehdrp = elf_elfheader (abfd); + if (i_ehdrp == NULL) + sprintf_vma (buf, value); + else + { + if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64) + { +#if BFD_HOST_64BIT_LONG + sprintf (buf, "%016lx", value); +#else + sprintf (buf, "%08lx%08lx", _bfd_int64_high (value), + _bfd_int64_low (value)); +#endif + } + else + sprintf (buf, "%08lx", (unsigned long) (value & 0xffffffff)); + } +#else + sprintf_vma (buf, value); +#endif +} + +void +_bfd_elf_fprintf_vma (abfd, stream, value) + bfd *abfd ATTRIBUTE_UNUSED; + PTR stream; + bfd_vma value; +{ +#ifdef BFD64 + Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ + + i_ehdrp = elf_elfheader (abfd); + if (i_ehdrp == NULL) + fprintf_vma ((FILE *) stream, value); + else + { + if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64) + { +#if BFD_HOST_64BIT_LONG + fprintf ((FILE *) stream, "%016lx", value); +#else + fprintf ((FILE *) stream, "%08lx%08lx", + _bfd_int64_high (value), _bfd_int64_low (value)); +#endif + } + else + fprintf ((FILE *) stream, "%08lx", + (unsigned long) (value & 0xffffffff)); + } +#else + fprintf_vma ((FILE *) stream, value); +#endif +} + +enum elf_reloc_type_class +_bfd_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED; +{ + return reloc_class_normal; +} + +/* For RELA architectures, return what the relocation value for + relocation against a local symbol. */ + +bfd_vma +_bfd_elf_rela_local_sym (abfd, sym, sec, rel) + bfd *abfd; + Elf_Internal_Sym *sym; + asection *sec; + Elf_Internal_Rela *rel; +{ + bfd_vma relocation; + + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION + && elf_section_data (sec)->sec_info_type == ELF_INFO_TYPE_MERGE) + { + asection *msec; + + msec = sec; + rel->r_addend = + _bfd_merged_section_offset (abfd, &msec, + elf_section_data (sec)->sec_info, + sym->st_value + rel->r_addend, + (bfd_vma) 0) + - relocation; + rel->r_addend += msec->output_section->vma + msec->output_offset; + } + return relocation; +} + +bfd_vma +_bfd_elf_rel_local_sym (abfd, sym, psec, addend) + bfd *abfd; + Elf_Internal_Sym *sym; + asection **psec; + bfd_vma addend; +{ + asection *sec = *psec; + + if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE) + return sym->st_value + addend; + + return _bfd_merged_section_offset (abfd, psec, + elf_section_data (sec)->sec_info, + sym->st_value + addend, (bfd_vma) 0); +} + +bfd_vma +_bfd_elf_section_offset (abfd, info, sec, offset) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + bfd_vma offset; +{ + struct bfd_elf_section_data *sec_data; + + sec_data = elf_section_data (sec); + switch (sec_data->sec_info_type) + { + case ELF_INFO_TYPE_STABS: + return _bfd_stab_section_offset + (abfd, &elf_hash_table (info)->merge_info, sec, &sec_data->sec_info, + offset); + case ELF_INFO_TYPE_EH_FRAME: + return _bfd_elf_eh_frame_section_offset (abfd, sec, offset); + default: + return offset; + } +} diff --git a/contrib/binutils/bfd/elf32-arc.c b/contrib/binutils/bfd/elf32-arc.c index 82b6104..ad7247a 100644 --- a/contrib/binutils/bfd/elf32-arc.c +++ b/contrib/binutils/bfd/elf32-arc.c @@ -23,6 +23,7 @@ #include "libbfd.h" #include "elf-bfd.h" #include "elf/arc.h" +#include "libiberty.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); @@ -32,6 +33,8 @@ static boolean arc_elf_object_p PARAMS ((bfd *)); static void arc_elf_final_write_processing PARAMS ((bfd *, boolean)); +static bfd_reloc_status_type arc_elf_b22_pcrel + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); /* 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). */ @@ -50,7 +53,7 @@ static reloc_howto_type elf_arc_howto_table[] = complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_NONE", /* name */ - false, /* partial_inplace */ + true, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ @@ -65,7 +68,7 @@ static reloc_howto_type elf_arc_howto_table[] = complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_32", /* name */ - false, /* partial_inplace */ + true, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ @@ -80,7 +83,7 @@ static reloc_howto_type elf_arc_howto_table[] = complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_B26", /* name */ - false, /* partial_inplace */ + true, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ false), /* pcrel_offset */ @@ -93,13 +96,12 @@ static reloc_howto_type elf_arc_howto_table[] = true, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + arc_elf_b22_pcrel, /* special_function */ "R_ARC_B22_PCREL", /* name */ - false, /* partial_inplace */ + true, /* partial_inplace */ 0x07ffff80, /* src_mask */ 0x07ffff80, /* dst_mask */ - true), /* pcrel_offset */ - + false), /* pcrel_offset */ }; /* Map BFD reloc types to ARC ELF reloc types. */ @@ -126,11 +128,10 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, 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]; - } + for (i = ARRAY_SIZE (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; } @@ -155,7 +156,7 @@ static boolean arc_elf_object_p (abfd) bfd *abfd; { - int mach = bfd_mach_arc_6; + unsigned int mach = bfd_mach_arc_6; if (elf_elfheader(abfd)->e_machine == EM_ARC) { @@ -207,11 +208,34 @@ arc_elf_final_write_processing (abfd, linker) val = E_ARC_MACH_ARC8; break; } - elf_elfheader (abfd)->e_machine = EM_ARC; elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH; elf_elfheader (abfd)->e_flags |= val; } +bfd_reloc_status_type +arc_elf_b22_pcrel (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; +{ + /* If linking, back up the final symbol address by the address of the + reloc. This cannot be accomplished by setting the pcrel_offset + field to true, as bfd_install_relocation will detect this and refuse + to install the offset in the first place, but bfd_perform_relocation + will still insist on removing it. */ + if (output_bfd == (bfd *) NULL) + reloc_entry->addend -= reloc_entry->address; + + /* Fall through to the default elf reloc handler. */ + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + #define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec #define TARGET_LITTLE_NAME "elf32-littlearc" #define TARGET_BIG_SYM bfd_elf32_bigarc_vec diff --git a/contrib/binutils/bfd/elf32-arm.h b/contrib/binutils/bfd/elf32-arm.h index d628f1d..ab8a6b3 100644 --- a/contrib/binutils/bfd/elf32-arm.h +++ b/contrib/binutils/bfd/elf32-arm.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -35,13 +35,13 @@ static struct bfd_link_hash_table *elf32_arm_link_hash_table_create static bfd_reloc_status_type elf32_arm_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *, - const char *, unsigned char, struct elf_link_hash_entry *)); + const char *, int, struct elf_link_hash_entry *)); static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct elf_link_hash_entry *find_thumb_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct elf_link_hash_entry *find_arm_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static void record_arm_to_thumb_glue PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void record_thumb_to_arm_glue @@ -54,8 +54,47 @@ static int elf32_arm_to_thumb_stub static int elf32_thumb_to_arm_stub PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *, bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma)); +static boolean elf32_arm_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static asection * elf32_arm_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_arm_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static boolean elf32_arm_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean elf32_arm_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_arm_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean elf32_arm_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static struct bfd_hash_entry * elf32_arm_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +#ifdef USE_REL +static void arm_add_to_rel + PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma)); +#endif -#define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_INTERWORK) +boolean bfd_elf32_arm_allocate_interworking_sections + PARAMS ((struct bfd_link_info *)); +boolean bfd_elf32_arm_get_bfd_for_interworking + PARAMS ((bfd *, struct bfd_link_info *)); +boolean bfd_elf32_arm_process_before_allocation + PARAMS ((bfd *, struct bfd_link_info *, int)); +static enum elf_reloc_type_class elf32_arm_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); + +#define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. @@ -78,23 +117,23 @@ static int elf32_thumb_to_arm_stub this. It is set up so that any shared library function that is called before the relocation has been set up calls the dynamic linker first. */ -static const unsigned long elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe52de004, /* str lr, [sp, #-4]! */ - 0xe59fe010, /* ldr lr, [pc, #16] */ - 0xe08fe00e, /* add lr, pc, lr */ - 0xe5bef008 /* ldr pc, [lr, #8]! */ -}; +static const bfd_vma elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = + { + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe010, /* ldr lr, [pc, #16] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008 /* ldr pc, [lr, #8]! */ + }; /* Subsequent entries in a procedure linkage table look like this. */ -static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe59fc004, /* ldr ip, [pc, #4] */ - 0xe08fc00c, /* add ip, pc, ip */ - 0xe59cf000, /* ldr pc, [ip] */ - 0x00000000 /* offset to symbol in got */ -}; +static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = + { + 0xe59fc004, /* ldr ip, [pc, #4] */ + 0xe08fc00c, /* add ip, pc, ip */ + 0xe59cf000, /* ldr pc, [ip] */ + 0x00000000 /* offset to symbol in got */ + }; /* The ARM linker needs to keep track of the number of relocs that it decides to copy in check_relocs for each symbol. This is so that @@ -105,23 +144,23 @@ static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ struct elf32_arm_pcrel_relocs_copied -{ - /* Next section. */ - struct elf32_arm_pcrel_relocs_copied * next; - /* A section in dynobj. */ - asection * section; - /* Number of relocs copied in this section. */ - bfd_size_type count; -}; + { + /* Next section. */ + struct elf32_arm_pcrel_relocs_copied * next; + /* A section in dynobj. */ + asection * section; + /* Number of relocs copied in this section. */ + bfd_size_type count; + }; /* Arm ELF linker hash entry. */ struct elf32_arm_link_hash_entry -{ - struct elf_link_hash_entry root; + { + struct elf_link_hash_entry root; - /* Number of PC relative relocs copied for this symbol. */ - struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; -}; + /* Number of PC relative relocs copied for this symbol. */ + struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; + }; /* Declare this now that the above structures are defined. */ static boolean elf32_arm_discard_copies @@ -140,23 +179,23 @@ static boolean elf32_arm_discard_copies /* ARM ELF linker hash table. */ struct elf32_arm_link_hash_table -{ - /* The main hash table. */ - struct elf_link_hash_table root; + { + /* The main hash table. */ + struct elf_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + bfd_size_type thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + bfd_size_type arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; - /* A boolean indicating whether knowledge of the ARM's pipeline - length should be applied by the linker. */ - int no_pipeline_knowledge; -}; + /* A boolean indicating whether knowledge of the ARM's pipeline + length should be applied by the linker. */ + int no_pipeline_knowledge; + }; /* Create an entry in an ARM ELF linker hash table. */ @@ -195,9 +234,9 @@ elf32_arm_link_hash_table_create (abfd) bfd *abfd; { struct elf32_arm_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf32_arm_link_hash_table); - ret = ((struct elf32_arm_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf32_arm_link_hash_table))); + ret = (struct elf32_arm_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct elf32_arm_link_hash_table *) NULL) return NULL; @@ -221,7 +260,7 @@ elf32_arm_link_hash_table_create (abfd) static struct elf_link_hash_entry * find_thumb_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -231,8 +270,8 @@ find_thumb_glue (link_info, name, input_bfd) /* We need a pointer to the armelf specific hash table. */ hash_table = elf32_arm_hash_table (link_info); - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1)); + tmp_name = (char *) bfd_malloc ((bfd_size_type) strlen (name) + + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1); BFD_ASSERT (tmp_name); @@ -243,8 +282,8 @@ find_thumb_glue (link_info, name, input_bfd) if (hash == NULL) /* xgettext:c-format */ - _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), - bfd_get_filename (input_bfd), tmp_name, name); + (*_bfd_error_handler) (_("%s: unable to find THUMB glue '%s' for `%s'"), + bfd_archive_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -256,7 +295,7 @@ find_thumb_glue (link_info, name, input_bfd) static struct elf_link_hash_entry * find_arm_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -266,8 +305,8 @@ find_arm_glue (link_info, name, input_bfd) /* We need a pointer to the elfarm specific hash table. */ hash_table = elf32_arm_hash_table (link_info); - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1)); + tmp_name = (char *) bfd_malloc ((bfd_size_type) strlen (name) + + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1); BFD_ASSERT (tmp_name); @@ -278,8 +317,8 @@ find_arm_glue (link_info, name, input_bfd) if (myh == NULL) /* xgettext:c-format */ - _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), - bfd_get_filename (input_bfd), tmp_name, name); + (*_bfd_error_handler) (_("%s: unable to find ARM glue '%s' for `%s'"), + bfd_archive_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -344,13 +383,13 @@ bfd_elf32_arm_allocate_interworking_sections (info) { BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - s = bfd_get_section_by_name - (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); - foo = (bfd_byte *) bfd_alloc - (globals->bfd_of_glue_owner, globals->arm_glue_size); + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, + globals->arm_glue_size); s->_raw_size = s->_cooked_size = globals->arm_glue_size; s->contents = foo; @@ -365,8 +404,8 @@ bfd_elf32_arm_allocate_interworking_sections (info) BFD_ASSERT (s != NULL); - foo = (bfd_byte *) bfd_alloc - (globals->bfd_of_glue_owner, globals->thumb_glue_size); + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, + globals->thumb_glue_size); s->_raw_size = s->_cooked_size = globals->thumb_glue_size; s->contents = foo; @@ -381,10 +420,11 @@ record_arm_to_thumb_glue (link_info, h) struct elf_link_hash_entry * h; { const char * name = h->root.root.string; - register asection * s; + asection * s; char * tmp_name; struct elf_link_hash_entry * myh; struct elf32_arm_link_hash_table * globals; + bfd_vma val; globals = elf32_arm_hash_table (link_info); @@ -396,8 +436,8 @@ record_arm_to_thumb_glue (link_info, h) BFD_ASSERT (s != NULL); - tmp_name = ((char *) - bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1)); + tmp_name = (char *) bfd_malloc ((bfd_size_type) strlen (name) + + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1); BFD_ASSERT (tmp_name); @@ -416,9 +456,9 @@ record_arm_to_thumb_glue (link_info, h) /* The only trick here is using hash_table->arm_glue_size as the value. Even though the section isn't allocated yet, this is where we will be putting it. */ - _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, - s, globals->arm_glue_size + 1, + val = globals->arm_glue_size + 1; + _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner, + tmp_name, BSF_GLOBAL, s, val, NULL, true, false, (struct bfd_link_hash_entry **) &myh); @@ -435,11 +475,12 @@ record_thumb_to_arm_glue (link_info, h) struct elf_link_hash_entry *h; { const char *name = h->root.root.string; - register asection *s; + asection *s; char *tmp_name; struct elf_link_hash_entry *myh; struct elf32_arm_link_hash_table *hash_table; char bind; + bfd_vma val; hash_table = elf32_arm_hash_table (link_info); @@ -451,7 +492,8 @@ record_thumb_to_arm_glue (link_info, h) BFD_ASSERT (s != NULL); - tmp_name = (char *) bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1); + tmp_name = (char *) bfd_malloc ((bfd_size_type) strlen (name) + + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1); BFD_ASSERT (tmp_name); @@ -467,8 +509,9 @@ record_thumb_to_arm_glue (link_info, h) return; } - _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, s, hash_table->thumb_glue_size + 1, + val = hash_table->thumb_glue_size + 1; + _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, + tmp_name, BSF_GLOBAL, s, val, NULL, true, false, (struct bfd_link_hash_entry **) &myh); @@ -482,7 +525,8 @@ record_thumb_to_arm_glue (link_info, h) #define BACK_FROM_ARM "__%s_back_from_arm" /* Allocate another symbol to mark where we switch to Arm mode. */ - tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1); + tmp_name = (char *) bfd_malloc ((bfd_size_type) strlen (name) + + strlen (CHANGE_TO_ARM) + 1); BFD_ASSERT (tmp_name); @@ -490,8 +534,9 @@ record_thumb_to_arm_glue (link_info, h) myh = NULL; - _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, - BSF_LOCAL, s, hash_table->thumb_glue_size + 4, + val = hash_table->thumb_glue_size + 4, + _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, + tmp_name, BSF_LOCAL, s, val, NULL, true, false, (struct bfd_link_hash_entry **) &myh); @@ -616,7 +661,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* Load the relocs. */ irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, false)); + (Elf_Internal_Rela *) NULL, false)); BFD_ASSERT (irel != 0); @@ -652,7 +697,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) free_contents = contents; if (!bfd_get_section_contents (abfd, sec, contents, - (file_ptr) 0, sec->_raw_size)) + (file_ptr) 0, sec->_raw_size)) goto error_return; } } @@ -674,7 +719,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) free_extsyms = extsyms; if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) + || (bfd_bread (extsyms, symtab_hdr->sh_size, abfd) != symtab_hdr->sh_size)) goto error_return; } @@ -807,7 +852,7 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, bfd_vma val; { asection * s = 0; - long int my_offset; + bfd_vma my_offset; unsigned long int tmp; long int ret_offset; struct elf_link_hash_entry * myh; @@ -837,12 +882,12 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, && sym_sec->owner != NULL && !INTERWORK_FLAG (sym_sec->owner)) { - _bfd_error_handler + (*_bfd_error_handler) (_("%s(%s): warning: interworking not enabled."), - bfd_get_filename (sym_sec->owner), name); - _bfd_error_handler + bfd_archive_filename (sym_sec->owner), name); + (*_bfd_error_handler) (_(" first occurrence: %s: thumb call to arm"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); return false; } @@ -850,10 +895,10 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, --my_offset; myh->root.u.def.value = my_offset; - bfd_put_16 (output_bfd, t2a1_bx_pc_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a1_bx_pc_insn, s->contents + my_offset); - bfd_put_16 (output_bfd, t2a2_noop_insn, + bfd_put_16 (output_bfd, (bfd_vma) t2a2_noop_insn, s->contents + my_offset + 2); ret_offset = @@ -872,7 +917,7 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, + 8); bfd_put_32 (output_bfd, - t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), + (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), s->contents + my_offset + 4); } @@ -880,18 +925,17 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, /* Now go back and fix up the original BL insn to point to here. */ - ret_offset = - s->output_offset - + my_offset - - (input_section->output_offset - + offset + addend) - - 8; + ret_offset = (s->output_offset + + my_offset + - (input_section->output_offset + + offset + addend) + - 8); tmp = bfd_get_32 (input_bfd, hit_data - input_section->vma); bfd_put_32 (output_bfd, - insert_thumb_branch (tmp, ret_offset), + (bfd_vma) insert_thumb_branch (tmp, ret_offset), hit_data - input_section->vma); return true; @@ -914,7 +958,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, bfd_vma val; { unsigned long int tmp; - long int my_offset; + bfd_vma my_offset; asection * s; long int ret_offset; struct elf_link_hash_entry * myh; @@ -942,21 +986,21 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, && sym_sec->owner != NULL && !INTERWORK_FLAG (sym_sec->owner)) { - _bfd_error_handler + (*_bfd_error_handler) (_("%s(%s): warning: interworking not enabled."), - bfd_get_filename (sym_sec->owner), name); - _bfd_error_handler + bfd_archive_filename (sym_sec->owner), name); + (*_bfd_error_handler) (_(" first occurrence: %s: arm call to thumb"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); } --my_offset; myh->root.u.def.value = my_offset; - bfd_put_32 (output_bfd, a2t1_ldr_insn, + bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn, s->contents + my_offset); - bfd_put_32 (output_bfd, a2t2_bx_r12_insn, + bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn, s->contents + my_offset + 4); /* It's a thumb address. Add the low order bit. */ @@ -970,18 +1014,17 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, tmp = tmp & 0xFF000000; /* Somehow these are both 4 too far, so subtract 8. */ - ret_offset = s->output_offset - + my_offset - + s->output_section->vma - - (input_section->output_offset - + input_section->output_section->vma - + offset + addend) - - 8; + ret_offset = (s->output_offset + + my_offset + + s->output_section->vma + - (input_section->output_offset + + input_section->output_section->vma + + offset + addend) + - 8); tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); - bfd_put_32 (output_bfd, tmp, hit_data - - input_section->vma); + bfd_put_32 (output_bfd, (bfd_vma) tmp, hit_data - input_section->vma); return true; } @@ -1002,7 +1045,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, struct bfd_link_info * info; asection * sym_sec; const char * sym_name; - unsigned char sym_flags; + int sym_flags; struct elf_link_hash_entry * h; { unsigned long r_type = howto->type; @@ -1022,7 +1065,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* If the start address has been set, then set the EF_ARM_HASENTRY flag. Setting this more than once is redundant, but the cost is not too high, and it keeps the code simple. - + The test is done here, rather than somewhere else, because the start address is only set just before the final link commences. @@ -1030,7 +1073,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, flag will not be set. */ if (bfd_get_start_address (output_bfd) != 0) elf_elfheader (output_bfd)->e_flags |= EF_ARM_HASENTRY; - + globals = elf32_arm_hash_table (info); dynobj = elf_hash_table (info)->dynobj; @@ -1073,8 +1116,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ if (info->shared + && r_symndx != 0 && (r_type != R_ARM_PC24 - || (h != NULL + || (h != NULL && h->dynindx != -1 && (! info->symbolic || (h->elf_link_hash_flags @@ -1105,22 +1149,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - & elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } - + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -1188,10 +1221,10 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* FIXME: Should we translate the instruction into a BL instruction instead ? */ if (sym_flags != STT_ARM_TFUNC) - _bfd_error_handler (_("\ + (*_bfd_error_handler) (_("\ %s: Warning: Arm BLX instruction targets Arm function '%s'."), - bfd_get_filename (input_bfd), - h ? h->root.root.string : "(local)"); + bfd_archive_filename (input_bfd), + h ? h->root.root.string : "(local)"); } else #endif @@ -1384,10 +1417,10 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* FIXME: Should we translate the instruction into a BL instruction instead ? */ if (sym_flags == STT_ARM_TFUNC) - _bfd_error_handler (_("\ + (*_bfd_error_handler) (_("\ %s: Warning: Thumb BLX instruction targets thumb function '%s'."), - bfd_get_filename (input_bfd), - h ? h->root.root.string : "(local)"); + bfd_archive_filename (input_bfd), + h ? h->root.root.string : "(local)"); } else #endif @@ -1457,7 +1490,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, corresponding bit one in the target address will be set from bit one of the source address. */ lower_insn &= ~1; -#endif +#endif /* Put the relocated value back in the object file: */ bfd_put_16 (input_bfd, upper_insn, hit_data); bfd_put_16 (input_bfd, lower_insn, hit_data + 2); @@ -1466,6 +1499,47 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, } break; + case R_ARM_THM_PC11: + /* Thumb B (branch) instruction). */ + { + bfd_vma relocation; + bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; + bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; + bfd_vma check; + bfd_signed_vma signed_check; + +#ifdef USE_REL + /* Need to refetch addend. */ + addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask; + /* ??? Need to determine shift amount from operand size. */ + addend >>= howto->rightshift; +#endif + relocation = value + addend; + + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + check = relocation >> howto->rightshift; + + /* If this is a signed value, the rightshift just + dropped leading 1 bits (assuming twos complement). */ + if ((bfd_signed_vma) relocation >= 0) + signed_check = check; + else + signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); + + relocation |= (bfd_get_16 (input_bfd, hit_data) & (~ howto->dst_mask)); + + bfd_put_16 (input_bfd, relocation, hit_data); + + /* Assumes two's complement. */ + if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) + return bfd_reloc_overflow; + + return bfd_reloc_ok; + } + case R_ARM_GNU_VTINHERIT: case R_ARM_GNU_VTENTRY: return bfd_reloc_ok; @@ -1497,8 +1571,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, calculation. */ value -= sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_GOTPC: /* Use global offset table as symbol value. */ @@ -1509,8 +1583,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, value = sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_GOT32: /* Relocation is to the entry for this symbol in the @@ -1593,8 +1667,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, } return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_PLT32: /* Relocation is to the entry for this symbol in the @@ -1604,8 +1678,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, without using the procedure linkage table. */ if (h == NULL) return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); if (h->plt.offset == (bfd_vma) -1) /* We didn't make a PLT entry for this symbol. This @@ -1623,8 +1697,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, + splt->output_offset + h->plt.offset); return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_SBREL32: return bfd_reloc_notsupported; @@ -1683,8 +1757,8 @@ arm_add_to_rel (abfd, address, howto, increment) upper_insn = (upper_insn & 0xf800) | ((addend >> 11) & 0x7ff); lower_insn = (lower_insn & 0xf800) | (addend & 0x7ff); - bfd_put_16 (abfd, upper_insn, address); - bfd_put_16 (abfd, lower_insn, address + 2); + bfd_put_16 (abfd, (bfd_vma) upper_insn, address); + bfd_put_16 (abfd, (bfd_vma) lower_insn, address + 2); } else { @@ -1712,7 +1786,7 @@ arm_add_to_rel (abfd, address, howto, increment) case R_ARM_PC24: addend <<= howto->size; - addend += increment; + addend += increment; /* Should we check for overflow here ? */ @@ -1771,7 +1845,12 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_ARM_GNU_VTINHERIT) continue; +#ifdef USE_REL + elf32_arm_info_to_howto (input_bfd, & bfd_reloc, + (Elf_Internal_Rel *) rel); +#else elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel); +#endif howto = bfd_reloc.howto; if (info->relocateable) @@ -1788,10 +1867,11 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, sec = local_sections[r_symndx]; #ifdef USE_REL arm_add_to_rel (input_bfd, contents + rel->r_offset, - howto, sec->output_offset + sym->st_value); + howto, + (bfd_signed_vma) (sec->output_offset + + sym->st_value)); #else - rel->r_addend += (sec->output_offset + sym->st_value) - >> howto->rightshift; + rel->r_addend += (sec->output_offset + sym->st_value); #endif } } @@ -1808,9 +1888,49 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; +#ifdef USE_REL relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + bfd_vma addend, value; + + if (howto->rightshift) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, howto->name); + return false; + } + + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + + /* Get the (signed) value from the instruction. */ + addend = value & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~ howto->src_mask; + addend |= mask; + } + msec = sec; + addend = + _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) + - relocation; + addend += msec->output_section->vma + msec->output_offset; + value = (value & ~ howto->dst_mask) | (addend & howto->dst_mask); + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + } +#else + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); +#endif } else { @@ -1834,9 +1954,10 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, { case R_ARM_PC24: case R_ARM_ABS32: + case R_ARM_THM_PC22: if (info->shared && ( - (!info->symbolic && h->dynindx != -1) + (!info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 ) && ((input_section->flags & SEC_ALLOC) != 0 @@ -1874,8 +1995,10 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (sec->output_section == NULL) { (*_bfd_error_handler) - (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), - bfd_get_filename (input_bfd), h->root.root.string, + (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"), + bfd_archive_filename (input_bfd), + r_type, + h->root.root.string, bfd_get_section_name (input_bfd, input_section)); relocation_needed = 0; } @@ -1987,14 +2110,14 @@ elf32_arm_set_private_flags (abfd, flags) { if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN) { - if (flags & EF_INTERWORK) - _bfd_error_handler (_("\ + if (flags & EF_ARM_INTERWORK) + (*_bfd_error_handler) (_("\ Warning: Not setting interwork flag of %s since it has already been specified as non-interworking"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); else _bfd_error_handler (_("\ Warning: Clearing the interwork flag of %s due to outside request"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); } } else @@ -2028,28 +2151,29 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) && in_flags != out_flags) { /* Cannot mix APCS26 and APCS32 code. */ - if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) + if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26)) return false; /* Cannot mix float APCS and non-float APCS code. */ - if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) + if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT)) return false; /* If the src and dest have different interworking flags then turn off the interworking bit. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + if ((in_flags & EF_ARM_INTERWORK) != (out_flags & EF_ARM_INTERWORK)) { - if (out_flags & EF_INTERWORK) + if (out_flags & EF_ARM_INTERWORK) _bfd_error_handler (_("\ Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it"), - bfd_get_filename (obfd), bfd_get_filename (ibfd)); + bfd_get_filename (obfd), + bfd_archive_filename (ibfd)); - in_flags &= ~EF_INTERWORK; + in_flags &= ~EF_ARM_INTERWORK; } /* Likewise for PIC, though don't warn for this case. */ - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - in_flags &= ~EF_PIC; + if ((in_flags & EF_ARM_PIC) != (out_flags & EF_ARM_PIC)) + in_flags &= ~EF_ARM_PIC; } elf_elfheader (obfd)->e_flags = in_flags; @@ -2136,59 +2260,104 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) { _bfd_error_handler (_("\ Error: %s compiled for EABI version %d, whereas %s is compiled for version %d"), - bfd_get_filename (ibfd), - (in_flags & EF_ARM_EABIMASK) >> 24, - bfd_get_filename (obfd), - (out_flags & EF_ARM_EABIMASK) >> 24); + bfd_archive_filename (ibfd), + (in_flags & EF_ARM_EABIMASK) >> 24, + bfd_get_filename (obfd), + (out_flags & EF_ARM_EABIMASK) >> 24); return false; } /* Not sure what needs to be checked for EABI versions >= 1. */ if (EF_ARM_EABI_VERSION (in_flags) == EF_ARM_EABI_UNKNOWN) { - if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) + if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26)) { _bfd_error_handler (_("\ Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), - bfd_get_filename (ibfd), - in_flags & EF_APCS_26 ? 26 : 32, - bfd_get_filename (obfd), - out_flags & EF_APCS_26 ? 26 : 32); + bfd_archive_filename (ibfd), + in_flags & EF_ARM_APCS_26 ? 26 : 32, + bfd_get_filename (obfd), + out_flags & EF_ARM_APCS_26 ? 26 : 32); flags_compatible = false; } - if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) + if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT)) { - _bfd_error_handler (_("\ -Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), - bfd_get_filename (ibfd), - in_flags & EF_APCS_FLOAT ? _("float") : _("integer"), - bfd_get_filename (obfd), - out_flags & EF_APCS_26 ? _("float") : _("integer")); + if (in_flags & EF_ARM_APCS_FLOAT) + _bfd_error_handler (_("\ +Error: %s passes floats in FP registers, whereas %s passes them in integer registers"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_("\ +Error: %s passes floats in integer registers, whereas %s passes them in FP registers"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + flags_compatible = false; } -#ifdef EF_SOFT_FLOAT - if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) + if ((in_flags & EF_ARM_VFP_FLOAT) != (out_flags & EF_ARM_VFP_FLOAT)) { - _bfd_error_handler (_ ("\ -Error: %s uses %s floating point, whereas %s uses %s floating point"), - bfd_get_filename (ibfd), - in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), - bfd_get_filename (obfd), - out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + if (in_flags & EF_ARM_VFP_FLOAT) + _bfd_error_handler (_("\ +Error: %s uses VFP instructions, whereas %s FPA instructions"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_("\ +Error: %s uses FPA instructions, whereas %s VFP instructions"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + flags_compatible = false; } + +#ifdef EF_ARM_SOFT_FLOAT + if ((in_flags & EF_ARM_SOFT_FLOAT) != (out_flags & EF_ARM_SOFT_FLOAT)) + { + /* We can allow interworking between code that is VFP format + layout, and uses either soft float or integer regs for + passing floating point arguments and results. We already + know that the APCS_FLOAT flags match; similarly for VFP + flags. */ + if ((in_flags & EF_ARM_APCS_FLOAT) != 0 + || (in_flags & EF_ARM_VFP_FLOAT) == 0) + { + if (in_flags & EF_ARM_SOFT_FLOAT) + _bfd_error_handler (_ ("\ +Error: %s uses software FP, whereas %s uses hardware FP"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_ ("\ +Error: %s uses hardware FP, whereas %s uses software FP"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + + flags_compatible = false; + } + } #endif /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) - _bfd_error_handler (_("\ -Warning: %s %s interworking, whereas %s %s"), - bfd_get_filename (ibfd), - in_flags & EF_INTERWORK ? _("supports") : _("does not support"), - bfd_get_filename (obfd), - out_flags & EF_INTERWORK ? _("does") : _("does not")); + if ((in_flags & EF_ARM_INTERWORK) != (out_flags & EF_ARM_INTERWORK)) + { + if (in_flags & EF_ARM_INTERWORK) + { + _bfd_error_handler (_("\ +Warning: %s supports interworking, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + } + else + { + _bfd_error_handler (_("\ +Warning: %s does not support interworking, whereas %s does"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + } + } } return flags_compatible; @@ -2222,31 +2391,37 @@ elf32_arm_print_private_bfd_data (abfd, ptr) /* The following flag bits are GNU extenstions and not part of the official ARM ELF extended ABI. Hence they are only decoded if the EABI version is not set. */ - if (flags & EF_INTERWORK) + if (flags & EF_ARM_INTERWORK) fprintf (file, _(" [interworking enabled]")); - if (flags & EF_APCS_26) + if (flags & EF_ARM_APCS_26) fprintf (file, _(" [APCS-26]")); else fprintf (file, _(" [APCS-32]")); - if (flags & EF_APCS_FLOAT) + if (flags & EF_ARM_VFP_FLOAT) + fprintf (file, _(" [VFP float format]")); + else + fprintf (file, _(" [FPA float format]")); + + if (flags & EF_ARM_APCS_FLOAT) fprintf (file, _(" [floats passed in float registers]")); - if (flags & EF_PIC) + if (flags & EF_ARM_PIC) fprintf (file, _(" [position independent]")); - if (flags & EF_NEW_ABI) + if (flags & EF_ARM_NEW_ABI) fprintf (file, _(" [new ABI]")); - if (flags & EF_OLD_ABI) + if (flags & EF_ARM_OLD_ABI) fprintf (file, _(" [old ABI]")); - if (flags & EF_SOFT_FLOAT) + if (flags & EF_ARM_SOFT_FLOAT) fprintf (file, _(" [software FP]")); - flags &= ~(EF_INTERWORK | EF_APCS_26 | EF_APCS_FLOAT | EF_PIC - | EF_NEW_ABI | EF_OLD_ABI | EF_SOFT_FLOAT); + flags &= ~(EF_ARM_INTERWORK | EF_ARM_APCS_26 | EF_ARM_APCS_FLOAT + | EF_ARM_PIC | EF_ARM_NEW_ABI | EF_ARM_OLD_ABI + | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT); break; case EF_ARM_EABI_VER1: @@ -2260,6 +2435,24 @@ elf32_arm_print_private_bfd_data (abfd, ptr) flags &= ~ EF_ARM_SYMSARESORTED; break; + case EF_ARM_EABI_VER2: + fprintf (file, _(" [Version2 EABI]")); + + if (flags & EF_ARM_SYMSARESORTED) + fprintf (file, _(" [sorted symbol table]")); + else + fprintf (file, _(" [unsorted symbol table]")); + + if (flags & EF_ARM_DYNSYMSUSESEGIDX) + fprintf (file, _(" [dynamic symbols use segment index]")); + + if (flags & EF_ARM_MAPSYMSFIRST) + fprintf (file, _(" [mapping symbols precede others]")); + + flags &= ~(EF_ARM_SYMSARESORTED | EF_ARM_DYNSYMSUSESEGIDX + | EF_ARM_MAPSYMSFIRST); + break; + default: fprintf (file, _(" ")); break; @@ -2342,14 +2535,9 @@ elf32_arm_gc_mark_hook (abfd, info, rel, h, sym) } else { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + return NULL; } @@ -2452,7 +2640,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) srelgot = bfd_make_section (dynobj, ".rel.got"); if (srelgot == NULL || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -2480,14 +2668,15 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) } else { - /* This is a global offset table entry for a local + /* This is a global offset table entry for a local symbol. */ if (local_got_offsets == NULL) { - size_t size; - register unsigned int i; + bfd_size_type size; + unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_vma); local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); if (local_got_offsets == NULL) return false; @@ -2512,7 +2701,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) sgot->_raw_size += 4; break; - case R_ARM_PLT32: + case R_ARM_PLT32: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code which is @@ -2565,7 +2754,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) return false; BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (abfd, sec), + && strcmp (bfd_get_section_name (abfd, sec), name + 4) == 0); sreloc = bfd_get_section_by_name (dynobj, name); @@ -2583,6 +2772,8 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rel); @@ -2609,8 +2800,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) if (p == NULL) { p = ((struct elf32_arm_pcrel_relocs_copied *) - bfd_alloc (dynobj, sizeof * p)); - + bfd_alloc (dynobj, (bfd_size_type) sizeof * p)); if (p == NULL) return false; p->next = eh->pcrel_relocs_copied; @@ -2654,8 +2844,8 @@ elf32_arm_find_nearest_line asection * section; asymbol ** symbols; bfd_vma offset; - CONST char ** filename_ptr; - CONST char ** functionname_ptr; + const char ** filename_ptr; + const char ** functionname_ptr; unsigned int * line_ptr; { boolean found; @@ -2897,14 +3087,13 @@ elf32_arm_adjust_dynamic_symbol (info, h) static boolean elf32_arm_size_dynamic_sections (output_bfd, info) - bfd * output_bfd; + bfd * output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info * info; { bfd * dynobj; asection * s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -2946,7 +3135,6 @@ elf32_arm_size_dynamic_sections (output_bfd, info) memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char * name; @@ -2992,30 +3180,10 @@ elf32_arm_size_dynamic_sections (output_bfd, info) } else { - asection * target; - /* Remember whether there are any reloc sections other than .rel.plt. */ if (strcmp (name, ".rel.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rel.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 4); - - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -3033,12 +3201,16 @@ elf32_arm_size_dynamic_sections (output_bfd, info) asection ** spp; for (spp = &s->output_section->owner->sections; - *spp != s->output_section; + *spp != NULL; spp = &(*spp)->next) - ; - *spp = s->output_section->next; - --s->output_section->owner->section_count; - + { + if (*spp == s->output_section) + { + bfd_section_list_remove (s->output_section->owner, spp); + --s->output_section->owner->section_count; + break; + } + } continue; } @@ -3055,37 +3227,40 @@ elf32_arm_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ - if (! info->shared) +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + + if (!info->shared) { - if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } if (plt) { - if ( ! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_REL) - || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0)) + if ( !add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_REL) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } if (relocs) { - if ( ! bfd_elf32_add_dynamic_entry (info, DT_REL, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELENT, - sizeof (Elf32_External_Rel))) + if ( !add_dynamic_entry (DT_REL, 0) + || !add_dynamic_entry (DT_RELSZ, 0) + || !add_dynamic_entry (DT_RELENT, sizeof (Elf32_External_Rel))) return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { - if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; info->flags |= DF_TEXTREL; } } +#undef add_synamic_entry return true; } @@ -3218,7 +3393,7 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) rel.r_offset = (sgot->output_section->vma + sgot->output_offset - + (h->got.offset &~ 1)); + + (h->got.offset &~ (bfd_vma) 1)); /* If this is a -Bsymbolic link, and the symbol is defined locally, we just want to emit a RELATIVE reloc. The entry in @@ -3403,29 +3578,48 @@ elf32_arm_post_process_headers (abfd, link_info) i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION; } +static enum elf_reloc_type_class +elf32_arm_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_ARM_RELATIVE: + return reloc_class_relative; + case R_ARM_JUMP_SLOT: + return reloc_class_plt; + case R_ARM_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + + #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define ELF_MAXPAGESIZE 0x8000 -#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data -#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data +#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create -#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup +#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line #define elf_backend_get_symbol_type elf32_arm_get_symbol_type #define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_arm_gc_sweep_hook #define elf_backend_check_relocs elf32_arm_check_relocs -#define elf_backend_relocate_section elf32_arm_relocate_section +#define elf_backend_relocate_section elf32_arm_relocate_section #define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers +#define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 diff --git a/contrib/binutils/bfd/elf32-gen.c b/contrib/binutils/bfd/elf32-gen.c index 7a39f47..58b5fc6 100644 --- a/contrib/binutils/bfd/elf32-gen.c +++ b/contrib/binutils/bfd/elf32-gen.c @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -40,6 +40,13 @@ static reloc_howto_type dummy = 0, /* dst_mask */ false); /* pcrel_offset */ +static void elf_generic_info_to_howto + PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static void elf_generic_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); +static boolean elf32_generic_link_add_symbols + PARAMS ((bfd *, struct bfd_link_info *)); + static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; @@ -58,7 +65,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd_reloc->howto = &dummy; } -static boolean +static boolean elf32_generic_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -72,15 +79,9 @@ elf32_generic_link_add_symbols (abfd, info) Elf_Internal_Ehdr *ehdrp; ehdrp = elf_elfheader (abfd); - if (abfd->my_archive) - (*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"), - bfd_get_filename (abfd->my_archive), - bfd_get_filename (abfd), - ehdrp->e_machine); - else - (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), - bfd_get_filename (abfd), - ehdrp->e_machine); + (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), + bfd_archive_filename (abfd), + ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); return false; diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c index b838d3a..236e167 100644 --- a/contrib/binutils/bfd/elf32-i386.c +++ b/contrib/binutils/bfd/elf32-i386.c @@ -30,16 +30,39 @@ static void elf_i386_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); static void elf_i386_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static boolean elf_i386_is_local_label_name PARAMS ((bfd *, const char *)); -static struct bfd_hash_entry *elf_i386_link_hash_newfunc +static boolean elf_i386_is_local_label_name + PARAMS ((bfd *, const char *)); +static boolean elf_i386_grok_prstatus + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); +static boolean elf_i386_grok_psinfo + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); +static struct bfd_hash_entry *link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *elf_i386_link_hash_table_create PARAMS ((bfd *)); +static boolean create_got_section + PARAMS((bfd *, struct bfd_link_info *)); +static boolean elf_i386_create_dynamic_sections + PARAMS((bfd *, struct bfd_link_info *)); +static void elf_i386_copy_indirect_symbol + PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); static boolean elf_i386_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static asection *elf_i386_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf_i386_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static boolean elf_i386_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean elf_i386_fake_sections + PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); static boolean elf_i386_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_i386_relocate_section @@ -48,6 +71,8 @@ static boolean elf_i386_relocate_section static boolean elf_i386_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static enum elf_reloc_type_class elf_i386_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); static boolean elf_i386_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -271,7 +296,7 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) >= R_386_vt - R_386_ext)) { (*_bfd_error_handler) (_("%s: invalid relocation type %d"), - bfd_get_filename (abfd), (int) r_type); + bfd_archive_filename (abfd), (int) r_type); indx = (unsigned int) R_386_NONE; } cache_ptr->howto = &elf_howto_table[indx]; @@ -294,7 +319,84 @@ elf_i386_is_local_label_name (abfd, name) return _bfd_elf_is_local_label_name (abfd, name); } -/* Functions for the i386 ELF linker. */ +/* Support for core dump NOTE sections. */ +static boolean +elf_i386_grok_prstatus (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + int offset; + size_t raw_size; + + switch (note->descsz) + { + default: + return false; + + case 144: /* Linux/i386 */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 68; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + raw_size, note->descpos + offset); +} + +static boolean +elf_i386_grok_psinfo (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + switch (note->descsz) + { + default: + return false; + + case 124: /* Linux/i386 elf_prpsinfo */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return true; +} + +/* Functions for the i386 ELF linker. + + In order to gain some understanding of code in this file without + knowing all the intricate details of the linker, note the + following: + + Functions named elf_i386_* are called by external routines, other + functions are only called locally. elf_i386_* functions appear + in this file more or less in the order in which they are called + from external routines. eg. elf_i386_check_relocs is called + early in the link process, elf_i386_finish_dynamic_sections is + one of the last functions. */ + /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -352,53 +454,53 @@ static const bfd_byte elf_i386_pic_plt_entry[PLT_ENTRY_SIZE] = }; /* The i386 linker needs to keep track of the number of relocs that it - decides to copy in check_relocs for each symbol. This is so that - it can discard PC relative relocs if it doesn't need them when - linking with -Bsymbolic. We store the information in a field - extending the regular ELF linker hash table. */ + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ -/* This structure keeps track of the number of PC relative relocs we - have copied for a given symbol. */ - -struct elf_i386_pcrel_relocs_copied +struct elf_i386_dyn_relocs { - /* Next section. */ - struct elf_i386_pcrel_relocs_copied *next; - /* A section in dynobj. */ - asection *section; - /* Number of relocs copied in this section. */ + struct elf_i386_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; }; /* i386 ELF linker hash entry. */ struct elf_i386_link_hash_entry { - struct elf_link_hash_entry root; + struct elf_link_hash_entry elf; - /* Number of PC relative relocs copied for this symbol. */ - struct elf_i386_pcrel_relocs_copied *pcrel_relocs_copied; + /* Track dynamic relocs copied for this symbol. */ + struct elf_i386_dyn_relocs *dyn_relocs; }; /* i386 ELF linker hash table. */ struct elf_i386_link_hash_table { - struct elf_link_hash_table root; -}; - -/* Declare this now that the above structures are defined. */ + struct elf_link_hash_table elf; -static boolean elf_i386_discard_copies - PARAMS ((struct elf_i386_link_hash_entry *, PTR)); - -/* Traverse an i386 ELF linker hash table. */ + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; -#define elf_i386_link_hash_traverse(table, func, info) \ - (elf_link_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ - (info))) + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; /* Get the i386 ELF linker hash table from a link_info structure. */ @@ -408,33 +510,32 @@ static boolean elf_i386_discard_copies /* Create an entry in an i386 ELF linker hash table. */ static struct bfd_hash_entry * -elf_i386_link_hash_newfunc (entry, table, string) +link_hash_newfunc (entry, table, string) struct bfd_hash_entry *entry; struct bfd_hash_table *table; const char *string; { - struct elf_i386_link_hash_entry *ret = - (struct elf_i386_link_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct elf_i386_link_hash_entry *) NULL) - ret = ((struct elf_i386_link_hash_entry *) - bfd_hash_allocate (table, - sizeof (struct elf_i386_link_hash_entry))); - if (ret == (struct elf_i386_link_hash_entry *) NULL) - return (struct bfd_hash_entry *) ret; + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct elf_i386_link_hash_entry)); + if (entry == NULL) + return entry; + } /* Call the allocation method of the superclass. */ - ret = ((struct elf_i386_link_hash_entry *) - _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, - table, string)); - if (ret != (struct elf_i386_link_hash_entry *) NULL) + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) { - ret->pcrel_relocs_copied = NULL; + struct elf_i386_link_hash_entry *eh; + + eh = (struct elf_i386_link_hash_entry *) entry; + eh->dyn_relocs = NULL; } - return (struct bfd_hash_entry *) ret; + return entry; } /* Create an i386 ELF linker hash table. */ @@ -444,25 +545,142 @@ elf_i386_link_hash_table_create (abfd) bfd *abfd; { struct elf_i386_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf_i386_link_hash_table); - ret = ((struct elf_i386_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf_i386_link_hash_table))); - if (ret == (struct elf_i386_link_hash_table *) NULL) + ret = (struct elf_i386_link_hash_table *) bfd_alloc (abfd, amt); + if (ret == NULL) return NULL; - if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, - elf_i386_link_hash_newfunc)) + if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) { bfd_release (abfd, ret); return NULL; } - return &ret->root.root; + ret->sgot = NULL; + ret->sgotplt = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->sym_sec.abfd = NULL; + + return &ret->elf.root; +} + +/* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf_i386_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return false; + + htab = elf_i386_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + if (!htab->sgot || !htab->sgotplt) + abort (); + + htab->srelgot = bfd_make_section (dynobj, ".rel.got"); + if (htab->srelgot == NULL + || ! bfd_set_section_flags (dynobj, htab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + return false; + return true; +} + +/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and + .rel.bss sections in DYNOBJ, and set up shortcuts to them in our + hash table. */ + +static boolean +elf_i386_create_dynamic_sections (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf_i386_link_hash_table *htab; + + htab = elf_i386_hash_table (info); + if (!htab->sgot && !create_got_section (dynobj, info)) + return false; + + if (!_bfd_elf_create_dynamic_sections (dynobj, info)) + return false; + + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) + htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss"); + + if (!htab->splt || !htab->srelplt || !htab->sdynbss + || (!info->shared && !htab->srelbss)) + abort (); + + return true; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +elf_i386_copy_indirect_symbol (dir, ind) + struct elf_link_hash_entry *dir, *ind; +{ + struct elf_i386_link_hash_entry *edir, *eind; + + edir = (struct elf_i386_link_hash_entry *) dir; + eind = (struct elf_i386_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct elf_i386_dyn_relocs **pp; + struct elf_i386_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct elf_i386_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + _bfd_elf_link_hash_copy_indirect (dir, ind); } /* Look through the relocs for a section during the first phase, and - allocate space in the global offset table or procedure linkage - table. */ + calculate needed space in the global offset table, procedure linkage + table, and dynamic reloc sections. */ static boolean elf_i386_check_relocs (abfd, info, sec, relocs) @@ -471,26 +689,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs) asection *sec; const Elf_Internal_Rela *relocs; { - bfd *dynobj; + struct elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; - bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - asection *sgot; - asection *srelgot; asection *sreloc; if (info->relocateable) return true; - dynobj = elf_hash_table (info)->dynobj; + htab = elf_i386_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - local_got_refcounts = elf_local_got_refcounts (abfd); - sgot = NULL; - srelgot = NULL; sreloc = NULL; rel_end = relocs + sec->reloc_count; @@ -503,15 +715,9 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { - if (abfd->my_archive) - (*_bfd_error_handler) (_("%s(%s): bad symbol index: %d"), - bfd_get_filename (abfd->my_archive), - bfd_get_filename (abfd), - r_symndx); - else - (*_bfd_error_handler) (_("%s: bad symbol index: %d"), - bfd_get_filename (abfd), - r_symndx); + (*_bfd_error_handler) (_("%s: bad symbol index: %d"), + bfd_archive_filename (abfd), + r_symndx); return false; } @@ -520,133 +726,80 @@ elf_i386_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - /* Some relocs require a global offset table. */ - if (dynobj == NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_386_GOT32: - case R_386_GOTOFF: - case R_386_GOTPC: - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; - break; - - default: - break; - } - } - switch (ELF32_R_TYPE (rel->r_info)) { case R_386_GOT32: /* This symbol requires a global offset table entry. */ - - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - - if (srelgot == NULL - && (h != NULL || info->shared)) - { - srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); - if (srelgot == NULL) - { - srelgot = bfd_make_section (dynobj, ".rel.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return false; - } - } - if (h != NULL) { - if (h->got.refcount == -1) - { - h->got.refcount = 1; - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - sgot->_raw_size += 4; - srelgot->_raw_size += sizeof (Elf32_External_Rel); - } - else - h->got.refcount += 1; + h->got.refcount += 1; } else { - /* This is a global offset table entry for a local symbol. */ + bfd_signed_vma *local_got_refcounts; + + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); if (local_got_refcounts == NULL) { - size_t size; + bfd_size_type size; - size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_signed_vma); local_got_refcounts = ((bfd_signed_vma *) - bfd_alloc (abfd, size)); + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) return false; elf_local_got_refcounts (abfd) = local_got_refcounts; - memset (local_got_refcounts, -1, size); } - if (local_got_refcounts[r_symndx] == -1) - { - local_got_refcounts[r_symndx] = 1; + local_got_refcounts[r_symndx] += 1; + } + /* Fall through */ - sgot->_raw_size += 4; - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_386_RELATIVE reloc so that the dynamic - linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rel); - } - } - else - local_got_refcounts[r_symndx] += 1; + case R_386_GOTOFF: + case R_386_GOTPC: + if (htab->sgot == NULL) + { + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!create_got_section (htab->elf.dynobj, info)) + return false; } break; case R_386_PLT32: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code which is + never referenced by a dynamic object, in which case we + don't need to generate a procedure linkage table entry + after all. */ /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ + creating a procedure linkage table entry. */ if (h == NULL) continue; - if (h->plt.refcount == -1) - { - h->plt.refcount = 1; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - } - else - h->plt.refcount += 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; break; case R_386_32: case R_386_PC32: - if (h != NULL) - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + if (h != NULL && !info->shared) + { + /* If this reloc is in a read-only section, we might + need a copy reloc. We can't check reliably at this + stage whether the section is read-only, as input + sections have not yet been mapped to output sections. + Tentatively set the flag for now, and correct in + adjust_dynamic_symbol. */ + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + + /* We may need a .plt entry if the function this reloc + refers to is in a shared lib. */ + h->plt.refcount += 1; + } /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc @@ -659,26 +812,41 @@ elf_i386_check_relocs (abfd, info, sec, relocs) possible that DEF_REGULAR is not set now but will be set later (it is never cleared). In case of a weak definition, DEF_REGULAR may be cleared later by a strong definition in - a shared library. We account for that possibility below by + a shared library. We account for that possibility below by storing information in the relocs_copied field of the hash table entry. A similar situation occurs when creating shared libraries and symbol visibility changes render the - symbol local. */ - if (info->shared - && (sec->flags & SEC_ALLOC) != 0 - && (ELF32_R_TYPE (rel->r_info) != R_386_PC32 - || (h != NULL - && (! info->symbolic - || h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (sec->flags & SEC_ALLOC) != 0 + && (ELF32_R_TYPE (rel->r_info) != R_386_PC32 + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) { - /* When creating a shared object, we must copy these - reloc types into the output file. We create a reloc - section in dynobj and make room for this reloc. */ + struct elf_i386_dyn_relocs *p; + struct elf_i386_dyn_relocs **head; + + /* We must copy these reloc types into the output file. + Create a reloc section in dynobj and make room for + this reloc. */ if (sreloc == NULL) { const char *name; + bfd *dynobj; name = (bfd_elf_string_from_elf_section (abfd, @@ -691,17 +859,15 @@ elf_i386_check_relocs (abfd, info, sec, relocs) || strcmp (bfd_get_section_name (abfd, sec), name + 4) != 0) { - if (abfd->my_archive) - (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), - bfd_get_filename (abfd->my_archive), - bfd_get_filename (abfd), - name); - else - (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), - bfd_get_filename (abfd), - name); + (*_bfd_error_handler) + (_("%s: bad relocation section name `%s\'"), + bfd_archive_filename (abfd), name); } + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + + dynobj = htab->elf.dynobj; sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) { @@ -717,44 +883,50 @@ elf_i386_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + elf_section_data (sec)->sreloc = sreloc; } - sreloc->_raw_size += sizeof (Elf32_External_Rel); - - /* If this is a global symbol, we count the number of PC - relative relocations we have entered for this symbol, - so that we can discard them later as necessary. Note - that this function is only called if we are using an - elf_i386 linker hash table, which means that h is - really a pointer to an elf_i386_link_hash_entry. */ - if (h != NULL - && ELF32_R_TYPE (rel->r_info) == R_386_PC32) + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) { - struct elf_i386_link_hash_entry *eh; - struct elf_i386_pcrel_relocs_copied *p; - - eh = (struct elf_i386_link_hash_entry *) h; + head = &((struct elf_i386_link_hash_entry *) h)->dyn_relocs; + } + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return false; - for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next) - if (p->section == sreloc) - break; + head = ((struct elf_i386_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + } + p = *head; + if (p == NULL || p->sec != sec) + { + bfd_size_type amt = sizeof *p; + p = ((struct elf_i386_dyn_relocs *) + bfd_alloc (htab->elf.dynobj, amt)); if (p == NULL) - { - p = ((struct elf_i386_pcrel_relocs_copied *) - bfd_alloc (dynobj, sizeof *p)); - if (p == NULL) - return false; - p->next = eh->pcrel_relocs_copied; - eh->pcrel_relocs_copied = p; - p->section = sreloc; - p->count = 0; - } - - ++p->count; + return false; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; } - } + p->count += 1; + if (ELF32_R_TYPE (rel->r_info) == R_386_PC32) + p->pc_count += 1; + } break; /* This relocation describes the C++ object vtable hierarchy. @@ -815,13 +987,7 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) } else { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); } return NULL; @@ -842,21 +1008,13 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) const Elf_Internal_Rela *rel, *relend; unsigned long r_symndx; struct elf_link_hash_entry *h; - bfd *dynobj; - asection *sgot; - asection *srelgot; + + elf_section_data (sec)->local_dynrel = NULL; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); - dynobj = elf_hash_table (info)->dynobj; - if (dynobj == NULL) - return true; - - sgot = bfd_get_section_by_name (dynobj, ".got"); - srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); - relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) switch (ELF32_R_TYPE (rel->r_info)) @@ -869,27 +1027,41 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; if (h->got.refcount > 0) - { - h->got.refcount -= 1; - if (h->got.refcount == 0) - { - sgot->_raw_size -= 4; - srelgot->_raw_size -= sizeof (Elf32_External_Rel); - } - } + h->got.refcount -= 1; } else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) - { - local_got_refcounts[r_symndx] -= 1; - if (local_got_refcounts[r_symndx] == 0) - { - sgot->_raw_size -= 4; - if (info->shared) - srelgot->_raw_size -= sizeof (Elf32_External_Rel); - } - } + local_got_refcounts[r_symndx] -= 1; + } + break; + + case R_386_32: + case R_386_PC32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_i386_link_hash_entry *eh; + struct elf_i386_dyn_relocs **pp; + struct elf_i386_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + if (!info->shared && h->plt.refcount > 0) + h->plt.refcount -= 1; + + eh = (struct elf_i386_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + if (ELF32_R_TYPE (rel->r_info) == R_386_PC32) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } } break; @@ -921,33 +1093,22 @@ elf_i386_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { - bfd *dynobj; + struct elf_i386_link_hash_table *htab; + struct elf_i386_link_hash_entry * eh; + struct elf_i386_dyn_relocs *p; asection *s; unsigned int power_of_two; - dynobj = elf_hash_table (info)->dynobj; - - /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL - && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) - || h->weakdef != NULL - || ((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_REF_REGULAR) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))); - /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, when we know the address of the .got section. */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if ((! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) - || (info->shared && h->plt.refcount <= 0)) + if (h->plt.refcount <= 0 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -956,54 +1117,17 @@ elf_i386_adjust_dynamic_symbol (info, h) linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return true; - } - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_ENTRY_SIZE; - - /* If this symbol is not defined in a regular file, and we are - not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; } - h->plt.offset = s->_raw_size; - - /* Make room for this entry. */ - s->_raw_size += PLT_ENTRY_SIZE; - - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += 4; - - /* We also need to make an entry in the .rel.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rel.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += sizeof (Elf32_External_Rel); - return true; } + else + /* It's possible that we incorrectly decided a .plt reloc was + needed for an R_386_PC32 reloc to a non-function sym in + check_relocs. We can't decide accurately between function and + non-function syms in check-relocs; Objects loaded later in + the link may change h->type. So fix it now. */ + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -1032,6 +1156,29 @@ elf_i386_adjust_dynamic_symbol (info, h) if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) return true; + /* If -z nocopyreloc was given, we won't generate them either. */ + if (info->nocopyreloc) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return true; + } + + eh = (struct elf_i386_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return true; + } + /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be an entry for this symbol in the .dynsym section. The dynamic @@ -1042,20 +1189,14 @@ elf_i386_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); - BFD_ASSERT (s != NULL); + htab = elf_i386_hash_table (info); /* We must generate a R_386_COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the - runtime process image. We need to remember the offset into the - .rel.bss section we are going to use. */ + runtime process image. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { - asection *srel; - - srel = bfd_get_section_by_name (dynobj, ".rel.bss"); - BFD_ASSERT (srel != NULL); - srel->_raw_size += sizeof (Elf32_External_Rel); + htab->srelbss->_raw_size += sizeof (Elf32_External_Rel); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; } @@ -1066,11 +1207,11 @@ elf_i386_adjust_dynamic_symbol (info, h) power_of_two = 3; /* Apply the required alignment. */ - s->_raw_size = BFD_ALIGN (s->_raw_size, - (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) + s = htab->sdynbss; + s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) + if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) return false; } @@ -1084,142 +1225,356 @@ elf_i386_adjust_dynamic_symbol (info, h) return true; } -/* Set the sizes of the dynamic sections. */ +/* This is the condition under which elf_i386_finish_dynamic_symbol + will be called from elflink.h. If elflink.h doesn't call our + finish_dynamic_symbol routine, we'll need to do something about + initializing any .plt and .got entries in elf_i386_relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ + ((DYN) \ + && ((INFO)->shared \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ static boolean -elf_i386_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; { - bfd *dynobj; - asection *s; - boolean plt; - boolean relocs; - boolean reltext; + struct bfd_link_info *info; + struct elf_i386_link_hash_table *htab; + struct elf_i386_link_hash_entry *eh; + struct elf_i386_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + return true; - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); + info = (struct bfd_link_info *) inf; + htab = elf_i386_hash_table (info); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created + && h->plt.refcount > 0) { - /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - s = bfd_get_section_by_name (dynobj, ".interp"); - BFD_ASSERT (s != NULL); - s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; - s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; } - } - else - { - /* We may have created entries in the .rel.got section. - However, if we are not creating the dynamic sections, we will - not actually use these entries. Reset the size of .rel.got, - which will cause it to get stripped from the output file - below. */ - s = bfd_get_section_by_name (dynobj, ".rel.got"); - if (s != NULL) - s->_raw_size = 0; - } - - /* If this is a -Bsymbolic shared link, then we need to discard all - PC relative relocs against symbols defined in a regular object. - We allocated space for them in the check_relocs routine, but we - will not fill them in in the relocate_section routine. */ - if (info->shared) - elf_i386_link_hash_traverse (elf_i386_hash_table (info), - elf_i386_discard_copies, - (PTR) info); - - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - plt = false; - relocs = false; - reltext = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - const char *name; - boolean strip; - if ((s->flags & SEC_LINKER_CREATED) == 0) - continue; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + { + asection *s = htab->splt; - /* It's OK to base decisions on the section name, because none - of the dynobj section names depend upon the input files. */ - name = bfd_get_section_name (dynobj, s); + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->_raw_size == 0) + s->_raw_size += PLT_ENTRY_SIZE; - strip = false; + h->plt.offset = s->_raw_size; - if (strcmp (name, ".plt") == 0) - { - if (s->_raw_size == 0) + /* If this symbol is not defined in a regular file, and we are + not generating a shared library, then set the symbol to this + location in the .plt. This is required to make function + pointers compare as equal between the normal executable and + the shared library. */ + if (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { - /* Strip this section if we don't need it; see the - comment below. */ - strip = true; + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; } - else + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ + htab->sgotplt->_raw_size += 4; + + /* We also need to make an entry in the .rel.plt section. */ + htab->srelplt->_raw_size += sizeof (Elf32_External_Rel); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + if (h->got.refcount > 0) + { + asection *s; + boolean dyn; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } + + s = htab->sgot; + h->got.offset = s->_raw_size; + s->_raw_size += 4; + dyn = htab->elf.dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); + } + else + h->got.offset = (bfd_vma) -1; + + eh = (struct elf_i386_link_hash_entry *) h; + if (eh->dyn_relocs == NULL) + return true; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for pc-relative relocs that have become local due to symbol + visibility changes. */ + + if (info->shared) + { + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + struct elf_i386_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) { - /* Remember whether there is a PLT. */ - plt = true; + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; } } - else if (strncmp (name, ".rel", 4) == 0) + } + else + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + || (htab->elf.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) { - if (s->_raw_size == 0) + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - /* If we don't need this section, strip it from the - output file. This is mostly to handle .rel.bss and - .rel.plt. We must create both sections in - create_dynamic_sections, because they must be created - before the linker maps input sections to output - sections. The linker does that before - adjust_dynamic_symbol is called, and it is that - function which decides whether anything needs to go - into these sections. */ - strip = true; + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; } - else - { - asection *target; - /* Remember whether there are any reloc sections other - than .rel.plt. */ - if (strcmp (name, ".rel.plt") != 0) + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel); + } + + return true; +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static boolean +readonly_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct elf_i386_link_hash_entry *eh; + struct elf_i386_dyn_relocs *p; + + eh = (struct elf_i386_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *s = p->sec->output_section; + + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; + + info->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return false; + } + } + return true; +} + +/* Set the sizes of the dynamic sections. */ + +static boolean +elf_i386_size_dynamic_sections (output_bfd, info) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + struct elf_i386_link_hash_table *htab; + bfd *dynobj; + asection *s; + boolean relocs; + bfd *ibfd; + + htab = elf_i386_hash_table (info); + dynobj = htab->elf.dynobj; + if (dynobj == NULL) + abort (); + + if (htab->elf.dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + if (s == NULL) + abort (); + s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; + s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + } + } + + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct elf_i386_dyn_relocs *p; + + for (p = *((struct elf_i386_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + if (!bfd_is_abs_section (p->sec) + && bfd_is_abs_section (p->sec->output_section)) { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rel.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 4); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ } + else + { + srel = elf_section_data (p->sec)->sreloc; + srel->_raw_size += p->count * sizeof (Elf32_External_Rel); + } + } + } - /* We use the reloc_count field as a counter if we need - to copy relocs into the output file. */ - s->reloc_count = 0; + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) + { + if (*local_got > 0) + { + *local_got = s->_raw_size; + s->_raw_size += 4; + if (info->shared) + srel->_raw_size += sizeof (Elf32_External_Rel); } + else + *local_got = (bfd_vma) -1; + } + } + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ + relocs = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + if (s == htab->splt + || s == htab->sgot + || s == htab->sgotplt) + { + /* Strip this section if we don't need it; see the + comment below. */ } - else if (strncmp (name, ".got", 4) != 0) + else if (strncmp (bfd_get_section_name (dynobj, s), ".rel", 4) == 0) + { + if (s->_raw_size != 0 && s != htab->srelplt) + relocs = true; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + else { /* It's not one of our sections, so don't allocate space. */ continue; } - if (strip) + if (s->_raw_size == 0) { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rel.bss and + .rel.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + _bfd_strip_section_from_output (info, s); continue; } @@ -1230,79 +1585,89 @@ elf_i386_size_dynamic_sections (output_bfd, info) but this way if it does, we get a R_386_NONE reloc instead of garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) + if (s->contents == NULL) return false; } - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { /* Add some entries to the .dynamic section. We fill in the values later, in elf_i386_finish_dynamic_sections, but we must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + if (! info->shared) { - if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } - if (plt) + if (htab->splt->_raw_size != 0) { - if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_REL) - || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_REL) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } if (relocs) { - if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELENT, - sizeof (Elf32_External_Rel))) + if (!add_dynamic_entry (DT_REL, 0) + || !add_dynamic_entry (DT_RELSZ, 0) + || !add_dynamic_entry (DT_RELENT, sizeof (Elf32_External_Rel))) return false; - } - if (reltext) - { - if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) - return false; - info->flags |= DF_TEXTREL; + /* If any dynamic relocs apply to a read-only section, + then we need a DT_TEXTREL entry. */ + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info); + + if ((info->flags & DF_TEXTREL) != 0) + { + if (!add_dynamic_entry (DT_TEXTREL, 0)) + return false; + } } } +#undef add_dynamic_entry return true; } -/* This function is called via elf_i386_link_hash_traverse if we are - creating a shared object. In the -Bsymbolic case, it discards the - space allocated to copy PC relative relocs against symbols which - are defined in regular objects. For the normal non-symbolic case, - we also discard space for relocs that have become local due to - symbol visibility changes. We allocated space for them in the - check_relocs routine, but we won't fill them in in the - relocate_section routine. */ +/* Set the correct type for an x86 ELF section. We do this by the + section name, which is a hack, but ought to work. */ static boolean -elf_i386_discard_copies (h, inf) - struct elf_i386_link_hash_entry *h; - PTR inf; +elf_i386_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + Elf32_Internal_Shdr *hdr; + asection *sec; { - struct elf_i386_pcrel_relocs_copied *s; - struct bfd_link_info *info = (struct bfd_link_info *) inf; - - /* If a symbol has been forced local or we have found a regular - definition for the symbolic link case, then we won't be needing - any relocs. */ - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) - { - for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) - s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel); - } + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + /* This is an ugly, but unfortunately necessary hack that is + needed when producing EFI binaries on x86. It tells + elf.c:elf_fake_sections() not to consider ".reloc" as a section + containing ELF relocation info. We need this hack in order to + be able to generate ELF binaries that can be translated into + EFI applications (which are essentially COFF objects). Those + files contain a COFF ".reloc" section inside an ELFNN object, + which would normally cause BFD to segfault because it would + attempt to interpret this section as containing relocation + entries for section "oc". With this hack enabled, ".reloc" + will be treated as a normal data section, which will avoid the + segfault. However, you won't be able to create an ELFNN binary + with a section named "oc" that needs relocations, but that's + the kind of ugly side-effects you get when detecting section + types based on their names... In practice, this limitation is + unlikely to bite. */ + if (strcmp (name, ".reloc") == 0) + hdr->sh_type = SHT_PROGBITS; return true; } @@ -1321,30 +1686,18 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *local_syms; asection **local_sections; { - bfd *dynobj; + struct elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; - asection *sgot; - asection *splt; - asection *sreloc; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - dynobj = elf_hash_table (info)->dynobj; + htab = elf_i386_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); - sreloc = NULL; - splt = NULL; - sgot = NULL; - if (dynobj != NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got"); - } - rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) @@ -1355,7 +1708,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sec; + bfd_vma off; bfd_vma relocation; + boolean unresolved_reloc; bfd_reloc_status_type r; unsigned int indx; @@ -1377,7 +1732,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (info->relocateable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable 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. */ @@ -1394,7 +1749,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (input_bfd, val, contents + rel->r_offset); } } - continue; } @@ -1402,6 +1756,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; + unresolved_reloc = false; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -1409,6 +1764,30 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + bfd_vma addend; + + if (howto->src_mask != 0xffffffff) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, howto->name); + return false; + } + + addend = bfd_get_32 (input_bfd, contents + rel->r_offset); + msec = sec; + addend = + _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) + - relocation; + addend += msec->output_section->vma + msec->output_offset; + bfd_put_32 (input_bfd, addend, contents + rel->r_offset); + } } else { @@ -1416,59 +1795,30 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, 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; + + relocation = 0; if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if (r_type == R_386_GOTPC - || (r_type == R_386_PLT32 - && splt != NULL - && h->plt.offset != (bfd_vma) -1) - || (r_type == R_386_GOT32 - && elf_hash_table (info)->dynamic_sections_created - && (! info->shared - || (! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - && (r_type == R_386_32 - || r_type == R_386_PC32) - && ((input_section->flags & SEC_ALLOC) != 0 - /* DWARF will emit R_386_32 relocations in its - sections against symbols defined externally - in shared libraries. We can't do anything - with them here. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } - else if (sec->output_section == NULL) - { - (*_bfd_error_handler) - (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), - bfd_get_filename (input_bfd), h->root.root.string, - bfd_get_section_name (input_bfd, input_section)); - relocation = 0; - } + if (sec->output_section == NULL) + /* Set a flag that will be cleared later if we find a + relocation value for this symbol. output_section + is typically NULL for symbols satisfied by a shared + library. */ + unresolved_reloc = true; else relocation = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; - else if (info->shared && !info->symbolic + ; + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; + ; else { if (! ((*info->callbacks->undefined_symbol) @@ -1477,7 +1827,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return false; - relocation = 0; } } @@ -1486,18 +1835,20 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_GOT32: /* Relocation is to the entry for this symbol in the global offset table. */ - BFD_ASSERT (sgot != NULL); + if (htab->sgot == NULL) + abort (); if (h != NULL) { - bfd_vma off; + boolean dyn; off = h->got.offset; - BFD_ASSERT (off != (bfd_vma) -1); - - if (! elf_hash_table (info)->dynamic_sections_created + dyn = htab->elf.dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) || (info->shared - && (info->symbolic || h->dynindx == -1) + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) { /* This is actually a static link, or it is a @@ -1517,88 +1868,75 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, else { bfd_put_32 (output_bfd, relocation, - sgot->contents + off); + htab->sgot->contents + off); h->got.offset |= 1; } } - - relocation = sgot->output_offset + off; + else + unresolved_reloc = false; } else { - bfd_vma off; - - BFD_ASSERT (local_got_offsets != NULL - && local_got_offsets[r_symndx] != (bfd_vma) -1); + if (local_got_offsets == NULL) + abort (); off = local_got_offsets[r_symndx]; /* The offset must always be a multiple of 4. We use - the least significant bit to record whether we have - already generated the necessary reloc. */ + the least significant bit to record whether we have + already generated the necessary reloc. */ if ((off & 1) != 0) off &= ~1; else { - bfd_put_32 (output_bfd, relocation, sgot->contents + off); + bfd_put_32 (output_bfd, relocation, + htab->sgot->contents + off); if (info->shared) { asection *srelgot; Elf_Internal_Rel outrel; + Elf32_External_Rel *loc; - srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); - BFD_ASSERT (srelgot != NULL); + srelgot = htab->srelgot; + if (srelgot == NULL) + abort (); - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - (((Elf32_External_Rel *) - srelgot->contents) - + srelgot->reloc_count)); - ++srelgot->reloc_count; + loc = (Elf32_External_Rel *) srelgot->contents; + loc += srelgot->reloc_count++; + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } local_got_offsets[r_symndx] |= 1; } - - relocation = sgot->output_offset + off; } + if (off >= (bfd_vma) -2) + abort (); + + relocation = htab->sgot->output_offset + off; break; case R_386_GOTOFF: /* Relocation is relative to the start of the global offset table. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - /* Note that sgot->output_offset is not involved in this calculation. We always want the start of .got. If we defined _GLOBAL_OFFSET_TABLE in a different way, as is permitted by the ABI, we might have to change this calculation. */ - relocation -= sgot->output_section->vma; - + relocation -= htab->sgot->output_section->vma; break; case R_386_GOTPC: /* Use global offset table as symbol value. */ - - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - - relocation = sgot->output_section->vma; - + relocation = htab->sgot->output_section->vma; + unresolved_reloc = false; break; case R_386_PLT32: @@ -1606,93 +1944,68 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, procedure linkage table. */ /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ + without using the procedure linkage table. */ if (h == NULL) break; if (h->plt.offset == (bfd_vma) -1 - || splt == NULL) + || htab->splt == NULL) { /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ + happens when statically linking PIC code, or when + using -Bsymbolic. */ break; } - relocation = (splt->output_section->vma - + splt->output_offset + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + h->plt.offset); - + unresolved_reloc = false; break; case R_386_32: case R_386_PC32: - if (info->shared - && (input_section->flags & SEC_ALLOC) != 0 - && (r_type != R_386_PC32 - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) + break; + + if ((info->shared + && (r_type != R_386_PC32 + || (h != NULL + && h->dynindx != -1 + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && h != NULL + && h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0) + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined))) { Elf_Internal_Rel outrel; boolean skip, relocate; + asection *sreloc; + Elf32_External_Rel *loc; /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - if (sreloc == NULL) - { - const char *name; - - name = (bfd_elf_string_from_elf_section - (input_bfd, - elf_elfheader (input_bfd)->e_shstrndx, - elf_section_data (input_section)->rel_hdr.sh_name)); - if (name == NULL) - return false; - - if (strncmp (name, ".rel", 4) != 0 - || strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 4) != 0) - { - if (input_bfd->my_archive) - (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), - bfd_get_filename (input_bfd->my_archive), - bfd_get_filename (input_bfd), - name); - else - (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), - bfd_get_filename (input_bfd), - name); - return false; - } - - sreloc = bfd_get_section_by_name (dynobj, name); - BFD_ASSERT (sreloc != NULL); - } - skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } - + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -1701,37 +2014,32 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, memset (&outrel, 0, sizeof outrel); relocate = false; } - else if (r_type == R_386_PC32) + else if (h != NULL + && h->dynindx != -1 + && (r_type == R_386_PC32 + || !info->shared + || !info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + { - BFD_ASSERT (h != NULL && h->dynindx != -1); relocate = false; - outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_PC32); + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); } else { - /* h->dynindx may be -1 if this symbol was marked to - become local. */ - if (h == NULL - || ((info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - { - relocate = true; - outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); - } - else - { - BFD_ASSERT (h->dynindx != -1); - relocate = false; - outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_32); - } + /* This symbol is local, or marked to become local. */ + relocate = true; + outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); } - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - (((Elf32_External_Rel *) - sreloc->contents) - + sreloc->reloc_count)); - ++sreloc->reloc_count; + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + + loc = (Elf32_External_Rel *) sreloc->contents; + loc += sreloc->reloc_count++; + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); /* If this reloc is against an external symbol, we do not want to fiddle with the addend. Otherwise, we @@ -1740,46 +2048,65 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (! relocate) continue; } - break; default: break; } + /* FIXME: Why do we allow debugging sections to escape this error? + More importantly, why do we not emit dynamic relocs for + R_386_32 above in debugging sections (which are ! SEC_ALLOC)? + If we had emitted the dynamic reloc, we could remove the + fudge here. */ + if (unresolved_reloc + && !(info->shared + && (input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + h->root.root.string); + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, (bfd_vma) 0); if (r != bfd_reloc_ok) { - switch (r) + const char *name; + + if (h != NULL) + name = h->root.root.string; + else { - default: - case bfd_reloc_outofrange: - abort (); - case bfd_reloc_overflow: - { - const char *name; - - 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) - return false; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); - } - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - break; + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return false; + if (*name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + if (r == bfd_reloc_overflow) + { + + if (! ((*info->callbacks->reloc_overflow) + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return false; + } + else + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): reloc against `%s': error %d"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, name, (int) r); + return false; } } } @@ -1797,28 +2124,25 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { - bfd *dynobj; + struct elf_i386_link_hash_table *htab; - dynobj = elf_hash_table (info)->dynobj; + htab = elf_i386_hash_table (info); if (h->plt.offset != (bfd_vma) -1) { - asection *splt; - asection *sgot; - asection *srel; bfd_vma plt_index; bfd_vma got_offset; Elf_Internal_Rel rel; + Elf32_External_Rel *loc; /* This symbol has an entry in the procedure linkage table. Set it up. */ - BFD_ASSERT (h->dynindx != -1); - - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); - srel = bfd_get_section_by_name (dynobj, ".rel.plt"); - BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL); + if (h->dynindx == -1 + || htab->splt == NULL + || htab->sgotplt == NULL + || htab->srelplt == NULL) + abort (); /* Get the index in the procedure linkage table which corresponds to this symbol. This is the index of this symbol @@ -1834,117 +2158,116 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) /* Fill in the entry in the procedure linkage table. */ if (! info->shared) { - memcpy (splt->contents + h->plt.offset, elf_i386_plt_entry, + memcpy (htab->splt->contents + h->plt.offset, elf_i386_plt_entry, PLT_ENTRY_SIZE); bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + (htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset + got_offset), - splt->contents + h->plt.offset + 2); + htab->splt->contents + h->plt.offset + 2); } else { - memcpy (splt->contents + h->plt.offset, elf_i386_pic_plt_entry, + memcpy (htab->splt->contents + h->plt.offset, elf_i386_pic_plt_entry, PLT_ENTRY_SIZE); bfd_put_32 (output_bfd, got_offset, - splt->contents + h->plt.offset + 2); + htab->splt->contents + h->plt.offset + 2); } bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rel), - splt->contents + h->plt.offset + 7); + htab->splt->contents + h->plt.offset + 7); bfd_put_32 (output_bfd, - (h->plt.offset + PLT_ENTRY_SIZE), - splt->contents + h->plt.offset + 12); + htab->splt->contents + h->plt.offset + 12); /* Fill in the entry in the global offset table. */ bfd_put_32 (output_bfd, - (splt->output_section->vma - + splt->output_offset + (htab->splt->output_section->vma + + htab->splt->output_offset + h->plt.offset + 6), - sgot->contents + got_offset); + htab->sgotplt->contents + got_offset); /* Fill in the entry in the .rel.plt section. */ - rel.r_offset = (sgot->output_section->vma - + sgot->output_offset + rel.r_offset = (htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset + got_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_JUMP_SLOT); - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) srel->contents - + plt_index)); + loc = (Elf32_External_Rel *) htab->srelplt->contents + plt_index; + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { /* Mark the symbol as undefined, rather than as defined in - the .plt section. Leave the value alone. */ + the .plt section. Leave the value alone. This is a clue + for the dynamic linker, to make function pointer + comparisons work between an application and shared + library. */ sym->st_shndx = SHN_UNDEF; } } if (h->got.offset != (bfd_vma) -1) { - asection *sgot; - asection *srel; Elf_Internal_Rel rel; + Elf32_External_Rel *loc; /* This symbol has an entry in the global offset table. Set it up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - srel = bfd_get_section_by_name (dynobj, ".rel.got"); - BFD_ASSERT (sgot != NULL && srel != NULL); + if (htab->sgot == NULL || htab->srelgot == NULL) + abort (); - rel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + (h->got.offset &~ 1)); + rel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + (h->got.offset & ~(bfd_vma) 1)); /* If this is a static link, or it is a -Bsymbolic link and the symbol is defined locally or was forced to be local because of a version file, we just want to emit a RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (! elf_hash_table (info)->dynamic_sections_created - || (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + if (info->shared + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { + BFD_ASSERT((h->got.offset & 1) != 0); rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); } else { BFD_ASSERT((h->got.offset & 1) == 0); - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); + bfd_put_32 (output_bfd, (bfd_vma) 0, + htab->sgot->contents + h->got.offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); } - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) srel->contents - + srel->reloc_count)); - ++srel->reloc_count; + loc = (Elf32_External_Rel *) htab->srelgot->contents; + loc += htab->srelgot->reloc_count++; + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { - asection *s; Elf_Internal_Rel rel; + Elf32_External_Rel *loc; /* This symbol needs a copy reloc. Set it up. */ - BFD_ASSERT (h->dynindx != -1 - && (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak)); - - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rel.bss"); - BFD_ASSERT (s != NULL); + if (h->dynindx == -1 + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + || htab->srelbss == NULL) + abort (); rel.r_offset = (h->root.u.def.value + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_COPY); - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) s->contents - + s->reloc_count)); - ++s->reloc_count; + loc = (Elf32_External_Rel *) htab->srelbss->contents; + loc += htab->srelbss->reloc_count++; + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ @@ -1955,6 +2278,26 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) return true; } +/* Used to decide how to sort relocs in an optimal manner for the + dynamic linker, before writing them out. */ + +static enum elf_reloc_type_class +elf_i386_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_386_RELATIVE: + return reloc_class_relative; + case R_386_JUMP_SLOT: + return reloc_class_plt; + case R_386_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + /* Finish up the dynamic sections. */ static boolean @@ -1962,29 +2305,26 @@ elf_i386_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; { + struct elf_i386_link_hash_table *htab; bfd *dynobj; - asection *sgot; asection *sdyn; - dynobj = elf_hash_table (info)->dynobj; - - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (sgot != NULL); + htab = elf_i386_hash_table (info); + dynobj = htab->elf.dynobj; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { - asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - BFD_ASSERT (sdyn != NULL); + if (sdyn == NULL || htab->sgot == NULL) + abort (); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; asection *s; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); @@ -1992,28 +2332,22 @@ elf_i386_finish_dynamic_sections (output_bfd, info) switch (dyn.d_tag) { default: - break; + continue; case DT_PLTGOT: - name = ".got"; - goto get_vma; + dyn.d_un.d_ptr = htab->sgot->output_section->vma; + break; + case DT_JMPREL: - name = ".rel.plt"; - get_vma: - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - dyn.d_un.d_ptr = s->vma; - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + dyn.d_un.d_ptr = htab->srelplt->output_section->vma; break; case DT_PLTRELSZ: - s = bfd_get_section_by_name (output_bfd, ".rel.plt"); - BFD_ASSERT (s != NULL); + s = htab->srelplt->output_section; if (s->_cooked_size != 0) dyn.d_un.d_val = s->_cooked_size; else dyn.d_un.d_val = s->_raw_size; - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; case DT_RELSZ: @@ -2026,98 +2360,67 @@ elf_i386_finish_dynamic_sections (output_bfd, info) the linker script arranges for .rel.plt to follow all other relocation sections, we don't have to worry about changing the DT_REL entry. */ - s = bfd_get_section_by_name (output_bfd, ".rel.plt"); - if (s != NULL) + if (htab->srelplt != NULL) { + s = htab->srelplt->output_section; if (s->_cooked_size != 0) dyn.d_un.d_val -= s->_cooked_size; else dyn.d_un.d_val -= s->_raw_size; } - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; } + + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); } /* Fill in the first entry in the procedure linkage table. */ - splt = bfd_get_section_by_name (dynobj, ".plt"); - if (splt && splt->_raw_size > 0) + if (htab->splt && htab->splt->_raw_size > 0) { if (info->shared) - memcpy (splt->contents, elf_i386_pic_plt0_entry, PLT_ENTRY_SIZE); + memcpy (htab->splt->contents, + elf_i386_pic_plt0_entry, PLT_ENTRY_SIZE); else { - memcpy (splt->contents, elf_i386_plt0_entry, PLT_ENTRY_SIZE); + memcpy (htab->splt->contents, + elf_i386_plt0_entry, PLT_ENTRY_SIZE); bfd_put_32 (output_bfd, - sgot->output_section->vma + sgot->output_offset + 4, - splt->contents + 2); + (htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset + + 4), + htab->splt->contents + 2); bfd_put_32 (output_bfd, - sgot->output_section->vma + sgot->output_offset + 8, - splt->contents + 8); + (htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset + + 8), + htab->splt->contents + 8); } /* UnixWare sets the entsize of .plt to 4, although that doesn't really seem like the right value. */ - elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; + elf_section_data (htab->splt->output_section) + ->this_hdr.sh_entsize = 4; } } - /* Fill in the first three entries in the global offset table. */ - if (sgot->_raw_size > 0) + if (htab->sgotplt) { - if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); - else - bfd_put_32 (output_bfd, - sdyn->output_section->vma + sdyn->output_offset, - sgot->contents); - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4); - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8); - } - - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; - - return true; -} - -/* Set the correct type for an x86 ELF section. We do this by the - section name, which is a hack, but ought to work. */ - -static boolean -elf_i386_fake_sections (abfd, hdr, sec) - bfd *abfd ATTRIBUTE_UNUSED; - Elf32_Internal_Shdr *hdr; - asection *sec; -{ - register const char *name; - - name = bfd_get_section_name (abfd, sec); - - if (strcmp (name, ".reloc") == 0) - /* - * This is an ugly, but unfortunately necessary hack that is - * needed when producing EFI binaries on x86. It tells - * elf.c:elf_fake_sections() not to consider ".reloc" as a section - * containing ELF relocation info. We need this hack in order to - * be able to generate ELF binaries that can be translated into - * EFI applications (which are essentially COFF objects). Those - * files contain a COFF ".reloc" section inside an ELFNN object, - * which would normally cause BFD to segfault because it would - * attempt to interpret this section as containing relocation - * entries for section "oc". With this hack enabled, ".reloc" - * will be treated as a normal data section, which will avoid the - * segfault. However, you won't be able to create an ELFNN binary - * with a section named "oc" that needs relocations, but that's - * the kind of ugly side-effects you get when detecting section - * types based on their names... In practice, this limitation is - * unlikely to bite. - */ - hdr->sh_type = SHT_PROGBITS; + /* Fill in the first three entries in the global offset table. */ + if (htab->sgotplt->_raw_size > 0) + { + bfd_put_32 (output_bfd, + (sdyn == NULL ? (bfd_vma) 0 + : sdyn->output_section->vma + sdyn->output_offset), + htab->sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 4); + bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 8); + } + elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize = 4; + } return true; } - #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" #define ELF_ARCH bfd_arch_i386 @@ -2125,6 +2428,7 @@ elf_i386_fake_sections (abfd, hdr, sec) #define ELF_MAXPAGESIZE 0x1000 #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 @@ -2134,20 +2438,23 @@ elf_i386_fake_sections (abfd, hdr, sec) #define elf_info_to_howto elf_i386_info_to_howto #define elf_info_to_howto_rel elf_i386_info_to_howto_rel -#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup #define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol #define elf_backend_check_relocs elf_i386_check_relocs -#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_copy_indirect_symbol elf_i386_copy_indirect_symbol +#define elf_backend_create_dynamic_sections elf_i386_create_dynamic_sections +#define elf_backend_fake_sections elf_i386_fake_sections #define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections #define elf_backend_finish_dynamic_symbol elf_i386_finish_dynamic_symbol #define elf_backend_gc_mark_hook elf_i386_gc_mark_hook #define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook +#define elf_backend_grok_prstatus elf_i386_grok_prstatus +#define elf_backend_grok_psinfo elf_i386_grok_psinfo +#define elf_backend_reloc_type_class elf_i386_reloc_type_class #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections -#define elf_backend_fake_sections elf_i386_fake_sections #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index ab803f4..4c9ff82 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -38,10 +38,12 @@ static reloc_howto_type *ppc_elf_reloc_type_lookup static void ppc_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); static void ppc_elf_howto_init PARAMS ((void)); +static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR)); +static boolean ppc_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static bfd_reloc_status_type ppc_elf_addr16_ha_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword)); -static boolean ppc_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *)); static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); static int ppc_elf_additional_program_headers PARAMS ((bfd *)); @@ -105,6 +107,12 @@ static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *, Elf_Internal_Sym *)); static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static enum elf_reloc_type_class ppc_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +static boolean ppc_elf_grok_prstatus + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); +static boolean ppc_elf_grok_psinfo + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); #define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */ #define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */ @@ -989,8 +997,8 @@ ppc_elf_howto_init () static int ppc_elf_sort_rela (arg1, arg2) - const void *arg1; - const void *arg2; + const PTR arg1; + const PTR arg2; { const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; @@ -1051,6 +1059,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) if (isec->reloc_count) { unsigned n; + bfd_size_type amt; /* Get a copy of the native relocations. */ internal_relocs = _bfd_elf32_link_read_relocs ( @@ -1062,8 +1071,9 @@ ppc_elf_relax_section (abfd, isec, link_info, again) free_relocs = internal_relocs; /* Setup a faster access method for the reloc info we need. */ - rela_comb = (Elf_Internal_Rela**) - bfd_malloc (isec->reloc_count*sizeof (Elf_Internal_Rela*)); + amt = isec->reloc_count; + amt *= sizeof (Elf_Internal_Rela*); + rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt); if (rela_comb == NULL) goto error_return; for (n = 0; n < isec->reloc_count; ++n) @@ -1192,7 +1202,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) #undef BO4 if (modified) { - bfd_put_32 (abfd, insn, contents + isec_offset); + bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset); section_modified = true; } } @@ -1383,24 +1393,6 @@ ppc_elf_set_private_flags (abfd, flags) return true; } -/* Copy backend specific data from one object module to another */ -static boolean -ppc_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_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; - elf_flags_init (obfd) = true; - return true; -} - /* Merge backend specific data from an object file to the output object file when linking */ static boolean @@ -1442,7 +1434,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); } else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 && (old_flags & EF_PPC_RELOCATABLE) != 0) @@ -1450,7 +1442,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); } /* The output is -mrelocatable-lib iff both the input files are. */ @@ -1476,7 +1468,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_get_filename (ibfd), (long) new_flags, (long) old_flags); + bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); } if (error) @@ -1786,6 +1778,8 @@ ppc_elf_adjust_dynamic_symbol (info, h) return true; } + else + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -1875,14 +1869,13 @@ ppc_elf_adjust_dynamic_symbol (info, h) static boolean ppc_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; #ifdef DEBUG fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); @@ -1927,7 +1920,6 @@ ppc_elf_size_dynamic_sections (output_bfd, info) memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -1973,22 +1965,9 @@ ppc_elf_size_dynamic_sections (output_bfd, info) } else { - asection *target; - const char *outname; - /* Remember whether there are any relocation sections. */ relocs = true; - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ s->reloc_count = 0; @@ -2021,37 +2000,40 @@ ppc_elf_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ - if (! info->shared) +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + + if (!info->shared) { - if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } if (plt) { - if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } if (relocs) { - if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT, - sizeof (Elf32_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { - if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; info->flags |= DF_TEXTREL; } } +#undef add_dynamic_entry return true; } @@ -2085,7 +2067,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) #ifdef DEBUG fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n", bfd_get_section_name (abfd, sec), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); #endif /* Create the linker generated sections all the time so that the @@ -2185,7 +2167,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.refcount == -1) + if (h->got.refcount == 0) { /* Make sure this symbol is output as a dynamic symbol. */ if (h->dynindx == -1) @@ -2196,28 +2178,25 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) sgot->_raw_size += 4; /* Allocate relocation space. */ srelgot->_raw_size += sizeof (Elf32_External_Rela); - - h->got.refcount = 1; } - else - h->got.refcount++; + h->got.refcount++; } else { /* This is a global offset table entry for a local symbol. */ if (local_got_refcounts == NULL) { - size_t size; + bfd_size_type size; - size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); - local_got_refcounts = (bfd_signed_vma *) - bfd_alloc (abfd, size); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_signed_vma); + local_got_refcounts + = (bfd_signed_vma *) bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return false; elf_local_got_refcounts (abfd) = local_got_refcounts; - memset (local_got_refcounts, -1, size); } - if (local_got_refcounts[r_symndx] == -1) + if (local_got_refcounts[r_symndx] == 0) { sgot->_raw_size += 4; @@ -2226,11 +2205,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) dynamic linker can adjust this GOT entry. */ if (info->shared) srelgot->_raw_size += sizeof (Elf32_External_Rela); - - local_got_refcounts[r_symndx] = 1; } - else - local_got_refcounts[r_symndx]++; + local_got_refcounts[r_symndx]++; } break; @@ -2240,7 +2216,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) { ((*_bfd_error_handler) (_("%s: relocation %s cannot be used when making a shared object"), - bfd_get_filename (abfd), "R_PPC_EMB_SDAI16")); + bfd_archive_filename (abfd), "R_PPC_EMB_SDAI16")); return false; } @@ -2274,7 +2250,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) { ((*_bfd_error_handler) (_("%s: relocation %s cannot be used when making a shared object"), - bfd_get_filename (abfd), "R_PPC_EMB_SDA2I16")); + bfd_archive_filename (abfd), "R_PPC_EMB_SDA2I16")); return false; } @@ -2309,7 +2285,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) { ((*_bfd_error_handler) (_("%s: relocation %s cannot be used when making a shared object"), - bfd_get_filename (abfd), + bfd_archive_filename (abfd), ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name)); return false; } @@ -2343,13 +2319,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) if (! bfd_elf32_link_record_dynamic_symbol (info, h)) return false; } - if (h->plt.refcount == -1) - { - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount = 1; - } - else - h->plt.refcount++; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount++; break; /* The following relocations don't need to propagate the @@ -2430,6 +2401,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -2485,13 +2458,7 @@ ppc_elf_gc_mark_hook (abfd, info, rel, h, sym) } else { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); } return NULL; @@ -2575,7 +2542,7 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= (bfd_vma) bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sdata. */ @@ -2584,21 +2551,24 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) if (!sdata->bss_section) { + bfd_size_type amt; + /* We don't go through bfd_make_section, because we don't want to attach this common section to DYNOBJ. The linker will move the symbols to the appropriate output section when it defines common symbols. */ - sdata->bss_section = ((asection *) - bfd_zalloc (abfd, sizeof (asection))); + amt = sizeof (asection); + sdata->bss_section = (asection *) bfd_zalloc (abfd, amt); if (sdata->bss_section == NULL) return false; sdata->bss_section->name = sdata->bss_name; sdata->bss_section->flags = SEC_IS_COMMON; sdata->bss_section->output_section = sdata->bss_section; - sdata->bss_section->symbol = - (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); + amt = sizeof (asymbol); + sdata->bss_section->symbol = (asymbol *) bfd_zalloc (abfd, amt); + amt = sizeof (asymbol *); sdata->bss_section->symbol_ptr_ptr = - (asymbol **) bfd_zalloc (abfd, sizeof (asymbol *)); + (asymbol **) bfd_zalloc (abfd, amt); if (sdata->bss_section->symbol == NULL || sdata->bss_section->symbol_ptr_ptr == NULL) return false; @@ -2702,7 +2672,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset = (sgot->output_section->vma + sgot->output_offset - + (h->got.offset &~ 1)); + + (h->got.offset &~ (bfd_vma) 1)); /* If this is a -Bsymbolic link, and the symbol is defined locally, we just want to emit a RELATIVE reloc. The entry in @@ -2847,7 +2817,7 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) if (sgot) { unsigned char *contents = sgot->contents; - bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents); + bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents); if (sdyn == NULL) bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4); @@ -2919,7 +2889,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef DEBUG fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), bfd_section_name(input_bfd, input_section), (long) input_section->reloc_count, (info->relocateable) ? " (relocatable)" : ""); @@ -2958,7 +2928,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || !ppc_elf_howto_table[(int) r_type]) { (*_bfd_error_handler) (_("%s: unknown relocation type %d"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), (int) r_type); bfd_set_error (bfd_error_bad_value); @@ -3003,9 +2973,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, sec = local_sections[r_symndx]; sym_name = ""; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + addend = rel->r_addend; /* Relocs to local symbols are always resolved. */ will_become_local = 1; } @@ -3091,7 +3060,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), - bfd_get_filename (input_bfd), h->root.root.string, + bfd_archive_filename (input_bfd), h->root.root.string, bfd_get_section_name (input_bfd, input_section)); relocation = 0; } @@ -3102,7 +3071,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) + && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else @@ -3124,13 +3095,16 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { default: (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); ret = false; continue; + case (int) R_PPC_NONE: + continue; + /* Relocations that need no special processing. */ case (int) R_PPC_LOCAL24PC: /* It makes no sense to point a local relocation @@ -3166,7 +3140,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocations that always need to be propagated if this is a shared object. */ - case (int) R_PPC_NONE: case (int) R_PPC_ADDR32: case (int) R_PPC_ADDR24: case (int) R_PPC_ADDR16: @@ -3176,7 +3149,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, case (int) R_PPC_ADDR14: case (int) R_PPC_UADDR32: case (int) R_PPC_UADDR16: - if (info->shared) + if (info->shared && r_symndx != 0) { Elf_Internal_Rela outrel; boolean skip; @@ -3212,22 +3185,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } - + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -3325,7 +3287,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, insn &= ~BRANCH_PREDICT_BIT; else insn |= BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, insn, contents + offset); + bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); break; /* branch not taken predicition relocations */ @@ -3336,7 +3298,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, insn |= BRANCH_PREDICT_BIT; else insn &= ~BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, insn, contents + offset); + bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); break; /* GOT16 relocations */ @@ -3488,7 +3450,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, && strcmp (name, ".sbss") != 0) { (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), sym_name, ppc_elf_howto_table[(int) r_type]->name, name); @@ -3509,7 +3471,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (strcmp (name, ".sdata2") != 0 && strcmp (name, ".sbss2") != 0) { (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), sym_name, ppc_elf_howto_table[(int) r_type]->name, name); @@ -3559,7 +3521,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, else { (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), sym_name, ppc_elf_howto_table[(int) r_type]->name, name); @@ -3573,7 +3535,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { /* fill in register field */ insn = bfd_get_32 (output_bfd, contents + offset); insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT); - bfd_put_32 (output_bfd, insn, contents + offset); + bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); } } break; @@ -3625,7 +3587,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, case (int) R_PPC_EMB_RELST_HA: case (int) R_PPC_EMB_BIT_FLD: (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."), - bfd_get_filename (input_bfd), + bfd_archive_filename (input_bfd), ppc_elf_howto_table[(int) r_type]->name, sym_name); @@ -3709,6 +3671,90 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, return ret; } + +static enum elf_reloc_type_class +ppc_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_PPC_RELATIVE: + return reloc_class_relative; + case R_PPC_REL24: + case R_PPC_ADDR24: + case R_PPC_JMP_SLOT: + return reloc_class_plt; + case R_PPC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + +/* Support for core dump NOTE sections */ +static boolean +ppc_elf_grok_prstatus (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + int offset; + unsigned int raw_size; + + switch (note->descsz) + { + default: + return false; + + case 268: /* Linux/PPC */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 192; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + raw_size, note->descpos + offset); +} + +static boolean +ppc_elf_grok_psinfo (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + switch (note->descsz) + { + default: + return false; + + case 128: /* Linux/PPC elf_prpsinfo */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return true; +} #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_NAME "elf32-powerpcle" @@ -3730,10 +3776,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, #define elf_backend_plt_not_loaded 1 #define elf_backend_got_symbol_offset 4 #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE -#define bfd_elf32_bfd_copy_private_bfd_data ppc_elf_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data #define bfd_elf32_bfd_relax_section ppc_elf_relax_section #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup @@ -3754,5 +3800,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, #define elf_backend_fake_sections ppc_elf_fake_sections #define elf_backend_additional_program_headers ppc_elf_additional_program_headers #define elf_backend_modify_segment_map ppc_elf_modify_segment_map +#define elf_backend_grok_prstatus ppc_elf_grok_prstatus +#define elf_backend_grok_psinfo ppc_elf_grok_psinfo +#define elf_backend_reloc_type_class ppc_elf_reloc_type_class #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c index 091cd39..f0f9746 100644 --- a/contrib/binutils/bfd/elf32-sparc.c +++ b/contrib/binutils/bfd/elf32-sparc.c @@ -52,6 +52,14 @@ static boolean elf32_sparc_object_p PARAMS ((bfd *)); static void elf32_sparc_final_write_processing PARAMS ((bfd *, boolean)); +static enum elf_reloc_type_class elf32_sparc_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +static asection * elf32_sparc_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_sparc_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); /* The relocation "howto" table. */ @@ -68,7 +76,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true), HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true), HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0x00ffffff,true), + HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true), HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true), HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true), HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true), @@ -86,7 +94,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true), HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), - HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PLT32", false,0,0x00000000,true), + HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true), HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true), HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true), HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true), @@ -120,7 +128,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_UA64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", false,0,(~ (bfd_vma)0), true), + HOWTO(R_SPARC_UA64, 0,0, 0,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_UA64", false,0,0x00000000,true), HOWTO(R_SPARC_UA16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", false,0,0x0000ffff,true), HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true), }; @@ -134,10 +142,11 @@ struct elf_reloc_map { unsigned char elf_reloc_val; }; -static CONST struct elf_reloc_map sparc_reloc_map[] = +static const struct elf_reloc_map sparc_reloc_map[] = { { BFD_RELOC_NONE, R_SPARC_NONE, }, { BFD_RELOC_16, R_SPARC_16, }, + { BFD_RELOC_16_PCREL, R_SPARC_DISP16 }, { BFD_RELOC_8, R_SPARC_8 }, { BFD_RELOC_8_PCREL, R_SPARC_DISP8 }, { BFD_RELOC_CTOR, R_SPARC_32 }, @@ -146,6 +155,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_HI22, R_SPARC_HI22 }, { BFD_RELOC_LO10, R_SPARC_LO10, }, { BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 }, + { BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 }, { BFD_RELOC_SPARC22, R_SPARC_22 }, { BFD_RELOC_SPARC13, R_SPARC_13 }, { BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 }, @@ -447,10 +457,11 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) symbol. */ if (local_got_offsets == NULL) { - size_t size; + bfd_size_type size; register unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_vma); local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); if (local_got_offsets == NULL) return false; @@ -485,6 +496,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) break; + case R_SPARC_PLT32: case R_SPARC_WPLT30: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, @@ -498,6 +510,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) reloc for a local symbol if you assemble a call from one section to another when using -K pic. We treat it as WDISP30. */ + if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + goto r_sparc_plt32; break; } @@ -510,6 +524,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + goto r_sparc_plt32; break; case R_SPARC_PC10: @@ -554,11 +570,11 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) case R_SPARC_LO10: case R_SPARC_UA16: case R_SPARC_UA32: - case R_SPARC_UA64: if (h != NULL) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; - if (info->shared) + r_sparc_plt32: + if (info->shared && (sec->flags & SEC_ALLOC)) { /* When creating a shared object, we must copy these relocs into the output file. We create a reloc @@ -593,6 +609,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -652,14 +670,8 @@ elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym) } else { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } return NULL; } @@ -910,12 +922,11 @@ elf32_sparc_adjust_dynamic_symbol (info, h) static boolean elf32_sparc_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table (info)->dynobj; @@ -953,7 +964,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -986,19 +996,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) } else { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - if (strcmp (name, ".rela.plt") == 0) relplt = true; @@ -1038,34 +1035,36 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ - if (! info->shared) +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + + if (!info->shared) { - if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } if (relplt) { - if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } - if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT, - sizeof (Elf32_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { - if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } +#undef add_dynamic_entry return true; } @@ -1136,6 +1135,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation; bfd_reloc_status_type r; + boolean is_plt = false; r_type = ELF32_R_TYPE (rel->r_info); @@ -1179,9 +1179,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); } else { @@ -1193,7 +1191,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if ((r_type == R_SPARC_WPLT30 + if (((r_type == R_SPARC_WPLT30 + || r_type == R_SPARC_PLT32) && h->plt.offset != (bfd_vma) -1) || ((r_type == R_SPARC_GOT10 || r_type == R_SPARC_GOT13 @@ -1223,11 +1222,18 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_SPARC_LO10 || r_type == R_SPARC_UA16 || r_type == R_SPARC_UA32 - || r_type == R_SPARC_UA64 || ((r_type == R_SPARC_PC10 || r_type == R_SPARC_PC22) && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 0)))) + "_GLOBAL_OFFSET_TABLE_") != 0)) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_SPARC_32 relocations in its + sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some @@ -1241,7 +1247,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -1354,6 +1361,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; + case R_SPARC_PLT32: + if (h == NULL || h->plt.offset == (bfd_vma) -1) + { + r_type = R_SPARC_32; + goto r_sparc_plt32; + } + /* Fall through. */ case R_SPARC_WPLT30: /* Relocation is to the entry for this symbol in the procedure linkage table. */ @@ -1382,6 +1396,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); + if (r_type == R_SPARC_PLT32) + { + r_type = R_SPARC_32; + is_plt = true; + goto r_sparc_plt32; + } break; case R_SPARC_PC10: @@ -1412,8 +1432,10 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_LO10: case R_SPARC_UA16: case R_SPARC_UA32: - case R_SPARC_UA64: - if (info->shared) + r_sparc_plt32: + if (info->shared + && r_symndx != 0 + && (input_section->flags & SEC_ALLOC)) { Elf_Internal_Rela outrel; boolean skip; @@ -1444,30 +1466,41 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } - + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); + /* Optimize unaligned reloc usage now that we know where + it finally resides. */ + switch (r_type) + { + case R_SPARC_16: + if (outrel.r_offset & 1) + r_type = R_SPARC_UA16; + break; + case R_SPARC_UA16: + if (!(outrel.r_offset & 1)) + r_type = R_SPARC_16; + break; + case R_SPARC_32: + if (outrel.r_offset & 3) + r_type = R_SPARC_UA32; + break; + case R_SPARC_UA32: + if (!(outrel.r_offset & 3)) + r_type = R_SPARC_32; + break; + } + if (skip) memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if the symbol was marked to become local. */ - else if (h != NULL + else if (h != NULL && ! is_plt && ((! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) @@ -1487,7 +1520,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, { long indx; - if (h == NULL) + if (is_plt) + sec = splt; + else if (h == NULL) sec = local_sections[r_symndx]; else { @@ -1517,7 +1552,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, BFD_FAIL (); (*_bfd_error_handler) (_("%s: probably compiled without -fPIC?"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); return false; } @@ -1535,12 +1570,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, ++sreloc->reloc_count; /* This reloc will be computed at runtime, so there's no - need to do anything now, unless this is a RELATIVE - reloc in an unallocated section. */ - if (skip - || (input_section->flags & SEC_ALLOC) != 0 - || ELF32_R_TYPE (outrel.r_info) != R_SPARC_RELATIVE) - continue; + need to do anything now. */ + continue; } break; @@ -1661,7 +1692,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || reg == G0 || reg == O7) break; - bfd_put_32 (input_bfd, INSN_NOP, + bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP, contents + rel->r_offset + 4); } @@ -1748,7 +1779,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) (PLT_ENTRY_WORD1 + (((- (h->plt.offset + 4)) >> 2) & 0x3fffff)), splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, PLT_ENTRY_WORD2, + bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2, splt->contents + h->plt.offset + 8); /* Fill in the entry in the .rela.plt section. */ @@ -1791,7 +1822,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset = (sgot->output_section->vma + sgot->output_offset - + (h->got.offset &~ 1)); + + (h->got.offset &~ (bfd_vma) 1)); /* If this is a -Bsymbolic link, and the symbol is defined locally, we just want to emit a RELATIVE reloc. Likewise if @@ -1917,7 +1948,7 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) if (splt->_raw_size > 0) { memset (splt->contents, 0, 4 * PLT_ENTRY_SIZE); - bfd_put_32 (output_bfd, SPARC_NOP, + bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP, splt->contents + splt->_raw_size - 4); } @@ -1974,7 +2005,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: compiled for a 64 bit system and target is 32 bit"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); } else if ((ibfd->flags & DYNAMIC) == 0) { @@ -1988,7 +2019,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking little endian files with big endian files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); error = true; } previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA; @@ -2024,7 +2055,7 @@ elf32_sparc_object_p (abfd) } else if (elf_elfheader (abfd)->e_flags & EF_SPARC_LEDATA) return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, - bfd_mach_sparc_sparclite_le); + bfd_mach_sparc_sparclite_le); else return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc); } @@ -2066,6 +2097,23 @@ elf32_sparc_final_write_processing (abfd, linker) break; } } + +static enum elf_reloc_type_class +elf32_sparc_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_SPARC_RELATIVE: + return reloc_class_relative; + case R_SPARC_JMP_SLOT: + return reloc_class_plt; + case R_SPARC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_BIG_SYM bfd_elf32_sparc_vec #define TARGET_BIG_NAME "elf32-sparc" @@ -2096,6 +2144,7 @@ elf32_sparc_final_write_processing (abfd, linker) elf32_sparc_final_write_processing #define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook +#define elf_backend_reloc_type_class elf32_sparc_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_want_got_plt 0 diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c index bd89a7b..ef6e853 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, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Richard Henderson . @@ -74,6 +74,8 @@ static boolean elf64_alpha_object_p PARAMS((bfd *)); static boolean elf64_alpha_section_from_shdr PARAMS((bfd *, Elf64_Internal_Shdr *, char *)); +static boolean elf64_alpha_section_flags + PARAMS((flagword *, Elf64_Internal_Shdr *)); static boolean elf64_alpha_fake_sections PARAMS((bfd *, Elf64_Internal_Shdr *, asection *)); static boolean elf64_alpha_create_got_section @@ -133,6 +135,8 @@ static boolean elf64_alpha_merge_ind_symbols PARAMS((struct alpha_elf_link_hash_entry *, PTR)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); +static enum elf_reloc_type_class elf64_alpha_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); struct alpha_elf_link_hash_entry { @@ -166,8 +170,9 @@ struct alpha_elf_link_hash_entry int flags; - /* An additional flag. */ + /* Additional flags. */ #define ALPHA_ELF_GOT_ENTRY_RELOCS_DONE 0x10 +#define ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED 0x20 int use_count; } *got_entries; @@ -182,7 +187,10 @@ struct alpha_elf_link_hash_entry asection *srel; /* what kind of relocation? */ - unsigned long rtype; + unsigned int rtype; + + /* is this against read-only section? */ + unsigned int reltext : 1; /* how many did we find? */ unsigned long count; @@ -314,9 +322,9 @@ elf64_alpha_bfd_link_hash_table_create (abfd) bfd *abfd; { struct alpha_elf_link_hash_table *ret; + bfd_size_type amt = sizeof (struct alpha_elf_link_hash_table); - ret = ((struct alpha_elf_link_hash_table *) - bfd_zalloc (abfd, sizeof (struct alpha_elf_link_hash_table))); + ret = (struct alpha_elf_link_hash_table *) bfd_zalloc (abfd, amt); if (ret == (struct alpha_elf_link_hash_table *) NULL) return NULL; @@ -368,7 +376,8 @@ static boolean elf64_alpha_mkobject (abfd) bfd *abfd; { - abfd->tdata.any = bfd_zalloc (abfd, sizeof (struct alpha_elf_obj_tdata)); + bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) return false; return true; @@ -380,7 +389,8 @@ elf64_alpha_object_p (abfd) { /* Allocate our special target data. */ struct alpha_elf_obj_tdata *new_tdata; - new_tdata = bfd_zalloc (abfd, sizeof (struct alpha_elf_obj_tdata)); + bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); + new_tdata = bfd_zalloc (abfd, amt); if (new_tdata == NULL) return false; new_tdata->root = *abfd->tdata.elf_obj_data; @@ -394,6 +404,9 @@ elf64_alpha_object_p (abfd) from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) +#define SKIP_HOWTO(N) \ + HOWTO(N, 0, 0, 0, 0, 0, 0, elf64_alpha_reloc_bad, 0, 0, 0, 0, 0) + static reloc_howto_type elf64_alpha_howto_table[] = { HOWTO (R_ALPHA_NONE, /* type */ @@ -460,7 +473,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = /* Used for an instruction that refers to memory off the GP register. */ HOWTO (R_ALPHA_LITERAL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -481,7 +494,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = This does not actually do any relocation. */ HOWTO (R_ALPHA_LITUSE, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -541,7 +554,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = /* A hint for a jump to a register. */ HOWTO (R_ALPHA_HINT, /* type */ 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 14, /* bitsize */ true, /* pc_relative */ 0, /* bitpos */ @@ -598,99 +611,22 @@ static reloc_howto_type elf64_alpha_howto_table[] = MINUS_ONE, /* dst_mask */ true), /* pcrel_offset */ - /* Push a value on the reloc evaluation stack. */ - /* Not implemented -- it's dumb. */ - HOWTO (R_ALPHA_OP_PUSH, /* type */ - 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 */ - "OP_PUSH", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 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. */ - /* Not implemented -- it's dumb. */ - HOWTO (R_ALPHA_OP_STORE, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - elf64_alpha_reloc_bad, /* special_function */ - "OP_STORE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Subtract the reloc address from the value on the top of the - relocation stack. */ - /* Not implemented -- it's dumb. */ - HOWTO (R_ALPHA_OP_PSUB, /* type */ - 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 */ - "OP_PSUB", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* Shift the value on the top of the relocation stack right by the - given value. */ - /* Not implemented -- it's dumb. */ - HOWTO (R_ALPHA_OP_PRSHIFT, /* type */ - 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 */ - "OP_PRSHIFT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 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 */ + /* Skip 12 - 16; deprecated ECOFF relocs. */ + SKIP_HOWTO (12), + SKIP_HOWTO (13), + SKIP_HOWTO (14), + SKIP_HOWTO (15), + SKIP_HOWTO (16), /* The high 16 bits of the displacement from GP to the target. */ HOWTO (R_ALPHA_GPRELHIGH, 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - elf64_alpha_reloc_bad, /* special_function */ + 0, /* special_function */ "GPRELHIGH", /* name */ false, /* partial_inplace */ 0xffff, /* src_mask */ @@ -700,12 +636,12 @@ static reloc_howto_type elf64_alpha_howto_table[] = /* The low 16 bits of the displacement from GP to the target. */ HOWTO (R_ALPHA_GPRELLOW, 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - elf64_alpha_reloc_bad, /* special_function */ + 0, /* special_function */ "GPRELLOW", /* name */ false, /* partial_inplace */ 0xffff, /* src_mask */ @@ -713,89 +649,25 @@ static reloc_howto_type elf64_alpha_howto_table[] = false), /* pcrel_offset */ /* A 16-bit displacement from the GP to the target. */ - /* XXX: Not implemented. */ - HOWTO (R_ALPHA_IMMED_GP_16, + HOWTO (R_ALPHA_GPREL16, 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ - "IMMED_GP_16", /* name */ + "GPREL16", /* name */ false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* 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 */ + /* Skip 20 - 23; deprecated ECOFF relocs. */ + SKIP_HOWTO (20), + SKIP_HOWTO (21), + SKIP_HOWTO (22), + SKIP_HOWTO (23), /* Misc ELF relocations. */ @@ -934,8 +806,8 @@ elf64_alpha_do_reloc_gpdisp (abfd, gpdisp, p_ldah, p_lda) | (((gpdisp >> 16) + ((gpdisp >> 15) & 1)) & 0xffff)); i_lda = (i_lda & 0xffff0000) | (gpdisp & 0xffff); - bfd_put_32 (abfd, i_ldah, p_ldah); - bfd_put_32 (abfd, i_lda, p_lda); + bfd_put_32 (abfd, (bfd_vma) i_ldah, p_ldah); + bfd_put_32 (abfd, (bfd_vma) i_lda, p_lda); return ret; } @@ -998,30 +870,22 @@ struct elf_reloc_map static const struct elf_reloc_map elf64_alpha_reloc_map[] = { - {BFD_RELOC_NONE, R_ALPHA_NONE}, - {BFD_RELOC_32, R_ALPHA_REFLONG}, - {BFD_RELOC_64, R_ALPHA_REFQUAD}, - {BFD_RELOC_CTOR, R_ALPHA_REFQUAD}, - {BFD_RELOC_GPREL32, R_ALPHA_GPREL32}, - {BFD_RELOC_ALPHA_ELF_LITERAL, R_ALPHA_LITERAL}, - {BFD_RELOC_ALPHA_LITUSE, R_ALPHA_LITUSE}, - {BFD_RELOC_ALPHA_GPDISP, R_ALPHA_GPDISP}, - {BFD_RELOC_23_PCREL_S2, R_ALPHA_BRADDR}, - {BFD_RELOC_ALPHA_HINT, R_ALPHA_HINT}, - {BFD_RELOC_16_PCREL, R_ALPHA_SREL16}, - {BFD_RELOC_32_PCREL, R_ALPHA_SREL32}, - {BFD_RELOC_64_PCREL, R_ALPHA_SREL64}, - -/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process - the explicit !!sequence relocations, and are mapped into the normal - relocations at the end of processing. */ - {BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL}, - {BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE}, - {BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE}, - {BFD_RELOC_ALPHA_USER_LITUSE_JSR, R_ALPHA_LITUSE}, - {BFD_RELOC_ALPHA_USER_GPDISP, R_ALPHA_GPDISP}, - {BFD_RELOC_ALPHA_USER_GPRELHIGH, R_ALPHA_GPRELHIGH}, - {BFD_RELOC_ALPHA_USER_GPRELLOW, R_ALPHA_GPRELLOW}, + {BFD_RELOC_NONE, R_ALPHA_NONE}, + {BFD_RELOC_32, R_ALPHA_REFLONG}, + {BFD_RELOC_64, R_ALPHA_REFQUAD}, + {BFD_RELOC_CTOR, R_ALPHA_REFQUAD}, + {BFD_RELOC_GPREL32, R_ALPHA_GPREL32}, + {BFD_RELOC_ALPHA_ELF_LITERAL, R_ALPHA_LITERAL}, + {BFD_RELOC_ALPHA_LITUSE, R_ALPHA_LITUSE}, + {BFD_RELOC_ALPHA_GPDISP, R_ALPHA_GPDISP}, + {BFD_RELOC_23_PCREL_S2, R_ALPHA_BRADDR}, + {BFD_RELOC_ALPHA_HINT, R_ALPHA_HINT}, + {BFD_RELOC_16_PCREL, R_ALPHA_SREL16}, + {BFD_RELOC_32_PCREL, R_ALPHA_SREL32}, + {BFD_RELOC_64_PCREL, R_ALPHA_SREL64}, + {BFD_RELOC_ALPHA_GPREL_HI16, R_ALPHA_GPRELHIGH}, + {BFD_RELOC_ALPHA_GPREL_LO16, R_ALPHA_GPRELLOW}, + {BFD_RELOC_GPREL16, R_ALPHA_GPREL16}, }; /* Given a BFD reloc type, return a HOWTO structure. */ @@ -1077,7 +941,7 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst) #define OP_LDQ 0x29 #define OP_BR 0x30 #define OP_BSR 0x34 -#define INSN_UNOP 0x2fe00000 +#define INSN_UNOP 0x2ffe0000 struct alpha_relax_info { @@ -1119,7 +983,8 @@ elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type) { while (rel < relend) { - if (rel->r_offset == offset && ELF64_R_TYPE (rel->r_info) == type) + if (rel->r_offset == offset + && ELF64_R_TYPE (rel->r_info) == (unsigned int) type) return rel; ++rel; } @@ -1146,8 +1011,8 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) { ((*_bfd_error_handler) ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", - bfd_get_filename (info->abfd), info->sec->name, - (unsigned long)irel->r_offset)); + bfd_archive_filename (info->abfd), info->sec->name, + (unsigned long) irel->r_offset)); return irel; } @@ -1156,7 +1021,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) { if (ELF64_R_TYPE (urel->r_info) != R_ALPHA_LITUSE) break; - if (urel->r_addend >= 0 && urel->r_addend <= 3) + if (urel->r_addend <= 3) flags |= 1 << urel->r_addend; } @@ -1199,11 +1064,12 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) register from the literal insn. Leave the offset alone. */ insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000); urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GPRELLOW); + R_ALPHA_GPREL16); urel->r_addend = irel->r_addend; info->changed_relocs = true; - bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset); + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); info->changed_contents = true; } @@ -1215,7 +1081,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELHIGH); lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000); - bfd_put_32 (info->abfd, lit_insn, + bfd_put_32 (info->abfd, (bfd_vma) lit_insn, info->contents + irel->r_offset); lit_reused = true; info->changed_contents = true; @@ -1235,13 +1101,15 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) /* FIXME: sanity check the insn for byte op. Check that the literal dest reg is indeed Rb in the byte insn. */ - insn = (insn & ~0x001ff000) | ((symval & 7) << 13) | 0x1000; + insn &= ~ (unsigned) 0x001ff000; + insn |= ((symval & 7) << 13) | 0x1000; urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); urel->r_addend = 0; info->changed_relocs = true; - bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset); + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); info->changed_contents = true; break; @@ -1274,7 +1142,8 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) else all_optimized = false; - bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset); + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); /* Kill any HINT reloc that might exist for this insn. */ xrel = (elf64_alpha_find_reloc_at_ofs @@ -1289,14 +1158,36 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) else all_optimized = false; - /* ??? If target gp == current gp we can eliminate the gp reload. - This does depend on every place a gp could be reloaded will - be, which currently happens for all code produced by gcc, but - not necessarily by hand-coded assembly, or if sibling calls - are enabled in gcc. - - Perhaps conditionalize this on a flag being set in the target - object file's header, and have gcc set it? */ + /* Even if the target is not in range for a direct branch, + if we share a GP, we can eliminate the gp reload. */ + if (optdest) + { + Elf_Internal_Rela *gpdisp + = (elf64_alpha_find_reloc_at_ofs + (irel, irelend, urel->r_offset + 4, R_ALPHA_GPDISP)); + if (gpdisp) + { + bfd_byte *p_ldah = info->contents + gpdisp->r_offset; + bfd_byte *p_lda = p_ldah + gpdisp->r_addend; + unsigned int ldah = bfd_get_32 (info->abfd, p_ldah); + unsigned int lda = bfd_get_32 (info->abfd, p_lda); + + /* Verify that the instruction is "ldah $29,0($26)". + Consider a function that ends in a noreturn call, + and that the next function begins with an ldgp, + and that by accident there is no padding between. + In that case the insn would use $27 as the base. */ + if (ldah == 0x27ba0000 && lda == 0x23bd0000) + { + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_ldah); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_lda); + + gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + info->changed_contents = true; + info->changed_relocs = true; + } + } + } } break; } @@ -1320,7 +1211,8 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); info->changed_relocs = true; - bfd_put_32 (info->abfd, INSN_UNOP, info->contents + irel->r_offset); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, + info->contents + irel->r_offset); info->changed_contents = true; } } @@ -1416,7 +1308,7 @@ elf64_alpha_relax_without_lituse (info, symval, irel) { ((*_bfd_error_handler) ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", - bfd_get_filename (info->abfd), info->sec->name, + bfd_archive_filename (info->abfd), info->sec->name, (unsigned long) irel->r_offset)); return true; } @@ -1433,10 +1325,10 @@ elf64_alpha_relax_without_lituse (info, symval, irel) `ldq R,X(gp)' for `lda R,Y(gp)'. */ insn = (OP_LDA << 26) | (insn & 0x03ff0000); - bfd_put_32 (info->abfd, insn, info->contents + irel->r_offset); + bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); info->changed_contents = true; - irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELLOW); + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPREL16); info->changed_relocs = true; /* Reduce the use count on this got entry by one, possibly @@ -1470,12 +1362,14 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *free_contents = NULL; Elf64_External_Sym *extsyms = NULL; Elf64_External_Sym *free_extsyms = NULL; + Elf_External_Sym_Shndx *shndx_buf = NULL; struct alpha_elf_got_entry **local_got_entries; struct alpha_relax_info info; @@ -1556,18 +1450,33 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* Read this BFD's symbols if we haven't done so already. */ if (extsyms == NULL) { + bfd_size_type amt; + if (symtab_hdr->contents != NULL) extsyms = (Elf64_External_Sym *) symtab_hdr->contents; else { - extsyms = ((Elf64_External_Sym *) - bfd_malloc (symtab_hdr->sh_size)); + amt = symtab_hdr->sh_info; + amt *= sizeof (Elf64_External_Sym); + extsyms = (Elf64_External_Sym *) bfd_malloc (amt); if (extsyms == NULL) goto error_return; free_extsyms = extsyms; if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) - != symtab_hdr->sh_size)) + || bfd_bread ((PTR) extsyms, amt, abfd) != amt) + goto error_return; + } + + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (shndx_hdr->sh_size != 0) + { + amt = symtab_hdr->sh_info; + amt *= sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL) + goto error_return; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) goto error_return; } } @@ -1576,19 +1485,20 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) { /* A local symbol. */ - bfd_elf64_swap_symbol_in (abfd, - extsyms + ELF64_R_SYM (irel->r_info), - &isym); + Elf64_External_Sym *esym; + Elf_External_Sym_Shndx *shndx; + + esym = extsyms + ELF64_R_SYM (irel->r_info); + shndx = shndx_buf + (shndx_buf ? ELF64_R_SYM (irel->r_info) : 0); + bfd_elf64_swap_symbol_in (abfd, esym, shndx, &isym); if (isym.st_shndx == SHN_UNDEF) info.tsec = bfd_und_section_ptr; - else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE) - info.tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); else if (isym.st_shndx == SHN_ABS) info.tsec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) info.tsec = bfd_com_section_ptr; else - continue; /* who knows. */ + info.tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); info.h = NULL; info.other = isym.st_other; @@ -1615,7 +1525,6 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) continue; info.h = h; - info.gotent = gotent; info.tsec = h->root.root.u.def.section; info.other = h->root.other; gotent = h->got_entries; @@ -1676,6 +1585,9 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) } } + if (shndx_buf != NULL) + free (shndx_buf); + if (free_extsyms != NULL) { if (! link_info->keep_memory) @@ -1683,7 +1595,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } } @@ -1696,6 +1608,8 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) free (free_relocs); if (free_contents != NULL) free (free_contents); + if (shndx_buf != NULL) + free (shndx_buf); if (free_extsyms != NULL) free (free_extsyms); return false; @@ -1703,10 +1617,10 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* PLT/GOT Stuff */ #define PLT_HEADER_SIZE 32 -#define PLT_HEADER_WORD1 0xc3600000 /* br $27,.+4 */ -#define PLT_HEADER_WORD2 0xa77b000c /* ldq $27,12($27) */ -#define PLT_HEADER_WORD3 0x47ff041f /* nop */ -#define PLT_HEADER_WORD4 0x6b7b0000 /* jmp $27,($27) */ +#define PLT_HEADER_WORD1 (bfd_vma) 0xc3600000 /* br $27,.+4 */ +#define PLT_HEADER_WORD2 (bfd_vma) 0xa77b000c /* ldq $27,12($27) */ +#define PLT_HEADER_WORD3 (bfd_vma) 0x47ff041f /* nop */ +#define PLT_HEADER_WORD4 (bfd_vma) 0x6b7b0000 /* jmp $27,($27) */ #define PLT_ENTRY_SIZE 12 #define PLT_ENTRY_WORD1 0xc3800000 /* br $28, plt0 */ @@ -1741,13 +1655,6 @@ elf64_alpha_section_from_shdr (abfd, hdr, name) if (strcmp (name, ".mdebug") != 0) return false; break; -#ifdef ERIC_neverdef - case SHT_ALPHA_REGINFO: - if (strcmp (name, ".reginfo") != 0 - || hdr->sh_size != sizeof (Elf64_External_RegInfo)) - return false; - break; -#endif default: return false; } @@ -1764,22 +1671,18 @@ elf64_alpha_section_from_shdr (abfd, hdr, name) return false; } -#ifdef ERIC_neverdef - /* For a .reginfo section, set the gp value in the tdata information - from the contents of this section. We need the gp value while - processing relocs, so we just get it now. */ - if (hdr->sh_type == SHT_ALPHA_REGINFO) - { - Elf64_External_RegInfo ext; - Elf64_RegInfo s; + return true; +} - if (! bfd_get_section_contents (abfd, newsect, (PTR) &ext, - (file_ptr) 0, sizeof ext)) - return false; - bfd_alpha_elf64_swap_reginfo_in (abfd, &ext, &s); - elf_gp (abfd) = s.ri_gp_value; - } -#endif +/* Convert Alpha specific section flags to bfd internal section flags. */ + +static boolean +elf64_alpha_section_flags (flags, hdr) + flagword *flags; + Elf64_Internal_Shdr *hdr; +{ + if (hdr->sh_flags & SHF_ALPHA_GPREL) + *flags |= SEC_SMALL_DATA; return true; } @@ -1807,31 +1710,8 @@ elf64_alpha_fake_sections (abfd, hdr, sec) else hdr->sh_entsize = 1; } -#ifdef ERIC_neverdef - else if (strcmp (name, ".reginfo") == 0) - { - hdr->sh_type = SHT_ALPHA_REGINFO; - /* In a shared object on Irix 5.3, the .reginfo section has an - entsize of 0x18. FIXME: Does this matter? */ - if ((abfd->flags & DYNAMIC) != 0) - hdr->sh_entsize = sizeof (Elf64_External_RegInfo); - else - hdr->sh_entsize = 1; - - /* Force the section size to the correct value, even if the - linker thinks it is larger. The link routine below will only - write out this much data for .reginfo. */ - hdr->sh_size = sec->_raw_size = sizeof (Elf64_External_RegInfo); - } - else if (strcmp (name, ".hash") == 0 - || strcmp (name, ".dynamic") == 0 - || strcmp (name, ".dynstr") == 0) - { - hdr->sh_entsize = 0; - hdr->sh_info = SIZEOF_ALPHA_DYNSYM_SECNAMES; - } -#endif - else if (strcmp (name, ".sdata") == 0 + else if ((sec->flags & SEC_SMALL_DATA) + || strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0 || strcmp (name, ".lit4") == 0 || strcmp (name, ".lit8") == 0) @@ -1855,7 +1735,7 @@ elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sbss. */ @@ -2008,7 +1888,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; memset (debug, 0, sizeof (*debug)); - ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size); + ext_hdr = (char *) bfd_malloc (swap->external_hdr_size); if (ext_hdr == NULL && swap->external_hdr_size != 0) goto error_return; @@ -2027,12 +1907,12 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) debug->ptr = NULL; \ else \ { \ - debug->ptr = (type) bfd_malloc ((size_t) (size * symhdr->count)); \ + bfd_size_type amt = (bfd_size_type) size * symhdr->count; \ + debug->ptr = (type) bfd_malloc (amt); \ if (debug->ptr == NULL) \ goto error_return; \ if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ - || (bfd_read (debug->ptr, size, symhdr->count, \ - abfd) != size * symhdr->count)) \ + || bfd_bread (debug->ptr, amt, abfd) != amt) \ goto error_return; \ } @@ -2145,9 +2025,9 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, char *fraw_src; char *fraw_end; struct fdr *fdr_ptr; + bfd_size_type amt = sizeof (struct mips_elf_find_line); - fi = ((struct mips_elf_find_line *) - bfd_zalloc (abfd, sizeof (struct mips_elf_find_line))); + fi = (struct mips_elf_find_line *) bfd_zalloc (abfd, amt); if (fi == NULL) { msec->flags = origflags; @@ -2161,10 +2041,8 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, } /* Swap in the FDR information. */ - fi->d.fdr = ((struct fdr *) - bfd_alloc (abfd, - (fi->d.symbolic_header.ifdMax * - sizeof (struct fdr)))); + amt = fi->d.symbolic_header.ifdMax * sizeof (struct fdr); + fi->d.fdr = (struct fdr *) bfd_alloc (abfd, amt); if (fi->d.fdr == NULL) { msec->flags = origflags; @@ -2335,9 +2213,6 @@ elf64_alpha_output_extsym (h, data) else h->esym.asym.value = 0; } -#if 0 /* FIXME? */ - h->esym.ifd = 0; -#endif } if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap, @@ -2379,6 +2254,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) struct alpha_elf_got_entry **local_got_entries; const Elf_Internal_Rela *rel, *relend; int got_created; + bfd_size_type amt; if (info->relocateable) return true; @@ -2432,9 +2308,9 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) if (!gotent) { + amt = sizeof (struct alpha_elf_got_entry); gotent = ((struct alpha_elf_got_entry *) - bfd_alloc (abfd, - sizeof (struct alpha_elf_got_entry))); + bfd_alloc (abfd, amt)); if (!gotent) return false; @@ -2457,16 +2333,16 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) /* This is a local .got entry -- record for merge. */ if (!local_got_entries) { - size_t size; - size = (symtab_hdr->sh_info - * sizeof (struct alpha_elf_got_entry *)); + bfd_size_type size; + size = symtab_hdr->sh_info; + size *= sizeof (struct alpha_elf_got_entry *); local_got_entries = ((struct alpha_elf_got_entry **) bfd_alloc (abfd, size)); if (!local_got_entries) return false; - memset (local_got_entries, 0, size); + memset (local_got_entries, 0, (size_t) size); alpha_elf_tdata (abfd)->local_got_entries = local_got_entries; } @@ -2477,9 +2353,9 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) continue; if (!gotent) { + amt = sizeof (struct alpha_elf_got_entry); gotent = ((struct alpha_elf_got_entry *) - bfd_alloc (abfd, - sizeof (struct alpha_elf_got_entry))); + bfd_alloc (abfd, amt)); if (!gotent) return false; @@ -2534,6 +2410,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) /* FALLTHRU */ case R_ALPHA_GPDISP: + case R_ALPHA_GPREL16: case R_ALPHA_GPREL32: case R_ALPHA_GPRELHIGH: case R_ALPHA_GPRELLOW: @@ -2586,15 +2463,15 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) sreloc = bfd_get_section_by_name (dynobj, rel_sec_name); if (sreloc == NULL) { + flagword flags; + sreloc = bfd_make_section (dynobj, rel_sec_name); + flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED | SEC_READONLY); + if (sec->flags & SEC_ALLOC) + flags |= SEC_ALLOC | SEC_LOAD; if (sreloc == NULL - || !bfd_set_section_flags (dynobj, sreloc, - ((sec->flags & (SEC_ALLOC - | SEC_LOAD)) - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) + || !bfd_set_section_flags (dynobj, sreloc, flags) || !bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } @@ -2616,15 +2493,16 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) if (!rent) { - rent = ((struct alpha_elf_reloc_entry *) - bfd_alloc (abfd, - sizeof (struct alpha_elf_reloc_entry))); + amt = sizeof (struct alpha_elf_reloc_entry); + rent = (struct alpha_elf_reloc_entry *) bfd_alloc (abfd, amt); if (!rent) return false; rent->srel = sreloc; rent->rtype = r_type; rent->count = 1; + rent->reltext = ((sec->flags & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC)); rent->next = h->reloc_entries; h->reloc_entries = rent; @@ -2637,6 +2515,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) /* If this is a shared library, and the section is to be loaded into memory, we need a RELATIVE reloc. */ sreloc->_raw_size += sizeof (Elf64_External_Rela); + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } break; } @@ -2666,8 +2546,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) /* Now that we've seen all of the input symbols, finalize our decision about whether this symbol should get a .plt entry. */ - if (h->root.type != bfd_link_hash_undefweak - && alpha_elf_dynamic_symbol_p (h, info) + if (alpha_elf_dynamic_symbol_p (h, info) && ((h->type == STT_FUNC && !(ah->flags & ALPHA_ELF_LINK_HASH_LU_ADDR)) || (h->type == STT_NOTYPE @@ -2961,7 +2840,7 @@ elf64_alpha_merge_gots (a, b) static boolean elf64_alpha_calc_got_offsets_for_symbol (h, arg) struct alpha_elf_link_hash_entry *h; - PTR arg; + PTR arg ATTRIBUTE_UNUSED; { struct alpha_elf_got_entry *gotent; @@ -3027,10 +2906,10 @@ elf64_alpha_calc_got_offsets (info) static boolean elf64_alpha_size_got_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - bfd *i, *got_list, *cur_got_obj; + bfd *i, *got_list, *cur_got_obj = NULL; int something_changed = 0; got_list = alpha_elf_hash_table (info)->got_list; @@ -3053,7 +2932,7 @@ elf64_alpha_size_got_sections (output_bfd, info) /* Yikes! A single object file has too many entries. */ (*_bfd_error_handler) (_("%s: .got subsegment exceeds 64K (size %d)"), - bfd_get_filename (i), + bfd_archive_filename (i), alpha_elf_tdata (this_got)->total_got_entries * 8); return false; } @@ -3179,6 +3058,8 @@ elf64_alpha_calc_dynrel_sizes (h, info) { relent->srel->_raw_size += sizeof (Elf64_External_Rela) * relent->count; + if (relent->reltext) + info->flags |= DT_TEXTREL; } dynobj = elf_hash_table(info)->dynobj; @@ -3207,12 +3088,11 @@ elf64_alpha_calc_dynrel_sizes (h, info) static boolean elf64_alpha_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table(info)->dynobj; @@ -3261,7 +3141,6 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -3291,19 +3170,6 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) if (!strip) { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - if (strcmp(name, ".rela.plt") == 0) relplt = true; @@ -3323,7 +3189,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) else { /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc(dynobj, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -3336,36 +3202,38 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + if (!info->shared) { - if (!bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } - if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0)) return false; if (relplt) { - if (! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } - if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, - sizeof (Elf64_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { - if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } +#undef add_dynamic_entry return true; } @@ -3390,6 +3258,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec, *sgot, *srel, *srelgot; bfd *dynobj, *gotobj; bfd_vma gp; + boolean ret_val = true; srelgot = srel = NULL; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -3474,9 +3343,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); } else { @@ -3491,33 +3358,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, { sec = h->root.root.u.def.section; -#if rth_notdef - if ((r_type == R_ALPHA_LITERAL - && elf_hash_table(info)->dynamic_sections_created - && (!info->shared - || !info->symbolic - || !(h->root.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) - || (info->shared - && (!info->symbolic - || !(h->root.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR)) - && (input_section->flags & SEC_ALLOC) - && (r_type == R_ALPHA_REFLONG - || r_type == R_ALPHA_REFQUAD - || r_type == R_ALPHA_LITERAL))) - { - /* In these cases, we don't need the relocation value. - We check specially because in some obscure cases - sec->output_section will be NULL. */ - relocation = 0; - } -#else - /* FIXME: Are not these obscure cases simply bugs? Let's - get something working and come back to this. */ if (sec->output_section == NULL) relocation = 0; -#endif /* rth_notdef */ else { relocation = (h->root.root.u.def.value @@ -3527,7 +3369,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) relocation = 0; @@ -3538,7 +3381,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, input_section, rel->r_offset, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->root.other))))) - return false; + ret_val = false; relocation = 0; } } @@ -3564,13 +3407,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } break; - case R_ALPHA_OP_PUSH: - case R_ALPHA_OP_STORE: - case R_ALPHA_OP_PSUB: - case R_ALPHA_OP_PRSHIFT: - /* We hate these silly beasts. */ - abort (); - case R_ALPHA_LITERAL: { struct alpha_elf_got_entry *gotent; @@ -3589,6 +3425,38 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, gotent = (alpha_elf_tdata(input_bfd)-> local_got_entries[r_symndx]); dynamic_symbol = false; + + /* Need to adjust local GOT entries' addends for SEC_MERGE + unless it has been done already. */ + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION + && (elf_section_data (sec)->sec_info_type + == ELF_INFO_TYPE_MERGE) + && (gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED) == 0) + { + struct alpha_elf_got_entry *ent; + asection *msec; + + for (ent = gotent; ent; ent = ent->next) + { + ent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED; + if (ent->use_count == 0) + continue; + msec = sec; + ent->addend = + _bfd_merged_section_offset (output_bfd, &msec, + elf_section_data (sec)-> + sec_info, + sym->st_value + + ent->addend, + (bfd_vma) 0); + ent->addend -= sym->st_value; + ent->addend += msec->output_section->vma + + msec->output_offset + - sec->output_section->vma + - sec->output_offset; + } + } } BFD_ASSERT(gotent != NULL); @@ -3601,7 +3469,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* Initialize the .got entry's value. */ if (!(gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_DONE)) { - bfd_put_64 (output_bfd, relocation+addend, + bfd_put_64 (output_bfd, relocation + addend, sgot->contents + gotent->got_offset); /* If the symbol has been forced local, output a @@ -3617,7 +3485,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, + sgot->output_offset + gotent->got_offset); outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = 0; + outrel.r_addend = relocation + addend; bfd_elf64_swap_reloca_out (output_bfd, &outrel, ((Elf64_External_Rela *) @@ -3641,13 +3509,28 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* overflow handled by _bfd_final_link_relocate */ goto default_reloc; + case R_ALPHA_GPREL16: case R_ALPHA_GPREL32: case R_ALPHA_GPRELLOW: + if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + { + (*_bfd_error_handler) + (_("%s: gp-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } BFD_ASSERT(gp != 0); relocation -= gp; goto default_reloc; case R_ALPHA_GPRELHIGH: + if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + { + (*_bfd_error_handler) + (_("%s: gp-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } BFD_ASSERT(gp != 0); relocation -= gp; relocation += addend; @@ -3656,8 +3539,17 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, + ((relocation >> 15) & 1)); goto default_reloc; - case R_ALPHA_BRADDR: case R_ALPHA_HINT: + /* A call to a dynamic symbol is definitely out of range of + the 16-bit displacement. Don't bother writing anything. */ + if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + { + r = bfd_reloc_ok; + break; + } + /* FALLTHRU */ + + case R_ALPHA_BRADDR: /* The regular PC-relative stuff measures from the start of the instruction rather than the end. */ addend -= 4; @@ -3667,7 +3559,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, case R_ALPHA_REFQUAD: { Elf_Internal_Rela outrel; - boolean skip; /* Careful here to remember RELATIVE relocations for global variables for symbolic shared objects. */ @@ -3679,10 +3570,12 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, outrel.r_addend = addend; addend = 0, relocation = 0; } - else if (info->shared && (input_section->flags & SEC_ALLOC)) + else if (info->shared + && r_symndx != 0 + && (input_section->flags & SEC_ALLOC)) { outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = 0; + outrel.r_addend = relocation + addend; } else goto default_reloc; @@ -3700,25 +3593,10 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT(srel != NULL); } - skip = false; - - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } - - if (! skip) + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset != (bfd_vma) -1) outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); else @@ -3750,6 +3628,15 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, { const char *name; + /* Don't warn if the overflow is due to pc relative reloc + against discarded section. Section optimization code should + handle it. */ + + if (r_symndx < symtab_hdr->sh_info + && sec != NULL && howto->pc_relative + && elf_discarded_section (sec)) + break; + if (h != NULL) name = h->root.root.root.string; else @@ -3764,7 +3651,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + ret_val = false; } break; @@ -3774,7 +3661,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } } - return true; + return ret_val; } /* Finish up dynamic symbol handling. We set the contents of various @@ -3823,7 +3710,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) /* Fill in the entry in the procedure linkage table. */ { - unsigned insn1, insn2, insn3; + bfd_vma insn1, insn2, insn3; insn1 = PLT_ENTRY_WORD1 | ((-(h->plt.offset + 4) >> 2) & 0x1fffff); insn2 = PLT_ENTRY_WORD2; @@ -3875,7 +3762,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) + sgot->output_offset + gotent->got_offset); outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = 0; + outrel.r_addend = plt_addr; bfd_elf64_swap_reloca_out (output_bfd, &outrel, ((Elf64_External_Rela *) @@ -4009,8 +3896,8 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info) bfd_put_32 (output_bfd, PLT_HEADER_WORD4, splt->contents + 12); /* The next two words will be filled in by ld.so */ - bfd_put_64 (output_bfd, 0, splt->contents + 16); - bfd_put_64 (output_bfd, 0, splt->contents + 24); + bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 16); + bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 24); elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_HEADER_SIZE; @@ -4020,9 +3907,9 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info) return true; } -/* We need to use a special link routine to handle the .reginfo and - the .mdebug sections. We need to merge all instances of these - sections together, not write them all out sequentially. */ +/* We need to use a special link routine to handle the .mdebug section. + We need to merge all instances of these sections together, not write + them all out sequentially. */ static boolean elf64_alpha_final_link (abfd, info) @@ -4031,96 +3918,17 @@ elf64_alpha_final_link (abfd, info) { asection *o; struct bfd_link_order *p; - asection *reginfo_sec, *mdebug_sec, *gptab_data_sec, *gptab_bss_sec; + asection *mdebug_sec; struct ecoff_debug_info debug; const struct ecoff_debug_swap *swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; HDRR *symhdr = &debug.symbolic_header; PTR mdebug_handle = NULL; -#if 0 - if (++ngots == 2) - { - (*info->callbacks->warning) - (info, _("using multiple gp values"), (char *) NULL, - output_bfd, (asection *) NULL, (bfd_vma) 0); - } -#endif - - /* Go through the sections and collect the .reginfo and .mdebug - information. */ - reginfo_sec = NULL; + /* Go through the sections and collect the mdebug information. */ mdebug_sec = NULL; - gptab_data_sec = NULL; - gptab_bss_sec = NULL; for (o = abfd->sections; o != (asection *) NULL; o = o->next) { -#ifdef ERIC_neverdef - if (strcmp (o->name, ".reginfo") == 0) - { - memset (®info, 0, sizeof reginfo); - - /* We have found the .reginfo section in the output file. - Look through all the link_orders comprising it and merge - the information together. */ - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - Elf64_External_RegInfo ext; - Elf64_RegInfo sub; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - /* The linker emulation code has probably clobbered the - size to be zero bytes. */ - if (input_section->_raw_size == 0) - input_section->_raw_size = sizeof (Elf64_External_RegInfo); - - if (! bfd_get_section_contents (input_bfd, input_section, - (PTR) &ext, - (file_ptr) 0, - sizeof ext)) - return false; - - bfd_alpha_elf64_swap_reginfo_in (input_bfd, &ext, &sub); - - reginfo.ri_gprmask |= sub.ri_gprmask; - reginfo.ri_cprmask[0] |= sub.ri_cprmask[0]; - reginfo.ri_cprmask[1] |= sub.ri_cprmask[1]; - reginfo.ri_cprmask[2] |= sub.ri_cprmask[2]; - reginfo.ri_cprmask[3] |= sub.ri_cprmask[3]; - - /* ri_gp_value is set by the function - alpha_elf_section_processing when the section is - finally written out. */ - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* Force the section size to the value we want. */ - o->_raw_size = sizeof (Elf64_External_RegInfo); - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - reginfo_sec = o; - } -#endif - if (strcmp (o->name, ".mdebug") == 0) { struct extsym_info einfo; @@ -4166,7 +3974,7 @@ elf64_alpha_final_link (abfd, info) { asection *s; EXTR esym; - bfd_vma last; + bfd_vma last = 0; unsigned int i; static const char * const name[] = { @@ -4307,31 +4115,6 @@ elf64_alpha_final_link (abfd, info) input_section->flags &=~ SEC_HAS_CONTENTS; } -#ifdef ERIC_neverdef - if (info->shared) - { - /* Create .rtproc section. */ - rtproc_sec = bfd_get_section_by_name (abfd, ".rtproc"); - if (rtproc_sec == NULL) - { - flagword flags = (SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY); - - rtproc_sec = bfd_make_section (abfd, ".rtproc"); - if (rtproc_sec == NULL - || ! bfd_set_section_flags (abfd, rtproc_sec, flags) - || ! bfd_set_section_alignment (abfd, rtproc_sec, 12)) - return false; - } - - if (! alpha_elf_create_procedure_table (mdebug_handle, abfd, - info, rtproc_sec, &debug)) - return false; - } -#endif - /* Build the external symbol information. */ einfo.abfd = abfd; einfo.info = info; @@ -4353,229 +4136,6 @@ elf64_alpha_final_link (abfd, info) mdebug_sec = o; } - -#ifdef ERIC_neverdef - if (strncmp (o->name, ".gptab.", sizeof ".gptab." - 1) == 0) - { - const char *subname; - unsigned int c; - Elf64_gptab *tab; - Elf64_External_gptab *ext_tab; - unsigned int i; - - /* The .gptab.sdata and .gptab.sbss sections hold - information describing how the small data area would - change depending upon the -G switch. These sections - not used in executables files. */ - if (! info->relocateable) - { - asection **secpp; - - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* Skip this section later on (I don't think this - currently matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - /* Really remove the section. */ - for (secpp = &abfd->sections; - *secpp != o; - secpp = &(*secpp)->next) - ; - *secpp = (*secpp)->next; - --abfd->section_count; - - continue; - } - - /* There is one gptab for initialized data, and one for - uninitialized data. */ - if (strcmp (o->name, ".gptab.sdata") == 0) - gptab_data_sec = o; - else if (strcmp (o->name, ".gptab.sbss") == 0) - gptab_bss_sec = o; - else - { - (*_bfd_error_handler) - (_("%s: illegal section name `%s'"), - bfd_get_filename (abfd), o->name); - bfd_set_error (bfd_error_nonrepresentable_section); - return false; - } - - /* The linker script always combines .gptab.data and - .gptab.sdata into .gptab.sdata, and likewise for - .gptab.bss and .gptab.sbss. It is possible that there is - no .sdata or .sbss section in the output file, in which - case we must change the name of the output section. */ - subname = o->name + sizeof ".gptab" - 1; - if (bfd_get_section_by_name (abfd, subname) == NULL) - { - if (o == gptab_data_sec) - o->name = ".gptab.data"; - else - o->name = ".gptab.bss"; - subname = o->name + sizeof ".gptab" - 1; - BFD_ASSERT (bfd_get_section_by_name (abfd, subname) != NULL); - } - - /* Set up the first entry. */ - c = 1; - tab = (Elf64_gptab *) bfd_malloc (c * sizeof (Elf64_gptab)); - if (tab == NULL) - return false; - tab[0].gt_header.gt_current_g_value = elf_gp_size (abfd); - tab[0].gt_header.gt_unused = 0; - - /* Combine the input sections. */ - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - bfd_size_type size; - unsigned long last; - bfd_size_type gpentry; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - /* Combine the gptab entries for this input section one - by one. We know that the input gptab entries are - sorted by ascending -G value. */ - size = bfd_section_size (input_bfd, input_section); - last = 0; - for (gpentry = sizeof (Elf64_External_gptab); - gpentry < size; - gpentry += sizeof (Elf64_External_gptab)) - { - Elf64_External_gptab ext_gptab; - Elf64_gptab int_gptab; - unsigned long val; - unsigned long add; - boolean exact; - unsigned int look; - - if (! (bfd_get_section_contents - (input_bfd, input_section, (PTR) &ext_gptab, - gpentry, sizeof (Elf64_External_gptab)))) - { - free (tab); - return false; - } - - bfd_alpha_elf64_swap_gptab_in (input_bfd, &ext_gptab, - &int_gptab); - val = int_gptab.gt_entry.gt_g_value; - add = int_gptab.gt_entry.gt_bytes - last; - - exact = false; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value >= val) - tab[look].gt_entry.gt_bytes += add; - - if (tab[look].gt_entry.gt_g_value == val) - exact = true; - } - - if (! exact) - { - Elf64_gptab *new_tab; - unsigned int max; - - /* We need a new table entry. */ - new_tab = ((Elf64_gptab *) - bfd_realloc ((PTR) tab, - (c + 1) * sizeof (Elf64_gptab))); - if (new_tab == NULL) - { - free (tab); - return false; - } - tab = new_tab; - tab[c].gt_entry.gt_g_value = val; - tab[c].gt_entry.gt_bytes = add; - - /* Merge in the size for the next smallest -G - value, since that will be implied by this new - value. */ - max = 0; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value < val - && (max == 0 - || (tab[look].gt_entry.gt_g_value - > tab[max].gt_entry.gt_g_value))) - max = look; - } - if (max != 0) - tab[c].gt_entry.gt_bytes += - tab[max].gt_entry.gt_bytes; - - ++c; - } - - last = int_gptab.gt_entry.gt_bytes; - } - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* The table must be sorted by -G value. */ - if (c > 2) - qsort (tab + 1, c - 1, sizeof (tab[0]), gptab_compare); - - /* Swap out the table. */ - ext_tab = ((Elf64_External_gptab *) - bfd_alloc (abfd, c * sizeof (Elf64_External_gptab))); - if (ext_tab == NULL) - { - free (tab); - return false; - } - - for (i = 0; i < c; i++) - bfd_alpha_elf64_swap_gptab_out (abfd, tab + i, ext_tab + i); - free (tab); - - o->_raw_size = c * sizeof (Elf64_External_gptab); - o->contents = (bfd_byte *) ext_tab; - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - } -#endif - } /* Invoke the regular ELF backend linker to do all the work. */ @@ -4599,24 +4159,13 @@ elf64_alpha_final_link (abfd, info) sgot = alpha_elf_tdata(i)->got; if (! bfd_set_section_contents (abfd, sgot->output_section, - sgot->contents, sgot->output_offset, + sgot->contents, + (file_ptr) sgot->output_offset, sgot->_raw_size)) return false; } } -#ifdef ERIC_neverdef - if (reginfo_sec != (asection *) NULL) - { - Elf64_External_RegInfo ext; - - bfd_alpha_elf64_swap_reginfo_out (abfd, ®info, &ext); - if (! bfd_set_section_contents (abfd, reginfo_sec, (PTR) &ext, - (file_ptr) 0, sizeof ext)) - return false; - } -#endif - if (mdebug_sec != (asection *) NULL) { BFD_ASSERT (abfd->output_has_begun); @@ -4628,25 +4177,24 @@ elf64_alpha_final_link (abfd, info) bfd_ecoff_debug_free (mdebug_handle, abfd, &debug, swap, info); } - if (gptab_data_sec != (asection *) NULL) - { - if (! bfd_set_section_contents (abfd, gptab_data_sec, - gptab_data_sec->contents, - (file_ptr) 0, - gptab_data_sec->_raw_size)) - return false; - } + return true; +} - if (gptab_bss_sec != (asection *) NULL) +static enum elf_reloc_type_class +elf64_alpha_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF64_R_TYPE (rela->r_info)) { - if (! bfd_set_section_contents (abfd, gptab_bss_sec, - gptab_bss_sec->contents, - (file_ptr) 0, - gptab_bss_sec->_raw_size)) - return false; + case R_ALPHA_RELATIVE: + return reloc_class_relative; + case R_ALPHA_JMP_SLOT: + return reloc_class_plt; + case R_ALPHA_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; } - - return true; } /* ECOFF swapping routines. These are used when dealing with the @@ -4745,6 +4293,8 @@ const struct elf_size_info alpha_elf_size_info = #define elf_backend_section_from_shdr \ elf64_alpha_section_from_shdr +#define elf_backend_section_flags \ + elf64_alpha_section_flags #define elf_backend_fake_sections \ elf64_alpha_fake_sections @@ -4775,6 +4325,8 @@ const struct elf_size_info alpha_elf_size_info = elf64_alpha_finish_dynamic_sections #define bfd_elf64_bfd_final_link \ elf64_alpha_final_link +#define elf_backend_reloc_type_class \ + elf64_alpha_reloc_type_class #define elf_backend_ecoff_debug_swap \ &elf64_alpha_ecoff_debug_swap diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c index db68a07..a58f6ac 100644 --- a/contrib/binutils/bfd/elf64-gen.c +++ b/contrib/binutils/bfd/elf64-gen.c @@ -40,6 +40,13 @@ static reloc_howto_type dummy = 0, /* dst_mask */ false); /* pcrel_offset */ +static void elf_generic_info_to_howto + PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); +static void elf_generic_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); +static boolean elf64_generic_link_add_symbols + PARAMS ((bfd *, struct bfd_link_info *)); + static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; @@ -72,15 +79,9 @@ elf64_generic_link_add_symbols (abfd, info) Elf_Internal_Ehdr *ehdrp; ehdrp = elf_elfheader (abfd); - if (abfd->my_archive) - (*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"), - bfd_get_filename (abfd->my_archive), - bfd_get_filename (abfd), - ehdrp->e_machine); - else - (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), - bfd_get_filename (abfd), - ehdrp->e_machine); + (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), + bfd_archive_filename (abfd), + ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); return false; diff --git a/contrib/binutils/bfd/elf64-ppc.c b/contrib/binutils/bfd/elf64-ppc.c new file mode 100644 index 0000000..da339bb --- /dev/null +++ b/contrib/binutils/bfd/elf64-ppc.c @@ -0,0 +1,4463 @@ +/* PowerPC64-specific support for 64-bit ELF. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Linus Nordberg, Swox AB , + based on elf32-ppc.c by Ian Lance Taylor. + +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 is based on the 64-bit PowerPC ELF ABI. It is also based + on the file elf32-ppc.c. */ + +#include "bfd.h" +#include "sysdep.h" +#include "bfdlink.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/ppc.h" +#include "elf64-ppc.h" + +#define USE_RELA /* we want RELA relocations, not REL. */ + + +static void ppc_howto_init + PARAMS ((void)); +static reloc_howto_type *ppc64_elf_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +static void ppc64_elf_info_to_howto + PARAMS ((bfd *abfd, arelent *cache_ptr, Elf64_Internal_Rela *dst)); +static bfd_reloc_status_type ppc64_elf_addr16_ha_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean ppc64_elf_set_private_flags + PARAMS ((bfd *, flagword)); +static boolean ppc64_elf_merge_private_bfd_data + PARAMS ((bfd *, bfd *)); +static boolean ppc64_elf_section_from_shdr + PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); +static struct bfd_hash_entry *link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static struct bfd_link_hash_table *ppc64_elf_link_hash_table_create + PARAMS ((bfd *)); +static boolean create_got_section + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean ppc64_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static void ppc64_elf_copy_indirect_symbol + PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); +static boolean ppc64_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static asection * ppc64_elf_gc_mark_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); +static boolean ppc64_elf_gc_sweep_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs)); +static boolean func_desc_adjust + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean ppc64_elf_func_desc_adjust + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean ppc64_elf_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static void ppc64_elf_hide_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); +static boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static enum elf_reloc_type_class ppc64_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +static boolean ppc64_elf_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_byte *build_plt_stub + PARAMS ((bfd *, bfd_byte *, int, int)); +static boolean build_one_stub + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean ppc64_elf_fake_sections + PARAMS ((bfd *, Elf64_Internal_Shdr *, asection *)); +static boolean ppc64_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, + asection **)); +static boolean ppc64_elf_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean ppc64_elf_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + + +/* Mask to set RA in memory instructions. */ +#define RA_REGISTER_MASK 0x001f0000 + +/* Value to shift register by to insert RA. */ +#define RA_REGISTER_SHIFT 16 + +/* The name of the dynamic interpreter. This is put in the .interp + section. */ +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* The size in bytes of an entry in the procedure linkage table. */ +#define PLT_ENTRY_SIZE 24 + +/* The initial size of the plt reserved for the dynamic linker. */ +#define PLT_INITIAL_ENTRY_SIZE PLT_ENTRY_SIZE + +/* TOC base pointers offset from start of TOC. */ +#define TOC_BASE_OFF (0x8000) + +/* .plt call stub instructions. */ +#define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */ +#define STD_R2_40R1 0xf8410028 /* std %r2,40(%r1) */ +#define LD_R11_0R12 0xe96c0000 /* ld %r11,xxx+0@l(%r12) */ +#define LD_R2_0R12 0xe84c0000 /* ld %r2,xxx+8@l(%r12) */ +#define MTCTR_R11 0x7d6903a6 /* mtctr %r11 */ + /* ld %r11,xxx+16@l(%r12) */ +#define BCTR 0x4e800420 /* bctr */ + +/* The normal stub is this size. */ +#define PLT_CALL_STUB_SIZE (7*4) + +/* But sometimes the .plt entry crosses a 64k boundary, and we need + to adjust the high word with this insn. */ +#define ADDIS_R12_R12_1 0x3d8c0001 /* addis %r12,%r12,1 */ + +/* The .glink fixup call stub is the same as the .plt call stub, but + the first instruction restores r2, and the std is omitted. */ +#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ + +/* Always allow this much space. */ +#define GLINK_CALL_STUB_SIZE (8*4) + +/* Pad with this. */ +#define NOP 0x60000000 + +/* .glink entries for the first 32k functions are two instructions. */ +#define LI_R0_0 0x38000000 /* li %r0,0 */ +#define B_DOT 0x48000000 /* b . */ + +/* After that, we need two instructions to load the index, followed by + a branch. */ +#define LIS_R0_0 0x3c000000 /* lis %r0,0 */ +#define ORI_R0_R0_0 0x60000000 /* ori %r0,%r0,0 */ + +/* Since .opd is an array of descriptors and each entry will end up + with identical R_PPC64_RELATIVE relocs, there is really no need to + propagate .opd relocs; The dynamic linker should be taught to + relocate .opd without reloc entries. FIXME: the dynamic linker + will need to know where and how large .opd is via a couple of new + DT_PPC64_* tags, or perhaps just with one reloc that specifies the + start of .opd via its offset and the size via its addend. Also, + .opd should be trimmed of unused values. */ +#ifndef NO_OPD_RELOCS +#define NO_OPD_RELOCS 0 +#endif + +/* Relocation HOWTO's. */ +static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max]; + +static reloc_howto_type ppc64_elf_howto_raw[] = { + /* This reloc does nothing. */ + HOWTO (R_PPC64_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_PPC64_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A standard 32 bit relocation. */ + HOWTO (R_PPC64_ADDR32, /* 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_PPC64_ADDR32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 26 bit branch; the lower two bits must be zero. + FIXME: we don't check that, we just clear them. */ + HOWTO (R_PPC64_ADDR24, /* type */ + 0, /* 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_PPC64_ADDR24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* A standard 16 bit relocation. */ + HOWTO (R_PPC64_ADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit relocation without overflow. */ + HOWTO (R_PPC64_ADDR16_LO, /* 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_PPC64_ADDR16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Bits 16-31 of an address. */ + HOWTO (R_PPC64_ADDR16_HI, /* type */ + 16, /* 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_PPC64_ADDR16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Bits 16-31 of an address, plus 1 if the contents of the low 16 + bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch; the lower two bits must be zero. + FIXME: we don't check that, we just clear them. */ + HOWTO (R_PPC64_ADDR14, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch, for which bit 10 should be set to + indicate that the branch is expected to be taken. The lower two + bits must be zero. */ + HOWTO (R_PPC64_ADDR14_BRTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14_BRTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch, for which bit 10 should be set to + indicate that the branch is not expected to be taken. The lower + two bits must be zero. */ + HOWTO (R_PPC64_ADDR14_BRNTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14_BRNTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* A relative 26 bit branch; the lower two bits must be zero. */ + HOWTO (R_PPC64_REL24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch; the lower two bits must be zero. */ + HOWTO (R_PPC64_REL14, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch. Bit 10 should be set to indicate that + the branch is expected to be taken. The lower two bits must be + zero. */ + HOWTO (R_PPC64_REL14_BRTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14_BRTAKEN", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch. Bit 10 should be set to indicate that + the branch is not expected to be taken. The lower two bits must + be zero. */ + HOWTO (R_PPC64_REL14_BRNTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14_BRNTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but referring to the GOT table entry for the + symbol. */ + HOWTO (R_PPC64_GOT16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_LO, /* 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_PPC64_GOT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HI, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_HI, /* type */ + 16, /* 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_PPC64_GOT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HA, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_GOT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* This is used only by the dynamic linker. The symbol should exist + both in the object being run and in some shared library. The + dynamic linker copies the data addressed by the symbol from the + shared library into the object, because the object being + run has to have the data at some particular address. */ + HOWTO (R_PPC64_COPY, /* 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_PPC64_COPY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR64, but used when setting global offset table + entries. */ + HOWTO (R_PPC64_GLOB_DAT, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GLOB_DAT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Created by the link editor. Marks a procedure linkage table + entry for a symbol. */ + HOWTO (R_PPC64_JMP_SLOT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_JMP_SLOT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* Used only by the dynamic linker. When the object is run, this + doubleword64 is set to the load address of the object, plus the + addend. */ + HOWTO (R_PPC64_RELATIVE, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_RELATIVE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR32, but may be unaligned. */ + HOWTO (R_PPC64_UADDR32, /* 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_PPC64_UADDR32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but may be unaligned. */ + HOWTO (R_PPC64_UADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_UADDR16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit PC relative. */ + HOWTO (R_PPC64_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + /* FIXME: Verify. Was complain_overflow_bitfield. */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32-bit relocation to the symbol's procedure linkage table. */ + HOWTO (R_PPC64_PLT32, /* 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_PPC64_PLT32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit PC relative relocation to the symbol's procedure linkage table. + FIXME: R_PPC64_PLTREL32 not supported. */ + HOWTO (R_PPC64_PLTREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_LO, /* 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_PPC64_PLT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HI, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_HI, /* type */ + 16, /* 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_PPC64_PLT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HA, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_PLT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit section relative relocation. */ + /* FIXME: Verify R_PPC64_SECTOFF. Seems strange with size=2 and + dst_mask=0. */ + HOWTO (R_PPC64_SECTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16-bit lower half section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_LO, /* 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_PPC64_SECTOFF_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16-bit upper half section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_HI, /* type */ + 16, /* 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_PPC64_SECTOFF_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16-bit upper half adjusted section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_SECTOFF_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_REL24 without touching the two least significant + bits. */ + /* FIXME: Verify R_PPC64_ADDR30. */ + HOWTO (R_PPC64_ADDR30, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 30, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR30", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffffffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* Relocs in the 64-bit PowerPC ELF ABI, not in the 32-bit ABI. */ + + /* A standard 64-bit relocation. */ + HOWTO (R_PPC64_ADDR64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 32-47 of an address. */ + HOWTO (R_PPC64_ADDR16_HIGHER, /* type */ + 32, /* 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_PPC64_ADDR16_HIGHER", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 32-47 of an address, plus 1 if the contents of the low + 16 bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HIGHERA, /* type */ + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHERA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 48-63 of an address. */ + HOWTO (R_PPC64_ADDR16_HIGHEST,/* type */ + 48, /* 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_PPC64_ADDR16_HIGHEST", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 48-63 of an address, plus 1 if the contents of the low + 16 bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HIGHESTA,/* type */ + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHESTA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like ADDR64, but may be unaligned. */ + HOWTO (R_PPC64_UADDR64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_UADDR64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit relative relocation. */ + HOWTO (R_PPC64_REL64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 64-bit relocation to the symbol's procedure linkage table. */ + HOWTO (R_PPC64_PLT64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit PC relative relocation to the symbol's procedure linkage + table. */ + /* FIXME: R_PPC64_PLTREL64 not supported. */ + HOWTO (R_PPC64_PLTREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTREL64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation. */ + + /* R_PPC64_TOC16 47 half16* S + A - .TOC. */ + HOWTO (R_PPC64_TOC16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation without overflow. */ + + /* R_PPC64_TOC16_LO 48 half16 #lo (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_LO, /* 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_PPC64_TOC16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation, high 16 bits. */ + + /* R_PPC64_TOC16_HI 49 half16 #hi (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_HI, /* type */ + 16, /* 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_PPC64_TOC16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation, high 16 bits, plus 1 if the + contents of the low 16 bits, treated as a signed number, is + negative. */ + + /* R_PPC64_TOC16_HA 50 half16 #ha (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_TOC16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit relocation; insert value of TOC base (.TOC.). */ + + /* R_PPC64_TOC 51 doubleword64 .TOC. */ + HOWTO (R_PPC64_TOC, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16, but also informs the link editor that the + value to relocate may (!) refer to a PLT entry which the link + editor (a) may replace with the symbol value. If the link editor + is unable to fully resolve the symbol, it may (b) create a PLT + entry and store the address to the new PLT entry in the GOT. + This permits lazy resolution of function symbols at run time. + The link editor may also skip all of this and just (c) emit a + R_PPC64_GLOB_DAT to tie the symbol to the GOT entry. */ + /* FIXME: R_PPC64_PLTGOT16 not implemented. */ + HOWTO (R_PPC64_PLTGOT16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16, but without overflow. */ + /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ + HOWTO (R_PPC64_PLTGOT16_LO, /* 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_PPC64_PLTGOT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address. */ + /* FIXME: R_PPC64_PLTGOT16_HI not implemented. */ + HOWTO (R_PPC64_PLTGOT16_HI, /* type */ + 16, /* 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_PPC64_PLTGOT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address, plus + 1 if the contents of the low 16 bits, treated as a signed number, + is negative. */ + /* FIXME: R_PPC64_PLTGOT16_HA not implemented. */ + HOWTO (R_PPC64_PLTGOT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_PLTGOT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but for instructions with a DS field. */ + HOWTO (R_PPC64_ADDR16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_ADDR16_LO_DS, /* 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_PPC64_ADDR16_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16, but for instructions with a DS field. */ + HOWTO (R_PPC64_GOT16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_GOT16_LO_DS, /* 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_PPC64_GOT16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_PLT16_LO_DS, /* 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_PPC64_PLT16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_SECTOFF, but for instructions with a DS field. */ + /* FIXME: Verify R_PPC64_SECTOFF. Seems strange with size=2 and + dst_mask=0. */ + HOWTO (R_PPC64_SECTOFF_DS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_SECTOFF_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_SECTOFF_LO_DS, /* 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_PPC64_SECTOFF_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_TOC16, but for instructions with a DS field. */ + HOWTO (R_PPC64_TOC16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_TOC16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_TOC16_LO_DS, /* 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_PPC64_TOC16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16, but for instructions with a DS field. */ + /* FIXME: R_PPC64_PLTGOT16_DS not implemented. */ + HOWTO (R_PPC64_PLTGOT16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16_LO, but for instructions with a DS field. */ + /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ + HOWTO (R_PPC64_PLTGOT16_LO_DS,/* 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_PPC64_PLTGOT16_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_PPC64_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_PPC64_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ +}; + + +/* Initialize the ppc64_elf_howto_table, so that linear accesses can + be done. */ + +static void +ppc_howto_init () +{ + unsigned int i, type; + + for (i = 0; + i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); + i++) + { + type = ppc64_elf_howto_raw[i].type; + BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) + / sizeof (ppc64_elf_howto_table[0]))); + ppc64_elf_howto_table[type] = &ppc64_elf_howto_raw[i]; + } +} + +static reloc_howto_type * +ppc64_elf_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + switch ((int) code) + { + default: + return (reloc_howto_type *) NULL; + + case BFD_RELOC_NONE: ppc_reloc = R_PPC64_NONE; + break; + case BFD_RELOC_32: ppc_reloc = R_PPC64_ADDR32; + break; + case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC64_ADDR24; + break; + case BFD_RELOC_16: ppc_reloc = R_PPC64_ADDR16; + break; + case BFD_RELOC_LO16: ppc_reloc = R_PPC64_ADDR16_LO; + break; + case BFD_RELOC_HI16: ppc_reloc = R_PPC64_ADDR16_HI; + break; + case BFD_RELOC_HI16_S: ppc_reloc = R_PPC64_ADDR16_HA; + break; + case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC64_ADDR14; + break; + case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC64_ADDR14_BRTAKEN; + break; + case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC64_ADDR14_BRNTAKEN; + break; + case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC64_REL24; + break; + case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC64_REL14; + break; + case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC64_REL14_BRTAKEN; + break; + case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC64_REL14_BRNTAKEN; + break; + case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC64_GOT16; + break; + case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC64_GOT16_LO; + break; + case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC64_GOT16_HI; + break; + case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC64_GOT16_HA; + break; + case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC64_COPY; + break; + case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC64_GLOB_DAT; + break; + case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC64_REL32; + break; + case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC64_PLT32; + break; + case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL32; + break; + case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC64_PLT16_LO; + break; + case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC64_PLT16_HI; + break; + case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC64_PLT16_HA; + break; + case BFD_RELOC_32_BASEREL: ppc_reloc = R_PPC64_SECTOFF; + break; + case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_LO; + break; + case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HI; + break; + case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HA; + break; + case BFD_RELOC_CTOR: ppc_reloc = R_PPC64_ADDR64; + break; + case BFD_RELOC_64: ppc_reloc = R_PPC64_ADDR64; + break; + case BFD_RELOC_PPC64_HIGHER: ppc_reloc = R_PPC64_ADDR16_HIGHER; + break; + case BFD_RELOC_PPC64_HIGHER_S: ppc_reloc = R_PPC64_ADDR16_HIGHERA; + break; + case BFD_RELOC_PPC64_HIGHEST: ppc_reloc = R_PPC64_ADDR16_HIGHEST; + break; + case BFD_RELOC_PPC64_HIGHEST_S: ppc_reloc = R_PPC64_ADDR16_HIGHESTA; + break; + case BFD_RELOC_64_PCREL: ppc_reloc = R_PPC64_REL64; + break; + case BFD_RELOC_64_PLTOFF: ppc_reloc = R_PPC64_PLT64; + break; + case BFD_RELOC_64_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL64; + break; + case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC64_TOC16; + break; + case BFD_RELOC_PPC64_TOC16_LO: ppc_reloc = R_PPC64_TOC16_LO; + break; + case BFD_RELOC_PPC64_TOC16_HI: ppc_reloc = R_PPC64_TOC16_HI; + break; + case BFD_RELOC_PPC64_TOC16_HA: ppc_reloc = R_PPC64_TOC16_HA; + break; + case BFD_RELOC_PPC64_TOC: ppc_reloc = R_PPC64_TOC; + break; + case BFD_RELOC_PPC64_PLTGOT16: ppc_reloc = R_PPC64_PLTGOT16; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: ppc_reloc = R_PPC64_PLTGOT16_LO; + break; + case BFD_RELOC_PPC64_PLTGOT16_HI: ppc_reloc = R_PPC64_PLTGOT16_HI; + break; + case BFD_RELOC_PPC64_PLTGOT16_HA: ppc_reloc = R_PPC64_PLTGOT16_HA; + break; + case BFD_RELOC_PPC64_ADDR16_DS: ppc_reloc = R_PPC64_ADDR16_DS; + break; + case BFD_RELOC_PPC64_ADDR16_LO_DS: ppc_reloc = R_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_PPC64_GOT16_DS: ppc_reloc = R_PPC64_GOT16_DS; + break; + case BFD_RELOC_PPC64_GOT16_LO_DS: ppc_reloc = R_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_PPC64_PLT16_LO_DS: ppc_reloc = R_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_DS: ppc_reloc = R_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_LO_DS: ppc_reloc = R_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC64_TOC16_DS: ppc_reloc = R_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO_DS: ppc_reloc = R_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_DS: ppc_reloc = R_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: ppc_reloc = R_PPC64_PLTGOT16_LO_DS; + break; + case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC64_GNU_VTINHERIT; + break; + case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC64_GNU_VTENTRY; + break; + } + + return ppc64_elf_howto_table[(int) ppc_reloc]; +}; + +/* Set the howto pointer for a PowerPC ELF reloc. */ + +static void +ppc64_elf_info_to_howto (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf64_Internal_Rela *dst; +{ + unsigned int type; + + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + type = ELF64_R_TYPE (dst->r_info); + BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) + / sizeof (ppc64_elf_howto_table[0]))); + cache_ptr->howto = ppc64_elf_howto_table[type]; +} + +/* Handle the R_PPC_ADDR16_HA and similar relocs. */ + +static bfd_reloc_status_type +ppc64_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_vma relocation; + + if (output_bfd != NULL) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + relocation += reloc_entry->addend; + + reloc_entry->addend += (relocation & 0x8000) << 1; + + return bfd_reloc_continue; +} + +/* Function to set whether a module needs the -mrelocatable bit set. */ + +static boolean +ppc64_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; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ +static boolean +ppc64_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean error; + + /* Check if we have the same endianess. */ + if (ibfd->xvec->byteorder != obfd->xvec->byteorder + && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) + { + const char *msg; + + if (bfd_big_endian (ibfd)) + msg = _("%s: compiled for a big endian system and target is little endian"); + else + msg = _("%s: compiled for a little endian system and target is big endian"); + + (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); + + bfd_set_error (bfd_error_wrong_format); + return false; + } + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + old_flags = elf_elfheader (obfd)->e_flags; + if (!elf_flags_init (obfd)) + { + /* First call, no flags set. */ + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + } + + else if (new_flags == old_flags) + /* Compatible flags are ok. */ + ; + + else + { + /* Incompatible flags. Warn about -mrelocatable mismatch. + Allow -mrelocatable-lib to be linked with either. */ + error = false; + if ((new_flags & EF_PPC_RELOCATABLE) != 0 + && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0) + { + error = true; + (*_bfd_error_handler) + (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), + bfd_archive_filename (ibfd)); + } + else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 + && (old_flags & EF_PPC_RELOCATABLE) != 0) + { + error = true; + (*_bfd_error_handler) + (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), + bfd_archive_filename (ibfd)); + } + + /* The output is -mrelocatable-lib iff both the input files are. */ + if (! (new_flags & EF_PPC_RELOCATABLE_LIB)) + elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB; + + /* The output is -mrelocatable iff it can't be -mrelocatable-lib, + but each input file is either -mrelocatable or -mrelocatable-lib. */ + if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB) + && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)) + && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))) + elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE; + + /* Do not warn about eabi vs. V.4 mismatch, just or in the bit + if any module uses it. */ + elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); + + new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + + /* Warn about any other mismatches. */ + if (new_flags != old_flags) + { + error = true; + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); + } + + if (error) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + } + + return true; +} + +/* Handle a PowerPC specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static boolean +ppc64_elf_section_from_shdr (abfd, hdr, name) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + flagword flags; + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + + newsect = hdr->bfd_section; + flags = bfd_get_section_flags (abfd, newsect); + if (hdr->sh_flags & SHF_EXCLUDE) + flags |= SEC_EXCLUDE; + + if (hdr->sh_type == SHT_ORDERED) + flags |= SEC_SORT_ENTRIES; + + bfd_set_section_flags (abfd, newsect, flags); + return true; +} + +/* The following functions are specific to the ELF linker, while + functions above are used generally. Those named ppc64_elf_* are + called by the main ELF linker code. They appear in this file more + or less in the order in which they are called. eg. + ppc64_elf_check_relocs is called early in the link process, + ppc64_elf_finish_dynamic_sections is one of the last functions + called. + + PowerPC64-ELF uses a similar scheme to PowerPC64-XCOFF in that + functions have both a function code symbol and a function descriptor + symbol. A call to foo in a relocatable object file looks like: + + . .text + . x: + . bl .foo + . nop + + The function definition in another object file might be: + + . .section .opd + . foo: .quad .foo + . .quad .TOC.@tocbase + . .quad 0 + . + . .text + . .foo: blr + + When the linker resolves the call during a static link, the branch + unsurprisingly just goes to .foo and the .opd information is unused. + If the function definition is in a shared library, things are a little + different: The call goes via a plt call stub, the opd information gets + copied to the plt, and the linker patches the nop. + + . x: + . bl .foo_stub + . ld 2,40(1) + . + . + . .foo_stub: + . addis 12,2,Lfoo@toc@ha # in practice, the call stub + . addi 12,12,Lfoo@toc@l # is slightly optimised, but + . std 2,40(1) # this is the general idea + . ld 11,0(12) + . ld 2,8(12) + . mtctr 11 + . ld 11,16(12) + . bctr + . + . .section .plt + . Lfoo: reloc (R_PPC64_JMP_SLOT, foo) + + The "reloc ()" notation is supposed to indicate that the linker emits + an R_PPC64_JMP_SLOT reloc against foo. The dynamic linker does the opd + copying. + + What are the difficulties here? Well, firstly, the relocations + examined by the linker in check_relocs are against the function code + sym .foo, while the dynamic relocation in the plt is emitted against + the function descriptor symbol, foo. Somewhere along the line, we need + to carefully copy dynamic link information from one symbol to the other. + Secondly, the generic part of the elf linker will make .foo a dynamic + symbol as is normal for most other backends. We need foo dynamic + instead, at least for an application final link. However, when + creating a shared library containing foo, we need to have both symbols + dynamic so that references to .foo are satisfied during the early + stages of linking. Otherwise the linker might decide to pull in a + definition from some other object, eg. a static library. */ + +/* The linker needs to keep track of the number of relocs that it + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ + +struct ppc_dyn_relocs +{ + struct ppc_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ + bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; +}; + +/* Of those relocs that might be copied as dynamic relocs, this macro + selects between relative and absolute types. */ + +#define IS_ABSOLUTE_RELOC(RTYPE) \ + ((RTYPE) != R_PPC64_REL14 \ + && (RTYPE) != R_PPC64_REL14_BRNTAKEN \ + && (RTYPE) != R_PPC64_REL14_BRTAKEN \ + && (RTYPE) != R_PPC64_REL24 \ + && (RTYPE) != R_PPC64_REL32 \ + && (RTYPE) != R_PPC64_REL64) + +/* ppc64 ELF linker hash entry. */ + +struct ppc_link_hash_entry +{ + struct elf_link_hash_entry elf; + + /* Track dynamic relocs copied for this symbol. */ + struct ppc_dyn_relocs *dyn_relocs; + + /* Flag function code and descriptor symbols. */ + unsigned int is_func:1; + unsigned int is_func_descriptor:1; +}; + +/* ppc64 ELF linker hash table. */ + +struct ppc_link_hash_table +{ + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; + asection *sstub; + asection *sglink; + + /* Set on error. */ + int plt_overflow; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; + +/* Get the ppc64 ELF linker hash table from a link_info structure. */ + +#define ppc_hash_table(p) \ + ((struct ppc_link_hash_table *) ((p)->hash)) + +/* Create an entry in a ppc64 ELF linker hash table. */ + +static struct bfd_hash_entry * +link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct ppc_link_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) entry; + + eh->dyn_relocs = NULL; + eh->is_func = 0; + eh->is_func_descriptor = 0; + } + + return entry; +} + +/* Create a ppc64 ELF linker hash table. */ + +static struct bfd_link_hash_table * +ppc64_elf_link_hash_table_create (abfd) + bfd *abfd; +{ + struct ppc_link_hash_table *htab; + bfd_size_type amt = sizeof (struct ppc_link_hash_table); + + htab = (struct ppc_link_hash_table *) bfd_alloc (abfd, amt); + if (htab == NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&htab->elf, abfd, link_hash_newfunc)) + { + bfd_release (abfd, htab); + return NULL; + } + + htab->sgot = NULL; + htab->srelgot = NULL; + htab->splt = NULL; + htab->srelplt = NULL; + htab->sdynbss = NULL; + htab->srelbss = NULL; + htab->sstub = NULL; + htab->sglink = NULL; + htab->plt_overflow = 0; + htab->sym_sec.abfd = NULL; + + return &htab->elf.root; +} + +/* Create .got and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return false; + + htab = ppc_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + if (!htab->sgot) + abort (); + + htab->srelgot = bfd_make_section (dynobj, ".rela.got"); + if (!htab->srelgot + || ! bfd_set_section_flags (dynobj, htab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) + return false; + return true; +} + +/* Create the .stub and .glink sections as well as the ordinary + dynamic sections. */ + +static boolean +ppc64_elf_create_dynamic_sections (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + flagword flags; + + htab = ppc_hash_table (info); + if (!htab->sgot && !create_got_section (dynobj, info)) + return false; + + if (!_bfd_elf_create_dynamic_sections (dynobj, info)) + return false; + + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) + htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); + + if (!htab->splt || !htab->srelplt || !htab->sdynbss + || (!info->shared && !htab->srelbss)) + abort (); + + /* Create .stub and .glink for global linkage functions. */ + flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY + | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + htab->sstub = bfd_make_section (dynobj, ".stub"); + if (htab->sstub == NULL + || ! bfd_set_section_flags (dynobj, htab->sstub, flags) + || ! bfd_set_section_alignment (dynobj, htab->sstub, 2)) + return false; + htab->sglink = bfd_make_section (dynobj, ".glink"); + if (htab->sglink == NULL + || ! bfd_set_section_flags (dynobj, htab->sglink, flags) + || ! bfd_set_section_alignment (dynobj, htab->sglink, 3)) + return false; + + return true; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +ppc64_elf_copy_indirect_symbol (dir, ind) + struct elf_link_hash_entry *dir, *ind; +{ + struct ppc_link_hash_entry *edir, *eind; + + edir = (struct ppc_link_hash_entry *) dir; + eind = (struct ppc_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct ppc_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + edir->is_func |= eind->is_func; + edir->is_func_descriptor |= eind->is_func_descriptor; + + _bfd_elf_link_hash_copy_indirect (dir, ind); +} + +/* Look through the relocs for a section during the first phase, and + calculate needed space in the global offset table, procedure + linkage table, and dynamic reloc sections. */ + +static boolean +ppc64_elf_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct ppc_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + asection *sreloc; + boolean is_opd; + + if (info->relocateable) + return true; + + htab = ppc_hash_table (info); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = (sym_hashes + + symtab_hdr->sh_size / sizeof (Elf64_External_Sym)); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + sreloc = NULL; + is_opd = strcmp (bfd_get_section_name (abfd, sec), ".opd") == 0; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + unsigned long r_symndx; + struct elf_link_hash_entry *h; + enum elf_ppc_reloc_type r_type; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + switch (r_type) + { + /* GOT16 relocations */ + case R_PPC64_GOT16: + case R_PPC64_GOT16_DS: + case R_PPC64_GOT16_HA: + case R_PPC64_GOT16_HI: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_LO_DS: + + /* This symbol requires a global offset table entry. */ + if (htab->sgot == NULL) + { + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!create_got_section (htab->elf.dynobj, info)) + return false; + } + + if (h != NULL) + { + h->got.refcount += 1; + } + else + { + bfd_signed_vma *local_got_refcounts; + + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) + { + bfd_size_type size; + + size = symtab_hdr->sh_info; + size *= sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) + return false; + elf_local_got_refcounts (abfd) = local_got_refcounts; + } + local_got_refcounts[r_symndx] += 1; + } + break; + + case R_PPC64_PLT16_HA: + case R_PPC64_PLT16_HI: + case R_PPC64_PLT16_LO: + case R_PPC64_PLT32: + case R_PPC64_PLT64: + /* This symbol requires a procedure linkage table entry. We + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ + if (h == NULL) + { + /* It does not make sense to have a procedure linkage + table entry for a local symbol. */ + bfd_set_error (bfd_error_bad_value); + return false; + } + + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + ((struct ppc_link_hash_entry *) h)->is_func = 1; + break; + + /* The following relocations don't need to propagate the + relocation if linking a shared object since they are + section relative. */ + case R_PPC64_SECTOFF: + case R_PPC64_SECTOFF_LO: + case R_PPC64_SECTOFF_HI: + case R_PPC64_SECTOFF_HA: + case R_PPC64_SECTOFF_DS: + case R_PPC64_SECTOFF_LO_DS: + case R_PPC64_TOC16: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_HI: + case R_PPC64_TOC16_HA: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_PPC64_GNU_VTINHERIT: + if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_PPC64_GNU_VTENTRY: + if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + + case R_PPC64_REL24: + if (h != NULL + && h->root.root.string[0] == '.' + && h->root.root.string[1] != 0) + { + /* We may need a .plt entry if the function this reloc + refers to is in a shared lib. */ + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + ((struct ppc_link_hash_entry *) h)->is_func = 1; + } + break; + + case R_PPC64_ADDR64: + if (is_opd + && h != NULL + && h->root.root.string[0] == '.' + && h->root.root.string[1] != 0) + { + struct elf_link_hash_entry *fdh; + + fdh = elf_link_hash_lookup (&htab->elf, h->root.root.string + 1, + false, false, false); + if (fdh != NULL) + { + /* Ensure the function descriptor symbol string is + part of the code symbol string. We aren't + changing the name here, just allowing some tricks + in ppc64_elf_hide_symbol. */ + fdh->root.root.string = h->root.root.string + 1; + ((struct ppc_link_hash_entry *) fdh)->is_func_descriptor = 1; + ((struct ppc_link_hash_entry *) h)->is_func = 1; + } + } + /* Fall through. */ + + case R_PPC64_REL64: + case R_PPC64_REL32: + case R_PPC64_REL14: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL14_BRNTAKEN: + case R_PPC64_ADDR14: + case R_PPC64_ADDR14_BRNTAKEN: + case R_PPC64_ADDR14_BRTAKEN: + case R_PPC64_ADDR16: + case R_PPC64_ADDR16_DS: + case R_PPC64_ADDR16_HA: + case R_PPC64_ADDR16_HI: + case R_PPC64_ADDR16_HIGHER: + case R_PPC64_ADDR16_HIGHERA: + case R_PPC64_ADDR16_HIGHEST: + case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_ADDR16_LO: + case R_PPC64_ADDR16_LO_DS: + case R_PPC64_ADDR24: + case R_PPC64_ADDR30: + case R_PPC64_ADDR32: + case R_PPC64_UADDR16: + case R_PPC64_UADDR32: + case R_PPC64_UADDR64: + case R_PPC64_TOC: + /* Don't propagate .opd relocs. */ + if (NO_OPD_RELOCS && is_opd) + break; + + /* If we are creating a shared library, and this is a reloc + against a global symbol, or a non PC relative reloc + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the relocs_copied field of the hash + table entry. A similar situation occurs when creating + shared libraries and symbol visibility changes render the + symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (sec->flags & SEC_ALLOC) != 0 + && (IS_ABSOLUTE_RELOC (r_type) + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) + { + struct ppc_dyn_relocs *p; + struct ppc_dyn_relocs **head; + + /* We must copy these reloc types into the output file. + Create a reloc section in dynobj and make room for + this reloc. */ + if (sreloc == NULL) + { + const char *name; + bfd *dynobj; + + name = (bfd_elf_string_from_elf_section + (abfd, + elf_elfheader (abfd)->e_shstrndx, + elf_section_data (sec)->rel_hdr.sh_name)); + if (name == NULL) + return false; + + if (strncmp (name, ".rela", 5) != 0 + || strcmp (bfd_get_section_name (abfd, sec), + name + 5) != 0) + { + (*_bfd_error_handler) + (_("%s: bad relocation section name `%s\'"), + bfd_archive_filename (abfd), name); + bfd_set_error (bfd_error_bad_value); + } + + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + + dynobj = htab->elf.dynobj; + sreloc = bfd_get_section_by_name (dynobj, name); + if (sreloc == NULL) + { + flagword flags; + + sreloc = bfd_make_section (dynobj, name); + flags = (SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + if ((sec->flags & SEC_ALLOC) != 0) + flags |= SEC_ALLOC | SEC_LOAD; + if (sreloc == NULL + || ! bfd_set_section_flags (dynobj, sreloc, flags) + || ! bfd_set_section_alignment (dynobj, sreloc, 3)) + return false; + } + elf_section_data (sec)->sreloc = sreloc; + } + + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + { + head = &((struct ppc_link_hash_entry *) h)->dyn_relocs; + } + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return false; + + head = ((struct ppc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + } + + p = *head; + if (p == NULL || p->sec != sec) + { + p = ((struct ppc_dyn_relocs *) + bfd_alloc (htab->elf.dynobj, + (bfd_size_type) sizeof *p)); + if (p == NULL) + return false; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; + } + + p->count += 1; + if (!IS_ABSOLUTE_RELOC (r_type)) + p->pc_count += 1; + } + break; + + default: + } + } + + return true; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +ppc64_elf_gc_mark_hook (abfd, info, rel, h, sym) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + enum elf_ppc_reloc_type r_type; + + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC64_GNU_VTINHERIT: + case R_PPC64_GNU_VTENTRY: + break; + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + + return NULL; +} + +/* Update the .got, .plt. and dynamic reloc reference counts for the + section being removed. */ + +static boolean +ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + + elf_section_data (sec)->local_dynrel = NULL; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + { + unsigned long r_symndx; + enum elf_ppc_reloc_type r_type; + struct elf_link_hash_entry *h; + + r_symndx = ELF64_R_SYM (rel->r_info); + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC64_GOT16: + case R_PPC64_GOT16_DS: + case R_PPC64_GOT16_HA: + case R_PPC64_GOT16_HI: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_LO_DS: + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + h->got.refcount--; + } + else + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_PPC64_PLT16_HA: + case R_PPC64_PLT16_HI: + case R_PPC64_PLT16_LO: + case R_PPC64_PLT32: + case R_PPC64_PLT64: + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + case R_PPC64_REL24: + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + case R_PPC64_REL14: + case R_PPC64_REL14_BRNTAKEN: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL32: + case R_PPC64_REL64: + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_PPC64_ADDR14: + case R_PPC64_ADDR14_BRNTAKEN: + case R_PPC64_ADDR14_BRTAKEN: + case R_PPC64_ADDR16: + case R_PPC64_ADDR16_DS: + case R_PPC64_ADDR16_HA: + case R_PPC64_ADDR16_HI: + case R_PPC64_ADDR16_HIGHER: + case R_PPC64_ADDR16_HIGHERA: + case R_PPC64_ADDR16_HIGHEST: + case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_ADDR16_LO: + case R_PPC64_ADDR16_LO_DS: + case R_PPC64_ADDR24: + case R_PPC64_ADDR30: + case R_PPC64_ADDR32: + case R_PPC64_ADDR64: + case R_PPC64_UADDR16: + case R_PPC64_UADDR32: + case R_PPC64_UADDR64: + case R_PPC64_TOC: + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + default: + break; + } + } + return true; +} + +/* Called via elf_link_hash_traverse to transfer dynamic linking + information on function code symbol entries to their corresponding + function descriptor symbol entries. */ +static boolean +func_desc_adjust (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct ppc_link_hash_table *htab; + + if (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + return true; + + info = (struct bfd_link_info *) inf; + htab = ppc_hash_table (info); + + /* If this is a function code symbol, transfer dynamic linking + information to the function descriptor symbol. */ + if (!((struct ppc_link_hash_entry *) h)->is_func) + return true; + + if (h->plt.refcount > 0 + && h->root.root.string[0] == '.' + && h->root.root.string[1] != '\0') + { + struct elf_link_hash_entry *fdh; + boolean force_local; + + /* Find the corresponding function descriptor symbol. Create it + as undefined if necessary. */ + + fdh = elf_link_hash_lookup (&htab->elf, h->root.root.string + 1, + false, false, true); + + if (fdh == NULL && info->shared) + { + bfd *abfd; + asymbol *newsym; + + /* Create it as undefined. */ + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + abfd = h->root.u.undef.abfd; + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + abfd = h->root.u.def.section->owner; + else + abort (); + newsym = bfd_make_empty_symbol (abfd); + newsym->name = h->root.root.string + 1; + newsym->section = bfd_und_section_ptr; + newsym->value = 0; + newsym->flags = BSF_OBJECT; + if (h->root.type == bfd_link_hash_undefweak) + newsym->flags |= BSF_WEAK; + + if ( !(_bfd_generic_link_add_one_symbol + (info, abfd, newsym->name, newsym->flags, + newsym->section, newsym->value, NULL, false, false, + (struct bfd_link_hash_entry **) &fdh))) + { + return false; + } + } + + if (fdh != NULL + && (fdh->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0 + && (info->shared + || (fdh->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (fdh->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + { + if (fdh->dynindx == -1) + if (! bfd_elf64_link_record_dynamic_symbol (info, fdh)) + return false; + fdh->plt.refcount = h->plt.refcount; + fdh->elf_link_hash_flags |= (h->elf_link_hash_flags + & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_NON_GOT_REF)); + fdh->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + ((struct ppc_link_hash_entry *) fdh)->is_func_descriptor = 1; + fdh->root.root.string = h->root.root.string + 1; + } + + /* Now that the info is on the function descriptor, clear the + function code sym info. Any function code syms for which we + don't have a definition in a regular file, we force local. + This prevents a shared library from exporting syms that have + been imported from another library. Function code syms that + are really in the library we must leave global to prevent the + linker dragging a definition in from a static library. */ + force_local = (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0; + _bfd_elf_link_hash_hide_symbol (info, h, force_local); + } + + return true; +} + +/* Called near the start of bfd_elf_size_dynamic_sections. We use + this hook to transfer dynamic linking information gathered so far + on function code symbol entries, to their corresponding function + descriptor symbol entries. */ +static boolean +ppc64_elf_func_desc_adjust (obfd, info) + bfd *obfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + + htab = ppc_hash_table (info); + elf_link_hash_traverse (&htab->elf, func_desc_adjust, (PTR) info); + return true; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. The current definition is in some section of the + dynamic object, but we're not including those sections. We have to + change the definition to something the rest of the link can + understand. */ + +static boolean +ppc64_elf_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + struct ppc_link_hash_table *htab; + struct ppc_link_hash_entry * eh; + struct ppc_dyn_relocs *p; + asection *s; + unsigned int power_of_two; + + htab = ppc_hash_table (info); + + /* Deal with function syms. */ + if (h->type == STT_FUNC + || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) + { + /* Clear procedure linkage table information for any symbol that + won't need a .plt entry. */ + if (!((struct ppc_link_hash_entry *) h)->is_func_descriptor + || h->plt.refcount <= 0 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)) + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + return true; + } + else + h->plt.offset = (bfd_vma) -1; + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->weakdef != NULL) + { + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; + return true; + } + + /* This is a reference to a symbol defined by a dynamic object which + is not a function. */ + + /* If we are creating a shared library, we must presume that the + only references to the symbol are via the global offset table. + For such cases we need not do anything here; the relocations will + be handled correctly by relocate_section. */ + if (info->shared) + return true; + + /* If there are no references to this symbol that do not use the + GOT, we don't need to generate a copy reloc. */ + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) + return true; + + eh = (struct ppc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return true; + } + + /* We must allocate the symbol in our .dynbss section, which will + become part of the .bss section of the executable. There will be + an entry for this symbol in the .dynsym section. The dynamic + object will contain position independent code, so all references + from the dynamic object to this symbol will go through the global + offset table. The dynamic linker will use the .dynsym entry to + determine the address it must put in the global offset table, so + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + + /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to + copy the initial value out of the dynamic object and into the + runtime process image. We need to remember the offset into the + .rela.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { + htab->srelbss->_raw_size += sizeof (Elf64_External_Rela); + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; + } + + /* We need to figure out the alignment required for this symbol. I + have no idea how ELF linkers handle this. */ + power_of_two = bfd_log2 (h->size); + if (power_of_two > 4) + power_of_two = 4; + + /* Apply the required alignment. */ + s = htab->sdynbss; + s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) + { + if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) + return false; + } + + /* Define the symbol as being at this point in the section. */ + h->root.u.def.section = s; + h->root.u.def.value = s->_raw_size; + + /* Increment the section size to make room for the symbol. */ + s->_raw_size += h->size; + + return true; +} + +/* If given a function descriptor symbol, hide both the function code + sym and the descriptor. */ +static void +ppc64_elf_hide_symbol (info, h, force_local) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + boolean force_local; +{ + _bfd_elf_link_hash_hide_symbol (info, h, force_local); + + if (((struct ppc_link_hash_entry *) h)->is_func_descriptor) + { + const char *name; + struct elf_link_hash_entry *fh; + struct ppc_link_hash_table *htab; + + name = h->root.root.string - 1; + htab = ppc_hash_table (info); + fh = elf_link_hash_lookup (&htab->elf, name, false, false, false); + if (fh != NULL) + _bfd_elf_link_hash_hide_symbol (info, fh, force_local); + } +} + +/* This is the condition under which ppc64_elf_finish_dynamic_symbol + will be called from elflink.h. If elflink.h doesn't call our + finish_dynamic_symbol routine, we'll need to do something about + initializing any .plt and .got entries in ppc64_elf_relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ + ((DYN) \ + && ((INFO)->shared \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ + +static boolean +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct ppc_link_hash_table *htab; + asection *s; + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + return true; + + info = (struct bfd_link_info *) inf; + htab = ppc_hash_table (info); + + if (htab->elf.dynamic_sections_created + && h->plt.refcount > 0 + && h->dynindx != -1) + { + BFD_ASSERT (((struct ppc_link_hash_entry *) h)->is_func_descriptor); + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + { + /* If this is the first .plt entry, make room for the special + first entry. */ + s = htab->splt; + if (s->_raw_size == 0) + s->_raw_size += PLT_INITIAL_ENTRY_SIZE; + + h->plt.offset = s->_raw_size; + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* Make room for the .stub and .glink code. */ + s = htab->sstub; + s->_raw_size += PLT_CALL_STUB_SIZE; + + s = htab->sglink; + if (s->_raw_size == 0) + s->_raw_size += GLINK_CALL_STUB_SIZE; + /* We need bigger stubs past index 32767. */ + if (s->_raw_size >= GLINK_CALL_STUB_SIZE + 32768*2*4) + s->_raw_size += 4; + s->_raw_size += 2*4; + + /* We also need to make an entry in the .rela.plt section. */ + s = htab->srelplt; + s->_raw_size += sizeof (Elf64_External_Rela); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + if (h->got.refcount > 0) + { + boolean dyn; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf64_link_record_dynamic_symbol (info, h)) + return false; + } + + s = htab->sgot; + h->got.offset = s->_raw_size; + s->_raw_size += 8; + dyn = htab->elf.dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; + + eh = (struct ppc_link_hash_entry *) h; + if (eh->dyn_relocs == NULL) + return true; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for relocs that have become local due to symbol visibility + changes. */ + + if (info->shared) + { + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + struct ppc_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; + } + } + } + else + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + || (htab->elf.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf64_link_record_dynamic_symbol (info, h)) + return false; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela); + } + + return true; +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static boolean +readonly_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs *p; + + eh = (struct ppc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *s = p->sec->output_section; + + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; + + info->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return false; + } + } + return true; +} + +/* Set the sizes of the dynamic sections. */ + +static boolean +ppc64_elf_size_dynamic_sections (output_bfd, info) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + bfd *dynobj; + asection *s; + boolean relocs; + bfd *ibfd; + + htab = ppc_hash_table (info); + dynobj = htab->elf.dynobj; + if (dynobj == NULL) + abort (); + + if (htab->elf.dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + if (s == NULL) + abort (); + s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; + s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + } + } + + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct ppc_dyn_relocs *p; + + for (p = *((struct ppc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + if (!bfd_is_abs_section (p->sec) + && bfd_is_abs_section (p->sec->output_section)) + { + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ + } + else + { + srel = elf_section_data (p->sec)->sreloc; + srel->_raw_size += p->count * sizeof (Elf64_External_Rela); + } + } + } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) + { + if (*local_got > 0) + { + *local_got = s->_raw_size; + s->_raw_size += 8; + if (info->shared) + srel->_raw_size += sizeof (Elf64_External_Rela); + } + else + *local_got = (bfd_vma) -1; + } + } + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ + relocs = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + bfd_vma size; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + if (s == htab->splt + || s == htab->sgot + || s == htab->sstub + || s == htab->sglink) + { + /* Strip this section if we don't need it; see the + comment below. */ + } + else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + { + if (s->_raw_size == 0) + { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rela.bss and + .rela.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + } + else + { + if (s != htab->srelplt) + relocs = true; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + } + else + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + if (s->_raw_size == 0) + { + _bfd_strip_section_from_output (info, s); + continue; + } + + /* Allocate memory for the section contents. We use bfd_zalloc + here in case unused entries are not reclaimed before the + section's contents are written out. This should not happen, + but this way if it does, we get a R_PPC64_NONE reloc instead + of garbage. */ + size = s->_raw_size; + if (s == htab->sstub) + { + /* .stub may grow. Allocate enough for the maximum growth. */ + size += (size + 65536 + 65535) / 65536 * 4; + } + s->contents = (bfd_byte *) bfd_zalloc (dynobj, size); + if (s->contents == NULL) + return false; + } + + if (htab->elf.dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in ppc64_elf_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + + if (!info->shared) + { + if (!add_dynamic_entry (DT_DEBUG, 0)) + return false; + } + + if (htab->splt->_raw_size != 0) + { + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0) + || !add_dynamic_entry (DT_PPC64_GLINK, 0)) + return false; + } + + if (relocs) + { + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) + return false; + + /* If any dynamic relocs apply to a read-only section, + then we need a DT_TEXTREL entry. */ + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info); + + if ((info->flags & DF_TEXTREL) != 0) + { + if (!add_dynamic_entry (DT_TEXTREL, 0)) + return false; + } + } + } +#undef add_dynamic_entry + + return true; +} + +/* Called after we have seen all the input files/sections, but before + final symbol resolution and section placement has been determined. + + We use this hook to provide a value for TOCstart, which we store in + the output bfd elf_gp. */ + +boolean +ppc64_elf_set_toc (obfd, info) + bfd *obfd; + struct bfd_link_info *info; +{ + if (!info->relocateable) + { + asection *s; + bfd_vma TOCstart; + + /* The TOC consists of sections .got, .toc, .tocbss, .plt in that + order. The TOC starts where the first of these sections starts. */ + s = bfd_get_section_by_name (obfd, ".got"); + if (s == NULL) + s = bfd_get_section_by_name (obfd, ".toc"); + if (s == NULL) + s = bfd_get_section_by_name (obfd, ".tocbss"); + if (s == NULL) + s = bfd_get_section_by_name (obfd, ".plt"); + if (s == NULL) + { + /* This may happen for + o references to TOC base (SYM@toc / TOC[tc0]) without a + .toc directive + o bad linker script + o --gc-sections and empty TOC sections + + FIXME: Warn user? */ + + /* Look for a likely section. We probably won't even be + using TOCstart. */ + for (s = obfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_SMALL_DATA | SEC_READONLY)) + == (SEC_ALLOC | SEC_SMALL_DATA)) + break; + if (s == NULL) + for (s = obfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_SMALL_DATA)) + == (SEC_ALLOC | SEC_SMALL_DATA)) + break; + if (s == NULL) + for (s = obfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) + break; + if (s == NULL) + for (s = obfd->sections; s != NULL; s = s->next) + if ((s->flags & SEC_ALLOC) == SEC_ALLOC) + break; + } + + TOCstart = 0; + if (s != NULL) + TOCstart = s->output_section->vma + s->output_offset; + + elf_gp (obfd) = TOCstart; + } + return true; +} + +/* PowerPC64 .plt entries are 24 bytes long, which doesn't divide + evenly into 64k. Sometimes with a large enough .plt, we'll need to + use offsets differing in the high 16 bits when accessing a .plt + entry from a .plt call stub. This function adjusts the size of + .stub to accommodate the extra stub instruction needed in such + cases. */ + +boolean +ppc64_elf_size_stubs (obfd, info, changed) + bfd *obfd; + struct bfd_link_info *info; + int *changed; +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + bfd_vma plt_offset, next_64k; + long base, num, extra; + + /* .plt and .stub should be both present, or both absent. */ + if ((htab->splt == NULL || htab->splt->_raw_size == 0) + != (htab->sstub == NULL || htab->sstub->_raw_size == 0)) + abort (); + + /* If no .plt, then nothing to do. */ + if (htab->splt == NULL || htab->splt->_raw_size == 0) + return true; + + plt_offset = (htab->splt->output_section->vma + + htab->splt->output_offset + - elf_gp (obfd)); + next_64k = (plt_offset + 65535) & -65536; + + /* If the .plt doesn't have any entries crossing a 64k boundary, + then there is no need for bigger stubs. */ + if (next_64k <= plt_offset + htab->splt->_raw_size) + return true; + + /* OK, so we have at least one transition. Since .plt entries are + 24 bytes long, we'll strike it lucky every 3*64k, with the 64k + boundary between .plt entries. */ + base = next_64k / 65536; + num = (plt_offset + htab->splt->_raw_size - next_64k) / 65536; + extra = (base % 3 + num + 1) * 2 / 3; + + /* Allow one extra instruction for each EXTRA. The change in .stub + may change the location of .toc and .plt. .toc and .plt ought to + move as a group, but someone might be playing with eg. .plt + alignment, so don't allow .stub size to decrease. */ + if (htab->sstub->_cooked_size < htab->sstub->_raw_size + extra * 4) + { + htab->sstub->_cooked_size = htab->sstub->_raw_size + extra * 4; + *changed = true; + } + return true; +} + +/* Build a .plt call stub. */ + +static bfd_byte * +build_plt_stub (obfd, p, offset, glink) + bfd *obfd; + bfd_byte *p; + int offset; + int glink; +{ +#define PPC_LO(v) ((v) & 0xffff) +#define PPC_HI(v) (((v) >> 16) & 0xffff) +#define PPC_HA(v) PPC_HI ((v) + 0x8000) + + if (glink) + bfd_put_32 (obfd, LD_R2_40R1, p), p += 4; + bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4; + if (!glink) + bfd_put_32 (obfd, STD_R2_40R1, p), p += 4; + bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; + if (PPC_HA (offset + 8) != PPC_HA (offset)) + bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + offset += 8; + bfd_put_32 (obfd, LD_R2_0R12 | PPC_LO (offset), p), p += 4; + if (PPC_HA (offset + 8) != PPC_HA (offset)) + bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + offset += 8; + bfd_put_32 (obfd, MTCTR_R11, p), p += 4; + bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; + bfd_put_32 (obfd, BCTR, p), p += 4; + return p; +} + +/* Build the stubs for one function call. */ + +static boolean +build_one_stub (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct ppc_link_hash_table *htab; + + if (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + return true; + + info = (struct bfd_link_info *) inf; + htab = ppc_hash_table (info); + + if (htab->elf.dynamic_sections_created + && h->plt.offset != (bfd_vma) -1 + && ((struct ppc_link_hash_entry *) h)->is_func_descriptor) + { + struct elf_link_hash_entry *fh; + asection *s; + bfd_vma plt_r2; + bfd_byte *p; + unsigned int indx; + + fh = elf_link_hash_lookup (&htab->elf, h->root.root.string - 1, + false, false, true); + + if (fh == NULL) + abort (); + + BFD_ASSERT (((struct ppc_link_hash_entry *) fh)->is_func); + + /* Build the .plt call stub. */ + plt_r2 = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + - elf_gp (htab->splt->output_section->owner) + - TOC_BASE_OFF); + + if (plt_r2 + 0x80000000 > 0xffffffff + || (plt_r2 & 3) != 0) + { + (*_bfd_error_handler) + (_("linkage table error against `%s'"), + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + htab->plt_overflow = true; + return false; + } + + s = htab->sstub; + /* Steal plt.offset to store the stub offset. */ + fh->plt.offset = s->_cooked_size; + p = s->contents + s->_cooked_size; + p = build_plt_stub (s->owner, p, (int) plt_r2, 0); + s->_cooked_size = p - s->contents; + + /* Build the .glink lazy link call stub. */ + s = htab->sglink; + p = s->contents + s->_cooked_size; + indx = s->reloc_count; + if (indx < 0x8000) + { + bfd_put_32 (s->owner, LI_R0_0 | indx, p); + p += 4; + } + else + { + bfd_put_32 (s->owner, LIS_R0_0 | PPC_HI (indx), p); + p += 4; + bfd_put_32 (s->owner, ORI_R0_R0_0 | PPC_LO (indx), p); + p += 4; + } + bfd_put_32 (s->owner, B_DOT | ((s->contents - p) & 0x3fffffc), p); + p += 4; + s->_cooked_size = p - s->contents; + s->reloc_count += 1; + } + return true; +} + +boolean +ppc64_elf_build_stubs (obfd, info) + bfd *obfd; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + bfd_vma old_stub_size; + bfd_vma plt_r2; + bfd_byte *p; + + /* If no .plt stubs, then nothing to do. */ + if (htab->sstub == NULL || htab->sstub->_raw_size == 0) + return true; + + old_stub_size = htab->sstub->_cooked_size; + htab->sstub->_cooked_size = 0; + + /* Build the .glink plt call stub. */ + plt_r2 = (htab->splt->output_section->vma + + htab->splt->output_offset + - elf_gp (obfd) + - TOC_BASE_OFF); + p = htab->sglink->contents; + p = build_plt_stub (htab->sglink->owner, p, (int) plt_r2, 1); + while (p - htab->sglink->contents < GLINK_CALL_STUB_SIZE) + { + bfd_put_32 (htab->sglink->owner, NOP, p); + p += 4; + } + htab->sglink->_cooked_size = p - htab->sglink->contents; + + /* Use reloc_count to count entries. */ + htab->sglink->reloc_count = 0; + + elf_link_hash_traverse (&htab->elf, build_one_stub, (PTR) info); + htab->sglink->reloc_count = 0; + + if (htab->plt_overflow) + return false; + + if (old_stub_size != htab->sstub->_cooked_size + || htab->sglink->_raw_size != htab->sglink->_cooked_size) + { + (*_bfd_error_handler) + (_("stub section size doesn't match calculated size")); + bfd_set_error (bfd_error_bad_value); + return false; + } + return true; +} + +/* Set up any other section flags and such that may be necessary. */ + +static boolean +ppc64_elf_fake_sections (abfd, shdr, asect) + bfd *abfd ATTRIBUTE_UNUSED; + Elf64_Internal_Shdr *shdr; + asection *asect; +{ + if ((asect->flags & SEC_EXCLUDE) != 0) + shdr->sh_flags |= SHF_EXCLUDE; + + if ((asect->flags & SEC_SORT_ENTRIES) != 0) + shdr->sh_type = SHT_ORDERED; + + return true; +} + +/* The RELOCATE_SECTION function is called by the ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjust the section contents as + necessary, and (if using Rela relocs and generating a + relocateable output file) adjusting the reloc addend as + necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocateable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static boolean +ppc64_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; +{ + struct ppc_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + bfd_vma *local_got_offsets; + bfd_vma TOCstart; + boolean ret = true; + boolean is_opd; + + /* Initialize howto table if needed. */ + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + ppc_howto_init (); + + htab = ppc_hash_table (info); + local_got_offsets = elf_local_got_offsets (input_bfd); + TOCstart = elf_gp (output_bfd); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + is_opd = strcmp (bfd_get_section_name (abfd, input_section), ".opd") == 0; + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + bfd_vma offset; + bfd_vma addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; + unsigned long r_symndx; + bfd_vma relocation; + boolean unresolved_reloc; + boolean has_nop; + long insn; + + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_symndx = ELF64_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocatable 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 ((unsigned) ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + continue; + } + + /* This is a final link. */ + + offset = rel->r_offset; + addend = rel->r_addend; + r = bfd_reloc_other; + sym = (Elf_Internal_Sym *) 0; + sec = (asection *) 0; + h = (struct elf_link_hash_entry *) 0; + sym_name = (const char *) 0; + unresolved_reloc = false; + + if (r_type == R_PPC64_TOC) + { + /* Relocation value is TOC base. Symbol is ignored. */ + relocation = TOCstart + TOC_BASE_OFF; + } + else if (r_symndx < symtab_hdr->sh_info) + { + /* It's a local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = ""; + + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + addend = rel->r_addend; + } + else + { + /* It's a global symbol. */ + 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; + sym_name = h->root.root.string; + relocation = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + if (sec->output_section == NULL) + /* Set a flag that will be cleared later if we find a + relocation value for this symbol. output_section + is typically NULL for symbols satisfied by a shared + library. */ + unresolved_reloc = true; + else + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + ; + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + ; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + offset, (!info->shared + || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + } + } + + /* First handle relocations that tweak non-addend part of insn. */ + insn = 0; + switch (r_type) + { + default: + break; + + /* Branch taken prediction relocations. */ + case R_PPC64_ADDR14_BRTAKEN: + case R_PPC64_REL14_BRTAKEN: + insn = 0x01 << 21; /* Set 't' bit, lowest bit of BO field. */ + /* Fall thru. */ + + /* Branch not taken prediction relocations. */ + case R_PPC64_ADDR14_BRNTAKEN: + case R_PPC64_REL14_BRNTAKEN: + insn |= bfd_get_32 (output_bfd, contents + offset) & ~(0x01 << 21); + /* Set 'a' bit. This is 0b00010 in BO field for branch on CR(BI) + insns (BO == 001at or 011at), and 0b01000 for branch on CTR + insns (BO == 1a00t or 1a01t). */ + if ((insn & (0x14 << 21)) == (0x04 << 21)) + insn |= 0x02 << 21; + else if ((insn & (0x14 << 21)) == (0x10 << 21)) + insn |= 0x08 << 21; + else + break; + + bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); + break; + + case R_PPC64_REL24: + case R_PPC64_ADDR24: + /* An ADDR24 or REL24 branching to a linkage function may be + followed by a nop that we have to replace with a ld in + order to restore the TOC base pointer. Only calls to + shared objects need to alter the TOC base. These are + recognized by their need for a PLT entry. */ + has_nop = 0; + if (h != NULL + && h->plt.offset != (bfd_vma) -1 + && htab->sstub != NULL) + { + /* plt.offset here is the offset into the stub section. */ + relocation = (htab->sstub->output_section->vma + + htab->sstub->output_offset + + h->plt.offset); + unresolved_reloc = false; + + /* Make sure that there really is an instruction after + the branch that we can decode. */ + if (offset + 8 <= input_section->_cooked_size) + { + bfd_byte *pnext; + + pnext = contents + offset + 4; + insn = bfd_get_32 (input_bfd, pnext); + + if (insn == 0x60000000 /* nop (ori r0,r0,0) */ + || insn == 0x4def7b82 /* cror 15,15,15 */ + || insn == 0x4ffffb82) /* cror 31,31,31 */ + { + bfd_put_32 (input_bfd, + (bfd_vma) 0xe8410028, /* ld r2,40(r1) */ + pnext); + has_nop = 1; + } + } + } + + if (h != NULL + && h->root.type == bfd_link_hash_undefweak + && r_type == R_PPC64_REL24 + && addend == 0 + && relocation == 0) + { + /* Tweak calls to undefined weak functions to behave as + if the "called" function immediately returns. We can + thus call to a weak function without first checking + whether the function is defined. */ + relocation = 4; + if (has_nop) + relocation = 8; + } + break; + } + + /* Set `addend'. */ + switch (r_type) + { + default: + (*_bfd_error_handler) + (_("%s: unknown relocation type %d for symbol %s"), + bfd_archive_filename (input_bfd), (int) r_type, sym_name); + + bfd_set_error (bfd_error_bad_value); + ret = false; + continue; + + case R_PPC64_NONE: + case R_PPC_GNU_VTINHERIT: + case R_PPC_GNU_VTENTRY: + continue; + + /* GOT16 relocations. Like an ADDR16 using the symbol's + address in the GOT as relocation value instead of the + symbols value itself. Also, create a GOT entry for the + symbol and put the symbol value there. */ + case R_PPC64_GOT16: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_HI: + case R_PPC64_GOT16_HA: + case R_PPC64_GOT16_DS: + case R_PPC64_GOT16_LO_DS: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + bfd_vma off; + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + { + boolean dyn; + + off = h->got.offset; + dyn = htab->elf.dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + || (info->shared + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags + & ELF_LINK_FORCED_LOCAL)) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR))) + { + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. We must initialize + this entry in the global offset table. Since the + offset must always be a multiple of 8, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rel.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, + htab->sgot->contents + off); + h->got.offset |= 1; + } + } + else + unresolved_reloc = false; + } + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + + /* The offset must always be a multiple of 8. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, + htab->sgot->contents + off); + + if (info->shared) + { + Elf_Internal_Rela outrel; + Elf64_External_Rela *loc; + + /* We need to generate a R_PPC64_RELATIVE reloc + for the dynamic linker. */ + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + outrel.r_addend = relocation; + loc = (Elf64_External_Rela *) htab->srelgot->contents; + loc += htab->srelgot->reloc_count++; + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } + + local_got_offsets[r_symndx] |= 1; + } + } + + if (off >= (bfd_vma) -2) + abort (); + + relocation = htab->sgot->output_offset + off; + + /* TOC base (r2) is TOC start plus 0x8000. */ + addend -= TOC_BASE_OFF; + } + break; + + case R_PPC64_PLT16_HA: + case R_PPC64_PLT16_HI: + case R_PPC64_PLT16_LO: + case R_PPC64_PLT32: + case R_PPC64_PLT64: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ + + /* Resolve a PLT reloc against a local symbol directly, + without using the procedure linkage table. */ + if (h == NULL) + break; + + if (h->plt.offset == (bfd_vma) -1 + || htab->splt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = false; + break; + + /* TOC16 relocs. We want the offset relative to the TOC base, + which is the address of the start of the TOC plus 0x8000. + The TOC consists of sections .got, .toc, .tocbss, and .plt, + in this order. */ + case R_PPC64_TOC16: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_HI: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + case R_PPC64_TOC16_HA: + addend -= TOCstart + TOC_BASE_OFF; + break; + + /* Relocate against the beginning of the section. */ + case R_PPC64_SECTOFF: + case R_PPC64_SECTOFF_LO: + case R_PPC64_SECTOFF_HI: + case R_PPC64_SECTOFF_DS: + case R_PPC64_SECTOFF_LO_DS: + case R_PPC64_SECTOFF_HA: + if (sec != (asection *) 0) + addend -= sec->output_section->vma; + break; + + case R_PPC64_REL24: + break; + + /* Relocations that may need to be propagated if this is a + dynamic object. */ + case R_PPC64_REL14: + case R_PPC64_REL14_BRNTAKEN: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL32: + case R_PPC64_REL64: + case R_PPC64_ADDR14: + case R_PPC64_ADDR14_BRNTAKEN: + case R_PPC64_ADDR14_BRTAKEN: + case R_PPC64_ADDR16: + case R_PPC64_ADDR16_DS: + case R_PPC64_ADDR16_HA: + case R_PPC64_ADDR16_HI: + case R_PPC64_ADDR16_HIGHER: + case R_PPC64_ADDR16_HIGHERA: + case R_PPC64_ADDR16_HIGHEST: + case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_ADDR16_LO: + case R_PPC64_ADDR16_LO_DS: + case R_PPC64_ADDR24: + case R_PPC64_ADDR30: + case R_PPC64_ADDR32: + case R_PPC64_ADDR64: + case R_PPC64_UADDR16: + case R_PPC64_UADDR32: + case R_PPC64_UADDR64: + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + if (r_symndx == 0) + break; + /* Fall thru. */ + + case R_PPC64_TOC: + if ((input_section->flags & SEC_ALLOC) == 0) + break; + + if (NO_OPD_RELOCS && is_opd) + break; + + if ((info->shared + && (IS_ABSOLUTE_RELOC (r_type) + || (h != NULL + && h->dynindx != -1 + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && h != NULL + && h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0) + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined))) + { + Elf_Internal_Rela outrel; + boolean skip, relocate; + asection *sreloc; + Elf64_External_Rela *loc; + + /* When generating a dynamic object, these relocations + are copied into the output file to be resolved at run + time. */ + + skip = false; + + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; + + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); + outrel.r_addend = addend; + + if (skip) + { + relocate = false; + memset (&outrel, 0, sizeof outrel); + } + else if (h != NULL + && h->dynindx != -1 + && !is_opd + && (!IS_ABSOLUTE_RELOC (r_type) + || !info->shared + || !info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + { + relocate = false; + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); + } + else + { + /* This symbol is local, or marked to become local, + or this is an opd section reloc which must point + at a local function. */ + outrel.r_addend += relocation; + relocate = true; + if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC) + { + outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + } + else + { + long indx = 0; + + if (bfd_is_abs_section (sec)) + ; + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + else + { + asection *osec; + + osec = sec->output_section; + indx = elf_section_data (osec)->dynindx; + + /* We are turning this relocation into one + against a section symbol, so subtract out + the output section's address but not the + offset of the input section in the output + section. */ + outrel.r_addend -= osec->vma; + } + + outrel.r_info = ELF64_R_INFO (indx, r_type); + } + } + + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + + loc = (Elf64_External_Rela *) sreloc->contents; + loc += sreloc->reloc_count++; + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + /* If this reloc is against an external symbol, it will + be computed at runtime, so there's no need to do + anything now. */ + if (! relocate) + continue; + } + break; + + case R_PPC64_COPY: + case R_PPC64_GLOB_DAT: + case R_PPC64_JMP_SLOT: + case R_PPC64_RELATIVE: + /* We shouldn't ever see these dynamic relocs in relocatable + files. */ + /* Fall thru */ + + case R_PPC64_PLTGOT16: + case R_PPC64_PLTGOT16_DS: + case R_PPC64_PLTGOT16_HA: + case R_PPC64_PLTGOT16_HI: + case R_PPC64_PLTGOT16_LO: + case R_PPC64_PLTGOT16_LO_DS: + case R_PPC64_PLTREL32: + case R_PPC64_PLTREL64: + /* These ones haven't been implemented yet. */ + + (*_bfd_error_handler) + (_("%s: Relocation %s is not supported for symbol %s."), + bfd_archive_filename (input_bfd), + ppc64_elf_howto_table[(int) r_type]->name, sym_name); + + bfd_set_error (bfd_error_invalid_operation); + ret = false; + continue; + } + + /* Do any further special processing. */ + switch (r_type) + { + default: + break; + + case R_PPC64_ADDR16_HA: + case R_PPC64_ADDR16_HIGHERA: + case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_PLT16_HA: + case R_PPC64_TOC16_HA: + case R_PPC64_SECTOFF_HA: + /* It's just possible that this symbol is a weak symbol + that's not actually defined anywhere. In that case, + 'sec' would be NULL, and we should leave the symbol + alone (it will be set to zero elsewhere in the link). */ + if (sec != NULL) + /* Add 0x10000 if sign bit in 0:15 is set. */ + addend += ((relocation + addend) & 0x8000) << 1; + break; + + case R_PPC64_ADDR16_DS: + case R_PPC64_ADDR16_LO_DS: + case R_PPC64_GOT16_DS: + case R_PPC64_GOT16_LO_DS: + case R_PPC64_PLT16_LO_DS: + case R_PPC64_SECTOFF_DS: + case R_PPC64_SECTOFF_LO_DS: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + case R_PPC64_PLTGOT16_DS: + case R_PPC64_PLTGOT16_LO_DS: + if (((relocation + addend) & 3) != 0) + { + (*_bfd_error_handler) + (_("%s: error: relocation %s not a multiple of 4"), + bfd_archive_filename (input_bfd), + ppc64_elf_howto_table[(int) r_type]->name); + bfd_set_error (bfd_error_bad_value); + ret = false; + continue; + } + break; + } + + /* FIXME: Why do we allow debugging sections to escape this error? + More importantly, why do we not emit dynamic relocs above in + debugging sections (which are ! SEC_ALLOC)? If we had + emitted the dynamic reloc, we could remove the fudge here. */ + if (unresolved_reloc + && !(info->shared + && (input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + h->root.root.string); + + r = _bfd_final_link_relocate (ppc64_elf_howto_table[(int) r_type], + input_bfd, + input_section, + contents, + offset, + relocation, + addend); + + if (r == bfd_reloc_ok) + ; + else if (r == bfd_reloc_overflow) + { + const char *name; + + if (h != NULL) + { + if (h->root.type == bfd_link_hash_undefweak + && ppc64_elf_howto_table[(int) r_type]->pc_relative) + { + /* Assume this is a call protected by other code that + detects the symbol is undefined. If this is the case, + we can safely ignore the overflow. If not, the + program is hosed anyway, and a little warning isn't + going to help. */ + + continue; + } + + 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) + continue; + if (*name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + if (! ((*info->callbacks->reloc_overflow) + (info, name, ppc64_elf_howto_table[(int) r_type]->name, + (bfd_vma) 0, input_bfd, input_section, offset))) + return false; + } + else + ret = false; + } + + return ret; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + bfd *output_bfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + struct ppc_link_hash_table *htab; + bfd *dynobj; + + htab = ppc_hash_table (info); + dynobj = htab->elf.dynobj; + + if (h->plt.offset != (bfd_vma) -1 + && ((struct ppc_link_hash_entry *) h)->is_func_descriptor) + { + Elf_Internal_Rela rela; + Elf64_External_Rela *loc; + + /* This symbol has an entry in the procedure linkage table. Set + it up. */ + + if (htab->splt == NULL + || htab->srelplt == NULL + || htab->sglink == NULL) + abort (); + + /* Create a JMP_SLOT reloc to inform the dynamic linker to + fill in the PLT entry. */ + + rela.r_offset = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); + rela.r_addend = 0; + + loc = (Elf64_External_Rela *) htab->srelplt->contents; + loc += (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE; + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + } + + if (h->got.offset != (bfd_vma) -1) + { + Elf_Internal_Rela rela; + Elf64_External_Rela *loc; + + /* This symbol has an entry in the global offset table. Set it + up. */ + + if (htab->sgot == NULL || htab->srelgot == NULL) + abort (); + + rela.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + (h->got.offset &~ (bfd_vma) 1)); + + /* If this is a static link, or it is a -Bsymbolic link and the + symbol is defined locally or was forced to be local because + of a version file, we just want to emit a RELATIVE reloc. + The entry in the global offset table will already have been + initialized in the relocate_section function. */ + if (info->shared + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + { + BFD_ASSERT((h->got.offset & 1) != 0); + rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + rela.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + else + { + BFD_ASSERT ((h->got.offset & 1) == 0); + bfd_put_64 (output_bfd, (bfd_vma) 0, + htab->sgot->contents + h->got.offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_GLOB_DAT); + rela.r_addend = 0; + } + + loc = (Elf64_External_Rela *) htab->srelgot->contents; + loc += htab->srelgot->reloc_count++; + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + } + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) + { + Elf_Internal_Rela rela; + Elf64_External_Rela *loc; + + /* This symbol needs a copy reloc. Set it up. */ + + if (h->dynindx == -1 + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + || htab->srelbss == NULL) + abort (); + + rela.r_offset = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY); + rela.r_addend = 0; + loc = (Elf64_External_Rela *) htab->srelbss->contents; + loc += htab->srelbss->reloc_count++; + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + } + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +/* Used to decide how to sort relocs in an optimal manner for the + dynamic linker, before writing them out. */ + +static enum elf_reloc_type_class +ppc64_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + enum elf_ppc_reloc_type r_type; + + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rela->r_info); + switch (r_type) + { + case R_PPC64_RELATIVE: + return reloc_class_relative; + case R_PPC64_JMP_SLOT: + return reloc_class_plt; + case R_PPC64_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + +/* Finish up the dynamic sections. */ + +static boolean +ppc64_elf_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + bfd *dynobj; + asection *sdyn; + + htab = ppc_hash_table (info); + dynobj = htab->elf.dynobj; + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (htab->elf.dynamic_sections_created) + { + Elf64_External_Dyn *dyncon, *dynconend; + + if (sdyn == NULL || htab->sgot == NULL) + abort (); + + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + continue; + + case DT_PPC64_GLINK: + dyn.d_un.d_ptr = (htab->sglink->output_section->vma + + htab->sglink->output_offset); + break; + + case DT_PLTGOT: + dyn.d_un.d_ptr = (htab->splt->output_section->vma + + htab->splt->output_offset); + break; + + case DT_JMPREL: + dyn.d_un.d_ptr = (htab->srelplt->output_section->vma + + htab->srelplt->output_offset); + break; + + case DT_PLTRELSZ: + dyn.d_un.d_val = htab->srelplt->_raw_size; + break; + + case DT_RELASZ: + /* Don't count procedure linkage table relocs in the + overall reloc count. */ + if (htab->srelplt != NULL) + dyn.d_un.d_val -= htab->srelplt->_raw_size; + break; + } + + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + + if (htab->sgot != NULL && htab->sgot->_raw_size != 0) + { + /* Fill in the first entry in the global offset table. + We use it to hold the link-time TOCbase. */ + bfd_put_64 (output_bfd, + elf_gp (output_bfd) + TOC_BASE_OFF, + htab->sgot->contents); + + /* Set .got entry size. */ + elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 8; + } + + if (htab->splt != NULL && htab->splt->_raw_size != 0) + { + /* Set .plt entry size. */ + elf_section_data (htab->splt->output_section)->this_hdr.sh_entsize + = PLT_ENTRY_SIZE; + } + + return true; +} + +#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec +#define TARGET_LITTLE_NAME "elf64-powerpcle" +#define TARGET_BIG_SYM bfd_elf64_powerpc_vec +#define TARGET_BIG_NAME "elf64-powerpc" +#define ELF_ARCH bfd_arch_powerpc +#define ELF_MACHINE_CODE EM_PPC64 +#define ELF_MAXPAGESIZE 0x10000 +#define elf_info_to_howto ppc64_elf_info_to_howto + +#ifdef EM_CYGNUS_POWERPC +#define ELF_MACHINE_ALT1 EM_CYGNUS_POWERPC +#endif + +#ifdef EM_PPC_OLD +#define ELF_MACHINE_ALT2 EM_PPC_OLD +#endif + +#define elf_backend_want_got_sym 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 3 +#define elf_backend_plt_not_loaded 1 +#define elf_backend_got_symbol_offset 0 +#define elf_backend_got_header_size 8 +#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE +#define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 + +#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_set_private_flags ppc64_elf_set_private_flags +#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data +#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create + +#define elf_backend_section_from_shdr ppc64_elf_section_from_shdr +#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections +#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol +#define elf_backend_check_relocs ppc64_elf_check_relocs +#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook +#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol +#define elf_backend_hide_symbol ppc64_elf_hide_symbol +#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust +#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_fake_sections ppc64_elf_fake_sections +#define elf_backend_relocate_section ppc64_elf_relocate_section +#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol +#define elf_backend_reloc_type_class ppc64_elf_reloc_type_class +#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections + +#include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-ppc.h b/contrib/binutils/bfd/elf64-ppc.h new file mode 100644 index 0000000..b261a58 --- /dev/null +++ b/contrib/binutils/bfd/elf64-ppc.h @@ -0,0 +1,22 @@ +/* PowerPC64-specific support for 64-bit ELF. + Copyright 2002 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. */ + +boolean ppc64_elf_set_toc PARAMS ((bfd *, struct bfd_link_info *)); +boolean ppc64_elf_size_stubs PARAMS ((bfd *, struct bfd_link_info *, int *)); +boolean ppc64_elf_build_stubs PARAMS ((bfd *, struct bfd_link_info *)); diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c index bd32b6e..07c78bc 100644 --- a/contrib/binutils/bfd/elf64-sparc.c +++ b/contrib/binutils/bfd/elf64-sparc.c @@ -35,44 +35,55 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MINUS_ONE (~ (bfd_vma) 0) static struct bfd_link_hash_table * sparc64_elf_bfd_link_hash_table_create - PARAMS((bfd *)); + PARAMS ((bfd *)); +static bfd_reloc_status_type init_insn_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, + bfd *, bfd_vma *, bfd_vma *)); static reloc_howto_type *sparc64_elf_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void sparc64_elf_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static void sparc64_elf_build_plt - PARAMS((bfd *, unsigned char *, int)); + PARAMS ((bfd *, unsigned char *, int)); static bfd_vma sparc64_elf_plt_entry_offset - PARAMS((int)); + PARAMS ((bfd_vma)); static bfd_vma sparc64_elf_plt_ptr_offset - PARAMS((int, int)); + PARAMS ((bfd_vma, bfd_vma)); static boolean sparc64_elf_check_relocs - PARAMS((bfd *, struct bfd_link_info *, asection *sec, - const Elf_Internal_Rela *)); + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, + const Elf_Internal_Rela *)); static boolean sparc64_elf_adjust_dynamic_symbol - PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean sparc64_elf_size_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static int sparc64_elf_get_symbol_type PARAMS (( Elf_Internal_Sym *, int)); static boolean sparc64_elf_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); + const char **, flagword *, asection **, bfd_vma *)); +static boolean sparc64_elf_output_arch_syms + PARAMS ((bfd *, struct bfd_link_info *, PTR, + boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); static void sparc64_elf_symbol_processing PARAMS ((bfd *, asymbol *)); -static boolean sparc64_elf_copy_private_bfd_data - PARAMS ((bfd *, bfd *)); static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static const char *sparc64_elf_print_symbol_all + PARAMS ((bfd *, PTR, asymbol *)); static boolean sparc64_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean sparc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean sparc64_elf_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean sparc64_elf_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); static boolean sparc64_elf_object_p PARAMS ((bfd *)); static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *)); static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); @@ -83,6 +94,8 @@ static boolean sparc64_elf_slurp_reloc_table static long sparc64_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR)); +static enum elf_reloc_type_class sparc64_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); /* The relocation "howto" table. */ @@ -103,7 +116,7 @@ static reloc_howto_type sparc64_elf_howto_table[] = HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true), HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true), HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0x00ffffff,true), + HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true), HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true), HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true), HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true), @@ -122,8 +135,8 @@ static reloc_howto_type sparc64_elf_howto_table[] = HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), #ifndef SPARC64_OLD_RELOCS + HOWTO(R_SPARC_PLT32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true), /* These aren't implemented yet. */ - HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PLT32", false,0,0x00000000,true), HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true), HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true), HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true), @@ -147,7 +160,7 @@ static reloc_howto_type sparc64_elf_howto_table[] = HOWTO(R_SPARC_5, 0,2, 5,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", false,0,0x0000001f,true), HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true), HOWTO(R_SPARC_DISP64, 0,4,64,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", false,0,MINUS_ONE, true), - HOWTO(R_SPARC_PLT64, 0,4,64,false,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_PLT64", false,0,MINUS_ONE, false), + HOWTO(R_SPARC_PLT64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", false,0,MINUS_ONE, true), HOWTO(R_SPARC_HIX22, 0,4, 0,false,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", false,0,MINUS_ONE, false), HOWTO(R_SPARC_LOX10, 0,4, 0,false,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", false,0,MINUS_ONE, false), HOWTO(R_SPARC_H44, 22,2,22,false,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", false,0,0x003fffff,false), @@ -163,10 +176,11 @@ struct elf_reloc_map { unsigned char elf_reloc_val; }; -static CONST struct elf_reloc_map sparc_reloc_map[] = +static const struct elf_reloc_map sparc_reloc_map[] = { { BFD_RELOC_NONE, R_SPARC_NONE, }, { BFD_RELOC_16, R_SPARC_16, }, + { BFD_RELOC_16_PCREL, R_SPARC_DISP16 }, { BFD_RELOC_8, R_SPARC_8 }, { BFD_RELOC_8_PCREL, R_SPARC_DISP8 }, { BFD_RELOC_CTOR, R_SPARC_64 }, @@ -175,6 +189,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_HI22, R_SPARC_HI22 }, { BFD_RELOC_LO10, R_SPARC_LO10, }, { BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 }, + { BFD_RELOC_64_PCREL, R_SPARC_DISP64 }, { BFD_RELOC_SPARC22, R_SPARC_22 }, { BFD_RELOC_SPARC13, R_SPARC_13 }, { BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 }, @@ -207,6 +222,9 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_5, R_SPARC_5 }, { BFD_RELOC_SPARC_6, R_SPARC_6 }, { BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64 }, +#ifndef SPARC64_OLD_RELOCS + { BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 }, +#endif { BFD_RELOC_SPARC_PLT64, R_SPARC_PLT64 }, { BFD_RELOC_SPARC_HIX22, R_SPARC_HIX22 }, { BFD_RELOC_SPARC_LOX10, R_SPARC_LOX10 }, @@ -280,13 +298,12 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) bfd_size_type count; arelent *relents; - allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size); + allocated = (PTR) bfd_malloc (rel_hdr->sh_size); if (allocated == NULL) goto error_return; if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (allocated, 1, rel_hdr->sh_size, abfd) - != rel_hdr->sh_size)) + || bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size) goto error_return; native_relocs = (bfd_byte *) allocated; @@ -371,6 +388,7 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) struct bfd_elf_section_data * const d = elf_section_data (asect); Elf_Internal_Shdr *rel_hdr; Elf_Internal_Shdr *rel_hdr2; + bfd_size_type amt; if (asect->relocation != NULL) return true; @@ -401,9 +419,9 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) rel_hdr2 = NULL; } - asect->relocation = ((arelent *) - bfd_alloc (abfd, - asect->reloc_count * 2 * sizeof (arelent))); + amt = asect->reloc_count; + amt *= 2 * sizeof (arelent); + asect->relocation = (arelent *) bfd_alloc (abfd, amt); if (asect->relocation == NULL) return false; @@ -639,9 +657,9 @@ sparc64_elf_bfd_link_hash_table_create (abfd) bfd *abfd; { struct sparc64_elf_link_hash_table *ret; + bfd_size_type amt = sizeof (struct sparc64_elf_link_hash_table); - ret = ((struct sparc64_elf_link_hash_table *) - bfd_zalloc (abfd, sizeof (struct sparc64_elf_link_hash_table))); + ret = (struct sparc64_elf_link_hash_table *) bfd_zalloc (abfd, amt); if (ret == (struct sparc64_elf_link_hash_table *) NULL) return NULL; @@ -759,8 +777,8 @@ sparc_elf_wdisp16_reloc (abfd, reloc_entry, symbol, data, input_section, if (status != bfd_reloc_other) return status; - insn = (insn & ~0x303fff) | ((((relocation >> 2) & 0xc000) << 6) - | ((relocation >> 2) & 0x3fff)); + insn &= ~ (bfd_vma) 0x303fff; + insn |= (((relocation >> 2) & 0xc000) << 6) | ((relocation >> 2) & 0x3fff); bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); if ((bfd_signed_vma) relocation < - 0x40000 @@ -798,7 +816,7 @@ sparc_elf_hix22_reloc (abfd, return status; relocation ^= MINUS_ONE; - insn = (insn & ~0x3fffff) | ((relocation >> 10) & 0x3fffff); + insn = (insn &~ (bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff); bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); if ((relocation & ~ (bfd_vma) 0xffffffff) != 0) @@ -834,7 +852,7 @@ sparc_elf_lox10_reloc (abfd, if (status != bfd_reloc_other) return status; - insn = (insn & ~0x1fff) | 0x1c00 | (relocation & 0x3ff); + insn = (insn &~ (bfd_vma) 0x1fff) | 0x1c00 | (relocation & 0x3ff); bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); return bfd_reloc_ok; @@ -865,7 +883,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) We fill them with `illtrap 0' to force ld.so to do something. */ for (i = 0; i < PLT_HEADER_SIZE/4; ++i) - bfd_put_32 (output_bfd, 0, contents+i*4); + bfd_put_32 (output_bfd, (bfd_vma) 0, contents+i*4); /* The first 32768 entries are close enough to plt1 to get there via a straight branch. */ @@ -881,14 +899,14 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) /* ba,a,pt %xcc, plt1 */ ba = 0x30680000 | (((contents+PLT_ENTRY_SIZE) - (entry+4)) / 4 & 0x7ffff); - bfd_put_32 (output_bfd, sethi, entry); - bfd_put_32 (output_bfd, ba, entry+4); - bfd_put_32 (output_bfd, nop, entry+8); - bfd_put_32 (output_bfd, nop, entry+12); - bfd_put_32 (output_bfd, nop, entry+16); - bfd_put_32 (output_bfd, nop, entry+20); - bfd_put_32 (output_bfd, nop, entry+24); - bfd_put_32 (output_bfd, nop, entry+28); + bfd_put_32 (output_bfd, (bfd_vma) sethi, entry); + bfd_put_32 (output_bfd, (bfd_vma) ba, entry + 4); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 8); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 12); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 16); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 20); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 24); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 28); } /* Now the tricky bit. Entries 32768 and higher are grouped in blocks of @@ -906,17 +924,23 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) entry = contents + i*PLT_ENTRY_SIZE + j*4*6; ptr = contents + i*PLT_ENTRY_SIZE + block*4*6 + j*8; - /* ldx [%o7 + ptr - entry+4], %g1 */ - ldx = 0xc25be000 | ((ptr - entry+4) & 0x1fff); - - bfd_put_32 (output_bfd, 0x8a10000f, entry); /* mov %o7,%g5 */ - bfd_put_32 (output_bfd, 0x40000002, entry+4); /* call .+8 */ - bfd_put_32 (output_bfd, nop, entry+8); /* nop */ - bfd_put_32 (output_bfd, ldx, entry+12); /* ldx [%o7+P],%g1 */ - bfd_put_32 (output_bfd, 0x83c3c001, entry+16); /* jmpl %o7+%g1,%g1 */ - bfd_put_32 (output_bfd, 0x9e100005, entry+20); /* mov %g5,%o7 */ - - bfd_put_64 (output_bfd, contents - (entry+4), ptr); + /* ldx [%o7 + ptr - (entry+4)], %g1 */ + ldx = 0xc25be000 | ((ptr - (entry+4)) & 0x1fff); + + /* mov %o7,%g5 + call .+8 + nop + ldx [%o7+P],%g1 + jmpl %o7+%g1,%g1 + mov %g5,%o7 */ + bfd_put_32 (output_bfd, (bfd_vma) 0x8a10000f, entry); + bfd_put_32 (output_bfd, (bfd_vma) 0x40000002, entry + 4); + bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 8); + bfd_put_32 (output_bfd, (bfd_vma) ldx, entry + 12); + bfd_put_32 (output_bfd, (bfd_vma) 0x83c3c001, entry + 16); + bfd_put_32 (output_bfd, (bfd_vma) 0x9e100005, entry + 20); + + bfd_put_64 (output_bfd, (bfd_vma) (contents - (entry + 4)), ptr); } } } @@ -925,9 +949,9 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) static bfd_vma sparc64_elf_plt_entry_offset (index) - int index; + bfd_vma index; { - int block, ofs; + bfd_vma block, ofs; if (index < LARGE_PLT_THRESHOLD) return index * PLT_ENTRY_SIZE; @@ -937,22 +961,21 @@ sparc64_elf_plt_entry_offset (index) block = (index - LARGE_PLT_THRESHOLD) / 160; ofs = (index - LARGE_PLT_THRESHOLD) % 160; - return ((bfd_vma) (LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE - + ofs * 6*4); + return (LARGE_PLT_THRESHOLD + block * 160) * PLT_ENTRY_SIZE + ofs * 6 * 4; } static bfd_vma sparc64_elf_plt_ptr_offset (index, max) - int index, max; + bfd_vma index; + bfd_vma max; { - int block, ofs, last; + bfd_vma block, ofs, last; BFD_ASSERT(index >= LARGE_PLT_THRESHOLD); /* See above for details. */ - block = (((index - LARGE_PLT_THRESHOLD) / 160) * 160) - + LARGE_PLT_THRESHOLD; + block = (((index - LARGE_PLT_THRESHOLD) / 160) * 160) + LARGE_PLT_THRESHOLD; ofs = index - block; if (block + 160 > max) last = (max - LARGE_PLT_THRESHOLD) % 160; @@ -1073,10 +1096,11 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) symbol. */ if (local_got_offsets == NULL) { - size_t size; + bfd_size_type size; register unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_vma); local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); if (local_got_offsets == NULL) return false; @@ -1148,8 +1172,10 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) } h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - break; - + if (ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT32 + && ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT64) + break; + /* Fall through. */ case R_SPARC_PC10: case R_SPARC_PC22: case R_SPARC_PC_HH22: @@ -1235,6 +1261,8 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf64_External_Rela); @@ -1247,7 +1275,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) default: (*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"), - bfd_get_filename(abfd), + bfd_archive_filename (abfd), ELF64_R_TYPE_ID (rel->r_info)); return false; } @@ -1269,7 +1297,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) asection **secp ATTRIBUTE_UNUSED; bfd_vma *valp ATTRIBUTE_UNUSED; { - static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; + static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER) { @@ -1284,7 +1312,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) default: (*_bfd_error_handler) (_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); return false; } @@ -1303,11 +1331,12 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) if (p->name != NULL && strcmp (p->name, *namep)) { (*_bfd_error_handler) - (_("Register %%g%d used incompatibly: " - "previously declared in %s to %s, in %s redefined to %s"), - (int)sym->st_value, - bfd_get_filename (p->abfd), *p->name ? p->name : "#scratch", - bfd_get_filename (abfd), **namep ? *namep : "#scratch"); + (_("Register %%g%d used incompatibly: %s in %s"), + (int) sym->st_value, + **namep ? *namep : "#scratch", bfd_archive_filename (abfd)); + (*_bfd_error_handler) + (_(" previously %s in %s"), + *p->name ? p->name : "#scratch", bfd_archive_filename (p->abfd)); return false; } @@ -1324,11 +1353,14 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { unsigned char type = h->type; - if (type > STT_FUNC) type = 0; + if (type > STT_FUNC) + type = 0; + (*_bfd_error_handler) + (_("Symbol `%s' has differing types: %s in %s"), + *namep, "REGISTER", bfd_archive_filename (abfd)); (*_bfd_error_handler) - (_("Symbol `%s' has differing types: " - "previously %s, REGISTER in %s"), - *namep, stt_types [type], bfd_get_filename (abfd)); + (_(" previously %s in %s"), + stt_types[type], bfd_archive_filename (p->abfd)); return false; } @@ -1370,12 +1402,14 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { unsigned char type = ELF_ST_TYPE (sym->st_info); - if (type > STT_FUNC) type = 0; + if (type > STT_FUNC) + type = 0; + (*_bfd_error_handler) + (_("Symbol `%s' has differing types: %s in %s"), + *namep, stt_types[type], bfd_archive_filename (abfd)); (*_bfd_error_handler) - (_("Symbol `%s' has differing types: " - "REGISTER in %s, %s in %s"), - *namep, bfd_get_filename (p->abfd), stt_types [type], - bfd_get_filename (abfd)); + (_(" previously %s in %s"), + "REGISTER", bfd_archive_filename (p->abfd)); return false; } } @@ -1653,7 +1687,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table (info)->dynobj; @@ -1685,7 +1718,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -1718,18 +1750,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) } else { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0) - reltext = true; - if (strcmp (name, ".rela.plt") == 0) relplt = true; @@ -1766,37 +1786,38 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + int reg; struct sparc64_elf_app_reg * app_regs; - struct bfd_strtab_hash *dynstr; + struct elf_strtab_hash *dynstr; struct elf_link_hash_table *eht = elf_hash_table (info); - if (! info->shared) + if (!info->shared) { - if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } if (relplt) { - if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } - if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, - sizeof (Elf64_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { - if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER @@ -1809,7 +1830,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) { struct elf_link_local_dynamic_entry *entry, *e; - if (! bfd_elf64_add_dynamic_entry (info, DT_SPARC_REGISTER, 0)) + if (!add_dynamic_entry (DT_SPARC_REGISTER, 0)) return false; entry = (struct elf_link_local_dynamic_entry *) @@ -1824,7 +1845,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) entry->isym.st_size = 0; if (*app_regs [reg].name != '\0') entry->isym.st_name - = _bfd_stringtab_add (dynstr, app_regs[reg].name, true, false); + = _bfd_elf_strtab_add (dynstr, app_regs[reg].name, false); else entry->isym.st_name = 0; entry->isym.st_other = 0; @@ -1846,6 +1867,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) eht->dynsymcount++; } } +#undef add_dynamic_entry return true; } @@ -1914,6 +1936,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation; bfd_reloc_status_type r; + boolean is_plt = false; r_type = ELF64_R_TYPE_ID (rel->r_info); if (r_type < 0 || r_type >= (int) R_SPARC_max_std) @@ -1952,9 +1975,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); } else { @@ -2038,7 +2059,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared && ((!info->symbolic && h->dynindx != -1) || !(h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) + & ELF_LINK_HASH_DEF_REGULAR)) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_SPARC_{32,64} relocations in + its sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0))) skip_it = true; break; } @@ -2059,7 +2088,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -2083,9 +2113,10 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } +do_dynreloc: /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - if (info->shared && (input_section->flags & SEC_ALLOC)) + if (info->shared && r_symndx != 0 && (input_section->flags & SEC_ALLOC)) { switch (r_type) { @@ -2160,21 +2191,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rel->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rel->r_offset)); - if (off == MINUS_ONE) - skip = true; - outrel.r_offset = off; - } + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -2207,7 +2228,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if the symbol was marked to become local. */ - else if (h != NULL + else if (h != NULL && ! is_plt && ((! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) @@ -2231,7 +2252,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { long indx; - if (h == NULL) + if (is_plt) + sec = splt; + else if (h == NULL) sec = local_sections[r_symndx]; else { @@ -2261,7 +2284,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_FAIL (); (*_bfd_error_handler) (_("%s: probably compiled without -fPIC?"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); return false; } @@ -2283,12 +2306,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, ++sreloc->reloc_count; /* This reloc will be computed at runtime, so there's no - need to do anything now, unless this is a RELATIVE - reloc in an unallocated section. */ - if (skip - || (input_section->flags & SEC_ALLOC) != 0 - || ELF64_R_TYPE_ID (outrel.r_info) != R_SPARC_RELATIVE) - continue; + need to do anything now. */ + continue; } break; } @@ -2368,7 +2387,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, Note this is different behaviour to the 32-bit linker, which both adds the contents and ignores the addend. So clear the location. */ - bfd_put_64 (output_bfd, 0, sgot->contents + off); + bfd_put_64 (output_bfd, (bfd_vma) 0, + sgot->contents + off); /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ @@ -2424,6 +2444,12 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, + sparc64_elf_plt_entry_offset (h->plt.offset)); if (r_type == R_SPARC_WPLT30) goto do_wplt30; + if (r_type == R_SPARC_PLT32 || r_type == R_SPARC_PLT64) + { + r_type = r_type == R_SPARC_PLT32 ? R_SPARC_32 : R_SPARC_64; + is_plt = true; + goto do_dynreloc; + } goto do_default; case R_SPARC_OLO10: @@ -2434,7 +2460,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (relocation & 0x3ff) + ELF64_R_TYPE_DATA (rel->r_info); x = bfd_get_32 (input_bfd, contents + rel->r_offset); - x = (x & ~0x1fff) | (relocation & 0x1fff); + x = (x & ~(bfd_vma) 0x1fff) | (relocation & 0x1fff); bfd_put_32 (input_bfd, x, contents + rel->r_offset); r = bfd_check_overflow (howto->complain_on_overflow, @@ -2455,8 +2481,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation -= rel->r_offset; x = bfd_get_32 (input_bfd, contents + rel->r_offset); - x = (x & ~0x303fff) | ((((relocation >> 2) & 0xc000) << 6) - | ((relocation >> 2) & 0x3fff)); + x &= ~(bfd_vma) 0x303fff; + x |= ((((relocation >> 2) & 0xc000) << 6) + | ((relocation >> 2) & 0x3fff)); bfd_put_32 (input_bfd, x, contents + rel->r_offset); r = bfd_check_overflow (howto->complain_on_overflow, @@ -2474,7 +2501,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = relocation ^ MINUS_ONE; x = bfd_get_32 (input_bfd, contents + rel->r_offset); - x = (x & ~0x3fffff) | ((relocation >> 10) & 0x3fffff); + x = (x & ~(bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff); bfd_put_32 (input_bfd, x, contents + rel->r_offset); r = bfd_check_overflow (howto->complain_on_overflow, @@ -2492,7 +2519,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (relocation & 0x3ff) | 0x1c00; x = bfd_get_32 (input_bfd, contents + rel->r_offset); - x = (x & ~0x1fff) | relocation; + x = (x & ~(bfd_vma) 0x1fff) | relocation; bfd_put_32 (input_bfd, x, contents + rel->r_offset); r = bfd_reloc_ok; @@ -2581,7 +2608,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, || reg == G0 || reg == O7) break; - bfd_put_32 (input_bfd, INSN_NOP, + bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP, contents + rel->r_offset + 4); } break; @@ -2611,6 +2638,16 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { const char *name; + /* The Solaris native linker silently disregards + overflows. We don't, but this breaks stabs debugging + info, whose relocations are only 32-bits wide. Ignore + overflows in this case. */ + if (r_type == R_SPARC_32 + && (input_section->flags & SEC_DEBUGGING) != 0 + && strcmp (bfd_section_name (input_bfd, input_section), + ".stab") == 0) + break; + if (h != NULL) { if (h->root.type == bfd_link_hash_undefweak @@ -2686,7 +2723,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } else { - int max = splt->_raw_size / PLT_ENTRY_SIZE; + bfd_vma max = splt->_raw_size / PLT_ENTRY_SIZE; rela.r_offset = sparc64_elf_plt_ptr_offset (h->plt.offset, max); rela.r_addend = -(sparc64_elf_plt_entry_offset (h->plt.offset) + 4) -(splt->output_section->vma + splt->output_offset); @@ -2732,7 +2769,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset = (sgot->output_section->vma + sgot->output_offset - + (h->got.offset &~ 1)); + + (h->got.offset &~ (bfd_vma) 1)); /* If this is a -Bsymbolic link, and the symbol is defined locally, we just want to emit a RELATIVE reloc. Likewise if @@ -2874,8 +2911,8 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) /* Initialize the contents of the .plt section. */ if (splt->_raw_size > 0) { - sparc64_elf_build_plt(output_bfd, splt->contents, - splt->_raw_size / PLT_ENTRY_SIZE); + sparc64_elf_build_plt (output_bfd, splt->contents, + (int) (splt->_raw_size / PLT_ENTRY_SIZE)); } elf_section_data (splt->output_section)->this_hdr.sh_entsize = @@ -2900,26 +2937,25 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) return true; } - -/* Functions for dealing with the e_flags field. */ -/* Copy backend specific data from one object module to another */ -static boolean -sparc64_elf_copy_private_bfd_data (ibfd, obfd) - bfd *ibfd, *obfd; +static enum elf_reloc_type_class +sparc64_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour - || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; - - BFD_ASSERT (!elf_flags_init (obfd) - || (elf_elfheader (obfd)->e_flags - == elf_elfheader (ibfd)->e_flags)); - - elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; - elf_flags_init (obfd) = true; - return true; + switch ((int) ELF64_R_TYPE (rela->r_info)) + { + case R_SPARC_RELATIVE: + return reloc_class_relative; + case R_SPARC_JMP_SLOT: + return reloc_class_plt; + case R_SPARC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } } + +/* Functions for dealing with the e_flags field. */ /* Merge backend specific data from an object file to the output object file when linking. */ @@ -2976,7 +3012,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: linking UltraSPARC specific with HAL specific code"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); } /* Choose the most restrictive memory ordering. */ old_mm = (old_flags & EF_SPARCV9_MM); @@ -2995,7 +3031,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_get_filename (ibfd), (long)new_flags, (long)old_flags); + bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); } elf_elfheader (obfd)->e_flags = old_flags; @@ -3029,8 +3065,8 @@ sparc64_elf_print_symbol_all (abfd, filep, symbol) fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "", ((type & BSF_LOCAL) ? (type & BSF_GLOBAL) ? '!' : 'l' - : (type & BSF_GLOBAL) ? 'g' : ' '), - (type & BSF_WEAK) ? 'w' : ' '); + : (type & BSF_GLOBAL) ? 'g' : ' '), + (type & BSF_WEAK) ? 'w' : ' '); if (symbol->name == NULL || symbol->name [0] == '\0') return "#scratch"; else @@ -3142,8 +3178,6 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_print_symbol_all #define elf_backend_output_arch_syms \ sparc64_elf_output_arch_syms -#define bfd_elf64_bfd_copy_private_bfd_data \ - sparc64_elf_copy_private_bfd_data #define bfd_elf64_bfd_merge_private_bfd_data \ sparc64_elf_merge_private_bfd_data @@ -3151,6 +3185,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_size_info #define elf_backend_object_p \ sparc64_elf_object_p +#define elf_backend_reloc_type_class \ + sparc64_elf_reloc_type_class #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 diff --git a/contrib/binutils/bfd/elf64-x86-64.c b/contrib/binutils/bfd/elf64-x86-64.c index 6153468..4bbbb08 100644 --- a/contrib/binutils/bfd/elf64-x86-64.c +++ b/contrib/binutils/bfd/elf64-x86-64.c @@ -79,7 +79,16 @@ static reloc_howto_type x86_64_elf_howto_table[] = HOWTO(R_X86_64_8, 0, 0, 8, false, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_X86_64_8", false, 0xff, 0xff, false), HOWTO(R_X86_64_PC8, 0, 0, 8, true, 0, complain_overflow_signed, - bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true) + bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true), + +/* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, false, 0, complain_overflow_dont, + NULL, "R_X86_64_GNU_VTINHERIT", false, 0, 0, false), + +/* GNU extension to record C++ vtable member usage. */ + HOWTO (R_X86_64_GNU_VTENTRY, 0, 4, 0, false, 0, complain_overflow_dont, + _bfd_elf_rel_vtable_reloc_fn, "R_X86_64_GNU_VTENTRY", false, 0, 0, + false) }; /* Map BFD relocs to the x86_64 elf relocs. */ @@ -89,7 +98,7 @@ struct elf_reloc_map unsigned char elf_reloc_val; }; -static CONST struct elf_reloc_map x86_64_reloc_map[] = +static const struct elf_reloc_map x86_64_reloc_map[] = { { BFD_RELOC_NONE, R_X86_64_NONE, }, { BFD_RELOC_64, R_X86_64_64, }, @@ -107,6 +116,8 @@ static CONST struct elf_reloc_map x86_64_reloc_map[] = { BFD_RELOC_16_PCREL, R_X86_64_PC16, }, { BFD_RELOC_8, R_X86_64_8, }, { BFD_RELOC_8_PCREL, R_X86_64_PC8, }, + { BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, }, + { BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, }, }; static reloc_howto_type *elf64_x86_64_reloc_type_lookup @@ -115,6 +126,17 @@ static void elf64_x86_64_info_to_howto PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create PARAMS ((bfd *)); +static boolean elf64_x86_64_elf_object_p PARAMS ((bfd *abfd)); +static boolean elf64_x86_64_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, + const Elf_Internal_Rela *)); +static asection *elf64_x86_64_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static boolean elf64_x86_64_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static struct bfd_hash_entry *elf64_x86_64_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); @@ -131,6 +153,8 @@ static boolean elf64_x86_64_finish_dynamic_symbol Elf_Internal_Sym *sym)); static boolean elf64_x86_64_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static enum elf_reloc_type_class elf64_x86_64_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); /* Given a BFD reloc type, return a HOWTO structure. */ static reloc_howto_type * @@ -143,8 +167,7 @@ elf64_x86_64_reloc_type_lookup (abfd, code) i++) { if (x86_64_reloc_map[i].bfd_reloc_val == code) - return &x86_64_elf_howto_table[(int) - x86_64_reloc_map[i].elf_reloc_val]; + return &x86_64_elf_howto_table[i]; } return 0; } @@ -157,11 +180,20 @@ elf64_x86_64_info_to_howto (abfd, cache_ptr, dst) arelent *cache_ptr; Elf64_Internal_Rela *dst; { - unsigned r_type; + unsigned r_type, i; r_type = ELF64_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_X86_64_max); - cache_ptr->howto = &x86_64_elf_howto_table[r_type]; + if (r_type < (unsigned int) R_X86_64_GNU_VTINHERIT) + { + BFD_ASSERT (r_type <= (unsigned int) R_X86_64_PC8); + i = r_type; + } + else + { + BFD_ASSERT (r_type < (unsigned int) R_X86_64_max); + i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_PC8 - 1); + } + cache_ptr->howto = &x86_64_elf_howto_table[i]; BFD_ASSERT (r_type == cache_ptr->howto->type); } @@ -295,9 +327,9 @@ elf64_x86_64_link_hash_table_create (abfd) bfd *abfd; { struct elf64_x86_64_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf64_x86_64_link_hash_table); - ret = ((struct elf64_x86_64_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf64_x86_64_link_hash_table))); + ret = ((struct elf64_x86_64_link_hash_table *) bfd_alloc (abfd, amt)); if (ret == (struct elf64_x86_64_link_hash_table *) NULL) return NULL; @@ -311,7 +343,7 @@ elf64_x86_64_link_hash_table_create (abfd) return &ret->root.root; } -boolean +static boolean elf64_x86_64_elf_object_p (abfd) bfd *abfd; { @@ -409,10 +441,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.refcount == -1) + if (h->got.refcount == 0) { - h->got.refcount = 1; - /* Make sure this symbol is output as a dynamic symbol. */ if (h->dynindx == -1) { @@ -423,28 +453,25 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) sgot->_raw_size += GOT_ENTRY_SIZE; srelgot->_raw_size += sizeof (Elf64_External_Rela); } - else - h->got.refcount += 1; + h->got.refcount += 1; } else { /* This is a global offset table entry for a local symbol. */ if (local_got_refcounts == NULL) { - size_t size; + bfd_size_type size; - size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + size = symtab_hdr->sh_info; + size *= sizeof (bfd_signed_vma); local_got_refcounts = ((bfd_signed_vma *) - bfd_alloc (abfd, size)); + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) return false; elf_local_got_refcounts (abfd) = local_got_refcounts; - memset (local_got_refcounts, -1, size); } - if (local_got_refcounts[r_symndx] == -1) + if (local_got_refcounts[r_symndx] == 0) { - local_got_refcounts[r_symndx] = 1; - sgot->_raw_size += GOT_ENTRY_SIZE; if (info->shared) { @@ -454,8 +481,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) srelgot->_raw_size += sizeof (Elf64_External_Rela); } } - else - local_got_refcounts[r_symndx] += 1; + local_got_refcounts[r_symndx] += 1; } break; @@ -473,10 +499,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) continue; h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - if (h->plt.refcount == -1) - h->plt.refcount = 1; - else - h->plt.refcount += 1; + h->plt.refcount += 1; break; case R_X86_64_8: @@ -545,6 +568,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf64_External_Rela); @@ -572,7 +597,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) if (p == NULL) { p = ((struct elf64_x86_64_pcrel_relocs_copied *) - bfd_alloc (dynobj, sizeof *p)); + bfd_alloc (dynobj, (bfd_size_type) sizeof *p)); if (p == NULL) return false; p->next = eh->pcrel_relocs_copied; @@ -585,6 +610,20 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) } } break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_X86_64_GNU_VTINHERIT: + if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_X86_64_GNU_VTENTRY: + if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; } } @@ -604,28 +643,30 @@ elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym) { if (h != NULL) { - switch (h->root.type) + switch (ELF64_R_TYPE (rel->r_info)) { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; + case R_X86_64_GNU_VTINHERIT: + case R_X86_64_GNU_VTENTRY: + break; default: - break; + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } } } else { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); } return NULL; @@ -807,6 +848,8 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) return true; } + else + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -893,14 +936,13 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) static boolean elf64_x86_64_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -940,7 +982,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - plt = relocs = reltext = false; + plt = relocs = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -985,29 +1027,8 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) } else { - asection *target; - - /* Remember whether there are any reloc sections other - than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rela.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1043,37 +1064,39 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + if (! info->shared) { - if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } if (plt) { - if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } if (relocs) { - if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, - sizeof (Elf64_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { - if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } +#undef add_dynamic_entry return true; } @@ -1160,6 +1183,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, unsigned int indx; r_type = ELF64_R_TYPE (rela->r_info); + if (r_type == (int) R_X86_64_GNU_VTINHERIT + || r_type == (int) R_X86_64_GNU_VTENTRY) + continue; if ((indx = (unsigned) r_type) >= R_X86_64_max) { @@ -1197,9 +1223,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rela); } else { @@ -1249,7 +1273,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), - bfd_get_filename (input_bfd), h->root.root.string, + bfd_archive_filename (input_bfd), h->root.root.string, bfd_get_section_name (input_bfd, input_section)); relocation = 0; } @@ -1260,7 +1284,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) + && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else @@ -1408,7 +1434,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, case R_X86_64_64: /* FIXME: The ABI says the linker should make sure the value is the same when it's zeroextended to 64 bit. */ - if (info->shared && (input_section->flags & SEC_ALLOC) != 0) + if (info->shared + && r_symndx != 0 + && (input_section->flags & SEC_ALLOC) != 0) { Elf_Internal_Rela outrel; boolean skip, relocate; @@ -1439,21 +1467,11 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, skip = false; - if (elf_section_data (input_section)->stab_info == NULL) - outrel.r_offset = rela->r_offset; - else - { - bfd_vma off; - - off = (_bfd_stab_section_offset - (output_bfd, &elf_hash_table (info)->stab_info, - input_section, - &elf_section_data (input_section)->stab_info, - rela->r_offset)); - if (off == (bfd_vma) -1) - skip = true; - outrel.r_offset = off; - } + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rela->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = true; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -1485,7 +1503,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, } else { - long indx; + long sindx; if (h == NULL) sec = local_sections[r_symndx]; @@ -1497,7 +1515,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, sec = h->root.u.def.section; } if (sec != NULL && bfd_is_abs_section (sec)) - indx = 0; + sindx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); @@ -1508,12 +1526,12 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, asection *osec; osec = sec->output_section; - indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + sindx = elf_section_data (osec)->dynindx; + BFD_ASSERT (sindx > 0); } relocate = false; - outrel.r_info = ELF64_R_INFO (indx, r_type); + outrel.r_info = ELF64_R_INFO (sindx, r_type); outrel.r_addend = relocation + rela->r_addend; } @@ -1694,7 +1712,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset = (sgot->output_section->vma + sgot->output_offset - + (h->got.offset &~ 1)); + + (h->got.offset &~ (bfd_vma) 1)); /* If this is a static link, or it is a -Bsymbolic link and the symbol is defined locally or was forced to be local because @@ -1893,6 +1911,22 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) return true; } +static enum elf_reloc_type_class +elf64_x86_64_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELF64_R_TYPE (rela->r_info)) + { + case R_X86_64_RELATIVE: + return reloc_class_relative; + case R_X86_64_JUMP_SLOT: + return reloc_class_plt; + case R_X86_64_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec #define TARGET_LITTLE_NAME "elf64-x86-64" @@ -1901,6 +1935,7 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) #define ELF_MAXPAGESIZE 0x100000 #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 @@ -1925,5 +1960,6 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_object_p elf64_x86_64_elf_object_p +#define elf_backend_reloc_type_class elf64_x86_64_reloc_type_class #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elfarm-nabi.c b/contrib/binutils/bfd/elfarm-nabi.c index ee91e36..7ced680 100644 --- a/contrib/binutils/bfd/elfarm-nabi.c +++ b/contrib/binutils/bfd/elfarm-nabi.c @@ -42,6 +42,10 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); +static boolean elf32_arm_nabi_grok_prstatus + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); +static boolean elf32_arm_nabi_grok_psinfo + PARAMS ((bfd *abfd, Elf_Internal_Note *note)); /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO @@ -578,6 +582,9 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ +static void elf32_arm_info_to_howto + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -622,27 +629,27 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE}, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, - {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, - {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, - {BFD_RELOC_32, R_ARM_ABS32}, - {BFD_RELOC_32_PCREL, R_ARM_REL32}, - {BFD_RELOC_8, R_ARM_ABS8}, - {BFD_RELOC_16, R_ARM_ABS16}, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, - {BFD_RELOC_ARM_COPY, R_ARM_COPY}, - {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, - {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, - {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, - {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, - {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, - {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, - {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} -}; + { + {BFD_RELOC_NONE, R_ARM_NONE}, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, + {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, + {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, + {BFD_RELOC_32, R_ARM_ABS32}, + {BFD_RELOC_32_PCREL, R_ARM_REL32}, + {BFD_RELOC_8, R_ARM_ABS8}, + {BFD_RELOC_16, R_ARM_ABS16}, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, + {BFD_RELOC_ARM_COPY, R_ARM_COPY}, + {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, + {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, + {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, + {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, + {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, + {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, + {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) @@ -674,4 +681,72 @@ elf32_arm_reloc_type_lookup (abfd, code) } } +/* Support for core dump NOTE sections */ +static boolean +elf32_arm_nabi_grok_prstatus (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + int offset; + size_t raw_size; + + switch (note->descsz) + { + default: + return false; + + case 148: /* Linux/ARM 32-bit*/ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 72; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + raw_size, note->descpos + offset); +} + +static boolean +elf32_arm_nabi_grok_psinfo (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + switch (note->descsz) + { + default: + return false; + + case 124: /* Linux/ARM elf_prpsinfo */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return true; +} + +#define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus +#define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo + #include "elf32-arm.h" diff --git a/contrib/binutils/bfd/elfarm-oabi.c b/contrib/binutils/bfd/elfarm-oabi.c index b4f93f0..25c4d89 100644 --- a/contrib/binutils/bfd/elfarm-oabi.c +++ b/contrib/binutils/bfd/elfarm-oabi.c @@ -42,305 +42,310 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION 0 +static reloc_howto_type * find_howto PARAMS ((unsigned int)); +static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); + static reloc_howto_type elf32_arm_howto_table[] = -{ - /* No relocation */ - HOWTO (R_ARM_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_PC24, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC24", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 32 bit absolute */ - HOWTO (R_ARM_ABS32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* standard 32bit pc-relative reloc */ - HOWTO (R_ARM_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_REL32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 8 bit absolute */ - HOWTO (R_ARM_ABS8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit absolute */ - HOWTO (R_ARM_ABS16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 12 bit absolute */ - HOWTO (R_ARM_ABS12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ - 0x000008ff, /* src_mask */ - 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_ABS5, /* type */ - 6, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ - 0x000007e0, /* src_mask */ - 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_PC22, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 23, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ - 0x07ff07ff, /* src_mask */ - 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ - - HOWTO (R_ARM_SBREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_AMP_VCALL9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC11, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_ARM_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_ARM_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_PLT32, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PLT32", /* name */ - true, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_RREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RABS32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RPC24, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RBASE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false) /* pcrel_offset */ -}; + { + /* No relocation. */ + HOWTO (R_ARM_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_PC24, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC24", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32 bit absolute. */ + HOWTO (R_ARM_ABS32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Standard 32bit pc-relative reloc. */ + HOWTO (R_ARM_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 8 bit absolute. */ + HOWTO (R_ARM_ABS8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit absolute. */ + HOWTO (R_ARM_ABS16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 12 bit absolute. */ + HOWTO (R_ARM_ABS12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS12", /* name */ + false, /* partial_inplace */ + 0x000008ff, /* src_mask */ + 0x000008ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_ABS5, /* type */ + 6, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ABS5", /* name */ + false, /* partial_inplace */ + 0x000007e0, /* src_mask */ + 0x000007e0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC22, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 23, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC22", /* name */ + false, /* partial_inplace */ + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_SBREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SBREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_AMP_VCALL9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_AMP_VCALL9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC11", /* name */ + false, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_ARM_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_PLT32, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PLT32", /* name */ + true, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_RREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RABS32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RABS32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RPC24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RPC24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RBASE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RBASE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false) /* pcrel_offset */ + }; /* Locate a reloc in the howto table. This function must be used when the entry number is is > R_ARM_GNU_VTINHERIT. */ + static reloc_howto_type * find_howto (r_type) unsigned int r_type; @@ -377,23 +382,23 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE }, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, - {BFD_RELOC_32, R_ARM_ABS32 }, - {BFD_RELOC_32_PCREL, R_ARM_REL32 }, - {BFD_RELOC_8, R_ARM_ABS8 }, - {BFD_RELOC_16, R_ARM_ABS16 }, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, - {BFD_RELOC_NONE, R_ARM_SBREL32 }, - {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, - {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, - {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, - {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, - {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } -}; + { + {BFD_RELOC_NONE, R_ARM_NONE }, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, + {BFD_RELOC_32, R_ARM_ABS32 }, + {BFD_RELOC_32_PCREL, R_ARM_REL32 }, + {BFD_RELOC_8, R_ARM_ABS8 }, + {BFD_RELOC_16, R_ARM_ABS16 }, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, + {BFD_RELOC_NONE, R_ARM_SBREL32 }, + {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, + {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, + {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, + {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, + {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h index b02a399..203323c 100644 --- a/contrib/binutils/bfd/elfcode.h +++ b/contrib/binutils/bfd/elfcode.h @@ -66,6 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" +#include "libiberty.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -122,6 +123,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table) #define elf_link_create_dynamic_sections \ NAME(bfd_elf,link_create_dynamic_sections) +#define elf_bfd_discard_info NAME(bfd_elf,discard_info) +#define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p) #define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol #define elf_bfd_final_link NAME(bfd_elf,bfd_final_link) #define elf_create_pointer_linker_section NAME(bfd_elf,create_pointer_linker_section) @@ -184,56 +187,73 @@ static char *elf_symbol_flags PARAMS ((flagword)); /* Should perhaps use put_offset, put_word, etc. For now, the two versions 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 +#define H_PUT_WORD H_PUT_64 +#define H_PUT_SIGNED_WORD H_PUT_S64 +#define H_GET_WORD H_GET_64 +#define H_GET_SIGNED_WORD H_GET_S64 #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 +#define H_PUT_WORD H_PUT_32 +#define H_PUT_SIGNED_WORD H_PUT_S32 +#define H_GET_WORD H_GET_32 +#define H_GET_SIGNED_WORD H_GET_S32 #endif /* Translate an ELF symbol in external format into an ELF symbol in internal format. */ void -elf_swap_symbol_in (abfd, src, dst) +elf_swap_symbol_in (abfd, src, shndx, dst) bfd *abfd; const Elf_External_Sym *src; + const Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym *dst; { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; - dst->st_name = bfd_h_get_32 (abfd, (bfd_byte *) src->st_name); + dst->st_name = H_GET_32 (abfd, src->st_name); if (signed_vma) - dst->st_value = get_signed_word (abfd, (bfd_byte *) src->st_value); + dst->st_value = H_GET_SIGNED_WORD (abfd, src->st_value); else - dst->st_value = get_word (abfd, (bfd_byte *) src->st_value); - dst->st_size = get_word (abfd, (bfd_byte *) src->st_size); - dst->st_info = bfd_h_get_8 (abfd, (bfd_byte *) src->st_info); - dst->st_other = bfd_h_get_8 (abfd, (bfd_byte *) src->st_other); - dst->st_shndx = bfd_h_get_16 (abfd, (bfd_byte *) src->st_shndx); + dst->st_value = H_GET_WORD (abfd, src->st_value); + dst->st_size = H_GET_WORD (abfd, src->st_size); + dst->st_info = H_GET_8 (abfd, src->st_info); + dst->st_other = H_GET_8 (abfd, src->st_other); + dst->st_shndx = H_GET_16 (abfd, src->st_shndx); + if (dst->st_shndx == SHN_XINDEX) + { + if (shndx == NULL) + abort (); + dst->st_shndx = H_GET_32 (abfd, shndx->est_shndx); + } } /* Translate an ELF symbol in internal format into an ELF symbol in external format. */ void -elf_swap_symbol_out (abfd, src, cdst) +elf_swap_symbol_out (abfd, src, cdst, shndx) bfd *abfd; const Elf_Internal_Sym *src; PTR cdst; + PTR shndx; { + unsigned int tmp; Elf_External_Sym *dst = (Elf_External_Sym *) cdst; - bfd_h_put_32 (abfd, src->st_name, dst->st_name); - put_word (abfd, src->st_value, dst->st_value); - put_word (abfd, src->st_size, dst->st_size); - bfd_h_put_8 (abfd, src->st_info, dst->st_info); - bfd_h_put_8 (abfd, src->st_other, dst->st_other); - bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx); + H_PUT_32 (abfd, src->st_name, dst->st_name); + H_PUT_WORD (abfd, src->st_value, dst->st_value); + H_PUT_WORD (abfd, src->st_size, dst->st_size); + H_PUT_8 (abfd, src->st_info, dst->st_info); + H_PUT_8 (abfd, src->st_other, dst->st_other); + tmp = src->st_shndx; + if (tmp > SHN_HIRESERVE) + { + if (shndx == NULL) + abort (); + H_PUT_32 (abfd, tmp, shndx); + tmp = SHN_XINDEX; + } + H_PUT_16 (abfd, tmp, dst->st_shndx); } /* Translate an ELF file header in external format into an ELF file header in @@ -247,22 +267,22 @@ elf_swap_ehdr_in (abfd, src, dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; memcpy (dst->e_ident, src->e_ident, EI_NIDENT); - dst->e_type = bfd_h_get_16 (abfd, (bfd_byte *) src->e_type); - dst->e_machine = bfd_h_get_16 (abfd, (bfd_byte *) src->e_machine); - dst->e_version = bfd_h_get_32 (abfd, (bfd_byte *) src->e_version); + dst->e_type = H_GET_16 (abfd, src->e_type); + dst->e_machine = H_GET_16 (abfd, src->e_machine); + dst->e_version = H_GET_32 (abfd, src->e_version); if (signed_vma) - dst->e_entry = get_signed_word (abfd, (bfd_byte *) src->e_entry); + dst->e_entry = H_GET_SIGNED_WORD (abfd, src->e_entry); else - dst->e_entry = get_word (abfd, (bfd_byte *) src->e_entry); - dst->e_phoff = get_word (abfd, (bfd_byte *) src->e_phoff); - dst->e_shoff = get_word (abfd, (bfd_byte *) src->e_shoff); - dst->e_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->e_flags); - dst->e_ehsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_ehsize); - dst->e_phentsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_phentsize); - dst->e_phnum = bfd_h_get_16 (abfd, (bfd_byte *) src->e_phnum); - dst->e_shentsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shentsize); - dst->e_shnum = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shnum); - dst->e_shstrndx = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shstrndx); + dst->e_entry = H_GET_WORD (abfd, src->e_entry); + dst->e_phoff = H_GET_WORD (abfd, src->e_phoff); + dst->e_shoff = H_GET_WORD (abfd, src->e_shoff); + dst->e_flags = H_GET_32 (abfd, src->e_flags); + dst->e_ehsize = H_GET_16 (abfd, src->e_ehsize); + dst->e_phentsize = H_GET_16 (abfd, src->e_phentsize); + dst->e_phnum = H_GET_16 (abfd, src->e_phnum); + dst->e_shentsize = H_GET_16 (abfd, src->e_shentsize); + dst->e_shnum = H_GET_16 (abfd, src->e_shnum); + dst->e_shstrndx = H_GET_16 (abfd, src->e_shstrndx); } /* Translate an ELF file header in internal format into an ELF file header in @@ -274,25 +294,32 @@ elf_swap_ehdr_out (abfd, src, dst) const Elf_Internal_Ehdr *src; Elf_External_Ehdr *dst; { + unsigned int tmp; int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; memcpy (dst->e_ident, src->e_ident, EI_NIDENT); /* note that all elements of dst are *arrays of unsigned char* already... */ - bfd_h_put_16 (abfd, src->e_type, dst->e_type); - bfd_h_put_16 (abfd, src->e_machine, dst->e_machine); - bfd_h_put_32 (abfd, src->e_version, dst->e_version); + H_PUT_16 (abfd, src->e_type, dst->e_type); + H_PUT_16 (abfd, src->e_machine, dst->e_machine); + H_PUT_32 (abfd, src->e_version, dst->e_version); if (signed_vma) - put_signed_word (abfd, src->e_entry, dst->e_entry); + H_PUT_SIGNED_WORD (abfd, src->e_entry, dst->e_entry); else - put_word (abfd, src->e_entry, dst->e_entry); - put_word (abfd, src->e_phoff, dst->e_phoff); - put_word (abfd, src->e_shoff, dst->e_shoff); - bfd_h_put_32 (abfd, src->e_flags, dst->e_flags); - bfd_h_put_16 (abfd, src->e_ehsize, dst->e_ehsize); - bfd_h_put_16 (abfd, src->e_phentsize, dst->e_phentsize); - bfd_h_put_16 (abfd, src->e_phnum, dst->e_phnum); - bfd_h_put_16 (abfd, src->e_shentsize, dst->e_shentsize); - bfd_h_put_16 (abfd, src->e_shnum, dst->e_shnum); - bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx); + H_PUT_WORD (abfd, src->e_entry, dst->e_entry); + H_PUT_WORD (abfd, src->e_phoff, dst->e_phoff); + H_PUT_WORD (abfd, src->e_shoff, dst->e_shoff); + H_PUT_32 (abfd, src->e_flags, dst->e_flags); + H_PUT_16 (abfd, src->e_ehsize, dst->e_ehsize); + H_PUT_16 (abfd, src->e_phentsize, dst->e_phentsize); + H_PUT_16 (abfd, src->e_phnum, dst->e_phnum); + H_PUT_16 (abfd, src->e_shentsize, dst->e_shentsize); + tmp = src->e_shnum; + if (tmp >= SHN_LORESERVE) + tmp = SHN_UNDEF; + H_PUT_16 (abfd, tmp, dst->e_shnum); + tmp = src->e_shstrndx; + if (tmp >= SHN_LORESERVE) + tmp = SHN_XINDEX; + H_PUT_16 (abfd, tmp, dst->e_shstrndx); } /* Translate an ELF section header table entry in external format into an @@ -306,19 +333,19 @@ elf_swap_shdr_in (abfd, src, dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; - dst->sh_name = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_name); - dst->sh_type = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_type); - dst->sh_flags = get_word (abfd, (bfd_byte *) src->sh_flags); + dst->sh_name = H_GET_32 (abfd, src->sh_name); + dst->sh_type = H_GET_32 (abfd, src->sh_type); + dst->sh_flags = H_GET_WORD (abfd, src->sh_flags); if (signed_vma) - dst->sh_addr = get_signed_word (abfd, (bfd_byte *) src->sh_addr); + dst->sh_addr = H_GET_SIGNED_WORD (abfd, src->sh_addr); else - dst->sh_addr = get_word (abfd, (bfd_byte *) src->sh_addr); - dst->sh_offset = get_word (abfd, (bfd_byte *) src->sh_offset); - dst->sh_size = get_word (abfd, (bfd_byte *) src->sh_size); - dst->sh_link = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_link); - dst->sh_info = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_info); - dst->sh_addralign = get_word (abfd, (bfd_byte *) src->sh_addralign); - dst->sh_entsize = get_word (abfd, (bfd_byte *) src->sh_entsize); + dst->sh_addr = H_GET_WORD (abfd, src->sh_addr); + dst->sh_offset = H_GET_WORD (abfd, src->sh_offset); + dst->sh_size = H_GET_WORD (abfd, src->sh_size); + dst->sh_link = H_GET_32 (abfd, src->sh_link); + dst->sh_info = H_GET_32 (abfd, src->sh_info); + dst->sh_addralign = H_GET_WORD (abfd, src->sh_addralign); + dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize); dst->bfd_section = NULL; dst->contents = NULL; } @@ -333,16 +360,16 @@ elf_swap_shdr_out (abfd, src, dst) Elf_External_Shdr *dst; { /* note that all elements of dst are *arrays of unsigned char* already... */ - bfd_h_put_32 (abfd, src->sh_name, dst->sh_name); - bfd_h_put_32 (abfd, src->sh_type, dst->sh_type); - put_word (abfd, src->sh_flags, dst->sh_flags); - put_word (abfd, src->sh_addr, dst->sh_addr); - put_word (abfd, src->sh_offset, dst->sh_offset); - put_word (abfd, src->sh_size, dst->sh_size); - bfd_h_put_32 (abfd, src->sh_link, dst->sh_link); - bfd_h_put_32 (abfd, src->sh_info, dst->sh_info); - put_word (abfd, src->sh_addralign, dst->sh_addralign); - put_word (abfd, src->sh_entsize, dst->sh_entsize); + H_PUT_32 (abfd, src->sh_name, dst->sh_name); + H_PUT_32 (abfd, src->sh_type, dst->sh_type); + H_PUT_WORD (abfd, src->sh_flags, dst->sh_flags); + H_PUT_WORD (abfd, src->sh_addr, dst->sh_addr); + H_PUT_WORD (abfd, src->sh_offset, dst->sh_offset); + H_PUT_WORD (abfd, src->sh_size, dst->sh_size); + H_PUT_32 (abfd, src->sh_link, dst->sh_link); + H_PUT_32 (abfd, src->sh_info, dst->sh_info); + H_PUT_WORD (abfd, src->sh_addralign, dst->sh_addralign); + H_PUT_WORD (abfd, src->sh_entsize, dst->sh_entsize); } /* Translate an ELF program header table entry in external format into an @@ -356,22 +383,22 @@ elf_swap_phdr_in (abfd, src, dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; - dst->p_type = bfd_h_get_32 (abfd, (bfd_byte *) src->p_type); - dst->p_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->p_flags); - dst->p_offset = get_word (abfd, (bfd_byte *) src->p_offset); + dst->p_type = H_GET_32 (abfd, src->p_type); + dst->p_flags = H_GET_32 (abfd, src->p_flags); + dst->p_offset = H_GET_WORD (abfd, src->p_offset); if (signed_vma) { - dst->p_vaddr = get_signed_word (abfd, (bfd_byte *) src->p_vaddr); - dst->p_paddr = get_signed_word (abfd, (bfd_byte *) src->p_paddr); + dst->p_vaddr = H_GET_SIGNED_WORD (abfd, src->p_vaddr); + dst->p_paddr = H_GET_SIGNED_WORD (abfd, src->p_paddr); } else { - dst->p_vaddr = get_word (abfd, (bfd_byte *) src->p_vaddr); - dst->p_paddr = get_word (abfd, (bfd_byte *) src->p_paddr); + dst->p_vaddr = H_GET_WORD (abfd, src->p_vaddr); + dst->p_paddr = H_GET_WORD (abfd, src->p_paddr); } - dst->p_filesz = get_word (abfd, (bfd_byte *) src->p_filesz); - dst->p_memsz = get_word (abfd, (bfd_byte *) src->p_memsz); - dst->p_align = get_word (abfd, (bfd_byte *) src->p_align); + dst->p_filesz = H_GET_WORD (abfd, src->p_filesz); + dst->p_memsz = H_GET_WORD (abfd, src->p_memsz); + dst->p_align = H_GET_WORD (abfd, src->p_align); } void @@ -381,14 +408,14 @@ elf_swap_phdr_out (abfd, src, dst) Elf_External_Phdr *dst; { /* note that all elements of dst are *arrays of unsigned char* already... */ - bfd_h_put_32 (abfd, src->p_type, dst->p_type); - put_word (abfd, src->p_offset, dst->p_offset); - put_word (abfd, src->p_vaddr, dst->p_vaddr); - put_word (abfd, src->p_paddr, dst->p_paddr); - put_word (abfd, src->p_filesz, dst->p_filesz); - put_word (abfd, src->p_memsz, dst->p_memsz); - bfd_h_put_32 (abfd, src->p_flags, dst->p_flags); - put_word (abfd, src->p_align, dst->p_align); + H_PUT_32 (abfd, src->p_type, dst->p_type); + H_PUT_WORD (abfd, src->p_offset, dst->p_offset); + H_PUT_WORD (abfd, src->p_vaddr, dst->p_vaddr); + H_PUT_WORD (abfd, src->p_paddr, dst->p_paddr); + H_PUT_WORD (abfd, src->p_filesz, dst->p_filesz); + H_PUT_WORD (abfd, src->p_memsz, dst->p_memsz); + H_PUT_32 (abfd, src->p_flags, dst->p_flags); + H_PUT_WORD (abfd, src->p_align, dst->p_align); } /* Translate an ELF reloc from external format to internal format. */ @@ -398,8 +425,8 @@ elf_swap_reloc_in (abfd, src, dst) const Elf_External_Rel *src; Elf_Internal_Rel *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_offset = H_GET_WORD (abfd, src->r_offset); + dst->r_info = H_GET_WORD (abfd, src->r_info); } INLINE void @@ -408,9 +435,9 @@ elf_swap_reloca_in (abfd, src, dst) const Elf_External_Rela *src; Elf_Internal_Rela *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_signed_word (abfd, (bfd_byte *) src->r_addend); + dst->r_offset = H_GET_WORD (abfd, src->r_offset); + dst->r_info = H_GET_WORD (abfd, src->r_info); + dst->r_addend = H_GET_SIGNED_WORD (abfd, src->r_addend); } /* Translate an ELF reloc from internal format to external format. */ @@ -420,8 +447,8 @@ elf_swap_reloc_out (abfd, src, dst) const Elf_Internal_Rel *src; Elf_External_Rel *dst; { - put_word (abfd, src->r_offset, dst->r_offset); - put_word (abfd, src->r_info, dst->r_info); + H_PUT_WORD (abfd, src->r_offset, dst->r_offset); + H_PUT_WORD (abfd, src->r_info, dst->r_info); } INLINE void @@ -430,9 +457,9 @@ elf_swap_reloca_out (abfd, src, dst) const Elf_Internal_Rela *src; Elf_External_Rela *dst; { - put_word (abfd, src->r_offset, dst->r_offset); - put_word (abfd, src->r_info, dst->r_info); - put_signed_word (abfd, src->r_addend, dst->r_addend); + H_PUT_WORD (abfd, src->r_offset, dst->r_offset); + H_PUT_WORD (abfd, src->r_info, dst->r_info); + H_PUT_SIGNED_WORD (abfd, src->r_addend, dst->r_addend); } INLINE void @@ -443,8 +470,8 @@ elf_swap_dyn_in (abfd, p, dst) { const Elf_External_Dyn *src = (const Elf_External_Dyn *) p; - dst->d_tag = get_word (abfd, src->d_tag); - dst->d_un.d_val = get_word (abfd, src->d_un.d_val); + dst->d_tag = H_GET_WORD (abfd, src->d_tag); + dst->d_un.d_val = H_GET_WORD (abfd, src->d_un.d_val); } INLINE void @@ -455,8 +482,8 @@ elf_swap_dyn_out (abfd, src, p) { Elf_External_Dyn *dst = (Elf_External_Dyn *) p; - put_word (abfd, src->d_tag, dst->d_tag); - put_word (abfd, src->d_un.d_val, dst->d_un.d_val); + H_PUT_WORD (abfd, src->d_tag, dst->d_tag); + H_PUT_WORD (abfd, src->d_un.d_val, dst->d_un.d_val); } /* ELF .o/exec file reading */ @@ -476,6 +503,16 @@ elf_file_p (x_ehdrp) && (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3)); } +struct bfd_preserve +{ + const struct bfd_arch_info *arch_info; + struct elf_obj_tdata *tdata; + struct bfd_hash_table section_htab; + struct sec *sections; + struct sec **section_tail; + unsigned int section_count; +}; + /* Check to see if the file associated with ABFD matches the target vector that ABFD points to. @@ -491,26 +528,22 @@ elf_object_p (abfd) Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ Elf_External_Shdr x_shdr; /* Section header table entry, external form */ - Elf_Internal_Shdr *i_shdrp = NULL; /* Section header table, internal form */ + Elf_Internal_Shdr i_shdr; + Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */ unsigned int shindex; char *shstrtab; /* Internal copy of section header stringtab */ struct elf_backend_data *ebd; - struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd); - struct sec *preserved_sections = abfd->sections; - unsigned int preserved_section_count = abfd->section_count; - enum bfd_architecture previous_arch = bfd_get_arch (abfd); - unsigned long previous_mach = bfd_get_mach (abfd); + struct bfd_preserve preserve; struct elf_obj_tdata *new_tdata = NULL; asection *s; + bfd_size_type amt; - /* Clear section information, since there might be a recognized bfd that - we now check if we can replace, and we don't want to append to it. */ - abfd->sections = NULL; - abfd->section_count = 0; + preserve.arch_info = abfd->arch_info; /* Read in the ELF header in external format. */ - if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) + if (bfd_bread ((PTR) & x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd) + != sizeof (x_ehdr)) { if (bfd_get_error () != bfd_error_system_call) goto got_wrong_format_error; @@ -548,12 +581,25 @@ elf_object_p (abfd) /* Allocate an instance of the elf_obj_tdata structure and hook it up to the tdata pointer in the bfd. */ - new_tdata = ((struct elf_obj_tdata *) - bfd_zalloc (abfd, sizeof (struct elf_obj_tdata))); + amt = sizeof (struct elf_obj_tdata); + new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); if (new_tdata == NULL) goto got_no_match; + preserve.tdata = elf_tdata (abfd); elf_tdata (abfd) = new_tdata; + /* Clear section information, since there might be a recognized bfd that + we now check if we can replace, and we don't want to append to it. */ + preserve.sections = abfd->sections; + preserve.section_tail = abfd->section_tail; + preserve.section_count = abfd->section_count; + preserve.section_htab = abfd->section_htab; + abfd->sections = NULL; + abfd->section_tail = &abfd->sections; + abfd->section_count = 0; + if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + goto got_no_match; + /* Now that we know the byte order, swap in the rest of the header */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -565,14 +611,15 @@ elf_object_p (abfd) if (i_ehdrp->e_type == ET_CORE) goto got_wrong_format_error; - /* If there is no section header table, we're hosed. */ - if (i_ehdrp->e_shoff == 0) + /* If this is a relocatable file and there is no section header + table, then we're hosed. */ + if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL) goto got_wrong_format_error; /* As a simple sanity check, verify that the what BFD thinks is the size of each section header table entry actually matches the size - recorded in the file. */ - if (i_ehdrp->e_shentsize != sizeof (x_shdr)) + recorded in the file, but only if there are any sections. */ + if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0) goto got_wrong_format_error; ebd = get_elf_backend_data (abfd); @@ -628,34 +675,80 @@ elf_object_p (abfd) /* Remember the entry point specified in the ELF file header. */ bfd_set_start_address (abfd, i_ehdrp->e_entry); - /* Allocate space for a copy of the section header table in - internal form, seek to the section header table in the file, - read it in, and convert it to internal form. */ - i_shdrp = ((Elf_Internal_Shdr *) - bfd_alloc (abfd, sizeof (*i_shdrp) * i_ehdrp->e_shnum)); - elf_elfsections (abfd) = ((Elf_Internal_Shdr **) - bfd_alloc (abfd, - sizeof (i_shdrp) * i_ehdrp->e_shnum)); - if (!i_shdrp || !elf_elfsections (abfd)) + /* Seek to the section header table in the file. */ + if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0) goto got_no_match; - if (bfd_seek (abfd, i_ehdrp->e_shoff, SEEK_SET) != 0) + + /* Read the first section header at index 0, and convert to internal + form. */ + if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) + != sizeof (x_shdr)) goto got_no_match; - for (shindex = 0; shindex < i_ehdrp->e_shnum; shindex++) + elf_swap_shdr_in (abfd, &x_shdr, &i_shdr); + + /* If the section count is zero, the actual count is in the first + section header. */ + if (i_ehdrp->e_shnum == SHN_UNDEF) + i_ehdrp->e_shnum = i_shdr.sh_size; + + /* And similarly for the string table index. */ + if (i_ehdrp->e_shstrndx == SHN_XINDEX) + i_ehdrp->e_shstrndx = i_shdr.sh_link; + + /* Allocate space for a copy of the section header table in + internal form. */ + if (i_ehdrp->e_shnum != 0) { - if (bfd_read ((PTR) & x_shdr, sizeof x_shdr, 1, abfd) != sizeof (x_shdr)) + Elf_Internal_Shdr *shdrp; + unsigned int num_sec; + + amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum; + i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + if (!i_shdrp) goto got_no_match; - elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex); - elf_elfsections (abfd)[shindex] = i_shdrp + shindex; - - /* If the section is loaded, but not page aligned, clear - D_PAGED. */ - if ((i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0 - && i_shdrp[shindex].sh_type != SHT_NOBITS - && (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset) - % ebd->maxpagesize) - != 0)) - abfd->flags &= ~D_PAGED; + num_sec = i_ehdrp->e_shnum; + if (num_sec > SHN_LORESERVE) + num_sec += SHN_HIRESERVE + 1 - SHN_LORESERVE; + elf_numsections (abfd) = num_sec; + amt = sizeof (i_shdrp) * num_sec; + elf_elfsections (abfd) = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt); + if (!elf_elfsections (abfd)) + goto got_no_match; + + memcpy (i_shdrp, &i_shdr, sizeof (*i_shdrp)); + shdrp = i_shdrp; + shindex = 0; + if (num_sec > SHN_LORESERVE) + { + for ( ; shindex < SHN_LORESERVE; shindex++) + elf_elfsections (abfd)[shindex] = shdrp++; + for ( ; shindex < SHN_HIRESERVE + 1; shindex++) + elf_elfsections (abfd)[shindex] = i_shdrp; + } + for ( ; shindex < num_sec; shindex++) + elf_elfsections (abfd)[shindex] = shdrp++; + + /* Read in the rest of the section header table and convert it + to internal form. */ + for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++) + { + if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) + != sizeof (x_shdr)) + goto got_no_match; + elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex); + + /* If the section is loaded, but not page aligned, clear + D_PAGED. */ + if (i_shdrp[shindex].sh_size != 0 + && (i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0 + && i_shdrp[shindex].sh_type != SHT_NOBITS + && (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset) + % ebd->maxpagesize) + != 0)) + abfd->flags &= ~D_PAGED; + } } + if (i_ehdrp->e_shstrndx) { if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx)) @@ -670,20 +763,18 @@ elf_object_p (abfd) Elf_Internal_Phdr *i_phdr; unsigned int i; - elf_tdata (abfd)->phdr = ((Elf_Internal_Phdr *) - bfd_alloc (abfd, - (i_ehdrp->e_phnum - * sizeof (Elf_Internal_Phdr)))); + amt = i_ehdrp->e_phnum * sizeof (Elf_Internal_Phdr); + elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); if (elf_tdata (abfd)->phdr == NULL) goto got_no_match; - if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_phoff, SEEK_SET) != 0) goto got_no_match; i_phdr = elf_tdata (abfd)->phdr; for (i = 0; i < i_ehdrp->e_phnum; i++, i_phdr++) { Elf_External_Phdr x_phdr; - if (bfd_read ((PTR) &x_phdr, sizeof x_phdr, 1, abfd) + if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof x_phdr, abfd) != sizeof x_phdr) goto got_no_match; elf_swap_phdr_in (abfd, &x_phdr, i_phdr); @@ -696,18 +787,25 @@ elf_object_p (abfd) bfd_section_from_shdr with it (since this particular strtab is used to find all of the ELF section names.) */ - shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx); - if (!shstrtab) - goto got_no_match; - - /* Once all of the section headers have been read and converted, we - can start processing them. Note that the first section header is - a dummy placeholder entry, so we ignore it. */ - - for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++) + if (i_ehdrp->e_shstrndx != 0) { - if (! bfd_section_from_shdr (abfd, shindex)) + unsigned int num_sec; + + shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx); + if (!shstrtab) goto got_no_match; + + /* Once all of the section headers have been read and converted, we + can start processing them. Note that the first section header is + a dummy placeholder entry, so we ignore it. */ + num_sec = elf_numsections (abfd); + for (shindex = 1; shindex < num_sec; shindex++) + { + if (! bfd_section_from_shdr (abfd, shindex)) + goto got_no_match; + if (shindex == SHN_LORESERVE - 1) + shindex += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } } /* Let the backend double check the format and override global @@ -737,6 +835,10 @@ elf_object_p (abfd) } } + /* It would be nice to be able to free more memory here, eg. old + elf_elfsections, old tdata, but that's not possible since these + blocks are sitting inside obj_alloc'd memory. */ + bfd_hash_table_free (&preserve.section_htab); return (abfd->xvec); got_wrong_format_error: @@ -749,20 +851,22 @@ elf_object_p (abfd) target-specific elf_backend_object_p function. Note that saving the whole bfd here and restoring it would be even worse; the first thing you notice is that the cached bfd file position gets out of sync. */ - bfd_default_set_arch_mach (abfd, previous_arch, previous_mach); bfd_set_error (bfd_error_wrong_format); + got_no_match: - if (new_tdata != NULL - && new_tdata->elf_sect_ptr != NULL) - bfd_release (abfd, new_tdata->elf_sect_ptr); - if (i_shdrp != NULL) - bfd_release (abfd, i_shdrp); + abfd->arch_info = preserve.arch_info; if (new_tdata != NULL) - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserved_tdata; - abfd->sections = preserved_sections; - abfd->section_count = preserved_section_count; - return (NULL); + { + /* bfd_release frees all memory more recently bfd_alloc'd than + its arg, as well as its arg. */ + bfd_release (abfd, new_tdata); + elf_tdata (abfd) = preserve.tdata; + abfd->section_htab = preserve.section_htab; + abfd->sections = preserve.sections; + abfd->section_tail = preserve.section_tail; + abfd->section_count = preserve.section_count; + } + return NULL; } /* ELF .o/exec file writing */ @@ -935,14 +1039,14 @@ int elf_write_out_phdrs (abfd, phdr, count) bfd *abfd; const Elf_Internal_Phdr *phdr; - int count; + unsigned int count; { while (count--) { Elf_External_Phdr extphdr; elf_swap_phdr_out (abfd, phdr, &extphdr); - if (bfd_write (&extphdr, sizeof (Elf_External_Phdr), 1, abfd) - != sizeof (Elf_External_Phdr)) + if (bfd_bwrite (&extphdr, (bfd_size_type) sizeof (Elf_External_Phdr), + abfd) != sizeof (Elf_External_Phdr)) return -1; phdr++; } @@ -960,6 +1064,7 @@ elf_write_shdrs_and_ehdr (abfd) Elf_External_Shdr *x_shdrp; /* Section header table, external form */ Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */ unsigned int count; + bfd_size_type amt; i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); @@ -970,27 +1075,37 @@ elf_write_shdrs_and_ehdr (abfd) elf_debug_file (i_ehdrp); #endif elf_swap_ehdr_out (abfd, i_ehdrp, &x_ehdr); + amt = sizeof (x_ehdr); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || (bfd_write ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) - != sizeof (x_ehdr))) + || bfd_bwrite ((PTR) & x_ehdr, amt, abfd) != amt) return false; + /* Some fields in the first section header handle overflow of ehdr + fields. */ + if (i_ehdrp->e_shnum >= SHN_LORESERVE) + i_shdrp[0]->sh_size = i_ehdrp->e_shnum; + if (i_ehdrp->e_shstrndx >= SHN_LORESERVE) + i_shdrp[0]->sh_link = i_ehdrp->e_shstrndx; + /* at this point we've concocted all the ELF sections... */ - x_shdrp = (Elf_External_Shdr *) - bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum)); + amt = i_ehdrp->e_shnum; + amt *= sizeof (*x_shdrp); + x_shdrp = (Elf_External_Shdr *) bfd_alloc (abfd, amt); if (!x_shdrp) return false; - for (count = 0; count < i_ehdrp->e_shnum; count++) + for (count = 0; count < i_ehdrp->e_shnum; i_shdrp++, count++) { #if DEBUG & 2 - elf_debug_section (count, i_shdrp[count]); + elf_debug_section (count, *i_shdrp); #endif - elf_swap_shdr_out (abfd, i_shdrp[count], x_shdrp + count); + elf_swap_shdr_out (abfd, *i_shdrp, x_shdrp + count); + + if (count == SHN_LORESERVE - 1) + i_shdrp += SHN_HIRESERVE + 1 - SHN_LORESERVE; } if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0 - || (bfd_write ((PTR) x_shdrp, sizeof (*x_shdrp), i_ehdrp->e_shnum, abfd) - != sizeof (*x_shdrp) * i_ehdrp->e_shnum)) + || bfd_bwrite ((PTR) x_shdrp, amt, abfd) != amt) return false; /* need to dump the string table too... */ @@ -1011,7 +1126,9 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) elf_symbol_type *symbase; /* Buffer for generated bfd symbols */ Elf_Internal_Sym i_sym; Elf_External_Sym *x_symp = NULL; + Elf_External_Sym_Shndx *x_shndx = NULL; Elf_External_Versym *x_versymp = NULL; + bfd_size_type amt; /* Read each raw ELF symbol, converting from external ELF form to internal ELF form, and then using the information to create a @@ -1025,8 +1142,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (! dynamic) { + Elf_Internal_Shdr *shndx_hdr; + hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; verhdr = NULL; + + /* If we have a SHT_SYMTAB_SHNDX section for the symbol table, + read the raw contents. */ + if (elf_elfsections (abfd) != NULL + && elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr) + { + amt = shndx_hdr->sh_size; + x_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (x_shndx == NULL + || bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) x_shndx, amt, abfd) != amt) + goto error_return; + } } else { @@ -1045,8 +1178,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) } } - if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1) - return -1; + if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0) + goto error_return; symcount = hdr->sh_size / sizeof (Elf_External_Sym); @@ -1056,23 +1189,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) { unsigned long i; - if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1) - return -1; + if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0) + goto error_return; - symbase = ((elf_symbol_type *) - bfd_zalloc (abfd, symcount * sizeof (elf_symbol_type))); + amt = symcount; + amt *= sizeof (elf_symbol_type); + symbase = (elf_symbol_type *) bfd_zalloc (abfd, amt); if (symbase == (elf_symbol_type *) NULL) - return -1; + goto error_return; sym = symbase; /* Temporarily allocate room for the raw ELF symbols. */ - x_symp = ((Elf_External_Sym *) - bfd_malloc (symcount * sizeof (Elf_External_Sym))); - if (x_symp == NULL && symcount != 0) + amt = symcount; + amt *= sizeof (Elf_External_Sym); + x_symp = (Elf_External_Sym *) bfd_malloc (amt); + if (x_symp == NULL) goto error_return; - if (bfd_read ((PTR) x_symp, sizeof (Elf_External_Sym), symcount, abfd) - != symcount * sizeof (Elf_External_Sym)) + if (bfd_bread ((PTR) x_symp, amt, abfd) != amt) goto error_return; /* Read the raw ELF version symbol information. */ @@ -1100,7 +1234,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (x_versymp == NULL && verhdr->sh_size != 0) goto error_return; - if (bfd_read ((PTR) x_versymp, 1, verhdr->sh_size, abfd) + if (bfd_bread ((PTR) x_versymp, verhdr->sh_size, abfd) != verhdr->sh_size) goto error_return; } @@ -1108,7 +1242,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) /* Skip first symbol, which is a null dummy. */ for (i = 1; i < symcount; i++) { - elf_swap_symbol_in (abfd, x_symp + i, &i_sym); + elf_swap_symbol_in (abfd, x_symp + i, + x_shndx + (x_shndx != NULL ? i : 0), &i_sym); memcpy (&sym->internal_elf_sym, &i_sym, sizeof (Elf_Internal_Sym)); #ifdef ELF_KEEP_EXTSYM memcpy (&sym->native_elf_sym, x_symp + i, sizeof (Elf_External_Sym)); @@ -1121,7 +1256,12 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) sym->symbol.value = i_sym.st_value; - if (i_sym.st_shndx > 0 && i_sym.st_shndx < SHN_LORESERVE) + if (i_sym.st_shndx == SHN_UNDEF) + { + sym->symbol.section = bfd_und_section_ptr; + } + else if (i_sym.st_shndx < SHN_LORESERVE + || i_sym.st_shndx > SHN_HIRESERVE) { sym->symbol.section = section_from_elf_index (abfd, i_sym.st_shndx); @@ -1146,10 +1286,6 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) moment) about the alignment. */ sym->symbol.value = i_sym.st_size; } - else if (i_sym.st_shndx == SHN_UNDEF) - { - sym->symbol.section = bfd_und_section_ptr; - } else sym->symbol.section = bfd_abs_section_ptr; @@ -1236,12 +1372,17 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) *symptrs = 0; /* Final null pointer */ } + if (x_shndx != NULL) + free (x_shndx); if (x_versymp != NULL) free (x_versymp); if (x_symp != NULL) free (x_symp); return symcount; + error_return: + if (x_shndx != NULL) + free (x_shndx); if (x_versymp != NULL) free (x_versymp); if (x_symp != NULL) @@ -1270,12 +1411,12 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, unsigned int i; int entsize; - allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size); + allocated = (PTR) bfd_malloc (rel_hdr->sh_size); if (allocated == NULL) goto error_return; if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (allocated, 1, rel_hdr->sh_size, abfd) + || (bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size)) goto error_return; @@ -1361,6 +1502,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd_size_type reloc_count; bfd_size_type reloc_count2; arelent *relents; + bfd_size_type amt; if (asect->relocation != NULL) return true; @@ -1396,9 +1538,8 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) reloc_count2 = 0; } - relents = ((arelent *) - bfd_alloc (abfd, - (reloc_count + reloc_count2) * sizeof (arelent))); + amt = (reloc_count + reloc_count2) * sizeof (arelent); + relents = (arelent *) bfd_alloc (abfd, amt); if (relents == NULL) return false; diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h index ef71762..2a795a9 100644 --- a/contrib/binutils/bfd/elfcore.h +++ b/contrib/binutils/bfd/elfcore.h @@ -81,14 +81,18 @@ elf_core_file_p (abfd) { Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ - Elf_Internal_Phdr *i_phdrp = NULL; /* Elf program header, internal form */ + Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form */ unsigned int phindex; struct elf_backend_data *ebd; - struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd); + struct bfd_preserve preserve; struct elf_obj_tdata *new_tdata = NULL; + bfd_size_type amt; + + preserve.arch_info = abfd->arch_info; /* Read in the ELF header in external format. */ - if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) + if (bfd_bread ((PTR) &x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd) + != sizeof (x_ehdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -121,12 +125,25 @@ elf_core_file_p (abfd) } /* Give abfd an elf_obj_tdata. */ - new_tdata = - (struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); + amt = sizeof (struct elf_obj_tdata); + new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); if (new_tdata == NULL) return NULL; + preserve.tdata = elf_tdata (abfd); elf_tdata (abfd) = new_tdata; + /* Clear section information, since there might be a recognized bfd that + we now check if we can replace, and we don't want to append to it. */ + preserve.sections = abfd->sections; + preserve.section_tail = abfd->section_tail; + preserve.section_count = abfd->section_count; + preserve.section_htab = abfd->section_htab; + abfd->sections = NULL; + abfd->section_tail = &abfd->sections; + abfd->section_count = 0; + if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + goto fail; + /* Swap in the rest of the header, now that we have the byte order. */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -181,12 +198,12 @@ elf_core_file_p (abfd) goto wrong; /* Move to the start of the program headers. */ - if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_phoff, SEEK_SET) != 0) goto wrong; /* Allocate space for the program headers. */ - i_phdrp = (Elf_Internal_Phdr *) - bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum); + amt = sizeof (*i_phdrp) * i_ehdrp->e_phnum; + i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); if (!i_phdrp) goto fail; @@ -196,7 +213,7 @@ elf_core_file_p (abfd) for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { Elf_External_Phdr x_phdr; - if (bfd_read ((PTR) &x_phdr, sizeof (x_phdr), 1, abfd) + if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof (x_phdr), abfd) != sizeof (x_phdr)) goto fail; @@ -206,7 +223,7 @@ elf_core_file_p (abfd) /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { - if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex)) + if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex)) goto fail; } @@ -229,15 +246,33 @@ elf_core_file_p (abfd) goto wrong; } + bfd_hash_table_free (&preserve.section_htab); return abfd->xvec; wrong: + /* There is way too much undoing of half-known state here. The caller, + bfd_check_format_matches, really shouldn't iterate on live bfd's to + check match/no-match like it does. We have to rely on that a call to + bfd_default_set_arch_mach with the previously known mach, undoes what + was done by the first bfd_default_set_arch_mach (with mach 0) here. + For this to work, only elf-data and the mach may be changed by the + target-specific elf_backend_object_p function. Note that saving the + whole bfd here and restoring it would be even worse; the first thing + you notice is that the cached bfd file position gets out of sync. */ bfd_set_error (bfd_error_wrong_format); + fail: - if (i_phdrp != NULL) - bfd_release (abfd, i_phdrp); + abfd->arch_info = preserve.arch_info; if (new_tdata != NULL) - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserved_tdata; + { + /* bfd_release frees all memory more recently bfd_alloc'd than + its arg, as well as its arg. */ + bfd_release (abfd, new_tdata); + elf_tdata (abfd) = preserve.tdata; + abfd->section_htab = preserve.section_htab; + abfd->sections = preserve.sections; + abfd->section_tail = preserve.section_tail; + abfd->section_count = preserve.section_count; + } return NULL; } diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index b971311..2032efa 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -73,24 +73,27 @@ _bfd_elf_create_got_section (abfd, info) return false; } - /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got - (or .got.plt) section. We don't do this in the linker script - because we don't want to define the symbol if we are not creating - a global offset table. */ - h = NULL; - if (!(_bfd_generic_link_add_one_symbol - (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; + if (bed->want_got_sym) + { + /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got + (or .got.plt) section. We don't do this in the linker script + because we don't want to define the symbol if we are not creating + a global offset table. */ + h = NULL; + if (!(_bfd_generic_link_add_one_symbol + (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; - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + if (info->shared + && ! _bfd_elf_link_record_dynamic_symbol (info, h)) + return false; - elf_hash_table (info)->hgot = h; + elf_hash_table (info)->hgot = h; + } /* The first bit of the global offset table is the header. */ s->_raw_size += bed->got_header_size + bed->got_symbol_offset; @@ -134,7 +137,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) pltflags = flags; pltflags |= SEC_CODE; if (bed->plt_not_loaded) - pltflags &= ~ (SEC_LOAD | SEC_HAS_CONTENTS); + pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS); if (bed->plt_readonly) pltflags |= SEC_READONLY; @@ -227,7 +230,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h) { if (h->dynindx == -1) { - struct bfd_strtab_hash *dynstr; + struct elf_strtab_hash *dynstr; char *p, *alc; const char *name; boolean copy; @@ -259,7 +262,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h) if (dynstr == NULL) { /* Create a strtab to hold the dynamic symbol names. */ - elf_hash_table (info)->dynstr = dynstr = _bfd_elf_stringtab_init (); + elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); if (dynstr == NULL) return false; } @@ -275,16 +278,16 @@ _bfd_elf_link_record_dynamic_symbol (info, h) } else { - alc = bfd_malloc (p - name + 1); + alc = bfd_malloc ((bfd_size_type) (p - name + 1)); if (alc == NULL) return false; - strncpy (alc, name, p - name); + strncpy (alc, name, (size_t) (p - name)); alc[p - name] = '\0'; name = alc; copy = true; } - indx = _bfd_stringtab_add (dynstr, name, true, copy); + indx = _bfd_elf_strtab_add (dynstr, name, copy); if (alc != NULL) free (alc); @@ -394,9 +397,9 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) if (!lsect) { asection *s; + bfd_size_type amt = sizeof (elf_linker_section_t); - lsect = (elf_linker_section_t *) - bfd_alloc (dynobj, sizeof (elf_linker_section_t)); + lsect = (elf_linker_section_t *) bfd_alloc (dynobj, amt); *lsect = *defaults; elf_linker_section (dynobj, which) = lsect; @@ -428,10 +431,10 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) s->_raw_size += lsect->hole_size; if (lsect->hole_offset > lsect->max_hole_offset) { - (*_bfd_error_handler) (_("%s: Section %s is already to large to put hole of %ld bytes in"), + (*_bfd_error_handler) (_("%s: Section %s is too large to add hole of %ld bytes"), bfd_get_filename (abfd), lsect->name, - (long)lsect->hole_size); + (long) lsect->hole_size); bfd_set_error (bfd_error_bad_value); return (elf_linker_section_t *)0; @@ -503,7 +506,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) elf_linker_section_pointers_t * _bfd_elf_find_pointer_linker_section (linker_pointers, addend, which) elf_linker_section_pointers_t *linker_pointers; - bfd_signed_vma addend; + bfd_vma addend; elf_linker_section_enum_t which; { for ( ; linker_pointers != NULL; linker_pointers = linker_pointers->next) diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h index 26808ab..47927d3 100644 --- a/contrib/binutils/bfd/elflink.h +++ b/contrib/binutils/bfd/elflink.h @@ -27,18 +27,30 @@ struct elf_info_failed { boolean failed; struct bfd_link_info *info; + struct bfd_elf_version_tree *verdefs; }; +static boolean is_global_data_symbol_definition + PARAMS ((bfd *, Elf_Internal_Sym *)); +static boolean elf_link_is_defined_archive_symbol + PARAMS ((bfd *, carsym *)); 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 *, boolean)); + PARAMS ((bfd *, struct bfd_link_info *, const char *, + Elf_Internal_Sym *, asection **, bfd_vma *, + struct elf_link_hash_entry **, boolean *, boolean *, + boolean *, boolean)); +static boolean elf_add_default_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + const char *, Elf_Internal_Sym *, asection **, bfd_vma *, + boolean *, boolean, boolean)); static boolean elf_export_symbol PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean elf_finalize_dynstr + PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_fix_symbol_flags PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *)); static boolean elf_adjust_dynamic_symbol @@ -53,6 +65,8 @@ static boolean elf_collect_hash_codes PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_link_read_relocs_from_section PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); +static size_t compute_bucket_count + PARAMS ((struct bfd_link_info *)); static void elf_link_output_relocs PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); static boolean elf_link_size_reloc_section @@ -60,6 +74,14 @@ static boolean elf_link_size_reloc_section static void elf_link_adjust_relocs PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, struct elf_link_hash_entry **)); +static int elf_link_sort_cmp1 + PARAMS ((const void *, const void *)); +static int elf_link_sort_cmp2 + PARAMS ((const void *, const void *)); +static size_t elf_link_sort_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection **)); +static boolean elf_section_ignore_discarded_relocs + PARAMS ((asection *)); /* Given an ELF BFD, add symbols to the global hash table as appropriate. */ @@ -129,13 +151,18 @@ elf_link_is_defined_archive_symbol (abfd, symdef) carsym * symdef; { Elf_Internal_Shdr * hdr; + Elf_Internal_Shdr * shndx_hdr; Elf_External_Sym * esym; Elf_External_Sym * esymend; Elf_External_Sym * buf = NULL; - size_t symcount; - size_t extsymcount; - size_t extsymoff; + Elf_External_Sym_Shndx * shndx_buf = NULL; + Elf_External_Sym_Shndx * shndx; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; boolean result = false; + file_ptr pos; + bfd_size_type amt; abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (abfd == (bfd *) NULL) @@ -153,9 +180,15 @@ elf_link_is_defined_archive_symbol (abfd, symdef) /* Select the appropriate symbol table. */ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) - hdr = &elf_tdata (abfd)->symtab_hdr; + { + hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + } else - hdr = &elf_tdata (abfd)->dynsymtab_hdr; + { + hdr = &elf_tdata (abfd)->dynsymtab_hdr; + shndx_hdr = NULL; + } symcount = hdr->sh_size / sizeof (Elf_External_Sym); @@ -172,33 +205,41 @@ elf_link_is_defined_archive_symbol (abfd, symdef) extsymoff = hdr->sh_info; } - buf = ((Elf_External_Sym *) - bfd_malloc (extsymcount * sizeof (Elf_External_Sym))); + amt = extsymcount * sizeof (Elf_External_Sym); + buf = (Elf_External_Sym *) bfd_malloc (amt); if (buf == NULL && extsymcount != 0) return false; /* Read in the symbol table. FIXME: This ought to be cached somewhere. */ - if (bfd_seek (abfd, - hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym), - SEEK_SET) != 0 - || (bfd_read ((PTR) buf, sizeof (Elf_External_Sym), extsymcount, abfd) - != extsymcount * sizeof (Elf_External_Sym))) + pos = hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym); + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) buf, amt, abfd) != amt) + goto error_exit; + + if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) { - free (buf); - return false; + amt = extsymcount * sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL && extsymcount != 0) + goto error_exit; + + pos = shndx_hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym_Shndx); + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + goto error_exit; } /* Scan the symbol table looking for SYMDEF. */ esymend = buf + extsymcount; - for (esym = buf; + for (esym = buf, shndx = shndx_buf; esym < esymend; - esym++) + esym++, shndx = (shndx != NULL ? shndx + 1 : NULL)) { Elf_Internal_Sym sym; const char * name; - elf_swap_symbol_in (abfd, esym, & sym); + elf_swap_symbol_in (abfd, esym, shndx, &sym); name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, sym.st_name); if (name == (const char *) NULL) @@ -211,7 +252,11 @@ elf_link_is_defined_archive_symbol (abfd, symdef) } } - free (buf); + error_exit: + if (shndx_buf != NULL) + free (shndx_buf); + if (buf != NULL) + free (buf); return result; } @@ -251,6 +296,7 @@ elf_link_add_archive_symbols (abfd, info) boolean *included = NULL; carsym *symdefs; boolean loop; + bfd_size_type amt; if (! bfd_has_map (abfd)) { @@ -267,12 +313,14 @@ elf_link_add_archive_symbols (abfd, info) c = bfd_ardata (abfd)->symdef_count; if (c == 0) return true; - defined = (boolean *) bfd_malloc (c * sizeof (boolean)); - included = (boolean *) bfd_malloc (c * sizeof (boolean)); + amt = c; + amt *= sizeof (boolean); + defined = (boolean *) bfd_malloc (amt); + included = (boolean *) bfd_malloc (amt); if (defined == (boolean *) NULL || included == (boolean *) NULL) goto error_return; - memset (defined, 0, c * sizeof (boolean)); - memset (included, 0, c * sizeof (boolean)); + memset (defined, 0, (size_t) amt); + memset (included, 0, (size_t) amt); symdefs = bfd_ardata (abfd)->symdefs; @@ -320,10 +368,10 @@ elf_link_add_archive_symbols (abfd, info) if (p == NULL || p[1] != ELF_VER_CHR) continue; - copy = bfd_alloc (abfd, p - symdef->name + 1); + copy = bfd_alloc (abfd, (bfd_size_type) (p - symdef->name + 1)); if (copy == NULL) goto error_return; - memcpy (copy, symdef->name, p - symdef->name); + memcpy (copy, symdef->name, (size_t) (p - symdef->name)); copy[p - symdef->name] = '\0'; h = elf_link_hash_lookup (elf_hash_table (info), copy, @@ -874,6 +922,243 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, return true; } +/* This function is called to create an indirect symbol from the + default for the symbol with the default version if needed. The + symbol is described by H, NAME, SYM, SEC, VALUE, and OVERRIDE. We + set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED + indicates if it comes from a DT_NEEDED entry of a shared object. */ + +static boolean +elf_add_default_symbol (abfd, info, h, name, sym, sec, value, + dynsym, override, dt_needed) + bfd *abfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + const char *name; + Elf_Internal_Sym *sym; + asection **sec; + bfd_vma *value; + boolean *dynsym; + boolean override; + boolean dt_needed; +{ + boolean type_change_ok; + boolean size_change_ok; + char *shortname; + struct elf_link_hash_entry *hi; + struct elf_backend_data *bed; + boolean collect; + boolean dynamic; + char *p; + + /* If this symbol has a version, and it is the default version, we + create an indirect symbol from the default name to the fully + decorated name. This will cause external references which do not + specify a version to be bound to this version of the symbol. */ + p = strchr (name, ELF_VER_CHR); + if (p == NULL || p[1] != ELF_VER_CHR) + return true; + + if (override) + { + /* We are overridden by an old defition. We need to check if we + need to crreate the indirect symbol from the default name. */ + hi = elf_link_hash_lookup (elf_hash_table (info), name, true, + false, false); + BFD_ASSERT (hi != NULL); + if (hi == h) + return true; + 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; + if (hi == h) + return true; + } + } + + bed = get_elf_backend_data (abfd); + collect = bed->collect; + dynamic = (abfd->flags & DYNAMIC) != 0; + + shortname = bfd_hash_allocate (&info->hash->table, + (size_t) (p - name + 1)); + if (shortname == NULL) + return false; + strncpy (shortname, name, (size_t) (p - name)); + shortname [p - name] = '\0'; + + /* 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. */ + type_change_ok = false; + size_change_ok = false; + if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + &hi, &override, &type_change_ok, + &size_change_ok, dt_needed)) + return false; + + if (! override) + { + 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))) + return false; + } + 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 (hi->elf_link_hash_flags + & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) + { + if (! _bfd_elf_link_record_dynamic_symbol (info, hi)) + return false; + } + } + + /* Now set HI to H, so that the following code will set the + other fields correctly. */ + hi = h; + } + + /* 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; + (*bed->elf_backend_copy_indirect_symbol) (ht, hi); + + /* See if the new flags lead us to realize that the symbol must + be dynamic. */ + if (! *dynsym) + { + 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; + } + } + } + + /* We also need to define an indirection from the nondefault version + of the symbol. */ + + shortname = bfd_hash_allocate (&info->hash->table, strlen (name)); + if (shortname == NULL) + return false; + strncpy (shortname, name, (size_t) (p - name)); + strcpy (shortname + (p - name), p + 1); + + /* Once again, merge with any existing symbol. */ + type_change_ok = false; + size_change_ok = false; + if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + &hi, &override, &type_change_ok, + &size_change_ok, dt_needed)) + return false; + + if (override) + { + /* 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_archive_filename (abfd), shortname); + } + else + { + 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))) + return false; + + /* 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) + { + /* 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); + + (*bed->elf_backend_copy_indirect_symbol) (h, hi); + + /* See if the new flags lead us to realize that the symbol + must be dynamic. */ + if (! *dynsym) + { + 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; + } + } + } + } + + return true; +} + /* Add symbols from an ELF object file to the linker hash table. */ static boolean @@ -889,10 +1174,13 @@ elf_link_add_object_symbols (abfd, info) asection *, const Elf_Internal_Rela *)); boolean collect; Elf_Internal_Shdr *hdr; - size_t symcount; - size_t extsymcount; - size_t extsymoff; + Elf_Internal_Shdr *shndx_hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; Elf_External_Sym *buf = NULL; + Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_External_Sym_Shndx *shndx; struct elf_link_hash_entry **sym_hash; boolean dynamic; Elf_External_Versym *extversym = NULL; @@ -903,6 +1191,11 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Sym *esymend; struct elf_backend_data *bed; boolean dt_needed; + struct elf_link_hash_table * hash_table; + file_ptr pos; + bfd_size_type amt; + + hash_table = elf_hash_table (info); bed = get_elf_backend_data (abfd); add_symbol_hook = bed->elf_add_symbol_hook; @@ -957,7 +1250,7 @@ elf_link_add_object_symbols (abfd, info) { struct elf_link_hash_entry *h; - h = elf_link_hash_lookup (elf_hash_table (info), name, + h = elf_link_hash_lookup (hash_table, name, false, false, true); /* FIXME: What about bfd_link_hash_common? */ @@ -1004,9 +1297,15 @@ elf_link_add_object_symbols (abfd, info) look at .symtab for a dynamic object. */ if (! dynamic || elf_dynsymtab (abfd) == 0) - hdr = &elf_tdata (abfd)->symtab_hdr; + { + hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + } else - hdr = &elf_tdata (abfd)->dynsymtab_hdr; + { + hdr = &elf_tdata (abfd)->dynsymtab_hdr; + shndx_hdr = NULL; + } if (dynamic) { @@ -1025,9 +1324,9 @@ elf_link_add_object_symbols (abfd, info) extversym = (Elf_External_Versym *) bfd_malloc (versymhdr->sh_size); if (extversym == NULL) goto error_return; + amt = versymhdr->sh_size; if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0 - || (bfd_read ((PTR) extversym, 1, versymhdr->sh_size, abfd) - != versymhdr->sh_size)) + || bfd_bread ((PTR) extversym, amt, abfd) != amt) goto error_return; } } @@ -1048,16 +1347,23 @@ elf_link_add_object_symbols (abfd, info) extsymoff = hdr->sh_info; } - buf = ((Elf_External_Sym *) - bfd_malloc (extsymcount * sizeof (Elf_External_Sym))); + amt = extsymcount * sizeof (Elf_External_Sym); + buf = (Elf_External_Sym *) bfd_malloc (amt); if (buf == NULL && extsymcount != 0) goto error_return; + if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) + { + amt = extsymcount * sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL && extsymcount != 0) + goto error_return; + } + /* We store a pointer to the hash table entry for each external symbol. */ - sym_hash = ((struct elf_link_hash_entry **) - bfd_alloc (abfd, - extsymcount * sizeof (struct elf_link_hash_entry *))); + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sym_hash = (struct elf_link_hash_entry **) bfd_alloc (abfd, amt); if (sym_hash == NULL) goto error_return; elf_sym_hashes (abfd) = sym_hash; @@ -1072,13 +1378,16 @@ elf_link_add_object_symbols (abfd, info) format. FIXME: If there are no input BFD's of the same format as the output, we can't make a shared library. */ if (info->shared - && ! elf_hash_table (info)->dynamic_sections_created + && is_elf_hash_table (info) + && ! hash_table->dynamic_sections_created && abfd->xvec == info->hash->creator) { if (! elf_link_create_dynamic_sections (abfd, info)) goto error_return; } } + else if (! is_elf_hash_table (info)) + goto error_return; else { asection *s; @@ -1113,11 +1422,11 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Dyn *extdyn; Elf_External_Dyn *extdynend; int elfsec; - unsigned long link; + unsigned long shlink; int rpath; int runpath; - dynbuf = (Elf_External_Dyn *) bfd_malloc ((size_t) s->_raw_size); + dynbuf = (Elf_External_Dyn *) bfd_malloc (s->_raw_size); if (dynbuf == NULL) goto error_return; @@ -1128,22 +1437,22 @@ elf_link_add_object_symbols (abfd, info) elfsec = _bfd_elf_section_from_bfd_section (abfd, s); if (elfsec == -1) goto error_return; - link = elf_elfsections (abfd)[elfsec]->sh_link; + shlink = elf_elfsections (abfd)[elfsec]->sh_link; { /* The shared libraries distributed with hpux11 have a bogus sh_link field for the ".dynamic" section. This code detects - when LINK refers to a section that is not a string table and - tries to find the string table for the ".dynsym" section + when SHLINK refers to a section that is not a string table + and tries to find the string table for the ".dynsym" section instead. */ - Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[link]; - if (hdr->sh_type != SHT_STRTAB) + Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[shlink]; + if (shdr->sh_type != SHT_STRTAB) { - asection *s = bfd_get_section_by_name (abfd, ".dynsym"); - int elfsec = _bfd_elf_section_from_bfd_section (abfd, s); - if (elfsec == -1) + asection *ds = bfd_get_section_by_name (abfd, ".dynsym"); + int elfdsec = _bfd_elf_section_from_bfd_section (abfd, ds); + if (elfdsec == -1) goto error_return; - link = elf_elfsections (abfd)[elfsec]->sh_link; + shlink = elf_elfsections (abfd)[elfdsec]->sh_link; } } @@ -1158,8 +1467,8 @@ elf_link_add_object_symbols (abfd, info) elf_swap_dyn_in (abfd, extdyn, &dyn); if (dyn.d_tag == DT_SONAME) { - name = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + unsigned int tagv = dyn.d_un.d_val; + name = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (name == NULL) goto error_return; } @@ -1167,21 +1476,21 @@ elf_link_add_object_symbols (abfd, info) { struct bfd_link_needed_list *n, **pn; char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; - n = ((struct bfd_link_needed_list *) - bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); - fnm = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + amt = sizeof (struct bfd_link_needed_list); + n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) goto error_return; - anm = bfd_alloc (abfd, strlen (fnm) + 1); + anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); if (anm == NULL) goto error_return; strcpy (anm, fnm); n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->needed; + for (pn = & hash_table->needed; *pn != NULL; pn = &(*pn)->next) ; @@ -1191,28 +1500,28 @@ elf_link_add_object_symbols (abfd, info) { struct bfd_link_needed_list *n, **pn; char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; /* When we see DT_RPATH before DT_RUNPATH, we have to clear runpath. Do _NOT_ bfd_release, as that frees all more recently bfd_alloc'd blocks as well. */ - if (rpath && elf_hash_table (info)->runpath) - elf_hash_table (info)->runpath = NULL; + if (rpath && hash_table->runpath) + hash_table->runpath = NULL; - n = ((struct bfd_link_needed_list *) - bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); - fnm = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + amt = sizeof (struct bfd_link_needed_list); + n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) goto error_return; - anm = bfd_alloc (abfd, strlen (fnm) + 1); + anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); if (anm == NULL) goto error_return; strcpy (anm, fnm); n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->runpath; + for (pn = & hash_table->runpath; *pn != NULL; pn = &(*pn)->next) ; @@ -1225,21 +1534,21 @@ elf_link_add_object_symbols (abfd, info) { struct bfd_link_needed_list *n, **pn; char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; - n = ((struct bfd_link_needed_list *) - bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); - fnm = bfd_elf_string_from_elf_section (abfd, link, - dyn.d_un.d_val); + amt = sizeof (struct bfd_link_needed_list); + n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) goto error_return; - anm = bfd_alloc (abfd, strlen (fnm) + 1); + anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); if (anm == NULL) goto error_return; strcpy (anm, fnm); n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->runpath; + for (pn = & hash_table->runpath; *pn != NULL; pn = &(*pn)->next) ; @@ -1259,27 +1568,23 @@ elf_link_add_object_symbols (abfd, info) SEC_NEVER_LOAD flag is not the one we want, because that one still implies that the section takes up space in the output file. */ - abfd->sections = NULL; - abfd->section_count = 0; + bfd_section_list_clear (abfd); /* If this is the first dynamic object found in the link, create the special sections required for dynamic linking. */ - if (! elf_hash_table (info)->dynamic_sections_created) - { - if (! elf_link_create_dynamic_sections (abfd, info)) - goto error_return; - } + if (! hash_table->dynamic_sections_created) + if (! elf_link_create_dynamic_sections (abfd, info)) + goto error_return; if (add_needed) { /* Add a DT_NEEDED entry for this dynamic object. */ - oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, name, - true, false); + oldsize = _bfd_elf_strtab_size (hash_table->dynstr); + strindex = _bfd_elf_strtab_add (hash_table->dynstr, name, false); if (strindex == (bfd_size_type) -1) goto error_return; - if (oldsize == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr)) { asection *sdyn; Elf_External_Dyn *dyncon, *dynconend; @@ -1289,8 +1594,7 @@ elf_link_add_object_symbols (abfd, info) have already included this dynamic object in the link, just ignore it. There is no reason to include a particular dynamic object more than once. */ - sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".dynamic"); + sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); BFD_ASSERT (sdyn != NULL); dyncon = (Elf_External_Dyn *) sdyn->contents; @@ -1300,8 +1604,7 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Dyn dyn; - elf_swap_dyn_in (elf_hash_table (info)->dynobj, dyncon, - &dyn); + elf_swap_dyn_in (hash_table->dynobj, dyncon, & dyn); if (dyn.d_tag == DT_NEEDED && dyn.d_un.d_val == strindex) { @@ -1309,36 +1612,46 @@ elf_link_add_object_symbols (abfd, info) free (buf); if (extversym != NULL) free (extversym); + _bfd_elf_strtab_delref (hash_table->dynstr, strindex); return true; } } } - if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_NEEDED, strindex)) goto error_return; } /* Save the SONAME, if there is one, because sometimes the linker emulation code will need to know it. */ if (*name == '\0') - name = bfd_get_filename (abfd); + name = basename (bfd_get_filename (abfd)); elf_dt_name (abfd) = name; } - if (bfd_seek (abfd, - hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym), - SEEK_SET) != 0 - || (bfd_read ((PTR) buf, sizeof (Elf_External_Sym), extsymcount, abfd) - != extsymcount * sizeof (Elf_External_Sym))) + pos = hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym); + amt = extsymcount * sizeof (Elf_External_Sym); + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) buf, amt, abfd) != amt) goto error_return; + if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) + { + amt = extsymcount * sizeof (Elf_External_Sym_Shndx); + pos = shndx_hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym_Shndx); + if (bfd_seek (abfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + goto error_return; + } + weaks = NULL; ever = extversym != NULL ? extversym + extsymoff : NULL; esymend = buf + extsymcount; - for (esym = buf; + for (esym = buf, shndx = shndx_buf; esym < esymend; - esym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL)) + esym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL), + shndx = (shndx != NULL ? shndx + 1 : NULL)) { Elf_Internal_Sym sym; int bind; @@ -1351,8 +1664,11 @@ elf_link_add_object_symbols (abfd, info) boolean size_change_ok, type_change_ok; boolean new_weakdef; unsigned int old_alignment; + boolean override; - elf_swap_symbol_in (abfd, esym, &sym); + override = false; + + elf_swap_symbol_in (abfd, esym, shndx, &sym); flags = BSF_NO_FLAGS; sec = NULL; @@ -1383,7 +1699,7 @@ elf_link_add_object_symbols (abfd, info) if (sym.st_shndx == SHN_UNDEF) sec = bfd_und_section_ptr; - else if (sym.st_shndx > 0 && sym.st_shndx < SHN_LORESERVE) + else if (sym.st_shndx < SHN_LORESERVE || sym.st_shndx > SHN_HIRESERVE) { sec = section_from_elf_index (abfd, sym.st_shndx); if (sec == NULL) @@ -1441,7 +1757,6 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Versym iver; unsigned int vernum = 0; - boolean override; if (ever != NULL) { @@ -1457,7 +1772,8 @@ elf_link_add_object_symbols (abfd, info) || (vernum > 1 && ! bfd_is_abs_section (sec))) { const char *verstr; - int namelen, newlen; + unsigned int namelen; + bfd_size_type newlen; char *newname, *p; if (sym.st_shndx != SHN_UNDEF) @@ -1466,7 +1782,7 @@ elf_link_add_object_symbols (abfd, info) { (*_bfd_error_handler) (_("%s: %s: invalid version %u (max %d)"), - bfd_get_filename (abfd), name, vernum, + bfd_archive_filename (abfd), name, vernum, elf_tdata (abfd)->dynverdef_hdr.sh_info); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1507,7 +1823,7 @@ elf_link_add_object_symbols (abfd, info) { (*_bfd_error_handler) (_("%s: %s: invalid needed version %d"), - bfd_get_filename (abfd), name, vernum); + bfd_archive_filename (abfd), name, vernum); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -1628,7 +1944,7 @@ elf_link_add_object_symbols (abfd, info) (*_bfd_error_handler) (_("Warning: size of symbol `%s' changed from %lu to %lu in %s"), name, (unsigned long) h->size, (unsigned long) sym.st_size, - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); h->size = sym.st_size; } @@ -1650,7 +1966,7 @@ elf_link_add_object_symbols (abfd, info) (*_bfd_error_handler) (_("Warning: type of symbol `%s' changed from %d to %d in %s"), name, h->type, ELF_ST_TYPE (sym.st_info), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); h->type = ELF_ST_TYPE (sym.st_info); } @@ -1712,217 +2028,13 @@ elf_link_add_object_symbols (abfd, info) h->elf_link_hash_flags |= new_flag; - /* If this symbol has a version, and it is the default - version, we create an indirect symbol from the default - name to the fully decorated name. This will cause - external references which do not specify a version to be - bound to this version of the symbol. */ + /* Check to see if we need to add an indirect symbol for + the default name. */ if (definition || h->root.type == bfd_link_hash_common) - { - char *p; - - p = strchr (name, ELF_VER_CHR); - if (p != NULL && p[1] == ELF_VER_CHR) - { - char *shortname; - struct elf_link_hash_entry *hi; - boolean override; - - shortname = bfd_hash_allocate (&info->hash->table, - p - name + 1); - if (shortname == NULL) - goto error_return; - strncpy (shortname, name, p - name); - shortname[p - name] = '\0'; - - /* 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. */ - type_change_ok = false; - size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec, - &value, &hi, &override, - &type_change_ok, - &size_change_ok, dt_needed)) - goto error_return; - - if (! override) - { - 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 (hi->elf_link_hash_flags - & (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_DEF_REGULAR)) - { - if (! _bfd_elf_link_record_dynamic_symbol (info, - hi)) - goto error_return; - } - } - - /* Now set HI to H, so that the following code - will set the other fields correctly. */ - hi = h; - } - - /* 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; - (*bed->elf_backend_copy_indirect_symbol) (ht, hi); - - /* See if the new flags lead us to realize that - the symbol must be dynamic. */ - if (! dynsym) - { - 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; - } - } - } - - /* We also need to define an indirection from the - nondefault version of the symbol. */ - - shortname = bfd_hash_allocate (&info->hash->table, - strlen (name)); - if (shortname == NULL) - goto error_return; - strncpy (shortname, name, p - name); - strcpy (shortname + (p - name), p + 1); - - /* Once again, merge with any existing symbol. */ - type_change_ok = false; - size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec, - &value, &hi, &override, - &type_change_ok, - &size_change_ok, dt_needed)) - goto error_return; - - if (override) - { - /* 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 - { - 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; - - /* 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) - { - /* 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); - - (*bed->elf_backend_copy_indirect_symbol) (h, hi); - - /* See if the new flags lead us to realize - that the symbol must be dynamic. */ - if (! dynsym) - { - 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 (! elf_add_default_symbol (abfd, info, h, name, &sym, + &sec, &value, &dynsym, + override, dt_needed)) + goto error_return; if (dynsym && h->dynindx == -1) { @@ -1932,8 +2044,7 @@ elf_link_add_object_symbols (abfd, info) && ! new_weakdef && h->weakdef->dynindx == -1) { - if (! _bfd_elf_link_record_dynamic_symbol (info, - h->weakdef)) + if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) goto error_return; } } @@ -1945,8 +2056,7 @@ elf_link_add_object_symbols (abfd, info) { case STV_INTERNAL: case STV_HIDDEN: - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); + (*bed->elf_backend_hide_symbol) (info, h, true); break; } @@ -1957,25 +2067,26 @@ elf_link_add_object_symbols (abfd, info) bfd_size_type oldsize; bfd_size_type strindex; + if (! is_elf_hash_table (info)) + goto error_return; + /* The symbol from a DT_NEEDED object is referenced from the regular object to create a dynamic executable. We have to make sure there is a DT_NEEDED entry for it. */ dt_needed = false; - oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - elf_dt_soname (abfd), - true, false); + oldsize = _bfd_elf_strtab_size (hash_table->dynstr); + strindex = _bfd_elf_strtab_add (hash_table->dynstr, + elf_dt_soname (abfd), false); if (strindex == (bfd_size_type) -1) goto error_return; - if (oldsize - == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr)) { asection *sdyn; Elf_External_Dyn *dyncon, *dynconend; - sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); BFD_ASSERT (sdyn != NULL); @@ -1986,14 +2097,14 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Dyn dyn; - elf_swap_dyn_in (elf_hash_table (info)->dynobj, + elf_swap_dyn_in (hash_table->dynobj, dyncon, &dyn); BFD_ASSERT (dyn.d_tag != DT_NEEDED || dyn.d_un.d_val != strindex); } } - if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_NEEDED, strindex)) goto error_return; } } @@ -2143,12 +2254,13 @@ elf_link_add_object_symbols (abfd, info) && ! info->relocateable && ! info->traditional_format && info->hash->creator->flavour == bfd_target_elf_flavour + && is_elf_hash_table (info) && (info->strip != strip_all && info->strip != strip_debugger)) { asection *stab, *stabstr; stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab != NULL) + if (stab != NULL && !(stab->flags & SEC_MERGE)) { stabstr = bfd_get_section_by_name (abfd, ".stabstr"); @@ -2158,14 +2270,36 @@ elf_link_add_object_symbols (abfd, info) secdata = elf_section_data (stab); if (! _bfd_link_section_stabs (abfd, - &elf_hash_table (info)->stab_info, + & hash_table->stab_info, stab, stabstr, - &secdata->stab_info)) + &secdata->sec_info)) goto error_return; + if (secdata->sec_info) + secdata->sec_info_type = ELF_INFO_TYPE_STABS; } } } + if (! info->relocateable && ! dynamic + && is_elf_hash_table (info)) + { + asection *s; + + for (s = abfd->sections; s != NULL; s = s->next) + if (s->flags & SEC_MERGE) + { + struct bfd_elf_section_data *secdata; + + secdata = elf_section_data (s); + if (! _bfd_merge_section (abfd, + & hash_table->merge_info, + s, &secdata->sec_info)) + goto error_return; + else if (secdata->sec_info) + secdata->sec_info_type = ELF_INFO_TYPE_MERGE; + } + } + return true; error_return: @@ -2195,6 +2329,9 @@ elf_link_create_dynamic_sections (abfd, info) struct elf_link_hash_entry *h; struct elf_backend_data *bed; + if (! is_elf_hash_table (info)) + return false; + if (elf_hash_table (info)->dynamic_sections_created) return true; @@ -2219,6 +2356,16 @@ elf_link_create_dynamic_sections (abfd, info) return false; } + if (! info->traditional_format + && info->hash->creator->flavour == bfd_target_elf_flavour) + { + s = bfd_make_section (abfd, ".eh_frame_hdr"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, 2)) + return false; + } + /* Create sections to hold version informations. These are removed if they are not needed. */ s = bfd_make_section (abfd, ".gnu.version_d"); @@ -2253,7 +2400,7 @@ elf_link_create_dynamic_sections (abfd, info) /* Create a strtab to hold the dynamic symbol names. */ if (elf_hash_table (info)->dynstr == NULL) { - elf_hash_table (info)->dynstr = elf_stringtab_init (); + elf_hash_table (info)->dynstr = _bfd_elf_strtab_init (); if (elf_hash_table (info)->dynstr == NULL) return false; } @@ -2316,9 +2463,12 @@ elf_add_dynamic_entry (info, tag, val) Elf_Internal_Dyn dyn; bfd *dynobj; asection *s; - size_t newsize; + bfd_size_type newsize; bfd_byte *newcontents; + if (! is_elf_hash_table (info)) + return false; + dynobj = elf_hash_table (info)->dynobj; s = bfd_get_section_by_name (dynobj, ".dynamic"); @@ -2350,10 +2500,17 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) { struct elf_link_local_dynamic_entry *entry; struct elf_link_hash_table *eht; - struct bfd_strtab_hash *dynstr; + struct elf_strtab_hash *dynstr; Elf_External_Sym esym; + Elf_External_Sym_Shndx eshndx; + Elf_External_Sym_Shndx *shndx; unsigned long dynstr_index; char *name; + file_ptr pos; + bfd_size_type amt; + + if (! is_elf_hash_table (info)) + return false; /* See if the entry exists already. */ for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) @@ -2361,19 +2518,28 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) return true; entry = (struct elf_link_local_dynamic_entry *) - bfd_alloc (input_bfd, sizeof (*entry)); + bfd_alloc (input_bfd, (bfd_size_type) sizeof (*entry)); if (entry == NULL) return false; /* Go find the symbol, so that we can find it's name. */ - if (bfd_seek (input_bfd, - (elf_tdata (input_bfd)->symtab_hdr.sh_offset - + input_indx * sizeof (Elf_External_Sym)), - SEEK_SET) != 0 - || (bfd_read (&esym, sizeof (Elf_External_Sym), 1, input_bfd) - != sizeof (Elf_External_Sym))) + amt = sizeof (Elf_External_Sym); + pos = elf_tdata (input_bfd)->symtab_hdr.sh_offset + input_indx * amt; + if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) &esym, amt, input_bfd) != amt) return false; - elf_swap_symbol_in (input_bfd, &esym, &entry->isym); + shndx = NULL; + if (elf_tdata (input_bfd)->symtab_shndx_hdr.sh_size != 0) + { + amt = sizeof (Elf_External_Sym_Shndx); + pos = elf_tdata (input_bfd)->symtab_shndx_hdr.sh_offset; + pos += input_indx * amt; + shndx = &eshndx; + if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx, amt, input_bfd) != amt) + return false; + } + elf_swap_symbol_in (input_bfd, &esym, shndx, &entry->isym); name = (bfd_elf_string_from_elf_section (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link, @@ -2383,12 +2549,12 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) if (dynstr == NULL) { /* Create a strtab to hold the dynamic symbol names. */ - elf_hash_table (info)->dynstr = dynstr = _bfd_elf_stringtab_init (); + elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); if (dynstr == NULL) return false; } - dynstr_index = _bfd_stringtab_add (dynstr, name, true, false); + dynstr_index = _bfd_elf_strtab_add (dynstr, name, false); if (dynstr_index == (unsigned long) -1) return false; entry->isym.st_name = dynstr_index; @@ -2428,6 +2594,7 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, Elf_Internal_Rela *internal_relocs; { struct elf_backend_data *bed; + bfd_size_type amt; /* If there aren't any relocations, that's OK. */ if (!shdr) @@ -2438,8 +2605,7 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, return false; /* Read the relocations. */ - if (bfd_read (external_relocs, 1, shdr->sh_size, abfd) - != shdr->sh_size) + if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size) return false; bed = get_elf_backend_data (abfd); @@ -2455,8 +2621,8 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, erel = (Elf_External_Rel *) external_relocs; erelend = erel + NUM_SHDR_ENTRIES (shdr); irela = internal_relocs; - irel = bfd_alloc (abfd, (bed->s->int_rels_per_ext_rel - * sizeof (Elf_Internal_Rel))); + amt = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel); + irel = bfd_alloc (abfd, amt); for (; erel < erelend; erel++, irela += bed->s->int_rels_per_ext_rel) { unsigned int i; @@ -2531,10 +2697,10 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, if (internal_relocs == NULL) { - size_t size; + bfd_size_type size; - size = (o->reloc_count * bed->s->int_rels_per_ext_rel - * sizeof (Elf_Internal_Rela)); + size = o->reloc_count; + size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); if (keep_memory) internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size); else @@ -2545,10 +2711,10 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, if (external_relocs == NULL) { - size_t size = (size_t) rel_hdr->sh_size; + bfd_size_type size = rel_hdr->sh_size; if (elf_section_data (o)->rel_hdr2) - size += (size_t) elf_section_data (o)->rel_hdr2->sh_size; + size += elf_section_data (o)->rel_hdr2->sh_size; alloc1 = (PTR) bfd_malloc (size); if (alloc1 == NULL) goto error_return; @@ -2590,7 +2756,6 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, /* Record an assignment to a symbol made by a linker script. We need this in case some dynamic object refers to this symbol. */ -/*ARGSUSED*/ boolean NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) bfd *output_bfd ATTRIBUTE_UNUSED; @@ -2608,7 +2773,7 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) return false; if (h->root.type == bfd_link_hash_new) - h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; + h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -2630,7 +2795,7 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - /* When possible, keep the original type of the symbol */ + /* When possible, keep the original type of the symbol. */ if (h->type == STT_NOTYPE) h->type = STT_OBJECT; @@ -2667,8 +2832,6 @@ struct elf_assign_sym_version_info struct bfd_link_info *info; /* Version tree. */ struct bfd_elf_version_tree *verdefs; - /* Whether we are exporting all dynamic symbols. */ - boolean export_dynamic; /* Whether we had a failure. */ boolean failed; }; @@ -2717,12 +2880,14 @@ compute_bucket_count (info) unsigned long int *hashcodes; unsigned long int *hashcodesp; unsigned long int i; + bfd_size_type amt; /* Compute the hash values for all exported symbols. At the same time store the values in an array so that we could use them for optimizations. */ - hashcodes = (unsigned long int *) bfd_malloc (dynsymcount - * sizeof (unsigned long int)); + amt = dynsymcount; + amt *= sizeof (unsigned long int); + hashcodes = (unsigned long int *) bfd_malloc (amt); if (hashcodes == NULL) return 0; hashcodesp = hashcodes; @@ -2753,8 +2918,9 @@ compute_bucket_count (info) /* Create array where we count the collisions in. We must use bfd_malloc since the size could be large. */ - counts = (unsigned long int *) bfd_malloc (maxsize - * sizeof (unsigned long int)); + amt = maxsize; + amt *= sizeof (unsigned long int); + counts = (unsigned long int *) bfd_malloc (amt); if (counts == NULL) { free (hashcodes); @@ -2850,13 +3016,12 @@ compute_bucket_count (info) boolean NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, - export_dynamic, filter_shlib, + filter_shlib, auxiliary_filters, info, sinterpptr, verdefs) bfd *output_bfd; const char *soname; const char *rpath; - boolean export_dynamic; const char *filter_shlib; const char * const *auxiliary_filters; struct bfd_link_info *info; @@ -2875,6 +3040,13 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (info->hash->creator->flavour != bfd_target_elf_flavour) return true; + if (! is_elf_hash_table (info)) + return false; + + /* Any syms created from now on start with -1 in + got.refcount/offset and plt.refcount/offset. */ + elf_hash_table (info)->init_refcount = -1; + /* The backend may have to create some sections regardless of whether we're dynamic or not. */ bed = get_elf_backend_data (output_bfd); @@ -2889,6 +3061,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (dynobj == NULL) return true; + if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) + return false; + if (elf_hash_table (info)->dynamic_sections_created) { struct elf_info_failed eif; @@ -2900,16 +3075,18 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (soname != NULL) { - soname_indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - soname, true, true); + soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + soname, true); if (soname_indx == (bfd_size_type) -1 - || ! elf_add_dynamic_entry (info, DT_SONAME, soname_indx)) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_SONAME, + soname_indx)) return false; } if (info->symbolic) { - if (! elf_add_dynamic_entry (info, DT_SYMBOLIC, 0)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_SYMBOLIC, + (bfd_vma) 0)) return false; info->flags |= DF_SYMBOLIC; } @@ -2918,12 +3095,15 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { bfd_size_type indx; - indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, rpath, - true, true); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath, + true); + if (info->new_dtags) + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx); if (indx == (bfd_size_type) -1 - || ! elf_add_dynamic_entry (info, DT_RPATH, indx) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_RPATH, indx) || (info->new_dtags - && ! elf_add_dynamic_entry (info, DT_RUNPATH, indx))) + && ! elf_add_dynamic_entry (info, (bfd_vma) DT_RUNPATH, + indx))) return false; } @@ -2931,10 +3111,10 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { bfd_size_type indx; - indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - filter_shlib, true, true); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + filter_shlib, true); if (indx == (bfd_size_type) -1 - || ! elf_add_dynamic_entry (info, DT_FILTER, indx)) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_FILTER, indx)) return false; } @@ -2946,20 +3126,22 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { bfd_size_type indx; - indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - *p, true, true); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + *p, true); if (indx == (bfd_size_type) -1 - || ! elf_add_dynamic_entry (info, DT_AUXILIARY, indx)) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_AUXILIARY, + indx)) return false; } } eif.info = info; + eif.verdefs = verdefs; eif.failed = false; /* If we are supposed to export all symbols into the dynamic symbol table (this is not the normal case), then do so. */ - if (export_dynamic) + if (info->export_dynamic) { elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol, (PTR) &eif); @@ -2971,7 +3153,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, asvinfo.output_bfd = output_bfd; asvinfo.info = info; asvinfo.verdefs = verdefs; - asvinfo.export_dynamic = export_dynamic; asvinfo.failed = false; elf_link_hash_traverse (elf_hash_table (info), @@ -3003,7 +3184,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR | ELF_LINK_HASH_DEF_REGULAR)) != 0) { - if (! elf_add_dynamic_entry (info, DT_INIT, 0)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_INIT, (bfd_vma) 0)) return false; } h = (info->fini_function @@ -3015,7 +3196,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR | ELF_LINK_HASH_DEF_REGULAR)) != 0) { - if (! elf_add_dynamic_entry (info, DT_FINI, 0)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_FINI, (bfd_vma) 0)) return false; } @@ -3028,13 +3209,13 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { bfd_size_type strsize; - strsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - if (! elf_add_dynamic_entry (info, DT_HASH, 0) - || ! elf_add_dynamic_entry (info, DT_STRTAB, 0) - || ! elf_add_dynamic_entry (info, DT_SYMTAB, 0) - || ! elf_add_dynamic_entry (info, DT_STRSZ, strsize) - || ! elf_add_dynamic_entry (info, DT_SYMENT, - sizeof (Elf_External_Sym))) + strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_HASH, (bfd_vma) 0) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_STRTAB, (bfd_vma) 0) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_SYMTAB, (bfd_vma) 0) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_STRSZ, strsize) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_SYMENT, + (bfd_vma) sizeof (Elf_External_Sym))) return false; } } @@ -3047,10 +3228,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (elf_hash_table (info)->dynamic_sections_created) { - size_t dynsymcount; + bfd_size_type dynsymcount; asection *s; size_t bucketcount = 0; size_t hash_entry_size; + unsigned int dtagcount; /* Set up the version definition section. */ s = bfd_get_section_by_name (dynobj, ".gnu.version_d"); @@ -3060,6 +3242,10 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, just linking a regular application. */ verdefs = asvinfo.verdefs; + /* Skip anonymous version tag. */ + if (verdefs != NULL && verdefs->vernum == 0) + verdefs = verdefs->next; + if (verdefs == NULL) _bfd_strip_section_from_output (info, s); else @@ -3110,6 +3296,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (soname_indx != (bfd_size_type) -1) { + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + soname_indx); def.vd_hash = bfd_elf_hash (soname); defaux.vda_name = soname_indx; } @@ -3118,10 +3306,10 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, const char *name; bfd_size_type indx; - name = output_bfd->filename; + name = basename (output_bfd->filename); def.vd_hash = bfd_elf_hash (name); - indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - name, true, false); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + name, false); if (indx == (bfd_size_type) -1) return false; defaux.vda_name = indx; @@ -3129,7 +3317,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, defaux.vda_next = 0; _bfd_elf_swap_verdef_out (output_bfd, &def, - (Elf_External_Verdef *)p); + (Elf_External_Verdef *) p); p += sizeof (Elf_External_Verdef); _bfd_elf_swap_verdaux_out (output_bfd, &defaux, (Elf_External_Verdaux *) p); @@ -3180,6 +3368,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, p += sizeof (Elf_External_Verdef); defaux.vda_name = h->dynstr_index; + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + h->dynstr_index); if (t->deps == NULL) defaux.vda_next = 0; else @@ -3199,7 +3389,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, defaux.vda_name = 0; } else - defaux.vda_name = n->version_needed->name_indx; + { + defaux.vda_name = n->version_needed->name_indx; + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + defaux.vda_name); + } if (n->next == NULL) defaux.vda_next = 0; else @@ -3211,8 +3405,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } } - if (! elf_add_dynamic_entry (info, DT_VERDEF, 0) - || ! elf_add_dynamic_entry (info, DT_VERDEFNUM, cdefs)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_VERDEF, (bfd_vma) 0) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_VERDEFNUM, + (bfd_vma) cdefs)) return false; elf_tdata (output_bfd)->cverdefs = cdefs; @@ -3220,7 +3415,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (info->new_dtags && info->flags) { - if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_FLAGS, info->flags)) return false; } @@ -3230,7 +3425,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, info->flags_1 &= ~ (DF_1_INITFIRST | DF_1_NODELETE | DF_1_NOOPEN); - if (! elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_FLAGS_1, + info->flags_1)) return false; } @@ -3277,7 +3473,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } s->_raw_size = size; - s->contents = (bfd_byte *) bfd_alloc (output_bfd, size); + s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; @@ -3296,13 +3492,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, t->vn_version = VER_NEED_CURRENT; t->vn_cnt = caux; - 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); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + elf_dt_name (t->vn_bfd) != NULL + ? elf_dt_name (t->vn_bfd) + : basename (t->vn_bfd->filename), + false); if (indx == (bfd_size_type) -1) return false; t->vn_file = indx; @@ -3320,8 +3514,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) { a->vna_hash = bfd_elf_hash (a->vna_nodename); - indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, - a->vna_nodename, true, false); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + a->vna_nodename, false); if (indx == (bfd_size_type) -1) return false; a->vna_name = indx; @@ -3336,8 +3530,10 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } } - if (! elf_add_dynamic_entry (info, DT_VERNEED, 0) - || ! elf_add_dynamic_entry (info, DT_VERNEEDNUM, crefs)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_VERNEED, + (bfd_vma) 0) + || ! elf_add_dynamic_entry (info, (bfd_vma) DT_VERNEEDNUM, + (bfd_vma) crefs)) return false; elf_tdata (output_bfd)->cverrefs = crefs; @@ -3369,7 +3565,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (s->contents == NULL) return false; - if (! elf_add_dynamic_entry (info, DT_VERSYM, 0)) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_VERSYM, (bfd_vma) 0)) return false; } @@ -3397,8 +3593,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, isym.st_info = 0; isym.st_other = 0; isym.st_shndx = 0; - elf_swap_symbol_out (output_bfd, &isym, - (PTR) (Elf_External_Sym *) s->contents); + elf_swap_symbol_out (output_bfd, &isym, (PTR) s->contents, (PTR) 0); } /* Compute the size of the hashing table. As a side effect this @@ -3414,57 +3609,206 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return false; memset (s->contents, 0, (size_t) s->_raw_size); - bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); - bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + bfd_put (8 * hash_entry_size, output_bfd, (bfd_vma) bucketcount, + s->contents); + bfd_put (8 * hash_entry_size, output_bfd, (bfd_vma) dynsymcount, s->contents + hash_entry_size); elf_hash_table (info)->bucketcount = bucketcount; s = bfd_get_section_by_name (dynobj, ".dynstr"); BFD_ASSERT (s != NULL); - s->_raw_size = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - if (! elf_add_dynamic_entry (info, DT_NULL, 0)) - return false; + elf_finalize_dynstr (output_bfd, info); + + s->_raw_size = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + + for (dtagcount = 0; dtagcount <= info->spare_dynamic_tags; ++dtagcount) + if (! elf_add_dynamic_entry (info, (bfd_vma) DT_NULL, (bfd_vma) 0)) + return false; } return true; } -/* 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. */ - +/* This function is used to adjust offsets into .dynstr for + dynamic symbols. This is called via elf_link_hash_traverse. */ + +static boolean elf_adjust_dynstr_offsets +PARAMS ((struct elf_link_hash_entry *, PTR)); + static boolean -elf_fix_symbol_flags (h, eif) +elf_adjust_dynstr_offsets (h, data) struct elf_link_hash_entry *h; - struct elf_info_failed *eif; + PTR data; { - /* 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 - an ELF dynamic object. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) + struct elf_strtab_hash *dynstr = (struct elf_strtab_hash *) data; + + if (h->dynindx != -1) + h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index); + return true; +} + +/* Assign string offsets in .dynstr, update all structures referencing + them. */ + +static boolean +elf_finalize_dynstr (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elf_link_local_dynamic_entry *entry; + struct elf_strtab_hash *dynstr = elf_hash_table (info)->dynstr; + bfd *dynobj = elf_hash_table (info)->dynobj; + asection *sdyn; + bfd_size_type size; + Elf_External_Dyn *dyncon, *dynconend; + + _bfd_elf_strtab_finalize (dynstr); + size = _bfd_elf_strtab_size (dynstr); + + /* Update all .dynamic entries referencing .dynstr strings. */ + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf_External_Dyn *) sdyn->contents; + dynconend = (Elf_External_Dyn *) (sdyn->contents + + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) { - while (h->root.type == bfd_link_hash_indirect) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + Elf_Internal_Dyn dyn; - if (h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK); - else + elf_swap_dyn_in (dynobj, dyncon, & dyn); + switch (dyn.d_tag) { - if (h->root.u.def.section->owner != NULL - && (bfd_get_flavour (h->root.u.def.section->owner) - == bfd_target_elf_flavour)) - h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK); - else - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - } + case DT_STRSZ: + dyn.d_un.d_val = size; + elf_swap_dyn_out (dynobj, & dyn, dyncon); + break; + case DT_NEEDED: + case DT_SONAME: + case DT_RPATH: + case DT_RUNPATH: + case DT_FILTER: + case DT_AUXILIARY: + dyn.d_un.d_val = _bfd_elf_strtab_offset (dynstr, dyn.d_un.d_val); + elf_swap_dyn_out (dynobj, & dyn, dyncon); + break; + default: + break; + } + } + + /* Now update local dynamic symbols. */ + for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) + entry->isym.st_name = _bfd_elf_strtab_offset (dynstr, + entry->isym.st_name); + + /* And the rest of dynamic symbols. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_adjust_dynstr_offsets, dynstr); + + /* Adjust version definitions. */ + if (elf_tdata (output_bfd)->cverdefs) + { + asection *s; + bfd_byte *p; + bfd_size_type i; + Elf_Internal_Verdef def; + Elf_Internal_Verdaux defaux; + + s = bfd_get_section_by_name (dynobj, ".gnu.version_d"); + p = (bfd_byte *) s->contents; + do + { + _bfd_elf_swap_verdef_in (output_bfd, (Elf_External_Verdef *) p, + &def); + p += sizeof (Elf_External_Verdef); + for (i = 0; i < def.vd_cnt; ++i) + { + _bfd_elf_swap_verdaux_in (output_bfd, + (Elf_External_Verdaux *) p, &defaux); + defaux.vda_name = _bfd_elf_strtab_offset (dynstr, + defaux.vda_name); + _bfd_elf_swap_verdaux_out (output_bfd, + &defaux, (Elf_External_Verdaux *) p); + p += sizeof (Elf_External_Verdaux); + } + } + while (def.vd_next); + } + + /* Adjust version references. */ + if (elf_tdata (output_bfd)->verref) + { + asection *s; + bfd_byte *p; + bfd_size_type i; + Elf_Internal_Verneed need; + Elf_Internal_Vernaux needaux; + + s = bfd_get_section_by_name (dynobj, ".gnu.version_r"); + p = (bfd_byte *) s->contents; + do + { + _bfd_elf_swap_verneed_in (output_bfd, (Elf_External_Verneed *) p, + &need); + need.vn_file = _bfd_elf_strtab_offset (dynstr, need.vn_file); + _bfd_elf_swap_verneed_out (output_bfd, &need, + (Elf_External_Verneed *) p); + p += sizeof (Elf_External_Verneed); + for (i = 0; i < need.vn_cnt; ++i) + { + _bfd_elf_swap_vernaux_in (output_bfd, + (Elf_External_Vernaux *) p, &needaux); + needaux.vna_name = _bfd_elf_strtab_offset (dynstr, + needaux.vna_name); + _bfd_elf_swap_vernaux_out (output_bfd, + &needaux, + (Elf_External_Vernaux *) p); + p += sizeof (Elf_External_Vernaux); + } + } + while (need.vn_next); + } + + return true; +} + +/* 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_fix_symbol_flags (h, eif) + struct elf_link_hash_entry *h; + struct elf_info_failed *eif; +{ + /* 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 + an ELF dynamic object. */ + if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) + { + while (h->root.type == bfd_link_hash_indirect) + 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) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + { + if (h->root.u.def.section->owner != NULL + && (bfd_get_flavour (h->root.u.def.section->owner) + == bfd_target_elf_flavour)) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + } if (h->dynindx == -1 && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 @@ -3519,17 +3863,20 @@ elf_fix_symbol_flags (h, eif) backend specifically; we can't just clear PLT-related data here. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared + && is_elf_hash_table (eif->info) && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { struct elf_backend_data *bed; + boolean force_local; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (eif->info, h); + + force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN); + (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); } /* If this is a weak defined symbol in a dynamic object, and we know @@ -3552,11 +3899,12 @@ elf_fix_symbol_flags (h, eif) if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) h->weakdef = NULL; else - weakdef->elf_link_hash_flags |= - (h->elf_link_hash_flags - & (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK - | ELF_LINK_NON_GOT_REF)); + { + struct elf_backend_data *bed; + + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_copy_indirect_symbol) (weakdef, h); + } } return true; @@ -3579,6 +3927,9 @@ elf_adjust_dynamic_symbol (h, data) if (h->root.type == bfd_link_hash_indirect) return true; + if (! is_elf_hash_table (eif->info)) + return false; + /* Fix the symbol flags. */ if (! elf_fix_symbol_flags (h, eif)) return false; @@ -3692,11 +4043,39 @@ elf_export_symbol (h, data) && (h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0) { - if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + + for (t = eif->verdefs; t != NULL; t = t->next) { - eif->failed = true; - return false; + if (t->globals != NULL) + { + for (d = t->globals; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + goto doit; + } + } + + if (t->locals != NULL) + { + for (d = t->locals ; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + return true; + } + } } + + if (!eif->verdefs) + { +doit: + if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = true; + return false; + } + } } return true; @@ -3715,6 +4094,7 @@ elf_link_find_version_dependencies (h, data) struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data; Elf_Internal_Verneed *t; Elf_Internal_Vernaux *a; + bfd_size_type amt; /* We only care about symbols defined in shared objects with version information. */ @@ -3741,7 +4121,8 @@ elf_link_find_version_dependencies (h, data) if (t == NULL) { - t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, sizeof *t); + amt = sizeof *t; + t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt); if (t == NULL) { rinfo->failed = true; @@ -3753,7 +4134,8 @@ elf_link_find_version_dependencies (h, data) elf_tdata (rinfo->output_bfd)->verref = t; } - a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, sizeof *a); + amt = sizeof *a; + a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt); /* Note that we are copying a string pointer here, and testing it above. If bfd_elf_string_from_elf_section is ever changed to @@ -3784,12 +4166,15 @@ elf_link_assign_sym_version (h, data) struct elf_link_hash_entry *h; PTR data; { - struct elf_assign_sym_version_info *sinfo = - (struct elf_assign_sym_version_info *) data; - struct bfd_link_info *info = sinfo->info; + struct elf_assign_sym_version_info *sinfo; + struct bfd_link_info *info; struct elf_backend_data *bed; struct elf_info_failed eif; char *p; + bfd_size_type amt; + + sinfo = (struct elf_assign_sym_version_info *) data; + info = sinfo->info; /* Fix the symbol flags. */ eif.failed = false; @@ -3837,12 +4222,12 @@ elf_link_assign_sym_version (h, data) { if (strcmp (t->name, p) == 0) { - int len; + size_t len; char *alc; struct bfd_elf_version_expr *d; len = p - h->root.root.string; - alc = bfd_alloc (sinfo->output_bfd, len); + alc = bfd_malloc ((bfd_size_type) len); if (alc == NULL) return false; strncpy (alc, h->root.root.string, len - 1); @@ -3871,13 +4256,9 @@ elf_link_assign_sym_version (h, data) { if (h->dynindx != -1 && info->shared - && ! sinfo->export_dynamic) + && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - /* FIXME: The name of the symbol has - already been recorded in the dynamic - string table section. */ + (*bed->elf_backend_hide_symbol) (info, h, true); } break; @@ -3885,7 +4266,7 @@ elf_link_assign_sym_version (h, data) } } - bfd_release (sinfo->output_bfd, alc); + free (alc); break; } } @@ -3902,8 +4283,9 @@ elf_link_assign_sym_version (h, data) if (h->dynindx == -1) return true; + amt = sizeof *t; t = ((struct bfd_elf_version_tree *) - bfd_alloc (sinfo->output_bfd, sizeof *t)); + bfd_alloc (sinfo->output_bfd, amt)); if (t == NULL) { sinfo->failed = true; @@ -3919,6 +4301,9 @@ elf_link_assign_sym_version (h, data) t->used = true; version_index = 1; + /* Don't count anonymous version tag. */ + if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0) + version_index = 0; for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next) ++version_index; t->vernum = version_index; @@ -3983,13 +4368,9 @@ elf_link_assign_sym_version (h, data) h->verinfo.vertree = t; if (h->dynindx != -1 && info->shared - && ! sinfo->export_dynamic) + && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - /* FIXME: The name of the symbol has already - been recorded in the dynamic string table - section. */ + (*bed->elf_backend_hide_symbol) (info, h, true); } break; } @@ -4005,12 +4386,9 @@ elf_link_assign_sym_version (h, data) h->verinfo.vertree = deflt; if (h->dynindx != -1 && info->shared - && ! sinfo->export_dynamic) + && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - /* FIXME: The name of the symbol has already been - recorded in the dynamic string table section. */ + (*bed->elf_backend_hide_symbol) (info, h, true); } } } @@ -4045,6 +4423,8 @@ struct elf_final_link_info /* Buffer large enough to hold external local symbols of any input BFD. */ Elf_External_Sym *external_syms; + /* And a buffer for symbol section indices. */ + Elf_External_Sym_Shndx *locsym_shndx; /* Buffer large enough to hold internal local symbols of any input BFD. */ Elf_Internal_Sym *internal_syms; @@ -4056,6 +4436,8 @@ struct elf_final_link_info asection **sections; /* Buffer to hold swapped out symbols. */ Elf_External_Sym *symbuf; + /* And one for symbol section indices. */ + Elf_External_Sym_Shndx *symshndxbuf; /* Number of swapped out symbols in buffer. */ size_t symbuf_count; /* Number of symbols which fit in symbuf. */ @@ -4069,6 +4451,8 @@ static boolean elf_link_flush_output_syms PARAMS ((struct elf_final_link_info *)); static boolean elf_link_output_extsym PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean elf_link_sec_merge_syms + PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_link_input_bfd PARAMS ((struct elf_final_link_info *, bfd *)); static boolean elf_reloc_link_order @@ -4093,7 +4477,8 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) Elf_Internal_Shdr *rel_hdr; asection *o; { - unsigned reloc_count; + bfd_size_type reloc_count; + bfd_size_type num_rel_hashes; /* Figure out how many relocations there will be. */ if (rel_hdr == &elf_section_data (o)->rel_hdr) @@ -4101,6 +4486,10 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) else reloc_count = elf_section_data (o)->rel_count2; + num_rel_hashes = o->reloc_count; + if (num_rel_hashes < reloc_count) + num_rel_hashes = reloc_count; + /* That allows us to calculate the size of the section. */ rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count; @@ -4114,14 +4503,15 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) /* We only allocate one set of hash entries, so we only do it the first time we are called. */ - if (elf_section_data (o)->rel_hashes == NULL) + if (elf_section_data (o)->rel_hashes == NULL + && num_rel_hashes) { struct elf_link_hash_entry **p; p = ((struct elf_link_hash_entry **) - bfd_zmalloc (o->reloc_count + bfd_zmalloc (num_rel_hashes * sizeof (struct elf_link_hash_entry *))); - if (p == NULL && o->reloc_count != 0) + if (p == NULL) return false; elf_section_data (o)->rel_hashes = p; @@ -4146,17 +4536,17 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) struct elf_backend_data *bed = get_elf_backend_data (abfd); Elf_Internal_Rel *irel; Elf_Internal_Rela *irela; + bfd_size_type amt = sizeof (Elf_Internal_Rel) * bed->s->int_rels_per_ext_rel; - irel = (Elf_Internal_Rel *) bfd_zmalloc (sizeof (Elf_Internal_Rel) - * bed->s->int_rels_per_ext_rel); + irel = (Elf_Internal_Rel *) bfd_zmalloc (amt); if (irel == NULL) { (*_bfd_error_handler) (_("Error: out of memory")); abort (); } - irela = (Elf_Internal_Rela *) bfd_zmalloc (sizeof (Elf_Internal_Rela) - * bed->s->int_rels_per_ext_rel); + amt = sizeof (Elf_Internal_Rela) * bed->s->int_rels_per_ext_rel; + irela = (Elf_Internal_Rela *) bfd_zmalloc (amt); if (irela == NULL) { (*_bfd_error_handler) (_("Error: out of memory")); @@ -4219,6 +4609,214 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) free (irela); } +struct elf_link_sort_rela { + bfd_vma offset; + enum elf_reloc_type_class type; + union { + Elf_Internal_Rel rel; + Elf_Internal_Rela rela; + } u; +}; + +static int +elf_link_sort_cmp1 (A, B) + const PTR A; + const PTR B; +{ + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B; + int relativea, relativeb; + + relativea = a->type == reloc_class_relative; + relativeb = b->type == reloc_class_relative; + + if (relativea < relativeb) + return 1; + if (relativea > relativeb) + return -1; + if (ELF_R_SYM (a->u.rel.r_info) < ELF_R_SYM (b->u.rel.r_info)) + return -1; + if (ELF_R_SYM (a->u.rel.r_info) > ELF_R_SYM (b->u.rel.r_info)) + return 1; + if (a->u.rel.r_offset < b->u.rel.r_offset) + return -1; + if (a->u.rel.r_offset > b->u.rel.r_offset) + return 1; + return 0; +} + +static int +elf_link_sort_cmp2 (A, B) + const PTR A; + const PTR B; +{ + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B; + int copya, copyb; + + if (a->offset < b->offset) + return -1; + if (a->offset > b->offset) + return 1; + copya = (a->type == reloc_class_copy) * 2 + (a->type == reloc_class_plt); + copyb = (b->type == reloc_class_copy) * 2 + (b->type == reloc_class_plt); + if (copya < copyb) + return -1; + if (copya > copyb) + return 1; + if (a->u.rel.r_offset < b->u.rel.r_offset) + return -1; + if (a->u.rel.r_offset > b->u.rel.r_offset) + return 1; + return 0; +} + +static size_t +elf_link_sort_relocs (abfd, info, psec) + bfd *abfd; + struct bfd_link_info *info; + asection **psec; +{ + bfd *dynobj = elf_hash_table (info)->dynobj; + asection *reldyn, *o; + boolean rel = false; + bfd_size_type count, size; + size_t i, j, ret; + struct elf_link_sort_rela *rela; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + + reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + { + reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + return 0; + rel = true; + count = reldyn->_raw_size / sizeof (Elf_External_Rel); + } + else + count = reldyn->_raw_size / sizeof (Elf_External_Rela); + + size = 0; + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + size += o->_raw_size; + + if (size != reldyn->_raw_size) + return 0; + + rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count); + if (rela == NULL) + { + (*info->callbacks->warning) + (info, _("Not enough memory to sort relocations"), 0, abfd, 0, + (bfd_vma) 0); + return 0; + } + + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + { + if (rel) + { + Elf_External_Rel *erel, *erelend; + struct elf_link_sort_rela *s; + + erel = (Elf_External_Rel *) o->contents; + erelend = (Elf_External_Rel *) (o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rel); + for (; erel < erelend; erel++, s++) + { + if (bed->s->swap_reloc_in) + (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &s->u.rel); + else + elf_swap_reloc_in (abfd, erel, &s->u.rel); + + s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela); + } + } + else + { + Elf_External_Rela *erela, *erelaend; + struct elf_link_sort_rela *s; + + erela = (Elf_External_Rela *) o->contents; + erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rela); + for (; erela < erelaend; erela++, s++) + { + if (bed->s->swap_reloca_in) + (*bed->s->swap_reloca_in) (dynobj, (bfd_byte *) erela, + &s->u.rela); + else + elf_swap_reloca_in (dynobj, erela, &s->u.rela); + + s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela); + } + } + } + + qsort (rela, (size_t) count, sizeof (*rela), elf_link_sort_cmp1); + for (ret = 0; ret < count && rela[ret].type == reloc_class_relative; ret++) + ; + for (i = ret, j = ret; i < count; i++) + { + if (ELF_R_SYM (rela[i].u.rel.r_info) != ELF_R_SYM (rela[j].u.rel.r_info)) + j = i; + rela[i].offset = rela[j].u.rel.r_offset; + } + qsort (rela + ret, (size_t) count - ret, sizeof (*rela), elf_link_sort_cmp2); + + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + { + if (rel) + { + Elf_External_Rel *erel, *erelend; + struct elf_link_sort_rela *s; + + erel = (Elf_External_Rel *) o->contents; + erelend = (Elf_External_Rel *) (o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rel); + for (; erel < erelend; erel++, s++) + { + if (bed->s->swap_reloc_out) + (*bed->s->swap_reloc_out) (abfd, &s->u.rel, + (bfd_byte *) erel); + else + elf_swap_reloc_out (abfd, &s->u.rel, erel); + } + } + else + { + Elf_External_Rela *erela, *erelaend; + struct elf_link_sort_rela *s; + + erela = (Elf_External_Rela *) o->contents; + erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rela); + for (; erela < erelaend; erela++, s++) + { + if (bed->s->swap_reloca_out) + (*bed->s->swap_reloca_out) (dynobj, &s->u.rela, + (bfd_byte *) erela); + else + elf_swap_reloca_out (dynobj, &s->u.rela, erela); + } + } + } + + free (rela); + *psec = reldyn; + return ret; +} + /* Do the final step of an ELF link. */ boolean @@ -4227,15 +4825,17 @@ elf_bfd_final_link (abfd, info) struct bfd_link_info *info; { boolean dynamic; + boolean emit_relocs; bfd *dynobj; struct elf_final_link_info finfo; register asection *o; register struct bfd_link_order *p; register bfd *sub; - size_t max_contents_size; - size_t max_external_reloc_size; - size_t max_internal_reloc_count; - size_t max_sym_count; + bfd_size_type max_contents_size; + bfd_size_type max_external_reloc_size; + bfd_size_type max_internal_reloc_count; + bfd_size_type max_sym_count; + bfd_size_type max_sym_shndx_count; file_ptr off; Elf_Internal_Sym elfsym; unsigned int i; @@ -4243,6 +4843,13 @@ elf_bfd_final_link (abfd, info) Elf_Internal_Shdr *symstrtab_hdr; struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_outext_info eoinfo; + boolean merged; + size_t relativecount = 0; + asection *reldyn = 0; + bfd_size_type amt; + + if (! is_elf_hash_table (info)) + return false; if (info->shared) abfd->flags |= DYNAMIC; @@ -4250,6 +4857,10 @@ elf_bfd_final_link (abfd, info) dynamic = elf_hash_table (info)->dynamic_sections_created; dynobj = elf_hash_table (info)->dynobj; + emit_relocs = (info->relocateable + || info->emitrelocations + || bed->elf_backend_emit_relocs); + finfo.info = info; finfo.output_bfd = abfd; finfo.symstrtab = elf_stringtab_init (); @@ -4275,10 +4886,12 @@ elf_bfd_final_link (abfd, info) finfo.external_relocs = NULL; finfo.internal_relocs = NULL; finfo.external_syms = NULL; + finfo.locsym_shndx = NULL; finfo.internal_syms = NULL; finfo.indices = NULL; finfo.sections = NULL; finfo.symbuf = NULL; + finfo.symshndxbuf = NULL; finfo.symbuf_count = 0; /* Count up the number of relocations we will output for each output @@ -4288,6 +4901,8 @@ elf_bfd_final_link (abfd, info) max_external_reloc_size = 0; max_internal_reloc_count = 0; max_sym_count = 0; + max_sym_shndx_count = 0; + merged = false; for (o = abfd->sections; o != (asection *) NULL; o = o->next) { o->reloc_count = 0; @@ -4309,8 +4924,25 @@ elf_bfd_final_link (abfd, info) the linker has decided to not include. */ sec->linker_mark = true; + if (sec->flags & SEC_MERGE) + merged = true; + if (info->relocateable || info->emitrelocations) o->reloc_count += sec->reloc_count; + else if (bed->elf_backend_count_relocs) + { + Elf_Internal_Rela * relocs; + + relocs = (NAME(_bfd_elf,link_read_relocs) + (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, info->keep_memory)); + + o->reloc_count += (*bed->elf_backend_count_relocs) + (sec, relocs); + + if (!info->keep_memory) + free (relocs); + } if (sec->_raw_size > max_contents_size) max_contents_size = sec->_raw_size; @@ -4333,6 +4965,10 @@ elf_bfd_final_link (abfd, info) if (sym_count > max_sym_count) max_sym_count = sym_count; + if (sym_count > max_sym_shndx_count + && elf_symtab_shndx (sec->owner) != 0) + max_sym_shndx_count = sym_count; + if ((sec->flags & SEC_RELOC) != 0) { size_t ext_size; @@ -4366,6 +5002,10 @@ elf_bfd_final_link (abfd, info) o->vma = 0; } + if (! info->relocateable && merged) + elf_link_hash_traverse (elf_hash_table (info), + elf_link_sec_merge_syms, (PTR) abfd); + /* Figure out the file positions for everything but the symbol table and the relocs. We set symcount to force assign_section_numbers to create a symbol table. */ @@ -4377,7 +5017,7 @@ elf_bfd_final_link (abfd, info) /* Figure out how many relocations we will have in each section. Just using RELOC_COUNT isn't good enough since that doesn't maintain a separate value for REL vs. RELA relocations. */ - if (info->relocateable || info->emitrelocations) + if (emit_relocs) for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) for (o = sub->sections; o != NULL; o = o->next) { @@ -4417,6 +5057,7 @@ elf_bfd_final_link (abfd, info) *rel_count += NUM_SHDR_ENTRIES (& esdi->rel_hdr); if (esdi->rel_hdr2) *rel_count2 += NUM_SHDR_ENTRIES (esdi->rel_hdr2); + output_section->flags |= SEC_RELOC; } } @@ -4476,14 +5117,24 @@ elf_bfd_final_link (abfd, info) finfo.symbuf_size = 20; else finfo.symbuf_size = max_sym_count; - finfo.symbuf = ((Elf_External_Sym *) - bfd_malloc (finfo.symbuf_size * sizeof (Elf_External_Sym))); + amt = finfo.symbuf_size; + amt *= sizeof (Elf_External_Sym); + finfo.symbuf = (Elf_External_Sym *) bfd_malloc (amt); if (finfo.symbuf == NULL) goto error_return; + if (elf_numsections (abfd) > SHN_LORESERVE) + { + amt = finfo.symbuf_size; + amt *= sizeof (Elf_External_Sym_Shndx); + finfo.symshndxbuf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (finfo.symshndxbuf == NULL) + goto error_return; + } /* Start writing out the symbol table. The first symbol is always a dummy symbol. */ - if (info->strip != strip_all || info->relocateable || info->emitrelocations) + if (info->strip != strip_all + || emit_relocs) { elfsym.st_value = 0; elfsym.st_size = 0; @@ -4516,12 +5167,13 @@ elf_bfd_final_link (abfd, info) symbols have no names. We store the index of each one in the index field of the section, so that we can find it again when outputting relocs. */ - if (info->strip != strip_all || info->relocateable || info->emitrelocations) + if (info->strip != strip_all + || emit_relocs) { elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); elfsym.st_other = 0; - for (i = 1; i < elf_elfheader (abfd)->e_shnum; i++) + for (i = 1; i < elf_numsections (abfd); i++) { o = section_from_elf_index (abfd, i); if (o != NULL) @@ -4534,34 +5186,66 @@ elf_bfd_final_link (abfd, info) if (! elf_link_output_sym (&finfo, (const char *) NULL, &elfsym, o)) goto error_return; + if (i == SHN_LORESERVE) + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; } } /* Allocate some memory to hold information read in from the input files. */ - finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); - finfo.external_relocs = (PTR) bfd_malloc (max_external_reloc_size); - finfo.internal_relocs = ((Elf_Internal_Rela *) - bfd_malloc (max_internal_reloc_count - * sizeof (Elf_Internal_Rela) - * bed->s->int_rels_per_ext_rel)); - finfo.external_syms = ((Elf_External_Sym *) - bfd_malloc (max_sym_count - * sizeof (Elf_External_Sym))); - finfo.internal_syms = ((Elf_Internal_Sym *) - bfd_malloc (max_sym_count - * sizeof (Elf_Internal_Sym))); - finfo.indices = (long *) bfd_malloc (max_sym_count * sizeof (long)); - finfo.sections = ((asection **) - bfd_malloc (max_sym_count * sizeof (asection *))); - if ((finfo.contents == NULL && max_contents_size != 0) - || (finfo.external_relocs == NULL && max_external_reloc_size != 0) - || (finfo.internal_relocs == NULL && max_internal_reloc_count != 0) - || (finfo.external_syms == NULL && max_sym_count != 0) - || (finfo.internal_syms == NULL && max_sym_count != 0) - || (finfo.indices == NULL && max_sym_count != 0) - || (finfo.sections == NULL && max_sym_count != 0)) - goto error_return; + if (max_contents_size != 0) + { + finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); + if (finfo.contents == NULL) + goto error_return; + } + + if (max_external_reloc_size != 0) + { + finfo.external_relocs = (PTR) bfd_malloc (max_external_reloc_size); + if (finfo.external_relocs == NULL) + goto error_return; + } + + if (max_internal_reloc_count != 0) + { + amt = max_internal_reloc_count * bed->s->int_rels_per_ext_rel; + amt *= sizeof (Elf_Internal_Rela); + finfo.internal_relocs = (Elf_Internal_Rela *) bfd_malloc (amt); + if (finfo.internal_relocs == NULL) + goto error_return; + } + + if (max_sym_count != 0) + { + amt = max_sym_count * sizeof (Elf_External_Sym); + finfo.external_syms = (Elf_External_Sym *) bfd_malloc (amt); + if (finfo.external_syms == NULL) + goto error_return; + + amt = max_sym_count * sizeof (Elf_Internal_Sym); + finfo.internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); + if (finfo.internal_syms == NULL) + goto error_return; + + amt = max_sym_count * sizeof (long); + finfo.indices = (long *) bfd_malloc (amt); + if (finfo.indices == NULL) + goto error_return; + + amt = max_sym_count * sizeof (asection *); + finfo.sections = (asection **) bfd_malloc (amt); + if (finfo.sections == NULL) + goto error_return; + } + + if (max_sym_shndx_count != 0) + { + amt = max_sym_shndx_count * sizeof (Elf_External_Sym_Shndx); + finfo.locsym_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (finfo.locsym_shndx == NULL) + goto error_return; + } /* Since ELF permits relocations to be against local symbols, we must have the local symbols available when we do the relocations. @@ -4645,7 +5329,7 @@ elf_bfd_final_link (abfd, info) { Elf_Internal_Sym sym; Elf_External_Sym *dynsym = - (Elf_External_Sym *)finfo.dynsym_sec->contents; + (Elf_External_Sym *) finfo.dynsym_sec->contents; long last_local = 0; /* Write out the section symbols for the output sections. */ @@ -4661,13 +5345,14 @@ elf_bfd_final_link (abfd, info) for (s = abfd->sections; s != NULL; s = s->next) { int indx; + Elf_External_Sym *dest; + indx = elf_section_data (s)->this_idx; BFD_ASSERT (indx > 0); sym.st_shndx = indx; sym.st_value = s->vma; - - elf_swap_symbol_out (abfd, &sym, - dynsym + elf_section_data (s)->dynindx); + dest = dynsym + elf_section_data (s)->dynindx; + elf_swap_symbol_out (abfd, &sym, (PTR) dest, (PTR) 0); } last_local = bfd_count_sections (abfd); @@ -4680,6 +5365,7 @@ elf_bfd_final_link (abfd, info) for (e = elf_hash_table (info)->dynlocal; e ; e = e->next) { asection *s; + Elf_External_Sym *dest; sym.st_size = e->isym.st_size; sym.st_other = e->isym.st_other; @@ -4689,7 +5375,8 @@ elf_bfd_final_link (abfd, info) the original st_name with the dynstr_index. */ sym = e->isym; - if (e->isym.st_shndx > 0 && e->isym.st_shndx < SHN_LORESERVE) + if (e->isym.st_shndx < SHN_LORESERVE + || e->isym.st_shndx > SHN_HIRESERVE) { s = bfd_section_from_elf_index (e->input_bfd, e->isym.st_shndx); @@ -4704,7 +5391,8 @@ elf_bfd_final_link (abfd, info) if (last_local < e->dynindx) last_local = e->dynindx; - elf_swap_symbol_out (abfd, &sym, dynsym + e->dynindx); + dest = dynsym + e->dynindx; + elf_swap_symbol_out (abfd, &sym, (PTR) dest, (PTR) 0); } } @@ -4725,11 +5413,12 @@ elf_bfd_final_link (abfd, info) table, do it now. */ if (bed->elf_backend_output_arch_syms) { - if (! (*bed->elf_backend_output_arch_syms) - (abfd, info, (PTR) &finfo, - (boolean (*) PARAMS ((PTR, const char *, - Elf_Internal_Sym *, asection *))) - elf_link_output_sym)) + typedef boolean (*out_sym_func) PARAMS ((PTR, const char *, + Elf_Internal_Sym *, + asection *)); + + if (! ((*bed->elf_backend_output_arch_syms) + (abfd, info, (PTR) &finfo, (out_sym_func) elf_link_output_sym))) return false; } @@ -4784,6 +5473,9 @@ elf_bfd_final_link (abfd, info) o->reloc_count = 0; } + if (dynamic && info->combreloc && dynobj != NULL) + relativecount = elf_link_sort_relocs (abfd, info, &reldyn); + /* If we are linking against a dynamic object, or generating a shared library, finish up the dynamic linking information. */ if (dynamic) @@ -4808,6 +5500,23 @@ elf_bfd_final_link (abfd, info) { default: break; + case DT_NULL: + if (relativecount > 0 && dyncon + 1 < dynconend) + { + switch (elf_section_data (reldyn)->this_hdr.sh_type) + { + case SHT_REL: dyn.d_tag = DT_RELCOUNT; break; + case SHT_RELA: dyn.d_tag = DT_RELACOUNT; break; + default: break; + } + if (dyn.d_tag != DT_NULL) + { + dyn.d_un.d_val = relativecount; + elf_swap_dyn_out (dynobj, &dyn, dyncon); + relativecount = 0; + } + } + break; case DT_INIT: name = info->init_function; goto get_sym; @@ -4873,7 +5582,7 @@ elf_bfd_final_link (abfd, info) else type = SHT_RELA; dyn.d_un.d_val = 0; - for (i = 1; i < elf_elfheader (abfd)->e_shnum; i++) + for (i = 1; i < elf_numsections (abfd); i++) { Elf_Internal_Shdr *hdr; @@ -4920,20 +5629,19 @@ elf_bfd_final_link (abfd, info) || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0) { if (! bfd_set_section_contents (abfd, o->output_section, - o->contents, o->output_offset, + o->contents, + (file_ptr) o->output_offset, o->_raw_size)) goto error_return; } else { - file_ptr off; - /* The contents of the .dynstr section are actually in a stringtab. */ off = elf_section_data (o->output_section)->this_hdr.sh_offset; if (bfd_seek (abfd, off, SEEK_SET) != 0 - || ! _bfd_stringtab_emit (abfd, - elf_hash_table (info)->dynstr)) + || ! _bfd_elf_strtab_emit (abfd, + elf_hash_table (info)->dynstr)) goto error_return; } } @@ -4946,6 +5654,19 @@ elf_bfd_final_link (abfd, info) goto error_return; } + if (info->eh_frame_hdr && elf_hash_table (info)->dynobj) + { + o = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + ".eh_frame_hdr"); + if (o + && (elf_section_data (o)->sec_info_type + == ELF_INFO_TYPE_EH_FRAME_HDR)) + { + if (! _bfd_elf_write_section_eh_frame_hdr (abfd, o)) + goto error_return; + } + } + if (finfo.symstrtab != NULL) _bfd_stringtab_free (finfo.symstrtab); if (finfo.contents != NULL) @@ -4956,6 +5677,8 @@ elf_bfd_final_link (abfd, info) free (finfo.internal_relocs); if (finfo.external_syms != NULL) free (finfo.external_syms); + if (finfo.locsym_shndx != NULL) + free (finfo.locsym_shndx); if (finfo.internal_syms != NULL) free (finfo.internal_syms); if (finfo.indices != NULL) @@ -4964,11 +5687,13 @@ elf_bfd_final_link (abfd, info) free (finfo.sections); if (finfo.symbuf != NULL) free (finfo.symbuf); + if (finfo.symshndxbuf != NULL) + free (finfo.symbuf); for (o = abfd->sections; o != NULL; o = o->next) { if ((o->flags & SEC_RELOC) != 0 && elf_section_data (o)->rel_hashes != NULL) - free (elf_section_data (o)->rel_hashes); + free (elf_section_data (o)->rel_hashes); } elf_tdata (abfd)->linker = true; @@ -4986,6 +5711,8 @@ elf_bfd_final_link (abfd, info) free (finfo.internal_relocs); if (finfo.external_syms != NULL) free (finfo.external_syms); + if (finfo.locsym_shndx != NULL) + free (finfo.locsym_shndx); if (finfo.internal_syms != NULL) free (finfo.internal_syms); if (finfo.indices != NULL) @@ -4994,6 +5721,8 @@ elf_bfd_final_link (abfd, info) free (finfo.sections); if (finfo.symbuf != NULL) free (finfo.symbuf); + if (finfo.symshndxbuf != NULL) + free (finfo.symbuf); for (o = abfd->sections; o != NULL; o = o->next) { if ((o->flags & SEC_RELOC) != 0 @@ -5013,6 +5742,9 @@ elf_link_output_sym (finfo, name, elfsym, input_sec) Elf_Internal_Sym *elfsym; asection *input_sec; { + Elf_External_Sym *dest; + Elf_External_Sym_Shndx *destshndx; + boolean (*output_symbol_hook) PARAMS ((bfd *, struct bfd_link_info *info, const char *, @@ -5035,8 +5767,7 @@ elf_link_output_sym (finfo, name, elfsym, input_sec) else { elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab, - name, true, - false); + name, true, false); if (elfsym->st_name == (unsigned long) -1) return false; } @@ -5047,8 +5778,11 @@ elf_link_output_sym (finfo, name, elfsym, input_sec) return false; } - elf_swap_symbol_out (finfo->output_bfd, elfsym, - (PTR) (finfo->symbuf + finfo->symbuf_count)); + dest = finfo->symbuf + finfo->symbuf_count; + destshndx = finfo->symshndxbuf; + if (destshndx != NULL) + destshndx += finfo->symbuf_count; + elf_swap_symbol_out (finfo->output_bfd, elfsym, (PTR) dest, (PTR) destshndx); ++finfo->symbuf_count; ++ bfd_get_symcount (finfo->output_bfd); @@ -5064,18 +5798,31 @@ elf_link_flush_output_syms (finfo) { if (finfo->symbuf_count > 0) { - Elf_Internal_Shdr *symtab; + Elf_Internal_Shdr *hdr; + file_ptr pos; + bfd_size_type amt; + + hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr; + pos = hdr->sh_offset + hdr->sh_size; + amt = finfo->symbuf_count * sizeof (Elf_External_Sym); + if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite ((PTR) finfo->symbuf, amt, finfo->output_bfd) != amt) + return false; - symtab = &elf_tdata (finfo->output_bfd)->symtab_hdr; + hdr->sh_size += amt; - if (bfd_seek (finfo->output_bfd, symtab->sh_offset + symtab->sh_size, - SEEK_SET) != 0 - || (bfd_write ((PTR) finfo->symbuf, finfo->symbuf_count, - sizeof (Elf_External_Sym), finfo->output_bfd) - != finfo->symbuf_count * sizeof (Elf_External_Sym))) - return false; + if (finfo->symshndxbuf != NULL) + { + hdr = &elf_tdata (finfo->output_bfd)->symtab_shndx_hdr; + pos = hdr->sh_offset + hdr->sh_size; + amt = finfo->symbuf_count * sizeof (Elf_External_Sym_Shndx); + if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0 + || (bfd_bwrite ((PTR) finfo->symshndxbuf, amt, finfo->output_bfd) + != amt)) + return false; - symtab->sh_size += finfo->symbuf_count * sizeof (Elf_External_Sym); + hdr->sh_size += amt; + } finfo->symbuf_count = 0; } @@ -5083,6 +5830,33 @@ elf_link_flush_output_syms (finfo) return true; } +/* Adjust all external symbols pointing into SEC_MERGE sections + to reflect the object merging within the sections. */ + +static boolean +elf_link_sec_merge_syms (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + asection *sec; + + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && ((sec = h->root.u.def.section)->flags & SEC_MERGE) + && elf_section_data (sec)->sec_info_type == ELF_INFO_TYPE_MERGE) + { + bfd *output_bfd = (bfd *) data; + + h->root.u.def.value = + _bfd_merged_section_offset (output_bfd, + &h->root.u.def.section, + elf_section_data (sec)->sec_info, + h->root.u.def.value, (bfd_vma) 0); + } + + return true; +} + /* Add an external symbol to the symbol table. This is called from the hash table traversal routine. When generating a shared object, we go through the symbol table twice. The first time we output @@ -5122,15 +5896,14 @@ elf_link_output_extsym (h, data) warnings for them. */ if (! finfo->info->relocateable && ! finfo->info->allow_shlib_undefined - && ! (finfo->info->shared - && !finfo->info->no_undefined) + && ! finfo->info->shared && h->root.type == bfd_link_hash_undefined && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) { if (! ((*finfo->info->callbacks->undefined_symbol) (finfo->info, h->root.root.string, h->root.u.undef.abfd, - (asection *) NULL, 0, true))) + (asection *) NULL, (bfd_vma) 0, true))) { eoinfo->failed = true; return false; @@ -5201,7 +5974,7 @@ elf_link_output_extsym (h, data) sym.st_shndx = _bfd_elf_section_from_bfd_section (finfo->output_bfd, input_sec->output_section); - if (sym.st_shndx == (unsigned short) -1) + if (sym.st_shndx == SHN_BAD) { (*_bfd_error_handler) (_("%s: could not find output section %s for input section %s"), @@ -5281,8 +6054,8 @@ elf_link_output_extsym (h, data) finish_dynamic_symbol routine gets through with it. */ if (sym.st_shndx == SHN_UNDEF && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 - && (ELF_ST_BIND(sym.st_info) == STB_GLOBAL - || ELF_ST_BIND(sym.st_info) == STB_WEAK)) + && (ELF_ST_BIND (sym.st_info) == STB_GLOBAL + || ELF_ST_BIND (sym.st_info) == STB_WEAK)) { int bindtype; @@ -5295,8 +6068,9 @@ elf_link_output_extsym (h, data) /* If a symbol is not defined locally, we clear the visibility field. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); + if (! finfo->info->relocateable + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym.st_other ^= ELF_ST_VISIBILITY (sym.st_other); /* 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 @@ -5309,13 +6083,11 @@ elf_link_output_extsym (h, data) size_t hash_entry_size; bfd_byte *bucketpos; bfd_vma chain; + Elf_External_Sym *esym; sym.st_name = h->dynstr_index; - - elf_swap_symbol_out (finfo->output_bfd, &sym, - (PTR) (((Elf_External_Sym *) - finfo->dynsym_sec->contents) - + h->dynindx)); + esym = (Elf_External_Sym *) finfo->dynsym_sec->contents + h->dynindx; + elf_swap_symbol_out (finfo->output_bfd, &sym, (PTR) esym, (PTR) 0); bucketcount = elf_hash_table (finfo->info)->bucketcount; bucket = h->elf_hash_value % bucketcount; @@ -5324,7 +6096,8 @@ elf_link_output_extsym (h, data) bucketpos = ((bfd_byte *) finfo->hash_sec->contents + (bucket + 2) * hash_entry_size); chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); - bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, (bfd_vma) h->dynindx, + bucketpos); bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, ((bfd_byte *) finfo->hash_sec->contents + (bucketcount + 2 + h->dynindx) * hash_entry_size)); @@ -5332,6 +6105,7 @@ elf_link_output_extsym (h, data) if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) { Elf_Internal_Versym iversym; + Elf_External_Versym *eversym; if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -5351,10 +6125,9 @@ elf_link_output_extsym (h, data) if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0) iversym.vs_vers |= VERSYM_HIDDEN; - _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, - (((Elf_External_Versym *) - finfo->symver_sec->contents) - + h->dynindx)); + eversym = (Elf_External_Versym *) finfo->symver_sec->contents; + eversym += h->dynindx; + _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym); } } @@ -5392,6 +6165,7 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, asection *output_section; unsigned int *rel_countp = NULL; struct elf_backend_data *bed; + bfd_size_type amt; output_section = input_section->output_section; output_rel_hdr = NULL; @@ -5421,9 +6195,9 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, { Elf_External_Rel *erel; Elf_Internal_Rel *irel; - - irel = (Elf_Internal_Rel *) bfd_zmalloc (bed->s->int_rels_per_ext_rel - * sizeof (Elf_Internal_Rel)); + + amt = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel); + irel = (Elf_Internal_Rel *) bfd_zmalloc (amt); if (irel == NULL) { (*_bfd_error_handler) (_("Error: out of memory")); @@ -5434,7 +6208,7 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, for (; irela < irelaend; irela += bed->s->int_rels_per_ext_rel, erel++) { unsigned int i; - + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) { irel[i].r_offset = irela[i].r_offset; @@ -5485,16 +6259,21 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Sym *, asection **)); bfd *output_bfd; Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; size_t locsymcount; size_t extsymoff; Elf_External_Sym *external_syms; Elf_External_Sym *esym; Elf_External_Sym *esymend; + Elf_External_Sym_Shndx *shndx_buf; + Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym *isym; long *pindex; asection **ppsection; asection *o; struct elf_backend_data *bed; + boolean emit_relocs; + struct elf_link_hash_entry **sym_hashes; output_bfd = finfo->output_bfd; bed = get_elf_backend_data (output_bfd); @@ -5506,6 +6285,10 @@ elf_link_input_bfd (finfo, input_bfd) if ((input_bfd->flags & DYNAMIC) != 0) return true; + emit_relocs = (finfo->info->relocateable + || finfo->info->emitrelocations + || bed->elf_backend_emit_relocs); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (elf_bad_symtab (input_bfd)) { @@ -5525,28 +6308,38 @@ elf_link_input_bfd (finfo, input_bfd) external_syms = NULL; else { + bfd_size_type amt = locsymcount * sizeof (Elf_External_Sym); external_syms = finfo->external_syms; if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (external_syms, sizeof (Elf_External_Sym), - locsymcount, input_bfd) - != locsymcount * sizeof (Elf_External_Sym))) + || bfd_bread (external_syms, amt, input_bfd) != amt) + return false; + } + + shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; + shndx_buf = NULL; + if (shndx_hdr->sh_size != 0 && locsymcount != 0) + { + bfd_size_type amt = locsymcount * sizeof (Elf_External_Sym_Shndx); + shndx_buf = finfo->locsym_shndx; + if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (shndx_buf, amt, input_bfd) != amt) return false; } /* Swap in the local symbols and write out the ones which we know are going into the output file. */ - esym = external_syms; - esymend = esym + locsymcount; - isym = finfo->internal_syms; - pindex = finfo->indices; - ppsection = finfo->sections; - for (; esym < esymend; esym++, isym++, pindex++, ppsection++) + for (esym = external_syms, esymend = esym + locsymcount, + isym = finfo->internal_syms, pindex = finfo->indices, + ppsection = finfo->sections, shndx = shndx_buf; + esym < esymend; + esym++, isym++, pindex++, ppsection++, + shndx = (shndx != NULL ? shndx + 1 : NULL)) { asection *isec; const char *name; Elf_Internal_Sym osym; - elf_swap_symbol_in (input_bfd, esym, isym); + elf_swap_symbol_in (input_bfd, esym, shndx, isym); *pindex = -1; if (elf_bad_symtab (input_bfd)) @@ -5558,24 +6351,24 @@ elf_link_input_bfd (finfo, input_bfd) } } - name = NULL; if (isym->st_shndx == SHN_UNDEF) - { - isec = bfd_und_section_ptr; - name = isec->name; - } - else if (isym->st_shndx > 0 && isym->st_shndx < SHN_LORESERVE) - isec = section_from_elf_index (input_bfd, isym->st_shndx); - else if (isym->st_shndx == SHN_ABS) + isec = bfd_und_section_ptr; + else if (isym->st_shndx < SHN_LORESERVE + || isym->st_shndx > SHN_HIRESERVE) { - isec = bfd_abs_section_ptr; - name = isec->name; + isec = section_from_elf_index (input_bfd, isym->st_shndx); + if (isec + && elf_section_data (isec)->sec_info_type == ELF_INFO_TYPE_MERGE + && ELF_ST_TYPE (isym->st_info) != STT_SECTION) + isym->st_value = + _bfd_merged_section_offset (output_bfd, &isec, + elf_section_data (isec)->sec_info, + isym->st_value, (bfd_vma) 0); } + else if (isym->st_shndx == SHN_ABS) + isec = bfd_abs_section_ptr; else if (isym->st_shndx == SHN_COMMON) - { - isec = bfd_com_section_ptr; - name = isec->name; - } + isec = bfd_com_section_ptr; else { /* Who knows? */ @@ -5590,41 +6383,6 @@ elf_link_input_bfd (finfo, input_bfd) if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) { - asection *ksec; - - /* Save away all section symbol values. */ - if (isec != NULL) - { - if (name) - { - if (isec->symbol->value != isym->st_value) - (*_bfd_error_handler) - (_("%s: invalid section symbol index 0x%x (%s) ingored"), - bfd_get_filename (input_bfd), isym->st_shndx, - name); - continue; - } - isec->symbol->value = isym->st_value; - } - - /* If this is a discarded link-once section symbol, update - it's value to that of the kept section symbol. The - linker will keep the first of any matching link-once - sections, so we should have already seen it's section - symbol. I trust no-one will have the bright idea of - re-ordering the bfd list... */ - if (isec != NULL - && (bfd_get_section_flags (input_bfd, isec) & SEC_LINK_ONCE) != 0 - && (ksec = isec->kept_section) != NULL) - { - isym->st_value = ksec->symbol->value; - - /* That put the value right, but the section info is all - wrong. I hope this works. */ - isec->output_offset = ksec->output_offset; - isec->output_section = ksec->output_section; - } - /* We never output section symbols. Instead, we use the section symbol of the corresponding section in the output file. */ @@ -5649,8 +6407,7 @@ elf_link_input_bfd (finfo, input_bfd) linker_mark is only reliable for sections that have contents. For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE as well as linker_mark. */ - if (isym->st_shndx > 0 - && isym->st_shndx < SHN_LORESERVE + if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) && isec != NULL && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0) || (! finfo->info->relocateable @@ -5667,7 +6424,9 @@ elf_link_input_bfd (finfo, input_bfd) if ((finfo->info->strip == strip_some && (bfd_hash_lookup (finfo->info->keep_hash, name, false, false) == NULL)) - || (finfo->info->discard == discard_l + || (((finfo->info->discard == discard_sec_merge + && (isec->flags & SEC_MERGE) && ! finfo->info->relocateable) + || finfo->info->discard == discard_l) && bfd_is_local_label_name (input_bfd, name))) continue; @@ -5678,7 +6437,7 @@ elf_link_input_bfd (finfo, input_bfd) /* Adjust the section index for the output file. */ osym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, isec->output_section); - if (osym.st_shndx == (unsigned short) -1) + if (osym.st_shndx == SHN_BAD) return false; *pindex = bfd_get_symcount (output_bfd); @@ -5699,6 +6458,7 @@ elf_link_input_bfd (finfo, input_bfd) } /* Relocate the contents of each section. */ + sym_hashes = elf_sym_hashes (input_bfd); for (o = input_bfd->sections; o != NULL; o = o->next) { bfd_byte *contents; @@ -5746,6 +6506,117 @@ elf_link_input_bfd (finfo, input_bfd) && o->reloc_count > 0) return false; + /* Run through the relocs looking for any against symbols + from discarded sections and section symbols from + removed link-once sections. Complain about relocs + against discarded sections. Zero relocs against removed + link-once sections. We should really complain if + anything in the final link tries to use it, but + DWARF-based exception handling might have an entry in + .eh_frame to describe a routine in the linkonce section, + and it turns out to be hard to remove the .eh_frame + entry too. FIXME. */ + if (!finfo->info->relocateable + && !elf_section_ignore_discarded_relocs (o)) + { + Elf_Internal_Rela *rel, *relend; + + rel = internal_relocs; + relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel; + for ( ; rel < relend; rel++) + { + unsigned long r_symndx = ELF_R_SYM (rel->r_info); + + if (r_symndx >= locsymcount + || (elf_bad_symtab (input_bfd) + && finfo->sections[r_symndx] == NULL)) + { + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - extsymoff]; + 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; + + /* Complain if the definition comes from a + discarded section. */ + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && elf_discarded_section (h->root.u.def.section)) + { +#if BFD_VERSION_DATE < 20031005 + if ((o->flags & SEC_DEBUGGING) != 0) + { +#if BFD_VERSION_DATE > 20021005 + (*finfo->info->callbacks->warning) + (finfo->info, + _("warning: relocation against removed section; zeroing"), + NULL, input_bfd, o, rel->r_offset); +#endif + BFD_ASSERT (r_symndx != 0); + memset (rel, 0, sizeof (*rel)); + } + else +#endif + { + if (! ((*finfo->info->callbacks->undefined_symbol) + (finfo->info, h->root.root.string, + input_bfd, o, rel->r_offset, + true))) + return false; + } + } + } + else + { + asection *sec = finfo->sections[r_symndx]; + + if (sec != NULL && elf_discarded_section (sec)) + { +#if BFD_VERSION_DATE < 20031005 + if ((o->flags & SEC_DEBUGGING) != 0 + || (sec->flags & SEC_LINK_ONCE) != 0) + { +#if BFD_VERSION_DATE > 20021005 + (*finfo->info->callbacks->warning) + (finfo->info, + _("warning: relocation against removed section"), + NULL, input_bfd, o, rel->r_offset); +#endif + BFD_ASSERT (r_symndx != 0); + rel->r_info + = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info)); + rel->r_addend = 0; + } + else +#endif + { + boolean ok; + const char *msg + = _("local symbols in discarded section %s"); + bfd_size_type amt + = strlen (sec->name) + strlen (msg) - 1; + char *buf = (char *) bfd_malloc (amt); + + if (buf != NULL) + sprintf (buf, msg, sec->name); + else + buf = (char *) sec->name; + ok = (*finfo->info->callbacks + ->undefined_symbol) (finfo->info, buf, + input_bfd, o, + rel->r_offset, + true); + if (buf != sec->name) + free (buf); + if (!ok) + return false; + } + } + } + } + } + /* Relocate the section by invoking a back end routine. The back end routine is responsible for adjusting the @@ -5773,26 +6644,27 @@ elf_link_input_bfd (finfo, input_bfd) finfo->sections)) return false; - if (finfo->info->relocateable || finfo->info->emitrelocations) + if (emit_relocs) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; struct elf_link_hash_entry **rel_hash; Elf_Internal_Shdr *input_rel_hdr; unsigned int next_erel; + void (*reloc_emitter) PARAMS ((bfd *, asection *, + Elf_Internal_Shdr *, + Elf_Internal_Rela *)); /* Adjust the reloc addresses and symbol indices. */ irela = internal_relocs; - irelaend = irela - + o->reloc_count * bed->s->int_rels_per_ext_rel; + irelaend = irela + o->reloc_count * bed->s->int_rels_per_ext_rel; rel_hash = (elf_section_data (o->output_section)->rel_hashes + elf_section_data (o->output_section)->rel_count + elf_section_data (o->output_section)->rel_count2); for (next_erel = 0; irela < irelaend; irela++, next_erel++) { unsigned long r_symndx; - Elf_Internal_Sym *isym; asection *sec; if (next_erel == bed->s->int_rels_per_ext_rel) @@ -5875,7 +6747,7 @@ elf_link_input_bfd (finfo, input_bfd) { if (finfo->indices[r_symndx] == -1) { - unsigned long link; + unsigned long shlink; const char *name; asection *osec; @@ -5889,10 +6761,9 @@ elf_link_input_bfd (finfo, input_bfd) /* This symbol was skipped earlier, but since it is needed by a reloc, we must output it now. */ - link = symtab_hdr->sh_link; - name = bfd_elf_string_from_elf_section (input_bfd, - link, - isym->st_name); + shlink = symtab_hdr->sh_link; + name = (bfd_elf_string_from_elf_section + (input_bfd, shlink, isym->st_name)); if (name == NULL) return false; @@ -5900,14 +6771,15 @@ elf_link_input_bfd (finfo, input_bfd) isym->st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, osec); - if (isym->st_shndx == (unsigned short) -1) + if (isym->st_shndx == SHN_BAD) return false; isym->st_value += sec->output_offset; if (! finfo->info->relocateable) isym->st_value += osec->vma; - finfo->indices[r_symndx] = bfd_get_symcount (output_bfd); + finfo->indices[r_symndx] + = bfd_get_symcount (output_bfd); if (! elf_link_output_sym (finfo, name, isym, sec)) return false; @@ -5921,37 +6793,72 @@ elf_link_input_bfd (finfo, input_bfd) } /* Swap out the relocs. */ + if (bed->elf_backend_emit_relocs + && !(finfo->info->relocateable + || finfo->info->emitrelocations)) + reloc_emitter = bed->elf_backend_emit_relocs; + else + reloc_emitter = elf_link_output_relocs; + input_rel_hdr = &elf_section_data (o)->rel_hdr; - elf_link_output_relocs (output_bfd, o, - input_rel_hdr, - internal_relocs); - internal_relocs += NUM_SHDR_ENTRIES (input_rel_hdr) - * bed->s->int_rels_per_ext_rel; + (*reloc_emitter) (output_bfd, o, input_rel_hdr, internal_relocs); + input_rel_hdr = elf_section_data (o)->rel_hdr2; - if (input_rel_hdr) - elf_link_output_relocs (output_bfd, o, - input_rel_hdr, - internal_relocs); + if (input_rel_hdr) + { + internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel); + reloc_emitter (output_bfd, o, input_rel_hdr, internal_relocs); + } + } } /* Write out the modified section contents. */ - if (elf_section_data (o)->stab_info == NULL) + if (bed->elf_backend_write_section + && (*bed->elf_backend_write_section) (output_bfd, o, contents)) { - if (! (o->flags & SEC_EXCLUDE) && - ! bfd_set_section_contents (output_bfd, o->output_section, - contents, o->output_offset, - (o->_cooked_size != 0 - ? o->_cooked_size - : o->_raw_size))) - return false; + /* Section written out. */ } - else + else switch (elf_section_data (o)->sec_info_type) { + case ELF_INFO_TYPE_STABS: if (! (_bfd_write_section_stabs - (output_bfd, &elf_hash_table (finfo->info)->stab_info, - o, &elf_section_data (o)->stab_info, contents))) + (output_bfd, + &elf_hash_table (finfo->info)->stab_info, + o, &elf_section_data (o)->sec_info, contents))) + return false; + break; + case ELF_INFO_TYPE_MERGE: + if (! (_bfd_write_merged_section + (output_bfd, o, elf_section_data (o)->sec_info))) return false; + break; + case ELF_INFO_TYPE_EH_FRAME: + { + asection *ehdrsec; + + ehdrsec + = bfd_get_section_by_name (elf_hash_table (finfo->info)->dynobj, + ".eh_frame_hdr"); + if (! (_bfd_elf_write_section_eh_frame (output_bfd, o, ehdrsec, + contents))) + return false; + } + break; + default: + { + bfd_size_type sec_size; + + sec_size = (o->_cooked_size != 0 ? o->_cooked_size : o->_raw_size); + if (! (o->flags & SEC_EXCLUDE) + && ! bfd_set_section_contents (output_bfd, o->output_section, + contents, + (file_ptr) o->output_offset, + sec_size)) + return false; + } + break; } } @@ -6047,28 +6954,31 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) bfd_reloc_status_type rstat; bfd_byte *buf; boolean ok; + const char *sym_name; size = bfd_get_reloc_size (howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) return false; - rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf); + rstat = _bfd_relocate_contents (howto, output_bfd, (bfd_vma) addend, buf); switch (rstat) { case bfd_reloc_ok: break; + default: case bfd_reloc_outofrange: abort (); + case bfd_reloc_overflow: + if (link_order->type == bfd_section_reloc_link_order) + sym_name = bfd_section_name (output_bfd, + link_order->u.reloc.p->u.section); + else + sym_name = link_order->u.reloc.p->u.name; if (! ((*info->callbacks->reloc_overflow) - (info, - (link_order->type == bfd_section_reloc_link_order - ? bfd_section_name (output_bfd, - link_order->u.reloc.p->u.section) - : link_order->u.reloc.p->u.name), - howto->name, addend, (bfd *) NULL, (asection *) NULL, - (bfd_vma) 0))) + (info, sym_name, howto->name, addend, + (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) { free (buf); return false; @@ -6093,15 +7003,16 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) if (rel_hdr->sh_type == SHT_REL) { + bfd_size_type size; Elf_Internal_Rel *irel; Elf_External_Rel *erel; unsigned int i; - - irel = (Elf_Internal_Rel *) bfd_zmalloc (bed->s->int_rels_per_ext_rel - * sizeof (Elf_Internal_Rel)); + + size = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel); + irel = (Elf_Internal_Rel *) bfd_zmalloc (size); if (irel == NULL) return false; - + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) irel[i].r_offset = offset; irel[0].r_info = ELF_R_INFO (indx, howto->type); @@ -6118,12 +7029,13 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) } else { + bfd_size_type size; Elf_Internal_Rela *irela; Elf_External_Rela *erela; unsigned int i; - - irela = (Elf_Internal_Rela *) bfd_zmalloc (bed->s->int_rels_per_ext_rel - * sizeof (Elf_Internal_Rela)); + + size = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); + irela = (Elf_Internal_Rela *) bfd_zmalloc (size); if (irela == NULL) return false; @@ -6158,14 +7070,15 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) { elf_linker_section_pointers_t **ptr_linker_section_ptr = NULL; elf_linker_section_pointers_t *linker_section_ptr; - unsigned long r_symndx = ELF_R_SYM (rel->r_info);; + unsigned long r_symndx = ELF_R_SYM (rel->r_info); + bfd_size_type amt; BFD_ASSERT (lsect != NULL); - /* Is this a global symbol? */ + /* Is this a global symbol? */ if (h != NULL) { - /* Has this symbol already been allocated, if so, our work is done */ + /* Has this symbol already been allocated? If so, our work is done. */ if (_bfd_elf_find_pointer_linker_section (h->linker_section_pointer, rel->r_addend, lsect->which)) @@ -6182,29 +7095,30 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) if (lsect->rel_section) lsect->rel_section->_raw_size += sizeof (Elf_External_Rela); } - - else /* Allocation of a pointer to a local symbol */ + else { + /* Allocation of a pointer to a local symbol. */ elf_linker_section_pointers_t **ptr = elf_local_ptr_offsets (abfd); - /* Allocate a table to hold the local symbols if first time */ + /* Allocate a table to hold the local symbols if first time. */ if (!ptr) { unsigned int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info; register unsigned int i; - ptr = (elf_linker_section_pointers_t **) - bfd_alloc (abfd, num_symbols * sizeof (elf_linker_section_pointers_t *)); + amt = num_symbols; + amt *= sizeof (elf_linker_section_pointers_t *); + ptr = (elf_linker_section_pointers_t **) bfd_alloc (abfd, amt); if (!ptr) return false; elf_local_ptr_offsets (abfd) = ptr; for (i = 0; i < num_symbols; i++) - ptr[i] = (elf_linker_section_pointers_t *)0; + ptr[i] = (elf_linker_section_pointers_t *) 0; } - /* Has this symbol already been allocated, if so, our work is done */ + /* Has this symbol already been allocated? If so, our work is done. */ if (_bfd_elf_find_pointer_linker_section (ptr[r_symndx], rel->r_addend, lsect->which)) @@ -6222,11 +7136,11 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) } } - /* Allocate space for a pointer in the linker section, and allocate a new pointer record - from internal memory. */ + /* Allocate space for a pointer in the linker section, and allocate + a new pointer record from internal memory. */ BFD_ASSERT (ptr_linker_section_ptr != NULL); - linker_section_ptr = (elf_linker_section_pointers_t *) - bfd_alloc (abfd, sizeof (elf_linker_section_pointers_t)); + amt = sizeof (elf_linker_section_pointers_t); + linker_section_ptr = (elf_linker_section_pointers_t *) bfd_alloc (abfd, amt); if (!linker_section_ptr) return false; @@ -6240,17 +7154,19 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) #if 0 if (lsect->hole_size && lsect->hole_offset < lsect->max_hole_offset) { - linker_section_ptr->offset = lsect->section->_raw_size - lsect->hole_size + (ARCH_SIZE / 8); + linker_section_ptr->offset = (lsect->section->_raw_size + - lsect->hole_size + (ARCH_SIZE / 8)); lsect->hole_offset += ARCH_SIZE / 8; lsect->sym_offset += ARCH_SIZE / 8; - if (lsect->sym_hash) /* Bump up symbol value if needed */ + if (lsect->sym_hash) { + /* Bump up symbol value if needed. */ lsect->sym_hash->root.u.def.value += ARCH_SIZE / 8; #ifdef DEBUG fprintf (stderr, "Bump up %s by %ld, current value = %ld\n", lsect->sym_hash->root.root.string, - (long)ARCH_SIZE / 8, - (long)lsect->sym_hash->root.u.def.value); + (long) ARCH_SIZE / 8, + (long) lsect->sym_hash->root.u.def.value); #endif } } @@ -6261,8 +7177,10 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) lsect->section->_raw_size += ARCH_SIZE / 8; #ifdef DEBUG - fprintf (stderr, "Create pointer in linker section %s, offset = %ld, section size = %ld\n", - lsect->name, (long)linker_section_ptr->offset, (long)lsect->section->_raw_size); + fprintf (stderr, + "Create pointer in linker section %s, offset = %ld, section size = %ld\n", + lsect->name, (long) linker_section_ptr->offset, + (long) lsect->section->_raw_size); #endif return true; @@ -6278,7 +7196,8 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) /* Fill in the address for a pointer generated in a linker section. */ bfd_vma -elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, relocation, rel, relative_reloc) +elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, + relocation, rel, relative_reloc) bfd *output_bfd; bfd *input_bfd; struct bfd_link_info *info; @@ -6292,11 +7211,13 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca BFD_ASSERT (lsect != NULL); - if (h != NULL) /* global symbol */ + if (h != NULL) { - linker_section_ptr = _bfd_elf_find_pointer_linker_section (h->linker_section_pointer, - rel->r_addend, - lsect->which); + /* Handle global symbol. */ + linker_section_ptr = (_bfd_elf_find_pointer_linker_section + (h->linker_section_pointer, + rel->r_addend, + lsect->which)); BFD_ASSERT (linker_section_ptr != NULL); @@ -6316,23 +7237,27 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca if (!linker_section_ptr->written_address_p) { linker_section_ptr->written_address_p = true; - bfd_put_ptr (output_bfd, relocation + linker_section_ptr->addend, - lsect->section->contents + linker_section_ptr->offset); + bfd_put_ptr (output_bfd, + relocation + linker_section_ptr->addend, + (lsect->section->contents + + linker_section_ptr->offset)); } } } - else /* local symbol */ + else { + /* Handle local symbol. */ unsigned long r_symndx = ELF_R_SYM (rel->r_info); BFD_ASSERT (elf_local_ptr_offsets (input_bfd) != NULL); BFD_ASSERT (elf_local_ptr_offsets (input_bfd)[r_symndx] != NULL); - linker_section_ptr = _bfd_elf_find_pointer_linker_section (elf_local_ptr_offsets (input_bfd)[r_symndx], - rel->r_addend, - lsect->which); + linker_section_ptr = (_bfd_elf_find_pointer_linker_section + (elf_local_ptr_offsets (input_bfd)[r_symndx], + rel->r_addend, + lsect->which)); BFD_ASSERT (linker_section_ptr != NULL); - /* Write out pointer if it hasn't been rewritten out before */ + /* Write out pointer if it hasn't been rewritten out before. */ if (!linker_section_ptr->written_address_p) { linker_section_ptr->written_address_p = true; @@ -6343,21 +7268,27 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca { asection *srel = lsect->rel_section; Elf_Internal_Rela *outrel; + Elf_External_Rela *erel; struct elf_backend_data *bed = get_elf_backend_data (output_bfd); unsigned int i; + bfd_size_type amt; - outrel = (Elf_Internal_Rela *) bfd_zmalloc (sizeof (Elf_Internal_Rela) - * bed->s->int_rels_per_ext_rel); + amt = sizeof (Elf_Internal_Rela) * bed->s->int_rels_per_ext_rel; + outrel = (Elf_Internal_Rela *) bfd_zmalloc (amt); if (outrel == NULL) { (*_bfd_error_handler) (_("Error: out of memory")); return 0; } - /* We need to generate a relative reloc for the dynamic linker. */ + /* We need to generate a relative reloc for the dynamic + linker. */ if (!srel) - lsect->rel_section = srel = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - lsect->rel_name); + { + srel = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + lsect->rel_name); + lsect->rel_section = srel; + } BFD_ASSERT (srel != NULL); @@ -6367,12 +7298,11 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca + linker_section_ptr->offset); outrel[0].r_info = ELF_R_INFO (0, relative_reloc); outrel[0].r_addend = 0; - elf_swap_reloca_out (output_bfd, outrel, - (((Elf_External_Rela *) - lsect->section->contents) - + elf_section_data (lsect->section)->rel_count)); + erel = (Elf_External_Rela *) lsect->section->contents; + erel += elf_section_data (lsect->section)->rel_count; + elf_swap_reloca_out (output_bfd, outrel, erel); ++elf_section_data (lsect->section)->rel_count; - + free (outrel); } } @@ -6384,8 +7314,9 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca - lsect->sym_offset); #ifdef DEBUG - fprintf (stderr, "Finish pointer in linker section %s, offset = %ld (0x%lx)\n", - lsect->name, (long)relocation, (long)relocation); + fprintf (stderr, + "Finish pointer in linker section %s, offset = %ld (0x%lx)\n", + lsect->name, (long) relocation, (long) relocation); #endif /* Subtract out the addend, because it will get added back in by the normal @@ -6420,7 +7351,8 @@ static boolean elf_gc_smash_unused_vtentry_relocs PARAMS ((struct elf_link_hash_entry *h, PTR dummy)); /* The mark phase of garbage collection. For a given section, mark - it, and all the sections which define symbols to which it refers. */ + it and any sections in this section's group, and all the sections + which define symbols to which it refers. */ static boolean elf_gc_mark (info, sec, gc_mark_hook) @@ -6430,20 +7362,29 @@ elf_gc_mark (info, sec, gc_mark_hook) PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); { - boolean ret = true; + boolean ret; + asection *group_sec; sec->gc_mark = 1; - /* Look through the section relocs. */ + /* Mark all the sections in the group. */ + group_sec = elf_section_data (sec)->next_in_group; + if (group_sec && !group_sec->gc_mark) + if (!elf_gc_mark (info, group_sec, gc_mark_hook)) + return false; + /* Look through the section relocs. */ + ret = true; if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0) { Elf_Internal_Rela *relstart, *rel, *relend; Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; struct elf_link_hash_entry **sym_hashes; size_t nlocsyms; size_t extsymoff; Elf_External_Sym *locsyms, *freesyms = NULL; + Elf_External_Sym_Shndx *locsym_shndx; bfd *input_bfd = sec->owner; struct elf_backend_data *bed = get_elf_backend_data (input_bfd); @@ -6461,25 +7402,35 @@ elf_gc_mark (info, sec, gc_mark_hook) } else extsymoff = nlocsyms = symtab_hdr->sh_info; + if (symtab_hdr->contents) locsyms = (Elf_External_Sym *) symtab_hdr->contents; else if (nlocsyms == 0) locsyms = NULL; else { - locsyms = freesyms = - bfd_malloc (nlocsyms * sizeof (Elf_External_Sym)); + bfd_size_type amt = nlocsyms * sizeof (Elf_External_Sym); + locsyms = freesyms = bfd_malloc (amt); if (freesyms == NULL || bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (locsyms, sizeof (Elf_External_Sym), - nlocsyms, input_bfd) - != nlocsyms * sizeof (Elf_External_Sym))) + || bfd_bread (locsyms, amt, input_bfd) != amt) { ret = false; goto out1; } } + shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; + locsym_shndx = NULL; + if (shndx_hdr->sh_size != 0 && nlocsyms != 0) + { + bfd_size_type amt = nlocsyms * sizeof (Elf_External_Sym_Shndx); + locsym_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (locsym_shndx, amt, input_bfd) != amt) + return false; + } + /* Read the relocations. */ relstart = (NAME(_bfd_elf,link_read_relocs) (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, @@ -6504,7 +7455,10 @@ elf_gc_mark (info, sec, gc_mark_hook) if (elf_bad_symtab (sec->owner)) { - elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); + elf_swap_symbol_in (input_bfd, + locsyms + r_symndx, + locsym_shndx + (locsym_shndx ? r_symndx : 0), + &s); if (ELF_ST_BIND (s.st_info) == STB_LOCAL) rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); else @@ -6520,7 +7474,10 @@ elf_gc_mark (info, sec, gc_mark_hook) } else { - elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); + elf_swap_symbol_in (input_bfd, + locsyms + r_symndx, + locsym_shndx + (locsym_shndx ? r_symndx : 0), + &s); rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); } @@ -6678,11 +7635,17 @@ elf_gc_propagate_vtable_entries_used (h, okp) pu = h->vtable_parent->vtable_entries_used; if (pu != NULL) { - n = h->vtable_parent->vtable_entries_size / FILE_ALIGN; - while (--n != 0) + asection *sec = h->root.u.def.section; + struct elf_backend_data *bed = get_elf_backend_data (sec->owner); + int file_align = bed->s->file_align; + + n = h->vtable_parent->vtable_entries_size / file_align; + while (n--) { - if (*pu) *cu = true; - pu++, cu++; + if (*pu) + *cu = true; + pu++; + cu++; } } } @@ -6699,6 +7662,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) bfd_vma hstart, hend; Elf_Internal_Rela *relstart, *relend, *rel; struct elf_backend_data *bed; + int file_align; /* Take care of both those symbols that do not describe vtables as well as those that are not loaded. */ @@ -6715,8 +7679,10 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) relstart = (NAME(_bfd_elf,link_read_relocs) (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, true)); if (!relstart) - return *(boolean *)okp = false; + return *(boolean *) okp = false; bed = get_elf_backend_data (sec->owner); + file_align = bed->s->file_align; + relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel; for (rel = relstart; rel < relend; ++rel) @@ -6726,7 +7692,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) if (h->vtable_entries_used && (rel->r_offset - hstart) < h->vtable_entries_size) { - bfd_vma entry = (rel->r_offset - hstart) / FILE_ALIGN; + bfd_vma entry = (rel->r_offset - hstart) / file_align; if (h->vtable_entries_used[entry]) continue; } @@ -6747,7 +7713,7 @@ elf_gc_sections (abfd, info) boolean ok = true; bfd *sub; asection * (*gc_mark_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *h, Elf_Internal_Sym *)); if (!get_elf_backend_data (abfd)->can_gc_sections @@ -6788,7 +7754,7 @@ elf_gc_sections (abfd, info) } /* ... and mark SEC_EXCLUDE for those that go. */ - if (!elf_gc_sweep(info, get_elf_backend_data (abfd)->gc_sweep_hook)) + if (!elf_gc_sweep (info, get_elf_backend_data (abfd)->gc_sweep_hook)) return false; return true; @@ -6830,12 +7796,12 @@ elf_gc_record_vtinherit (abfd, sec, h, offset) } (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT", - bfd_get_filename (abfd), sec->name, - (unsigned long)offset); + bfd_archive_filename (abfd), sec->name, + (unsigned long) offset); bfd_set_error (bfd_error_invalid_operation); return false; -win: + win: if (!h) { /* This *should* only be the absolute section. It could potentially @@ -6860,6 +7826,9 @@ elf_gc_record_vtentry (abfd, sec, h, addend) struct elf_link_hash_entry *h; bfd_vma addend; { + struct elf_backend_data *bed = get_elf_backend_data (abfd); + int file_align = bed->s->file_align; + if (addend >= h->vtable_entries_size) { size_t size, bytes; @@ -6882,22 +7851,23 @@ elf_gc_record_vtentry (abfd, sec, h, addend) /* Allocate one extra entry for use as a "done" flag for the consolidation pass. */ - bytes = (size / FILE_ALIGN + 1) * sizeof (boolean); + bytes = (size / file_align + 1) * sizeof (boolean); if (ptr) { - ptr = bfd_realloc (ptr - 1, bytes); + ptr = bfd_realloc (ptr - 1, (bfd_size_type) bytes); if (ptr != NULL) { size_t oldbytes; - oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof (boolean); - memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes); + oldbytes = ((h->vtable_entries_size / file_align + 1) + * sizeof (boolean)); + memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes); } } else - ptr = bfd_zmalloc (bytes); + ptr = bfd_zmalloc ((bfd_size_type) bytes); if (ptr == NULL) return false; @@ -6907,7 +7877,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) h->vtable_entries_size = size; } - h->vtable_entries_used[addend / FILE_ALIGN] = true; + h->vtable_entries_used[addend / file_align] = true; return true; } @@ -7029,8 +7999,8 @@ elf_collect_hash_codes (h, data) p = strchr (name, ELF_VER_CHR); if (p != NULL) { - alc = bfd_malloc (p - name + 1); - memcpy (alc, name, p - name); + alc = bfd_malloc ((bfd_size_type) (p - name + 1)); + memcpy (alc, name, (size_t) (p - name)); alc[p - name] = '\0'; name = alc; } @@ -7050,3 +8020,271 @@ elf_collect_hash_codes (h, data) return true; } + +boolean +elf_reloc_symbol_deleted_p (offset, cookie) + bfd_vma offset; + PTR cookie; +{ + struct elf_reloc_cookie *rcookie = (struct elf_reloc_cookie *) cookie; + + if (rcookie->bad_symtab) + rcookie->rel = rcookie->rels; + + for (; rcookie->rel < rcookie->relend; rcookie->rel++) + { + unsigned long r_symndx = ELF_R_SYM (rcookie->rel->r_info); + Elf_Internal_Sym isym; + + if (! rcookie->bad_symtab) + if (rcookie->rel->r_offset > offset) + return false; + if (rcookie->rel->r_offset != offset) + continue; + + if (rcookie->locsyms && r_symndx < rcookie->locsymcount) + { + Elf_External_Sym *lsym; + Elf_External_Sym_Shndx *lshndx; + + lsym = (Elf_External_Sym *) rcookie->locsyms + r_symndx; + lshndx = (Elf_External_Sym_Shndx *) rcookie->locsym_shndx; + if (lshndx != NULL) + lshndx += r_symndx; + elf_swap_symbol_in (rcookie->abfd, lsym, lshndx, &isym); + } + + if (r_symndx >= rcookie->locsymcount + || (rcookie->locsyms + && ELF_ST_BIND (isym.st_info) != STB_LOCAL)) + { + struct elf_link_hash_entry *h; + + h = rcookie->sym_hashes[r_symndx - rcookie->extsymoff]; + + 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) + && elf_discarded_section (h->root.u.def.section)) + return true; + else + return false; + } + else if (rcookie->locsyms) + { + /* It's not a relocation against a global symbol, + but it could be a relocation against a local + symbol for a discarded section. */ + asection *isec; + + /* Need to: get the symbol; get the section. */ + if (isym.st_shndx < SHN_LORESERVE || isym.st_shndx > SHN_HIRESERVE) + { + isec = section_from_elf_index (rcookie->abfd, isym.st_shndx); + if (isec != NULL && elf_discarded_section (isec)) + return true; + } + } + return false; + } + return false; +} + +/* Discard unneeded references to discarded sections. + Returns true if any section's size was changed. */ +/* This function assumes that the relocations are in sorted order, + which is true for all known assemblers. */ + +boolean +elf_bfd_discard_info (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elf_reloc_cookie cookie; + asection *stab, *eh, *ehdr; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; + Elf_External_Sym *freesyms; + struct elf_backend_data *bed; + bfd *abfd; + boolean ret = false; + boolean strip = info->strip == strip_all || info->strip == strip_debugger; + + if (info->relocateable + || info->traditional_format + || info->hash->creator->flavour != bfd_target_elf_flavour + || ! is_elf_hash_table (info)) + return false; + + ehdr = NULL; + if (elf_hash_table (info)->dynobj != NULL) + ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + ".eh_frame_hdr"); + + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + { + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + continue; + + bed = get_elf_backend_data (abfd); + + if ((abfd->flags & DYNAMIC) != 0) + continue; + + eh = NULL; + if (ehdr) + { + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh && eh->_raw_size == 0) + eh = NULL; + } + + stab = strip ? NULL : bfd_get_section_by_name (abfd, ".stab"); + if ((! stab || elf_section_data(stab)->sec_info_type != ELF_INFO_TYPE_STABS) + && ! eh + && (strip || ! bed->elf_backend_discard_info)) + continue; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + + cookie.abfd = abfd; + cookie.sym_hashes = elf_sym_hashes (abfd); + cookie.bad_symtab = elf_bad_symtab (abfd); + if (cookie.bad_symtab) + { + cookie.locsymcount = + symtab_hdr->sh_size / sizeof (Elf_External_Sym); + cookie.extsymoff = 0; + } + else + { + cookie.locsymcount = symtab_hdr->sh_info; + cookie.extsymoff = symtab_hdr->sh_info; + } + + freesyms = NULL; + if (symtab_hdr->contents) + cookie.locsyms = (void *) symtab_hdr->contents; + else if (cookie.locsymcount == 0) + cookie.locsyms = NULL; + else + { + bfd_size_type amt = cookie.locsymcount * sizeof (Elf_External_Sym); + cookie.locsyms = bfd_malloc (amt); + if (cookie.locsyms == NULL) + return false; + freesyms = cookie.locsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (cookie.locsyms, amt, abfd) != amt) + { + error_ret_free_loc: + free (cookie.locsyms); + return false; + } + } + + cookie.locsym_shndx = NULL; + if (shndx_hdr->sh_size != 0 && cookie.locsymcount != 0) + { + bfd_size_type amt; + amt = cookie.locsymcount * sizeof (Elf_External_Sym_Shndx); + cookie.locsym_shndx = bfd_malloc (amt); + if (cookie.locsym_shndx == NULL) + goto error_ret_free_loc; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (cookie.locsym_shndx, amt, abfd) != amt) + { + free (cookie.locsym_shndx); + goto error_ret_free_loc; + } + } + + if (stab) + { + cookie.rels = (NAME(_bfd_elf,link_read_relocs) + (abfd, stab, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory)); + if (cookie.rels) + { + cookie.rel = cookie.rels; + cookie.relend = + cookie.rels + stab->reloc_count * bed->s->int_rels_per_ext_rel; + if (_bfd_discard_section_stabs (abfd, stab, + elf_section_data (stab)->sec_info, + elf_reloc_symbol_deleted_p, + &cookie)) + ret = true; + if (! info->keep_memory) + free (cookie.rels); + } + } + + if (eh) + { + cookie.rels = NULL; + cookie.rel = NULL; + cookie.relend = NULL; + if (eh->reloc_count) + cookie.rels = (NAME(_bfd_elf,link_read_relocs) + (abfd, eh, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory)); + if (cookie.rels) + { + cookie.rel = cookie.rels; + cookie.relend = + cookie.rels + eh->reloc_count * bed->s->int_rels_per_ext_rel; + } + if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, ehdr, + elf_reloc_symbol_deleted_p, + &cookie)) + ret = true; + if (! info->keep_memory) + free (cookie.rels); + } + + if (bed->elf_backend_discard_info) + { + if (bed->elf_backend_discard_info (abfd, &cookie, info)) + ret = true; + } + + if (cookie.locsym_shndx != NULL) + free (cookie.locsym_shndx); + + if (freesyms != NULL) + free (freesyms); + } + + if (ehdr + && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, + info, ehdr)) + ret = true; + return ret; +} + +static boolean +elf_section_ignore_discarded_relocs (sec) + asection *sec; +{ + switch (elf_section_data (sec)->sec_info_type) + { + case ELF_INFO_TYPE_STABS: + case ELF_INFO_TYPE_EH_FRAME: + return true; + default: + break; + } + if ((get_elf_backend_data (sec->owner)->elf_backend_ignore_discarded_relocs + != NULL) + && (*get_elf_backend_data (sec->owner) + ->elf_backend_ignore_discarded_relocs) (sec)) + return true; + + return false; +} diff --git a/contrib/binutils/bfd/elfxx-ia64.c b/contrib/binutils/bfd/elfxx-ia64.c index ee69168..7c4e139 100644 --- a/contrib/binutils/bfd/elfxx-ia64.c +++ b/contrib/binutils/bfd/elfxx-ia64.c @@ -1,5 +1,5 @@ /* IA-64 support for 64-bit ELF - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -111,6 +111,10 @@ struct elfNN_ia64_local_hash_entry { struct bfd_hash_entry root; struct elfNN_ia64_dyn_sym_info *info; + + /* True if this hash entry's addends was translated for + SHF_MERGE optimization. */ + unsigned sec_merge_done : 1; }; struct elfNN_ia64_local_hash_table @@ -138,6 +142,7 @@ struct elfNN_ia64_link_hash_table asection *rel_pltoff_sec; /* dynamic relocation section for same */ bfd_size_type minplt_entries; /* number of minplt entries */ + unsigned reltext : 1; /* are there relocs against readonly sections? */ struct elfNN_ia64_local_hash_table loc_hash_table; }; @@ -158,9 +163,11 @@ static boolean elfNN_ia64_relax_section PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, boolean *again)); static boolean is_unwind_section_name - PARAMS ((const char *)); + PARAMS ((bfd *abfd, const char *)); static boolean elfNN_ia64_section_from_shdr PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *)); +static boolean elfNN_ia64_section_flags + PARAMS ((flagword *, ElfNN_Internal_Shdr *)); static boolean elfNN_ia64_fake_sections PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); static void elfNN_ia64_final_write_processing @@ -169,8 +176,18 @@ static boolean elfNN_ia64_add_symbol_hook PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym, const char **namep, flagword *flagsp, asection **secp, bfd_vma *valp)); +static boolean elfNN_ia64_aix_vec + PARAMS ((const bfd_target *vec)); +static boolean elfNN_ia64_aix_add_symbol_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym, + const char **namep, flagword *flagsp, asection **secp, + bfd_vma *valp)); +static boolean elfNN_ia64_aix_link_add_symbols + PARAMS ((bfd *abfd, struct bfd_link_info *info)); static int elfNN_ia64_additional_program_headers PARAMS ((bfd *abfd)); +static boolean elfNN_ia64_modify_segment_map + PARAMS ((bfd *)); static boolean elfNN_ia64_is_local_label_name PARAMS ((bfd *abfd, const char *name)); static boolean elfNN_ia64_dynamic_symbol_p @@ -184,17 +201,28 @@ static struct bfd_hash_entry *elfNN_ia64_new_loc_hash_entry static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); +static void elfNN_ia64_hash_copy_indirect + PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); +static void elfNN_ia64_hash_hide_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); static struct bfd_link_hash_table *elfNN_ia64_hash_table_create PARAMS ((bfd *abfd)); static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup PARAMS ((struct elfNN_ia64_local_hash_table *table, const char *string, boolean create, boolean copy)); +static boolean elfNN_ia64_global_dyn_sym_thunk + PARAMS ((struct bfd_hash_entry *, PTR)); +static boolean elfNN_ia64_local_dyn_sym_thunk + PARAMS ((struct bfd_hash_entry *, PTR)); static void elfNN_ia64_dyn_sym_traverse PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), PTR info)); static boolean elfNN_ia64_create_dynamic_sections PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static struct elfNN_ia64_local_hash_entry * get_local_sym_hash + PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, + bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); static struct elfNN_ia64_dyn_sym_info * get_dyn_sym_info PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, struct elf_link_hash_entry *h, @@ -219,7 +247,7 @@ static boolean elfNN_ia64_check_relocs const Elf_Internal_Rela *relocs)); static boolean elfNN_ia64_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); -static unsigned long global_sym_index +static long global_sym_index PARAMS ((struct elf_link_hash_entry *h)); static boolean allocate_fptr PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); @@ -257,6 +285,8 @@ static bfd_vma set_pltoff_entry PARAMS ((bfd *abfd, struct bfd_link_info *info, struct elfNN_ia64_dyn_sym_info *dyn_i, bfd_vma value, boolean)); +static int elfNN_ia64_unwind_entry_compare + PARAMS ((const PTR, const PTR)); static boolean elfNN_ia64_final_link PARAMS ((bfd *abfd, struct bfd_link_info *info)); static boolean elfNN_ia64_relocate_section @@ -271,12 +301,18 @@ static boolean elfNN_ia64_finish_dynamic_sections PARAMS ((bfd *abfd, struct bfd_link_info *info)); static boolean elfNN_ia64_set_private_flags PARAMS ((bfd *abfd, flagword flags)); -static boolean elfNN_ia64_copy_private_bfd_data - PARAMS ((bfd *ibfd, bfd *obfd)); static boolean elfNN_ia64_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); static boolean elfNN_ia64_print_private_bfd_data PARAMS ((bfd *abfd, PTR ptr)); +static enum elf_reloc_type_class elfNN_ia64_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +static boolean elfNN_ia64_hpux_vec + PARAMS ((const bfd_target *vec)); +static void elfNN_hpux_post_process_headers + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +boolean elfNN_hpux_backend_section_from_bfd_section + PARAMS ((bfd *abfd, asection *sec, int *retval)); /* ia64-specific relocation */ @@ -352,6 +388,8 @@ static reloc_howto_type ia64_howto_table[] = IA64_HOWTO (R_IA64_LTOFF_FPTR22, "LTOFF_FPTR22", 0, false, true), IA64_HOWTO (R_IA64_LTOFF_FPTR64I, "LTOFF_FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR32MSB, "LTOFF_FPTR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR32LSB, "LTOFF_FPTR32LSB", 2, false, true), IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true), IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true), @@ -472,6 +510,8 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code) case BFD_RELOC_IA64_LTOFF_FPTR22: rtype = R_IA64_LTOFF_FPTR22; break; case BFD_RELOC_IA64_LTOFF_FPTR64I: rtype = R_IA64_LTOFF_FPTR64I; break; + case BFD_RELOC_IA64_LTOFF_FPTR32MSB: rtype = R_IA64_LTOFF_FPTR32MSB; break; + case BFD_RELOC_IA64_LTOFF_FPTR32LSB: rtype = R_IA64_LTOFF_FPTR32LSB; break; case BFD_RELOC_IA64_LTOFF_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break; case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break; @@ -519,7 +559,8 @@ elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) arelent *bfd_reloc; ElfNN_Internal_Rela *elf_reloc; { - bfd_reloc->howto = lookup_howto (ELFNN_R_TYPE (elf_reloc->r_info)); + bfd_reloc->howto + = lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info)); } #define PLT_HEADER_SIZE (3 * 16) @@ -558,6 +599,9 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = }; #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +#define AIX_DYNAMIC_INTERPRETER "/usr/lib/ia64l64/libc.so.1" +#define DYNAMIC_INTERPRETER(abfd) \ + (elfNN_ia64_aix_vec (abfd->xvec) ? AIX_DYNAMIC_INTERPRETER : ELF_DYNAMIC_INTERPRETER) /* Select out of range branch fixup type. Note that Itanium does not support brl, and so it gets emulated by the kernel. */ @@ -604,6 +648,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) }; Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; @@ -611,6 +656,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) bfd_byte *free_contents = NULL; ElfNN_External_Sym *extsyms; ElfNN_External_Sym *free_extsyms = NULL; + Elf_External_Sym_Shndx *shndx_buf = NULL; struct elfNN_ia64_link_hash_table *ia64_info; struct one_fixup *fixups = NULL; boolean changed_contents = false; @@ -672,18 +718,34 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) goto error_return; } - /* Read this BFD's symbols. */ + /* Read this BFD's local symbols. */ if (symtab_hdr->contents != NULL) extsyms = (ElfNN_External_Sym *) symtab_hdr->contents; else { - extsyms = (ElfNN_External_Sym *) bfd_malloc (symtab_hdr->sh_size); + bfd_size_type amt; + + amt = symtab_hdr->sh_info * sizeof (ElfNN_External_Sym); + extsyms = (ElfNN_External_Sym *) bfd_malloc (amt); if (extsyms == NULL) goto error_return; free_extsyms = extsyms; if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) - != symtab_hdr->sh_size)) + || bfd_bread (extsyms, amt, abfd) != amt) + goto error_return; + } + + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (shndx_hdr->sh_size != 0) + { + bfd_size_type amt; + + amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL) + goto error_return; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (shndx_buf, amt, abfd) != amt) goto error_return; } @@ -693,6 +755,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) Elf_Internal_Sym isym; asection *tsec; struct one_fixup *f; + bfd_size_type amt; if (ELFNN_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B) continue; @@ -700,20 +763,23 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* Get the value of the symbol referred to by the reloc. */ if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) { + ElfNN_External_Sym *esym; + Elf_External_Sym_Shndx *shndx; + /* A local symbol. */ - bfd_elfNN_swap_symbol_in (abfd, - extsyms + ELFNN_R_SYM (irel->r_info), - &isym); + esym = extsyms + ELFNN_R_SYM (irel->r_info); + shndx = shndx_buf + (shndx_buf ? ELFNN_R_SYM (irel->r_info) : 0); + bfd_elfNN_swap_symbol_in (abfd, esym, shndx, &isym); if (isym.st_shndx == SHN_UNDEF) continue; /* We can't do anthing with undefined symbols. */ else if (isym.st_shndx == SHN_ABS) tsec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) tsec = bfd_com_section_ptr; - else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE) - tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + else if (isym.st_shndx == SHN_IA_64_ANSI_COMMON) + tsec = bfd_com_section_ptr; else - continue; /* who knows. */ + tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); toff = isym.st_value; } @@ -760,7 +826,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) roff = irel->r_offset; reladdr = (sec->output_section->vma + sec->output_offset - + roff) & -4; + + roff) & (bfd_vma) -4; /* If the branch is in range, no need to do anything. */ if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 @@ -784,7 +850,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) make a copy of the FULL_PLT entry. Otherwise, we'll have to use a `brl' insn to get where we're going. */ - int size; + size_t size; if (tsec == ia64_info->plt_sec) size = sizeof (plt_full_entry); @@ -798,11 +864,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) } /* Resize the current section to make room for the new branch. */ - trampoff = (sec->_cooked_size + 15) & -16; - contents = (bfd_byte *) bfd_realloc (contents, trampoff + size); + trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16; + amt = trampoff + size; + contents = (bfd_byte *) bfd_realloc (contents, amt); if (contents == NULL) goto error_return; - sec->_cooked_size = trampoff + size; + sec->_cooked_size = amt; if (tsec == ia64_info->plt_sec) { @@ -830,7 +897,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) } /* Record the fixup so we don't do it again this section. */ - f = (struct one_fixup *) bfd_malloc (sizeof (*f)); + f = (struct one_fixup *) bfd_malloc ((bfd_size_type) sizeof (*f)); f->next = fixups; f->tsec = tsec; f->toff = toff; @@ -846,7 +913,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* Fix up the existing branch to hit the trampoline. Hope like hell this doesn't overflow too. */ if (elfNN_ia64_install_value (abfd, contents + roff, - f->trampoff - (roff & -4), + f->trampoff - (roff & (bfd_vma) -4), R_IA64_PCREL21B) != bfd_reloc_ok) goto error_return; @@ -880,6 +947,9 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) } } + if (shndx_buf != NULL) + free (shndx_buf); + if (free_extsyms != NULL) { if (! link_info->keep_memory) @@ -887,7 +957,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } } @@ -899,6 +969,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) free (free_relocs); if (free_contents != NULL) free (free_contents); + if (shndx_buf != NULL) + free (shndx_buf); if (free_extsyms != NULL) free (free_extsyms); return false; @@ -907,11 +979,16 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* Return true if NAME is an unwind table section name. */ static inline boolean -is_unwind_section_name (name) +is_unwind_section_name (abfd, name) + bfd *abfd; const char *name; { size_t len1, len2, len3; + if (elfNN_ia64_hpux_vec (abfd->xvec) + && !strcmp (name, ELF_STRING_ia64_unwind_hdr)) + return false; + len1 = sizeof (ELF_STRING_ia64_unwind) - 1; len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1; @@ -939,6 +1016,10 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name) switch (hdr->sh_type) { case SHT_IA_64_UNWIND: + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: + case SHT_PREINIT_ARRAY: + case SHT_IA_64_HP_OPT_ANOT: break; case SHT_IA_64_EXT: @@ -986,7 +1067,7 @@ elfNN_ia64_fake_sections (abfd, hdr, sec) name = bfd_get_section_name (abfd, sec); - if (is_unwind_section_name (name)) + if (is_unwind_section_name (abfd, name)) { /* We don't have the sections numbered at this point, so sh_info is set later, in elfNN_ia64_final_write_processing. */ @@ -995,6 +1076,14 @@ elfNN_ia64_fake_sections (abfd, hdr, sec) } else if (strcmp (name, ELF_STRING_ia64_archext) == 0) hdr->sh_type = SHT_IA_64_EXT; + else if (strcmp (name, ".init_array") == 0) + hdr->sh_type = SHT_INIT_ARRAY; + else if (strcmp (name, ".fini_array") == 0) + hdr->sh_type = SHT_FINI_ARRAY; + else if (strcmp (name, ".preinit_array") == 0) + hdr->sh_type = SHT_PREINIT_ARRAY; + else if (strcmp (name, ".HP.opt_annot") == 0) + hdr->sh_type = SHT_IA_64_HP_OPT_ANOT; else if (strcmp (name, ".reloc") == 0) /* * This is an ugly, but unfortunately necessary hack that is @@ -1062,11 +1151,29 @@ elfNN_ia64_final_write_processing (abfd, linker) { /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.t.FOO */ size_t len2 = sizeof (".gnu.linkonce.t.") - 1; - char *once_name = alloca (len2 + strlen (sname) - len + 1); + char *once_name = bfd_malloc (len2 + strlen (sname + len) + 1); - memcpy (once_name, ".gnu.linkonce.t.", len2); - strcpy (once_name + len2, sname + len); - text_sect = bfd_get_section_by_name (abfd, once_name); + if (once_name != NULL) + { + memcpy (once_name, ".gnu.linkonce.t.", len2); + strcpy (once_name + len2, sname + len); + text_sect = bfd_get_section_by_name (abfd, once_name); + free (once_name); + } + else + /* Should only happen if we run out of memory, in + which case we're probably toast anyway. Try to + cope by finding the section the slow way. */ + for (text_sect = abfd->sections; + text_sect != NULL; + text_sect = text_sect->next) + { + if (strncmp (bfd_section_name (abfd, text_sect), + ".gnu.linkonce.t.", len2) == 0 + && strcmp (bfd_section_name (abfd, text_sect) + len2, + sname + len) == 0) + break; + } } else /* last resort: fall back on .text */ @@ -1101,7 +1208,7 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= (unsigned) bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sbss. */ @@ -1125,6 +1232,112 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) return true; } +static boolean +elfNN_ia64_aix_vec (const bfd_target *vec) +{ + extern const bfd_target bfd_elfNN_ia64_aix_little_vec; + extern const bfd_target bfd_elfNN_ia64_aix_big_vec; + + return (/**/vec == & bfd_elfNN_ia64_aix_little_vec + || vec == & bfd_elfNN_ia64_aix_big_vec); +} + +/* Hook called by the linker routine which adds symbols from an object + file. We use it to handle OS-specific symbols. */ + +static boolean +elfNN_ia64_aix_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; +{ + if (strcmp (*namep, "__GLOB_DATA_PTR") == 0) + { + /* Define __GLOB_DATA_PTR when it is encountered. This is expected to + be a linker-defined symbol by the Aix C runtime startup code. IBM sez + no one else should use it b/c it is undocumented. */ + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (elf_hash_table (info), *namep, + false, false, false); + if (h == NULL) + { + struct elf_backend_data *bed; + struct elfNN_ia64_link_hash_table *ia64_info; + + bed = get_elf_backend_data (abfd); + ia64_info = elfNN_ia64_hash_table (info); + + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, *namep, BSF_GLOBAL, + bfd_get_section_by_name (abfd, ".bss"), + 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; + + if (! _bfd_elf_link_record_dynamic_symbol (info, h)) + return false; + } + + return true; + } + else if (sym->st_shndx == SHN_LOOS) + { + unsigned int i; + + /* SHN_AIX_SYSCALL: Treat this as any other symbol. The special symbol + is only relevant when compiling code for extended system calls. + Replace the "special" section with .text, if possible. + Note that these symbols are always assumed to be in .text. */ + for (i = 1; i < elf_numsections (abfd); i++) + { + asection * sec = bfd_section_from_elf_index (abfd, i); + + if (sec && strcmp (sec->name, ".text") == 0) + { + *secp = sec; + break; + } + } + + if (*secp == NULL) + *secp = bfd_abs_section_ptr; + + *valp = sym->st_size; + + return true; + } + else + { + return elfNN_ia64_add_symbol_hook (abfd, info, sym, + namep, flagsp, secp, valp); + } +} + +boolean +elfNN_ia64_aix_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + /* Make sure dynamic sections are always created. */ + if (! elf_hash_table (info)->dynamic_sections_created + && abfd->xvec == info->hash->creator) + { + if (! bfd_elfNN_link_create_dynamic_sections (abfd, info)) + return false; + } + + /* Now do the standard call. */ + return bfd_elfNN_bfd_link_add_symbols (abfd, info); +} + /* Return the number of additional phdrs we will need. */ static int @@ -1141,7 +1354,7 @@ elfNN_ia64_additional_program_headers (abfd) /* Count how many PT_IA_64_UNWIND segments we need. */ for (s = abfd->sections; s; s = s->next) - if (is_unwind_section_name(s->name) && (s->flags & SEC_LOAD)) + if (is_unwind_section_name (abfd, s->name) && (s->flags & SEC_LOAD)) ++ret; return ret; @@ -1154,6 +1367,8 @@ elfNN_ia64_modify_segment_map (abfd) struct elf_segment_map *m, **pm; Elf_Internal_Shdr *hdr; asection *s; + boolean unwind_found; + asection *unwind_sec; /* If we need a PT_IA_64_ARCHEXT segment, it must come before all PT_LOAD segments. */ @@ -1165,7 +1380,8 @@ elfNN_ia64_modify_segment_map (abfd) break; if (m == NULL) { - m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + m = ((struct elf_segment_map *) + bfd_zalloc (abfd, (bfd_size_type) sizeof *m)); if (m == NULL) return false; @@ -1195,12 +1411,29 @@ elfNN_ia64_modify_segment_map (abfd) if (s && (s->flags & SEC_LOAD)) { for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - if (m->p_type == PT_IA_64_UNWIND && m->sections[0] == s) - break; + if (m->p_type == PT_IA_64_UNWIND) + { + /* Look through all sections in the unwind segment + for a match since there may be multiple sections + to a segment. */ + + unwind_sec = m->sections[0]; + unwind_found = false; + while (unwind_sec != NULL && !unwind_found) + { + if (unwind_sec == s) + unwind_found = true; + else + unwind_sec = unwind_sec -> next; + } + if (unwind_found) + break; + } if (m == NULL) { - m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + m = ((struct elf_segment_map *) + bfd_zalloc (abfd, (bfd_size_type) sizeof *m)); if (m == NULL) return false; @@ -1287,7 +1520,7 @@ elfNN_ia64_dynamic_symbol_p (h, info) || h->root.type == bfd_link_hash_defweak) return true; - if ((info->shared && !info->symbolic) + if ((info->shared && (!info->symbolic || info->allow_shlib_undefined)) || ((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) @@ -1369,8 +1602,8 @@ elfNN_ia64_hash_copy_indirect (xdir, xind) { struct elfNN_ia64_link_hash_entry *dir, *ind; - dir = (struct elfNN_ia64_link_hash_entry *)xdir; - ind = (struct elfNN_ia64_link_hash_entry *)xind; + dir = (struct elfNN_ia64_link_hash_entry *) xdir; + ind = (struct elfNN_ia64_link_hash_entry *) xind; /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -1381,6 +1614,9 @@ elfNN_ia64_hash_copy_indirect (xdir, xind) | ELF_LINK_HASH_REF_REGULAR | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + if (ind->root.root.type != bfd_link_hash_indirect) + return; + /* Copy over the got and plt data. This would have been done by check_relocs. */ @@ -1410,18 +1646,17 @@ elfNN_ia64_hash_copy_indirect (xdir, xind) } static void -elfNN_ia64_hash_hide_symbol (info, xh) - struct bfd_link_info *info ATTRIBUTE_UNUSED; +elfNN_ia64_hash_hide_symbol (info, xh, force_local) + struct bfd_link_info *info; struct elf_link_hash_entry *xh; + boolean force_local; { struct elfNN_ia64_link_hash_entry *h; struct elfNN_ia64_dyn_sym_info *dyn_i; h = (struct elfNN_ia64_link_hash_entry *)xh; - h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - h->root.dynindx = -1; + _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) dyn_i->want_plt2 = 0; @@ -1437,7 +1672,7 @@ elfNN_ia64_hash_table_create (abfd) { struct elfNN_ia64_link_hash_table *ret; - ret = bfd_zalloc (abfd, sizeof (*ret)); + ret = bfd_zalloc (abfd, (bfd_size_type) sizeof (*ret)); if (!ret) return 0; if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, @@ -1573,6 +1808,37 @@ elfNN_ia64_create_dynamic_sections (abfd, info) return true; } +/* Find and/or create a hash entry for local symbol. */ +static struct elfNN_ia64_local_hash_entry * +get_local_sym_hash (ia64_info, abfd, rel, create) + struct elfNN_ia64_link_hash_table *ia64_info; + bfd *abfd; + const Elf_Internal_Rela *rel; + boolean create; +{ + char *addr_name; + size_t len; + struct elfNN_ia64_local_hash_entry *ret; + + /* Construct a string for use in the elfNN_ia64_local_hash_table. + name describes what was once anonymous memory. */ + + len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1; + len += 10; /* %p slop */ + + addr_name = bfd_malloc (len); + if (addr_name == NULL) + return 0; + sprintf (addr_name, "%p:%lx", + (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info)); + + /* Collect the canonical entry data for this address. */ + ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table, + addr_name, create, create); + free (addr_name); + return ret; +} + /* Find and/or create a descriptor for dynamic symbol info. This will vary based on global or local symbol, and the addend to the reloc. */ @@ -1593,21 +1859,8 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) else { struct elfNN_ia64_local_hash_entry *loc_h; - char *addr_name; - size_t len; - - /* Construct a string for use in the elfNN_ia64_local_hash_table. - The name describes what was once anonymous memory. */ - len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1; - len += 10; /* %p slop */ - - addr_name = alloca (len); - sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info)); - - /* Collect the canonical entry data for this address. */ - loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table, - addr_name, create, create); + loc_h = get_local_sym_hash (ia64_info, abfd, rel, create); BFD_ASSERT (loc_h); pp = &loc_h->info; @@ -1618,8 +1871,8 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) if (dyn_i == NULL && create) { - dyn_i = (struct elfNN_ia64_dyn_sym_info *) - bfd_zalloc (abfd, sizeof *dyn_i); + dyn_i = ((struct elfNN_ia64_dyn_sym_info *) + bfd_zalloc (abfd, (bfd_size_type) sizeof *dyn_i)); *pp = dyn_i; dyn_i->addend = addend; } @@ -1781,6 +2034,9 @@ get_reloc_section (abfd, ia64_info, sec, create) return NULL; } + if (sec->flags & SEC_READONLY) + ia64_info->reltext = 1; + return srel; } @@ -1799,8 +2055,8 @@ count_dyn_reloc (abfd, dyn_i, srel, type) if (!rent) { - rent = (struct elfNN_ia64_dyn_reloc_entry *) - bfd_alloc (abfd, sizeof (*rent)); + rent = ((struct elfNN_ia64_dyn_reloc_entry *) + bfd_alloc (abfd, (bfd_size_type) sizeof (*rent))); if (!rent) return false; @@ -1874,9 +2130,11 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) have yet been processed. Do something with what we know, as this may help reduce memory usage and processing time later. */ maybe_dynamic = false; - if (h && ((info->shared && ! info->symbolic) + if (h && ((info->shared + && (!info->symbolic || info->allow_shlib_undefined)) || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) - || h->root.type == bfd_link_hash_defweak)) + || h->root.type == bfd_link_hash_defweak + || elfNN_ia64_aix_vec (abfd->xvec))) maybe_dynamic = true; need_entry = 0; @@ -1890,6 +2148,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) case R_IA64_LTOFF_FPTR22: case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR32MSB: + case R_IA64_LTOFF_FPTR32LSB: case R_IA64_LTOFF_FPTR64MSB: case R_IA64_LTOFF_FPTR64LSB: need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR; @@ -1900,7 +2160,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) case R_IA64_FPTR32LSB: case R_IA64_FPTR64MSB: case R_IA64_FPTR64LSB: - if (info->shared || h) + if (info->shared || h || elfNN_ia64_aix_vec (abfd->xvec)) need_entry = NEED_FPTR | NEED_DYNREL; else need_entry = NEED_FPTR; @@ -1927,7 +2187,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { (*info->callbacks->warning) (info, _("@pltoff reloc against local symbol"), 0, - abfd, 0, 0); + abfd, 0, (bfd_vma) 0); } break; @@ -1949,7 +2209,10 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) case R_IA64_DIR64MSB: case R_IA64_DIR64LSB: /* Shared objects will always need at least a REL relocation. */ - if (info->shared || maybe_dynamic) + if (info->shared || maybe_dynamic + || (elfNN_ia64_aix_vec (abfd->xvec) + && (!h || strcmp (h->root.root.string, + "__GLOB_DATA_PTR") != 0))) need_entry = NEED_DYNREL; dynrel_type = R_IA64_DIR64LSB; break; @@ -1982,7 +2245,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { (*info->callbacks->warning) (info, _("non-zero addend in @fptr reloc"), 0, - abfd, 0, 0); + abfd, 0, (bfd_vma) 0); } dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true); @@ -2013,10 +2276,12 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) /* FPTRs for shared libraries are allocated by the dynamic linker. Make sure this local symbol will appear in the dynamic symbol table. */ - if (!h && info->shared) + if (!h && (info->shared + /* AIX also needs one */ + || elfNN_ia64_aix_vec (abfd->xvec))) { if (! (_bfd_elfNN_link_record_local_dynamic_symbol - (info, abfd, r_symndx))) + (info, abfd, (long) r_symndx))) return false; } @@ -2069,7 +2334,10 @@ allocate_global_data_got (dyn_i, data) if (dyn_i->want_got && ! dyn_i->want_fptr - && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + && (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) + || (elfNN_ia64_aix_vec (x->info->hash->creator) + && (!dyn_i->h || strcmp (dyn_i->h->root.root.string, + "__GLOB_DATA_PTR") != 0)))) { dyn_i->got_offset = x->ofs; x->ofs += 8; @@ -2088,7 +2356,8 @@ allocate_global_fptr_got (dyn_i, data) if (dyn_i->want_got && dyn_i->want_fptr - && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + && (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) + || elfNN_ia64_aix_vec (x->info->hash->creator))) { dyn_i->got_offset = x->ofs; x->ofs += 8; @@ -2106,7 +2375,8 @@ allocate_local_got (dyn_i, data) struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; if (dyn_i->want_got - && ! elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + && ! (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) + || elfNN_ia64_aix_vec (x->info->hash->creator))) { dyn_i->got_offset = x->ofs; x->ofs += 8; @@ -2116,7 +2386,7 @@ allocate_local_got (dyn_i, data) /* Search for the index of a global symbol in it's defining object file. */ -static unsigned long +static long global_sym_index (h) struct elf_link_hash_entry *h; { @@ -2152,7 +2422,12 @@ allocate_fptr (dyn_i, data) || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (x->info->shared) + if (x->info->shared + /* AIX needs an FPTR in this case. */ + || (elfNN_ia64_aix_vec (x->info->hash->creator) + && (!h + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak))) { if (h && h->dynindx == -1) { @@ -2275,7 +2550,11 @@ allocate_dynrel_entries (dyn_i, data) boolean dynamic_symbol, shared; ia64_info = elfNN_ia64_hash_table (x->info); - dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info); + dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) + || (elfNN_ia64_aix_vec (x->info->hash->creator) + /* Don't allocate an entry for __GLOB_DATA_PTR */ + && (!dyn_i->h || strcmp (dyn_i->h->root.root.string, + "__GLOB_DATA_PTR") != 0)); shared = x->info->shared; /* Take care of the normal data relocations. */ @@ -2378,7 +2657,6 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) struct elfNN_ia64_link_hash_table *ia64_info; asection *sec; bfd *dynobj; - boolean reltext = false; boolean relplt = false; dynobj = elf_hash_table(info)->dynobj; @@ -2392,8 +2670,8 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) { sec = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (sec != NULL); - sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; - sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; + sec->contents = (bfd_byte *) DYNAMIC_INTERPRETER (output_bfd); + sec->_raw_size = strlen (DYNAMIC_INTERPRETER (output_bfd)) + 1; } /* Allocate the GOT entries. */ @@ -2432,7 +2710,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) } /* Align the pointer for the plt2 entries. */ - data.ofs = (data.ofs + 31) & -32; + data.ofs = (data.ofs + 31) & (bfd_vma) -32; elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data); if (data.ofs != 0) @@ -2535,24 +2813,6 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) { if (!strip) { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - sec->output_section); - if (outname[4] == 'a') - outname += 5; - else - outname += 4; - - target = bfd_get_section_by_name (output_bfd, outname); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ sec->reloc_count = 0; @@ -2567,7 +2827,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) else { /* Allocate memory for the section contents. */ - sec->contents = (bfd_byte *) bfd_zalloc(dynobj, sec->_raw_size); + sec->contents = (bfd_byte *) bfd_zalloc (dynobj, sec->_raw_size); if (sec->contents == NULL && sec->_raw_size != 0) return false; } @@ -2583,32 +2843,34 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) { /* The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ - if (!bfd_elfNN_add_dynamic_entry (info, DT_DEBUG, 0)) +#define add_dynamic_entry(TAG, VAL) \ + bfd_elfNN_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + + if (!add_dynamic_entry (DT_DEBUG, 0)) return false; } - if (! bfd_elfNN_add_dynamic_entry (info, DT_IA_64_PLT_RESERVE, 0)) + if (!add_dynamic_entry (DT_IA_64_PLT_RESERVE, 0)) return false; - if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTGOT, 0)) + if (!add_dynamic_entry (DT_PLTGOT, 0)) return false; if (relplt) { - if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTRELSZ, 0) - || ! bfd_elfNN_add_dynamic_entry (info, DT_PLTREL, DT_RELA) - || ! bfd_elfNN_add_dynamic_entry (info, DT_JMPREL, 0)) + if (!add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) return false; } - if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0) - || ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0) - || ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT, - sizeof (ElfNN_External_Rela))) + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (ElfNN_External_Rela))) return false; - if (reltext) + if (ia64_info->reltext) { - if (! bfd_elfNN_add_dynamic_entry (info, DT_TEXTREL, 0)) + if (!add_dynamic_entry (DT_TEXTREL, 0)) return false; info->flags |= DF_TEXTREL; } @@ -2620,10 +2882,10 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) } static bfd_reloc_status_type -elfNN_ia64_install_value (abfd, hit_addr, val, r_type) +elfNN_ia64_install_value (abfd, hit_addr, v, r_type) bfd *abfd; bfd_byte *hit_addr; - bfd_vma val; + bfd_vma v; unsigned int r_type; { const struct ia64_operand *op; @@ -2632,6 +2894,11 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) enum ia64_opnd opnd; const char *err; size_t size = 8; +#ifdef BFD_HOST_U_64_BIT + BFD_HOST_U_64_BIT val = (BFD_HOST_U_64_BIT) v; +#else + bfd_vma val = v; +#endif opnd = IA64_OPND_NIL; switch (r_type) @@ -2678,6 +2945,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) case R_IA64_GPREL32MSB: case R_IA64_FPTR32MSB: case R_IA64_PCREL32MSB: + case R_IA64_LTOFF_FPTR32MSB: case R_IA64_SEGREL32MSB: case R_IA64_SECREL32MSB: case R_IA64_LTV32MSB: @@ -2688,6 +2956,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) case R_IA64_GPREL32LSB: case R_IA64_FPTR32LSB: case R_IA64_PCREL32LSB: + case R_IA64_LTOFF_FPTR32LSB: case R_IA64_SEGREL32LSB: case R_IA64_SECREL32LSB: case R_IA64_LTV32LSB: @@ -2791,7 +3060,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) insn = (dword >> shift) & 0x1ffffffffffLL; op = elf64_ia64_operands + opnd; - err = (*op->insert) (op, val, &insn); + err = (*op->insert) (op, val, (ia64_insn *)& insn); if (err) return bfd_reloc_overflow; @@ -2832,33 +3101,19 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, { Elf_Internal_Rela outrel; - outrel.r_offset = (sec->output_section->vma - + sec->output_offset - + offset); + offset += sec->output_section->vma + sec->output_offset; BFD_ASSERT (dynindx != -1); outrel.r_info = ELFNN_R_INFO (dynindx, type); outrel.r_addend = addend; - - if (elf_section_data (sec)->stab_info != NULL) + outrel.r_offset = _bfd_elf_section_offset (abfd, info, sec, offset); + if (outrel.r_offset == (bfd_vma) -1) { - /* This may be NULL for linker-generated relocations, as it is - inconvenient to pass all the bits around. And this shouldn't - happen. */ - BFD_ASSERT (info != NULL); - - offset = (_bfd_stab_section_offset - (abfd, &elf_hash_table (info)->stab_info, sec, - &elf_section_data (sec)->stab_info, offset)); - if (offset == (bfd_vma) -1) - { - /* Run for the hills. We shouldn't be outputting a relocation - for this. So do what everyone else does and output a no-op. */ - outrel.r_info = ELFNN_R_INFO (0, R_IA64_NONE); - outrel.r_addend = 0; - offset = 0; - } - outrel.r_offset = offset; + /* Run for the hills. We shouldn't be outputting a relocation + for this. So do what everyone else does and output a no-op. */ + outrel.r_info = ELFNN_R_INFO (0, R_IA64_NONE); + outrel.r_addend = 0; + outrel.r_offset = 0; } bfd_elfNN_swap_reloca_out (abfd, &outrel, @@ -2899,6 +3154,7 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) /* Install a dynamic relocation if needed. */ if (info->shared || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info) + || elfNN_ia64_aix_vec (abfd->xvec) || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) { if (dynindx == -1) @@ -3043,8 +3299,8 @@ static bfd *elfNN_ia64_unwind_entry_compare_bfd; static int elfNN_ia64_unwind_entry_compare (a, b) - PTR a; - PTR b; + const PTR a; + const PTR b; { bfd_vma av, bv; @@ -3205,11 +3461,13 @@ elfNN_ia64_final_link (abfd, info) if (unwind_output_sec) { elfNN_ia64_unwind_entry_compare_bfd = abfd; - qsort (unwind_output_sec->contents, unwind_output_sec->_raw_size / 24, - 24, elfNN_ia64_unwind_entry_compare); + qsort (unwind_output_sec->contents, + (size_t) (unwind_output_sec->_raw_size / 24), + 24, + elfNN_ia64_unwind_entry_compare); if (! bfd_set_section_contents (abfd, unwind_output_sec, - unwind_output_sec->contents, 0, + unwind_output_sec->contents, (bfd_vma) 0, unwind_output_sec->_raw_size)) return false; } @@ -3277,7 +3535,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: unknown relocation type %d"), - bfd_get_filename (input_bfd), (int)r_type); + bfd_archive_filename (input_bfd), (int)r_type); bfd_set_error (bfd_error_bad_value); ret_val = false; continue; @@ -3315,9 +3573,39 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, /* Reloc against local symbol. */ sym = local_syms + r_symndx; sym_sec = local_sections[r_symndx]; - value = (sym_sec->output_section->vma - + sym_sec->output_offset - + sym->st_value); + value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); + if ((sym_sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION + && (elf_section_data (sym_sec)->sec_info_type + == ELF_INFO_TYPE_MERGE)) + { + struct elfNN_ia64_local_hash_entry *loc_h; + + loc_h = get_local_sym_hash (ia64_info, input_bfd, rel, false); + if (loc_h && ! loc_h->sec_merge_done) + { + struct elfNN_ia64_dyn_sym_info *dynent; + asection *msec; + + for (dynent = loc_h->info; dynent; dynent = dynent->next) + { + msec = sym_sec; + dynent->addend = + _bfd_merged_section_offset (output_bfd, &msec, + elf_section_data (msec)-> + sec_info, + sym->st_value + + dynent->addend, + (bfd_vma) 0); + dynent->addend -= sym->st_value; + dynent->addend += msec->output_section->vma + + msec->output_offset + - sym_sec->output_section->vma + - sym_sec->output_offset; + } + loc_h->sec_merge_done = 1; + } + } } else { @@ -3353,7 +3641,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) undef_weak_ref = true; - else if (info->shared && !info->symbolic + else if (info->shared + && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -3388,7 +3677,12 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_DIR64MSB: case R_IA64_DIR64LSB: /* Install a dynamic relocation for this reloc. */ - if ((dynamic_symbol_p || info->shared) + if ((dynamic_symbol_p || info->shared + || (elfNN_ia64_aix_vec (info->hash->creator) + /* Don't emit relocs for __GLOB_DATA_PTR on AIX. */ + && (!h || strcmp (h->root.root.string, + "__GLOB_DATA_PTR") != 0))) + && r_symndx != 0 && (input_section->flags & SEC_ALLOC) != 0) { unsigned int dyn_r_type; @@ -3432,7 +3726,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, shared libraries. Hork. */ (*_bfd_error_handler) (_("%s: linking non-pic code in a shared library"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); ret_val = false; continue; } @@ -3440,6 +3734,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, addend = value; } + if (elfNN_ia64_aix_vec (info->hash->creator)) + rel->r_addend = value; elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, srel, rel->r_offset, dyn_r_type, dynindx, addend); @@ -3463,7 +3759,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: @gprel relocation against dynamic symbol %s"), - bfd_get_filename (input_bfd), h->root.root.string); + bfd_archive_filename (input_bfd), h->root.root.string); ret_val = false; continue; } @@ -3521,7 +3817,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, else { dynindx = (_bfd_elf_link_lookup_local_dynindx - (info, input_bfd, r_symndx)); + (info, input_bfd, (long) r_symndx)); } elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, @@ -3535,6 +3831,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_LTOFF_FPTR22: case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR32MSB: + case R_IA64_LTOFF_FPTR32LSB: case R_IA64_LTOFF_FPTR64MSB: case R_IA64_LTOFF_FPTR64LSB: { @@ -3563,7 +3861,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } else dynindx = (_bfd_elf_link_lookup_local_dynindx - (info, input_bfd, r_symndx)); + (info, input_bfd, (long) r_symndx)); value = 0; } @@ -3579,7 +3877,9 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_PCREL64MSB: case R_IA64_PCREL64LSB: /* Install a dynamic relocation for this reloc. */ - if (dynamic_symbol_p) + if ((dynamic_symbol_p + || elfNN_ia64_aix_vec (info->hash->creator)) + && r_symndx != 0) { BFD_ASSERT (srel != NULL); @@ -3598,7 +3898,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: dynamic relocation against speculation fixup"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); ret_val = false; continue; } @@ -3606,7 +3906,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { (*_bfd_error_handler) (_("%s: speculation fixup against undefined weak symbol"), - bfd_get_filename (input_bfd)); + bfd_archive_filename (input_bfd)); ret_val = false; continue; } @@ -3657,47 +3957,48 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_SEGREL32LSB: case R_IA64_SEGREL64MSB: case R_IA64_SEGREL64LSB: - { - struct elf_segment_map *m; - Elf_Internal_Phdr *p; - - /* Find the segment that contains the output_section. */ - for (m = elf_tdata (output_bfd)->segment_map, - p = elf_tdata (output_bfd)->phdr; - m != NULL; - m = m->next, p++) - { - int i; - for (i = m->count - 1; i >= 0; i--) - if (m->sections[i] == sym_sec->output_section) + if (r_symndx == 0) + { + /* If the input section was discarded from the output, then + do nothing. */ + r = bfd_reloc_ok; + } + else + { + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + /* Find the segment that contains the output_section. */ + for (m = elf_tdata (output_bfd)->segment_map, + p = elf_tdata (output_bfd)->phdr; + m != NULL; + m = m->next, p++) + { + int i; + for (i = m->count - 1; i >= 0; i--) + if (m->sections[i] == sym_sec->output_section) + break; + if (i >= 0) break; - if (i >= 0) - break; - } - - if (m == NULL) - { - /* If the input section was discarded from the output, then - do nothing. */ + } - if (bfd_is_abs_section (sym_sec->output_section)) - r = bfd_reloc_ok; - else + if (m == NULL) + { r = bfd_reloc_notsupported; - } - else - { - /* The VMA of the segment is the vaddr of the associated - program header. */ - if (value > p->p_vaddr) - value -= p->p_vaddr; - else - value = 0; - r = elfNN_ia64_install_value (output_bfd, hit_addr, value, - r_type); - } - break; - } + } + else + { + /* The VMA of the segment is the vaddr of the associated + program header. */ + if (value > p->p_vaddr) + value -= p->p_vaddr; + else + value = 0; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, + r_type); + } + break; + } case R_IA64_SECREL32MSB: case R_IA64_SECREL32LSB: @@ -3816,7 +4117,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, name = bfd_section_name (input_bfd, input_section); } if (!(*info->callbacks->reloc_overflow) (info, name, - howto->name, 0, + howto->name, + (bfd_vma) 0, input_bfd, input_section, rel->r_offset)) @@ -4023,24 +4325,6 @@ elfNN_ia64_set_private_flags (abfd, flags) return true; } -/* Copy backend specific data from one object module to another */ -static boolean -elfNN_ia64_copy_private_bfd_data (ibfd, obfd) - bfd *ibfd, *obfd; -{ - if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour - || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; - - BFD_ASSERT (!elf_flags_init (obfd) - || (elf_elfheader (obfd)->e_flags - == elf_elfheader (ibfd)->e_flags)); - - elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; - elf_flags_init (obfd) = true; - return true; -} - /* Merge backend specific data from an object file to the output object file when linking. */ static boolean @@ -4086,7 +4370,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking trap-on-NULL-dereference with non-trapping files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); ok = false; @@ -4095,7 +4379,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking big-endian files with little-endian files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); ok = false; @@ -4104,7 +4388,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking 64-bit files with 32-bit files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); ok = false; @@ -4113,7 +4397,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking constant-gp files with non-constant-gp files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); ok = false; @@ -4123,7 +4407,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) { (*_bfd_error_handler) (_("%s: linking auto-pic files with non-auto-pic files"), - bfd_get_filename (ibfd)); + bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); ok = false; @@ -4155,6 +4439,59 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) _bfd_elf_print_private_bfd_data (abfd, ptr); return true; } + +static enum elf_reloc_type_class +elfNN_ia64_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + switch ((int) ELFNN_R_TYPE (rela->r_info)) + { + case R_IA64_REL32MSB: + case R_IA64_REL32LSB: + case R_IA64_REL64MSB: + case R_IA64_REL64LSB: + return reloc_class_relative; + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + return reloc_class_plt; + case R_IA64_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + +static boolean +elfNN_ia64_hpux_vec (const bfd_target *vec) +{ + extern const bfd_target bfd_elfNN_ia64_hpux_big_vec; + return (vec == & bfd_elfNN_ia64_hpux_big_vec); +} + +static void +elfNN_hpux_post_process_headers (abfd, info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; +{ + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + i_ehdrp->e_ident[EI_ABIVERSION] = 1; +} + +boolean +elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + int *retval; +{ + if (bfd_is_com_section (sec)) + { + *retval = SHN_IA_64_ANSI_COMMON; + return true; + } + return false; +} #define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec #define TARGET_LITTLE_NAME "elfNN-ia64-little" @@ -4210,8 +4547,6 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) #define bfd_elfNN_bfd_final_link \ elfNN_ia64_final_link -#define bfd_elfNN_bfd_copy_private_bfd_data \ - elfNN_ia64_copy_private_bfd_data #define bfd_elfNN_bfd_merge_private_bfd_data \ elfNN_ia64_merge_private_bfd_data #define bfd_elfNN_bfd_set_private_flags \ @@ -4231,5 +4566,60 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) #define elf_backend_want_dynbss 0 #define elf_backend_copy_indirect_symbol elfNN_ia64_hash_copy_indirect #define elf_backend_hide_symbol elfNN_ia64_hash_hide_symbol +#define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class + +#include "elfNN-target.h" + +/* AIX-specific vectors. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elfNN_ia64_aix_little_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elfNN-ia64-aix-little" +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elfNN_ia64_aix_big_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elfNN-ia64-aix-big" + +#undef elf_backend_add_symbol_hook +#define elf_backend_add_symbol_hook elfNN_ia64_aix_add_symbol_hook + +#undef bfd_elfNN_bfd_link_add_symbols +#define bfd_elfNN_bfd_link_add_symbols elfNN_ia64_aix_link_add_symbols + +#define elfNN_bed elfNN_ia64_aix_bed + +#include "elfNN-target.h" + +/* HPUX-specific vectors. */ + +#undef TARGET_LITTLE_SYM +#undef TARGET_LITTLE_NAME +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elfNN_ia64_hpux_big_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elfNN-ia64-hpux-big" + +/* We need to undo the AIX specific functions. */ + +#undef elf_backend_add_symbol_hook +#define elf_backend_add_symbol_hook elfNN_ia64_add_symbol_hook + +#undef bfd_elfNN_bfd_link_add_symbols +#define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols + +/* These are HP-UX specific functions. */ + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers elfNN_hpux_post_process_headers + +#undef elf_backend_section_from_bfd_section +#define elf_backend_section_from_bfd_section elfNN_hpux_backend_section_from_bfd_section + +#undef ELF_MAXPAGESIZE +#define ELF_MAXPAGESIZE 0x1000 /* 1K */ + +#undef elfNN_bed +#define elfNN_bed elfNN_ia64_hpux_bed #include "elfNN-target.h" diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h index 3ec9820..fda0f0d 100644 --- a/contrib/binutils/bfd/elfxx-target.h +++ b/contrib/binutils/bfd/elfxx-target.h @@ -66,6 +66,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_got_symbol_offset #define elf_backend_got_symbol_offset (bfd_vma) 0 #endif +#ifndef elf_backend_can_refcount +#define elf_backend_can_refcount 0 +#endif #ifndef elf_backend_want_got_plt #define elf_backend_want_got_plt 0 #endif @@ -87,7 +90,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void -#define bfd_elfNN_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void +#define bfd_elfNN_bfd_debug_info_accumulate \ + (void (*) PARAMS ((bfd*, struct sec *))) bfd_void #ifndef bfd_elfNN_bfd_get_relocated_section_contents #define bfd_elfNN_bfd_get_relocated_section_contents \ @@ -101,6 +105,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_can_gc_sections #define elf_backend_can_gc_sections 0 #endif +#ifndef elf_backend_can_refcount +#define elf_backend_can_refcount 0 +#endif +#ifndef elf_backend_want_got_sym +#define elf_backend_want_got_sym 1 +#endif #ifndef elf_backend_gc_mark_hook #define elf_backend_gc_mark_hook NULL #endif @@ -111,6 +121,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections #endif +#ifndef bfd_elfNN_bfd_merge_sections +#define bfd_elfNN_bfd_merge_sections \ + _bfd_elf_merge_sections +#endif + #ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) @@ -127,7 +142,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #ifndef bfd_elfNN_bfd_copy_private_bfd_data #define bfd_elfNN_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + _bfd_elf_copy_private_bfd_data #endif #ifndef bfd_elfNN_bfd_print_private_bfd_data #define bfd_elfNN_bfd_print_private_bfd_data \ @@ -159,7 +174,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create #endif #else /* ! defined (elf_backend_relocate_section) */ -/* If no backend relocate_section routine, use the generic linker. */ +/* If no backend relocate_section routine, use the generic linker. + Note - this will prevent the port from being able to use some of + the other features of the ELF linker, because the generic hash structure + does not have the fields needed by the ELF linker. In particular it + means that linking directly to S-records will not work. */ #ifndef bfd_elfNN_bfd_link_hash_table_create #define bfd_elfNN_bfd_link_hash_table_create \ _bfd_generic_link_hash_table_create @@ -318,6 +337,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_hide_symbol #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol #endif +#ifndef elf_backend_emit_relocs +#define elf_backend_emit_relocs NULL +#endif +#ifndef elf_backend_count_relocs +#define elf_backend_count_relocs NULL +#endif +#ifndef elf_backend_grok_prstatus +#define elf_backend_grok_prstatus NULL +#endif +#ifndef elf_backend_grok_psinfo +#define elf_backend_grok_psinfo NULL +#endif +#ifndef elf_backend_sprintf_vma +#define elf_backend_sprintf_vma _bfd_elf_sprintf_vma +#endif +#ifndef elf_backend_fprintf_vma +#define elf_backend_fprintf_vma _bfd_elf_fprintf_vma +#endif +#ifndef elf_backend_reloc_type_class +#define elf_backend_reloc_type_class _bfd_elf_reloc_type_class +#endif +#ifndef elf_backend_discard_info +#define elf_backend_discard_info NULL +#endif +#ifndef elf_backend_ignore_discarded_relocs +#define elf_backend_ignore_discarded_relocs NULL +#endif +#ifndef elf_backend_write_section +#define elf_backend_write_section NULL +#endif /* Previously, backends could only use SHT_REL or SHT_RELA relocation sections, but not both. They defined USE_REL to indicate SHT_REL @@ -360,7 +409,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern const struct elf_size_info _bfd_elfNN_size_info; #ifndef INCLUDED_TARGET_FILE -static CONST struct elf_backend_data elfNN_bed = +static const struct elf_backend_data elfNN_bed = { ELF_ARCH, /* arch */ ELF_MACHINE_CODE, /* elf_machine_code */ @@ -399,6 +448,16 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_output_arch_syms, elf_backend_copy_indirect_symbol, elf_backend_hide_symbol, + elf_backend_emit_relocs, + elf_backend_count_relocs, + elf_backend_grok_prstatus, + elf_backend_grok_psinfo, + elf_backend_sprintf_vma, + elf_backend_fprintf_vma, + elf_backend_reloc_type_class, + elf_backend_discard_info, + elf_backend_ignore_discarded_relocs, + elf_backend_write_section, elf_backend_ecoff_debug_swap, ELF_MACHINE_ALT1, ELF_MACHINE_ALT2, @@ -418,6 +477,8 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_plt_not_loaded, elf_backend_plt_alignment, elf_backend_can_gc_sections, + elf_backend_can_refcount, + elf_backend_want_got_sym, elf_backend_want_dynbss }; #endif @@ -443,12 +504,13 @@ const bfd_target TARGET_BIG_SYM = BFD_ENDIAN_BIG, /* object_flags: mask of all file flags */ - (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | - DYNAMIC | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS + | DYNAMIC | WP_TEXT | D_PAGED), /* section_flags: mask of all section flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | - SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY + | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES + | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), /* leading_symbol_char: is the first char of a user symbol predictable, and if so what is it */ @@ -538,12 +600,13 @@ const bfd_target TARGET_LITTLE_SYM = BFD_ENDIAN_LITTLE, /* object_flags: mask of all file flags */ - (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | - DYNAMIC | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS + | DYNAMIC | WP_TEXT | D_PAGED), /* section_flags: mask of all section flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | - SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY + | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES + | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), /* leading_symbol_char: is the first char of a user symbol predictable, and if so what is it */ diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c index 6afcb60..f60f0ca 100644 --- a/contrib/binutils/bfd/format.c +++ b/contrib/binutils/bfd/format.c @@ -119,38 +119,40 @@ bfd_check_format_matches (abfd, format, matching) char ***matching; { extern const bfd_target binary_vec; - const bfd_target * const *target, *save_targ, *right_targ; + const bfd_target * const *target, *save_targ, *right_targ, *ar_right_targ; char **matching_vector = NULL; int match_count; + int ar_match_index; - if (!bfd_read_p (abfd) || - ((int)(abfd->format) < (int)bfd_unknown) || - ((int)(abfd->format) >= (int)bfd_type_end)) + if (!bfd_read_p (abfd) + || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); return false; } if (abfd->format != bfd_unknown) - return (abfd->format == format)? true: false; + return abfd->format == format; /* Since the target type was defaulted, check them all in the hope that one will be uniquely recognized. */ save_targ = abfd->xvec; match_count = 0; + ar_match_index = _bfd_target_vector_entries; if (matching) { - matching_vector = - (char **) bfd_malloc (sizeof (char *) * - (_bfd_target_vector_entries + 1)); + bfd_size_type amt; + + *matching = NULL; + amt = sizeof (char *) * 2 * _bfd_target_vector_entries; + matching_vector = (char **) bfd_malloc (amt); if (!matching_vector) return false; - matching_vector[0] = NULL; - *matching = matching_vector; } right_targ = 0; + ar_right_targ = 0; /* Presume the answer is yes. */ abfd->format = format; @@ -158,7 +160,7 @@ bfd_check_format_matches (abfd, format, matching) /* If the target type was explicitly specified, just check that target. */ if (!abfd->target_defaulted) { - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) /* rewind! */ + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) /* rewind! */ return false; right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); @@ -202,13 +204,14 @@ bfd_check_format_matches (abfd, format, matching) for (target = bfd_target_vector; *target != NULL; target++) { const bfd_target *temp; + bfd_error_type err; if (*target == &binary_vec) continue; abfd->xvec = *target; /* Change BFD's target temporarily */ - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false; /* If _bfd_check_format neglects to set bfd_error, assume @@ -223,27 +226,20 @@ bfd_check_format_matches (abfd, format, matching) { /* This format checks out as ok! */ right_targ = temp; - if (matching) - { - matching_vector[match_count] = temp->name; - matching_vector[match_count + 1] = NULL; - } - - match_count++; - /* If this is the default target, accept it, even if other targets might match. People who want those other targets have to set the GNUTARGET variable. */ if (temp == bfd_default_vector[0]) { - if (matching) - { - matching_vector[0] = temp->name; - matching_vector[1] = NULL; - } match_count = 1; break; } + + if (matching) + matching_vector[match_count] = temp->name; + + match_count++; + #ifdef GNU960 /* Big- and little-endian b.out archives look the same, but it doesn't matter: there is no difference in their headers, and @@ -254,19 +250,50 @@ bfd_check_format_matches (abfd, format, matching) break; #endif } - else if (bfd_get_error () != bfd_error_wrong_format) + else if ((err = bfd_get_error ()) == bfd_error_wrong_object_format + || err == bfd_error_file_ambiguously_recognized) + { + /* An archive with objects of the wrong type, or an + ambiguous match. We want this target to match if we get + no better matches. */ + if (ar_right_targ != bfd_default_vector[0]) + ar_right_targ = *target; + if (matching) + matching_vector[ar_match_index] = (*target)->name; + ar_match_index++; + } + else if (err != bfd_error_wrong_format) { abfd->xvec = save_targ; abfd->format = bfd_unknown; - if (matching && bfd_get_error () - != bfd_error_file_ambiguously_recognized) + if (matching) free (matching_vector); return false; } } + if (match_count == 0) + { + /* Try partial matches. */ + right_targ = ar_right_targ; + if (right_targ == bfd_default_vector[0]) + { + match_count = 1; + } + else + { + match_count = ar_match_index - _bfd_target_vector_entries; + if (matching && match_count > 1) + { + memcpy (matching_vector, + matching_vector + _bfd_target_vector_entries, + sizeof (char *) * match_count); + } + } + } + if (match_count == 1) { abfd->xvec = right_targ; /* Change BFD's target permanently. */ @@ -288,7 +315,15 @@ bfd_check_format_matches (abfd, format, matching) free (matching_vector); } else - bfd_set_error (bfd_error_file_ambiguously_recognized); + { + bfd_set_error (bfd_error_file_ambiguously_recognized); + + if (matching) + { + *matching = matching_vector; + matching_vector[match_count] = NULL; + } + } return false; } @@ -312,9 +347,8 @@ bfd_set_format (abfd, format) bfd *abfd; bfd_format format; { - if (bfd_read_p (abfd) || - ((int)abfd->format < (int)bfd_unknown) || - ((int)abfd->format >= (int)bfd_type_end)) + if (bfd_read_p (abfd) + || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); return false; @@ -340,7 +374,7 @@ FUNCTION bfd_format_string SYNOPSIS - CONST char *bfd_format_string(bfd_format format); + const char *bfd_format_string(bfd_format format); DESCRIPTION Return a pointer to a const string @@ -348,7 +382,7 @@ DESCRIPTION depending upon the value of @var{format}. */ -CONST char * +const char * bfd_format_string (format) bfd_format format; { diff --git a/contrib/binutils/bfd/gen-aout.c b/contrib/binutils/bfd/gen-aout.c index 088fc09..1bba14a 100644 --- a/contrib/binutils/bfd/gen-aout.c +++ b/contrib/binutils/bfd/gen-aout.c @@ -1,5 +1,5 @@ /* Generate parameters for an a.out system. - Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -87,9 +87,12 @@ main (argc, argv) fprintf (stderr, _(" fix DEFAULT_ARCH in the output file yourself\n")); arch = "unknown"; } - printf("#define DEFAULT_ARCH bfd_arch_%s\n", arch); + printf("#define DEFAULT_ARCH bfd_arch_%s\n\n", arch); - printf("\n#define MY(OP) CAT(%s_,OP)\n", target); + printf("/* Do not \"beautify\" the CONCAT* macro args. Traditional C will not"); + printf(" remove whitespace added here, and thus will fail to concatenate"); + printf(" the tokens. */"); + printf("\n#define MY(OP) CONCAT2 (%s_,OP)\n\n", target); printf("#define TARGETNAME \"a.out-%s\"\n\n", target); printf("#include \"bfd.h\"\n"); diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c index 11d54fd..9766eaf 100644 --- a/contrib/binutils/bfd/hash.c +++ b/contrib/binutils/bfd/hash.c @@ -582,9 +582,9 @@ struct bfd_strtab_hash * _bfd_stringtab_init () { struct bfd_strtab_hash *table; + bfd_size_type amt = sizeof (struct bfd_strtab_hash); - table = ((struct bfd_strtab_hash *) - bfd_malloc (sizeof (struct bfd_strtab_hash))); + table = (struct bfd_strtab_hash *) bfd_malloc (amt); if (table == NULL) return NULL; @@ -711,8 +711,8 @@ _bfd_stringtab_emit (abfd, tab) for (entry = tab->first; entry != NULL; entry = entry->next) { - register const char *str; - register size_t len; + const char *str; + size_t len; str = entry->root.string; len = strlen (str) + 1; @@ -722,12 +722,12 @@ _bfd_stringtab_emit (abfd, tab) bfd_byte buf[2]; /* The output length includes the null byte. */ - bfd_put_16 (abfd, len, buf); - if (bfd_write ((PTR) buf, 1, 2, abfd) != 2) + bfd_put_16 (abfd, (bfd_vma) len, buf); + if (bfd_bwrite ((PTR) buf, (bfd_size_type) 2, abfd) != 2) return false; } - if (bfd_write ((PTR) str, 1, len, abfd) != len) + if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) return false; } diff --git a/contrib/binutils/bfd/host-aout.c b/contrib/binutils/bfd/host-aout.c index a53cf09..5cbb5df 100644 --- a/contrib/binutils/bfd/host-aout.c +++ b/contrib/binutils/bfd/host-aout.c @@ -1,5 +1,6 @@ /* BFD backend for local host's a.out binaries - Copyright 1990, 1991, 1992, 1994, 1995 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. Probably John Gilmore's fault. This file is part of BFD, the Binary File Descriptor library. @@ -77,7 +78,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #endif /* HOST_MACHINE_ARCH */ -#define MY(OP) CAT(host_aout_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (host_aout_,OP) #define TARGETNAME "a.out" #include "aout-target.h" diff --git a/contrib/binutils/bfd/i386aout.c b/contrib/binutils/bfd/i386aout.c index 1192dd4..c68dbec 100644 --- a/contrib/binutils/bfd/i386aout.c +++ b/contrib/binutils/bfd/i386aout.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1992, 1994, 1996, 1997 + Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* The only 386 aout system we have here is GO32 from DJ. +/* The only 386 aout system we have here is GO32 from DJ. These numbers make BFD work with that. If your aout 386 system doesn't work with these, we'll have to split them into different files. Send me (sac@cygnus.com) the runes to make it work on your @@ -41,7 +41,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SEGMENT_SIZE 0x400000 #define DEFAULT_ARCH bfd_arch_i386 -#define MY(OP) CAT(i386aout_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (i386aout_,OP) #define TARGETNAME "a.out-i386" #define NO_WRITE_HEADER_KLUDGE 1 @@ -51,6 +54,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "aout/aout64.h" #include "libaout.h" +static boolean i386aout_write_object_contents PARAMS ((bfd *)); +static boolean MY (set_sizes) PARAMS ((bfd *)); + /* Set the machine type correctly. */ static boolean @@ -71,9 +77,8 @@ i386aout_write_object_contents (abfd) #define MY_write_object_contents i386aout_write_object_contents -static boolean MY(set_sizes)(); #define MY_backend_data &MY(backend_data) -static CONST struct aout_backend_data MY(backend_data) = { +static const struct aout_backend_data MY(backend_data) = { 0, /* zmagic contiguous */ 1, /* text incl header */ 0, /* entry is text address */ diff --git a/contrib/binutils/bfd/i386bsd.c b/contrib/binutils/bfd/i386bsd.c index 98c48cd..e21a9ca 100644 --- a/contrib/binutils/bfd/i386bsd.c +++ b/contrib/binutils/bfd/i386bsd.c @@ -1,5 +1,6 @@ /* BFD back-end for i386 a.out binaries under BSD. - Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -35,7 +36,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DEFAULT_ARCH bfd_arch_i386 #define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN) -#define MY(OP) CAT(i386bsd_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (i386bsd_,OP) #define TARGETNAME "a.out-i386-bsd" #include "bfd.h" diff --git a/contrib/binutils/bfd/i386freebsd.c b/contrib/binutils/bfd/i386freebsd.c index f9684e4..73fa0ca 100644 --- a/contrib/binutils/bfd/i386freebsd.c +++ b/contrib/binutils/bfd/i386freebsd.c @@ -1,5 +1,5 @@ /* BFD back-end for FreeBSD/386 a.out-ish binaries. - Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1996, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,7 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DEFAULT_ARCH bfd_arch_i386 #define MACHTYPE_OK(mtype) ((mtype) == M_386_NETBSD || (mtype) == M_UNKNOWN) -#define MY(OP) CAT(i386freebsd_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (i386freebsd_,OP) + /* This needs to start with a.out so GDB knows it is an a.out variant. */ #define TARGETNAME "a.out-i386-freebsd" diff --git a/contrib/binutils/bfd/i386linux.c b/contrib/binutils/bfd/i386linux.c index 5fee098..bb93650 100644 --- a/contrib/binutils/bfd/i386linux.c +++ b/contrib/binutils/bfd/i386linux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored i386 a.out binaries. - Copyright 1992, 1993, 1994, 1995, 1996, 1997 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -36,7 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" /* BFD a.out internal data structures */ #define DEFAULT_ARCH bfd_arch_i386 -#define MY(OP) CAT(i386linux_,OP) + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (i386linux_,OP) #define TARGETNAME "a.out-i386-linux" extern const bfd_target MY(vec); @@ -223,9 +227,9 @@ linux_link_hash_table_create (abfd) bfd *abfd; { struct linux_link_hash_table *ret; + bfd_size_type amt = sizeof (struct linux_link_hash_table); - ret = ((struct linux_link_hash_table *) - bfd_alloc (abfd, sizeof (struct linux_link_hash_table))); + ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct linux_link_hash_table *) NULL) return (struct bfd_link_hash_table *) NULL; if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, @@ -405,7 +409,8 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, if (! (_bfd_generic_link_add_one_symbol (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS, - BSF_GLOBAL | BSF_CONSTRUCTOR, s, 0, NULL, false, false, NULL))) + BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL, + false, false, NULL))) return false; } @@ -444,7 +449,7 @@ linux_tally_symbols (h, data) name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1; p = strrchr (name, '_'); if (p != NULL) - alloc = (char *) bfd_malloc (strlen (name) + 1); + alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"), @@ -476,7 +481,7 @@ linux_tally_symbols (h, data) + sizeof PLT_REF_PREFIX - 1), false, false, true); /* h2 does not follow indirect symbols. */ - h2 = linux_link_hash_lookup (linux_hash_table (info), + h2 = linux_link_hash_lookup (linux_hash_table (info), (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), false, false, false); @@ -587,7 +592,8 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info) ".linux-dynamic"); if (s != NULL) { - s->_raw_size = 8 + linux_hash_table (info)->fixup_count * 8; + s->_raw_size = linux_hash_table (info)->fixup_count + 1; + s->_raw_size *= 8; s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; @@ -624,13 +630,14 @@ linux_finish_dynamic_link (output_bfd, info) fixups_written = 0; #ifdef LINUX_LINK_DEBUG - printf ("Fixup table file offset: %x VMA: %x\n", + printf ("Fixup table file offset: %x VMA: %x\n", os->filepos + s->output_offset, os->vma + s->output_offset); #endif fixup_table = s->contents; - bfd_put_32 (output_bfd, linux_hash_table (info)->fixup_count, fixup_table); + bfd_put_32 (output_bfd, + (bfd_vma) linux_hash_table (info)->fixup_count, fixup_table); fixup_table += 4; /* Fill in fixup table. */ @@ -660,15 +667,15 @@ linux_finish_dynamic_link (output_bfd, info) if (f->jump) { /* Relative address */ - new_addr = new_addr - (f->value + 5); - bfd_put_32 (output_bfd, new_addr, fixup_table); + new_addr = new_addr - (f->value + 5); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value + 1, fixup_table); fixup_table += 4; } else { - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value, fixup_table); fixup_table += 4; @@ -679,9 +686,9 @@ linux_finish_dynamic_link (output_bfd, info) if (linux_hash_table (info)->local_builtins != 0) { /* Special marker so we know to switch to the other type of fixup */ - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; ++fixups_written; for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next) @@ -707,7 +714,7 @@ linux_finish_dynamic_link (output_bfd, info) new_addr, f->value); #endif - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value, fixup_table); fixup_table += 4; @@ -720,15 +727,15 @@ linux_finish_dynamic_link (output_bfd, info) (*_bfd_error_handler) (_("Warning: fixup count mismatch\n")); while (linux_hash_table (info)->fixup_count > fixups_written) { - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; ++fixups_written; } } - h = linux_link_hash_lookup (linux_hash_table (info), + h = linux_link_hash_lookup (linux_hash_table (info), "__BUILTIN_FIXUPS__", false, false, false); @@ -744,16 +751,16 @@ linux_finish_dynamic_link (output_bfd, info) printf ("Builtin fixup table at %x\n", new_addr); #endif - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); } else - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); - if (bfd_seek (output_bfd, os->filepos + s->output_offset, SEEK_SET) != 0) + if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset), + SEEK_SET) != 0) return false; - if (bfd_write ((PTR) s->contents, 1, s->_raw_size, output_bfd) - != s->_raw_size) + if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size) return false; return true; diff --git a/contrib/binutils/bfd/i386netbsd.c b/contrib/binutils/bfd/i386netbsd.c index 0e01763..26fa30e 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 1990, 1991, 1992, 1994, 1995, 1996, 1998 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -27,7 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DEFAULT_ARCH bfd_arch_i386 #define DEFAULT_MID M_386_NETBSD -#define MY(OP) CAT(i386netbsd_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (i386netbsd_,OP) + /* This needs to start with a.out so GDB knows it is an a.out variant. */ #define TARGETNAME "a.out-i386-netbsd" diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c index 8414424..546f12c 100644 --- a/contrib/binutils/bfd/ieee.c +++ b/contrib/binutils/bfd/ieee.c @@ -32,29 +32,96 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "ieee.h" #include "libieee.h" +#include "safe-ctype.h" -#include +struct output_buffer_struct +{ + unsigned char *ptrp; + int buffer; +}; static boolean ieee_write_byte PARAMS ((bfd *, int)); static boolean ieee_write_2bytes PARAMS ((bfd *, int)); static boolean ieee_write_int PARAMS ((bfd *, bfd_vma)); static boolean ieee_write_id PARAMS ((bfd *, const char *)); +static unsigned short read_2bytes PARAMS ((common_header_type *)); +static void bfd_get_string PARAMS ((common_header_type *, char *, size_t)); +static char *read_id PARAMS ((common_header_type *)); static boolean ieee_write_expression PARAMS ((bfd *, bfd_vma, asymbol *, boolean, unsigned int)); static void ieee_write_int5 PARAMS ((bfd_byte *, bfd_vma)); static boolean ieee_write_int5_out PARAMS ((bfd *, bfd_vma)); +static boolean parse_int PARAMS ((common_header_type *, bfd_vma *)); +static int parse_i PARAMS ((common_header_type *, boolean *)); +static bfd_vma must_parse_int PARAMS ((common_header_type *)); +static void parse_expression + PARAMS ((ieee_data_type *, bfd_vma *, ieee_symbol_index_type *, + boolean *, unsigned int *, asection **)); +static file_ptr ieee_part_after PARAMS ((ieee_data_type *, file_ptr)); +static ieee_symbol_type *get_symbol + PARAMS ((bfd *, ieee_data_type *, ieee_symbol_type *, unsigned int *, + ieee_symbol_type ***, unsigned int *, int)); +static boolean ieee_slurp_external_symbols PARAMS ((bfd *)); +static boolean ieee_slurp_symbol_table PARAMS ((bfd *)); +static long ieee_get_symtab_upper_bound PARAMS ((bfd *)); +static long ieee_get_symtab PARAMS ((bfd *, asymbol **)); +static asection *get_section_entry + PARAMS ((bfd *, ieee_data_type *i, unsigned int)); +static void ieee_slurp_sections PARAMS ((bfd *)); +static boolean ieee_slurp_debug PARAMS ((bfd *)); +const bfd_target *ieee_archive_p PARAMS ((bfd *)); +const bfd_target *ieee_object_p PARAMS ((bfd *)); +static void ieee_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void ieee_print_symbol + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); +static boolean do_one + PARAMS ((ieee_data_type *, ieee_per_section_type *, unsigned char *, + asection *, int)); +static boolean ieee_slurp_section_data PARAMS ((bfd *)); +static boolean ieee_new_section_hook PARAMS ((bfd *, asection *)); +static long ieee_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); +static boolean ieee_get_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static long ieee_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +static int comp PARAMS ((const PTR, const PTR)); static boolean ieee_write_section_part PARAMS ((bfd *)); static boolean do_with_relocs PARAMS ((bfd *, asection *)); static boolean do_as_repeat PARAMS ((bfd *, asection *)); static boolean do_without_relocs PARAMS ((bfd *, asection *)); -static boolean ieee_write_external_part PARAMS ((bfd *)); -static boolean ieee_write_data_part PARAMS ((bfd *)); +static boolean ieee_mkobject PARAMS ((bfd *)); +static void fill PARAMS ((void)); +static void flush PARAMS ((void)); +static void write_int PARAMS ((int)); +static void copy_id PARAMS ((void)); +static void copy_expression PARAMS ((void)); +static void fill_int PARAMS ((struct output_buffer_struct *)); +static void drop_int PARAMS ((struct output_buffer_struct *)); +static void copy_int PARAMS ((void)); +static void f1_record PARAMS ((void)); +static void f0_record PARAMS ((void)); +static void copy_till_end PARAMS ((void)); +static void f2_record PARAMS ((void)); +static void f8_record PARAMS ((void)); +static void e2_record PARAMS ((void)); +static void block PARAMS ((void)); +static void relocate_debug PARAMS ((bfd *, bfd *)); static boolean ieee_write_debug_part PARAMS ((bfd *)); +static boolean ieee_write_data_part PARAMS ((bfd *)); +static boolean init_for_output PARAMS ((bfd *)); +static boolean ieee_set_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static boolean ieee_write_external_part PARAMS ((bfd *)); static boolean ieee_write_me_part PARAMS ((bfd *)); static boolean ieee_write_processor PARAMS ((bfd *)); - -static boolean ieee_slurp_debug PARAMS ((bfd *)); -static boolean ieee_slurp_section_data PARAMS ((bfd *)); +static boolean ieee_write_object_contents PARAMS ((bfd *)); +static asymbol *ieee_make_empty_symbol PARAMS ((bfd *)); +static bfd *ieee_openr_next_archived_file PARAMS ((bfd *, bfd *)); +static boolean ieee_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static int ieee_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +static int ieee_sizeof_headers PARAMS ((bfd *, boolean)); /* Functions for writing to ieee files in the strange way that the standard requires. */ @@ -67,7 +134,7 @@ ieee_write_byte (abfd, barg) bfd_byte byte; byte = barg; - if (bfd_write ((PTR) &byte, 1, 1, abfd) != 1) + if (bfd_bwrite ((PTR) &byte, (bfd_size_type) 1, abfd) != 1) return false; return true; } @@ -81,7 +148,7 @@ ieee_write_2bytes (abfd, bytes) buffer[0] = bytes >> 8; buffer[1] = bytes & 0xff; - if (bfd_write ((PTR) buffer, 1, 2, abfd) != 2) + if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 2, abfd) != 2) return false; return true; } @@ -171,7 +238,7 @@ ieee_write_id (abfd, id) return false; } - if (bfd_write ((PTR) id, 1, length, abfd) != length) + if (bfd_bwrite ((PTR) id, (bfd_size_type) length, abfd) != length) return false; return true; } @@ -230,7 +297,7 @@ read_id (ieee) length = (length * 256) + this_byte_and_next (ieee); } /* Buy memory and read string */ - string = bfd_alloc (ieee->abfd, length + 1); + string = bfd_alloc (ieee->abfd, (bfd_size_type) length + 1); if (!string) return NULL; bfd_get_string (ieee, string, length); @@ -316,7 +383,7 @@ ieee_write_expression (abfd, value, symbol, pcrel, index) /* Handle the degenerate case of a 0 address. */ if (term_count == 0) { - if (! ieee_write_int (abfd, 0)) + if (! ieee_write_int (abfd, (bfd_vma) 0)) return false; } @@ -355,7 +422,7 @@ ieee_write_int5_out (abfd, value) bfd_byte b[5]; ieee_write_int5 (b, value); - if (bfd_write ((PTR) b, 1, 5, abfd) != 5) + if (bfd_bwrite ((PTR) b, (bfd_size_type) 5, abfd) != 5) return false; return true; } @@ -543,8 +610,9 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC; #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value; ieee_value_type *sp = stack; + asection *dummy; - while (loop) + while (loop && ieee->h.input_p < ieee->h.last_byte) { switch (this_byte (&(ieee->h))) { @@ -637,70 +705,85 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) } else { - /* - Thats all that we can understand. As far as I can see - there is a bug in the Microtec IEEE output which I'm - using to scan, whereby the comma operator is omitted - sometimes in an expression, giving expressions with too - many terms. We can tell if that's the case by ensuring - that sp == stack here. If not, then we've pushed - something too far, so we keep adding. */ - - while (sp != stack + 1) - { - asection *section1; - ieee_symbol_index_type sy1; - POP (sy1, section1, *extra); - } - { - asection *dummy; - - POP (*symbol, dummy, *value); - if (section) - *section = dummy; - } - + /* Thats all that we can understand. */ loop = false; } } } } + + /* As far as I can see there is a bug in the Microtec IEEE output + which I'm using to scan, whereby the comma operator is omitted + sometimes in an expression, giving expressions with too many + terms. We can tell if that's the case by ensuring that + sp == stack here. If not, then we've pushed something too far, + so we keep adding. */ + + while (sp != stack + 1) + { + asection *section1; + ieee_symbol_index_type sy1; + POP (sy1, section1, *extra); + } + + POP (*symbol, dummy, *value); + if (section) + *section = dummy; } -#define ieee_seek(abfd, offset) \ - IEEE_DATA(abfd)->h.input_p = IEEE_DATA(abfd)->h.first_byte + offset +#define ieee_seek(ieee, offset) \ + do \ + { \ + ieee->h.input_p = ieee->h.first_byte + offset; \ + ieee->h.last_byte = (ieee->h.first_byte \ + + ieee_part_after (ieee, offset)); \ + } \ + while (0) + +#define ieee_pos(ieee) \ + (ieee->h.input_p - ieee->h.first_byte) + +/* Find the first part of the ieee file after HERE. */ -#define ieee_pos(abfd) \ - (IEEE_DATA(abfd)->h.input_p - IEEE_DATA(abfd)->h.first_byte) +static file_ptr +ieee_part_after (ieee, here) + ieee_data_type *ieee; + file_ptr here; +{ + int part; + file_ptr after = ieee->w.r.me_record; + + /* File parts can come in any order, except that module end is + guaranteed to be last (and the header first). */ + for (part = 0; part < N_W_VARIABLES; part++) + if (ieee->w.offset[part] > here && after > ieee->w.offset[part]) + after = ieee->w.offset[part]; + + return after; +} static unsigned int last_index; static char last_type; /* is the index for an X or a D */ static ieee_symbol_type * -get_symbol (abfd, - ieee, - last_symbol, - symbol_count, - pptr, - max_index, - this_type -) +get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) bfd *abfd ATTRIBUTE_UNUSED; ieee_data_type *ieee; ieee_symbol_type *last_symbol; unsigned int *symbol_count; ieee_symbol_type ***pptr; unsigned int *max_index; - char this_type - ; + int this_type; { /* Need a new symbol */ unsigned int new_index = must_parse_int (&(ieee->h)); if (new_index != last_index || this_type != last_type) { - ieee_symbol_type *new_symbol = (ieee_symbol_type *) bfd_alloc (ieee->h.abfd, - sizeof (ieee_symbol_type)); + ieee_symbol_type *new_symbol; + bfd_size_type amt = sizeof (ieee_symbol_type); + + new_symbol = (ieee_symbol_type *) bfd_alloc (ieee->h.abfd, amt); if (!new_symbol) return NULL; @@ -735,7 +818,7 @@ ieee_slurp_external_symbols (abfd) last_index = 0xffffff; ieee->symbol_table_full = true; - ieee_seek (abfd, offset); + ieee_seek (ieee, offset); while (loop) { @@ -777,7 +860,7 @@ ieee_slurp_external_symbols (abfd) unsigned int symbol_type_index; unsigned int symbol_attribute_def; bfd_vma value; - switch (read_2bytes (ieee)) + switch (read_2bytes (&ieee->h)) { case ieee_attribute_record_enum: symbol_name_index = must_parse_int (&(ieee->h)); @@ -792,7 +875,7 @@ ieee_slurp_external_symbols (abfd) default: (*_bfd_error_handler) (_("%s: unimplemented ATI record %u for symbol %u"), - bfd_get_filename (abfd), symbol_attribute_def, + bfd_archive_filename (abfd), symbol_attribute_def, symbol_name_index); bfd_set_error (bfd_error_bad_value); return false; @@ -817,7 +900,7 @@ ieee_slurp_external_symbols (abfd) { (*_bfd_error_handler) (_("%s: unexpected ATN type %d in external part"), - bfd_get_filename (abfd), (int) value); + bfd_archive_filename (abfd), (int) value); bfd_set_error (bfd_error_bad_value); return false; } @@ -829,7 +912,7 @@ ieee_slurp_external_symbols (abfd) --value; - switch (read_2bytes (ieee)) + switch (read_2bytes (&ieee->h)) { case ieee_asn_record_enum: parse_int (&ieee->h, &val1); @@ -839,7 +922,7 @@ ieee_slurp_external_symbols (abfd) default: (*_bfd_error_handler) (_("%s: unexpected type after ATN"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); bfd_set_error (bfd_error_bad_value); return false; } @@ -984,7 +1067,7 @@ ieee_slurp_symbol_table (abfd) return true; } -long +static long ieee_get_symtab_upper_bound (abfd) bfd *abfd; { @@ -1002,7 +1085,7 @@ symbol index order extern const bfd_target ieee_vec; -long +static long ieee_get_symtab (abfd, location) bfd *abfd; asymbol **location; @@ -1079,6 +1162,7 @@ get_section_entry (abfd, ieee, index) { unsigned int c, i; asection **n; + bfd_size_type amt; c = ieee->section_table_size; if (c == 0) @@ -1086,8 +1170,9 @@ get_section_entry (abfd, ieee, index) while (c <= index) c *= 2; - n = ((asection **) - bfd_realloc (ieee->section_table, c * sizeof (asection *))); + amt = c; + amt *= sizeof (asection *); + n = (asection **) bfd_realloc (ieee->section_table, amt); if (n == NULL) return NULL; @@ -1100,7 +1185,7 @@ get_section_entry (abfd, ieee, index) if (ieee->section_table[index] == (asection *) NULL) { - char *tmp = bfd_alloc (abfd, 11); + char *tmp = bfd_alloc (abfd, (bfd_size_type) 11); asection *section; if (!tmp) @@ -1121,19 +1206,19 @@ ieee_slurp_sections (abfd) { ieee_data_type *ieee = IEEE_DATA (abfd); file_ptr offset = ieee->w.r.section_part; - asection *section = (asection *) NULL; char *name; if (offset != 0) { bfd_byte section_type[3]; - ieee_seek (abfd, offset); + ieee_seek (ieee, offset); while (true) { switch (this_byte (&(ieee->h))) { case ieee_section_type_enum: { + asection *section; unsigned int section_index; next_byte (&(ieee->h)); section_index = must_parse_int (&(ieee->h)); @@ -1233,8 +1318,10 @@ ieee_slurp_sections (abfd) break; case ieee_e2_first_byte_enum: { - ieee_record_enum_type t = (ieee_record_enum_type) (read_2bytes (&(ieee->h))); + asection *section; + ieee_record_enum_type t; + t = (ieee_record_enum_type) (read_2bytes (&(ieee->h))); switch (t) { case ieee_section_size_enum: @@ -1301,11 +1388,7 @@ ieee_slurp_debug (abfd) sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS; sec->filepos = ieee->w.r.debug_information_part; - debug_end = ieee->w.r.data_part; - if (debug_end == 0) - debug_end = ieee->w.r.trailer_part; - if (debug_end == 0) - debug_end = ieee->w.r.me_record; + debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part); sec->_raw_size = debug_end - ieee->w.r.debug_information_part; return true; @@ -1325,18 +1408,18 @@ ieee_archive_p (abfd) file_ptr buffer_offset = 0; ieee_ar_data_type *save = abfd->tdata.ieee_ar_data; ieee_ar_data_type *ieee; - unsigned int alc_elts; + bfd_size_type alc_elts; ieee_ar_obstack_type *elts = NULL; + bfd_size_type amt = sizeof (ieee_ar_data_type); - abfd->tdata.ieee_ar_data = - (ieee_ar_data_type *) bfd_alloc (abfd, sizeof (ieee_ar_data_type)); + abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, amt); if (!abfd->tdata.ieee_ar_data) goto error_return; ieee = IEEE_AR_DATA (abfd); - /* FIXME: Check return value. I'm not sure whether it needs to read - the entire buffer or not. */ - bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); + /* Ignore the return value here. It doesn't matter if we don't read + the entire buffer. We might have a very small ieee file. */ + bfd_bread ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; @@ -1396,29 +1479,27 @@ ieee_archive_p (abfd) t->abfd = (bfd *) NULL; /* Make sure that we don't go over the end of the buffer. */ - if ((size_t) ieee_pos (abfd) > sizeof (buffer) / 2) + if ((size_t) ieee_pos (IEEE_DATA (abfd)) > sizeof (buffer) / 2) { /* Past half way, reseek and reprime. */ - buffer_offset += ieee_pos (abfd); + buffer_offset += ieee_pos (IEEE_DATA (abfd)); if (bfd_seek (abfd, buffer_offset, SEEK_SET) != 0) goto error_return; - /* FIXME: Check return value. I'm not sure whether it needs - to read the entire buffer or not. */ - bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); + /* Again ignore return value of bfd_bread. */ + bfd_bread ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; } } - ieee->elements = ((ieee_ar_obstack_type *) - bfd_alloc (abfd, - ieee->element_count * sizeof *ieee->elements)); + amt = ieee->element_count; + amt *= sizeof *ieee->elements; + ieee->elements = (ieee_ar_obstack_type *) bfd_alloc (abfd, amt); if (ieee->elements == NULL) goto error_return; - memcpy (ieee->elements, elts, - ieee->element_count * sizeof *ieee->elements); + memcpy (ieee->elements, elts, (size_t) amt); free (elts); elts = NULL; @@ -1428,16 +1509,15 @@ ieee_archive_p (abfd) if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0) goto error_return; - /* FIXME: Check return value. I'm not sure whether it needs to - read the entire buffer or not. */ - bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); + /* Again ignore return value of bfd_bread. */ + bfd_bread ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; next_byte (&(ieee->h)); /* Drop F8. */ next_byte (&(ieee->h)); /* Drop 14. */ must_parse_int (&(ieee->h)); /* Drop size of block. */ - + if (must_parse_int (&(ieee->h)) != 0) /* This object has been deleted. */ ieee->elements[i].file_offset = 0; @@ -1461,14 +1541,6 @@ ieee_archive_p (abfd) return NULL; } -static boolean -ieee_mkobject (abfd) - bfd *abfd; -{ - abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type)); - return abfd->tdata.ieee_data ? true : false; -} - const bfd_target * ieee_object_p (abfd) bfd *abfd; @@ -1478,6 +1550,7 @@ ieee_object_p (abfd) ieee_data_type *ieee; unsigned char buffer[300]; ieee_data_type *save = IEEE_DATA (abfd); + bfd_size_type amt; abfd->tdata.ieee_data = 0; ieee_mkobject (abfd); @@ -1485,10 +1558,9 @@ ieee_object_p (abfd) ieee = IEEE_DATA (abfd); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) goto fail; - /* Read the first few bytes in to see if it makes sense */ - /* FIXME: Check return value. I'm not sure whether it needs to read - the entire buffer or not. */ - bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); + /* Read the first few bytes in to see if it makes sense. Ignore + bfd_bread return value; The file might be very small. */ + bfd_bread ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd); ieee->h.input_p = buffer; if (this_byte_and_next (&(ieee->h)) != Module_Beginning) @@ -1509,7 +1581,7 @@ ieee_object_p (abfd) if (strcmp (processor, "LIBRARY") == 0) goto got_wrong_format; ieee->mb.module_name = read_id (&(ieee->h)); - if (abfd->filename == (CONST char *) NULL) + if (abfd->filename == (const char *) NULL) { abfd->filename = ieee->mb.module_name; } @@ -1553,12 +1625,12 @@ ieee_object_p (abfd) strcpy (family, "68332"); /* Guess it will be CPU32 */ } } - else if (toupper (processor[3]) == 'F') /* 68F333 */ - strcpy (family, "68332"); /* CPU32 */ - else if ((toupper (processor[3]) == 'C') /* Embedded controllers */ - && ((toupper (processor[2]) == 'E') - || (toupper (processor[2]) == 'H') - || (toupper (processor[2]) == 'L'))) + else if (TOUPPER (processor[3]) == 'F') /* 68F333 */ + strcpy (family, "68332"); /* CPU32 */ + else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers */ + && ((TOUPPER (processor[2]) == 'E') + || (TOUPPER (processor[2]) == 'H') + || (TOUPPER (processor[2]) == 'L'))) { strcpy (family, "68"); strncat (family, processor + 4, 7); @@ -1633,16 +1705,17 @@ ieee_object_p (abfd) quickly. We can work out how big the file is from the trailer record */ + amt = ieee->w.r.me_record + 1; IEEE_DATA (abfd)->h.first_byte = - (unsigned char *) bfd_alloc (ieee->h.abfd, ieee->w.r.me_record + 1); + (unsigned char *) bfd_alloc (ieee->h.abfd, amt); if (!IEEE_DATA (abfd)->h.first_byte) goto fail; if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) goto fail; /* FIXME: Check return value. I'm not sure whether it needs to read the entire buffer or not. */ - bfd_read ((PTR) (IEEE_DATA (abfd)->h.first_byte), 1, - ieee->w.r.me_record + 1, abfd); + bfd_bread ((PTR) (IEEE_DATA (abfd)->h.first_byte), + (bfd_size_type) ieee->w.r.me_record + 1, abfd); ieee_slurp_sections (abfd); @@ -1654,7 +1727,7 @@ ieee_object_p (abfd) if (! ieee_slurp_section_data (abfd)) goto fail; - + return abfd->xvec; got_wrong_format: bfd_set_error (bfd_error_wrong_format); @@ -1664,7 +1737,7 @@ fail: return (const bfd_target *) NULL; } -void +static void ieee_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; @@ -1677,9 +1750,9 @@ ieee_get_symbol_info (ignore_abfd, symbol, ret) ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A'; } -void -ieee_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +static void +ieee_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -1710,7 +1783,7 @@ ieee_print_symbol (ignore_abfd, afile, symbol, how) } else { - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %04x %02x %s", section_name, @@ -1765,9 +1838,10 @@ do_one (ieee, current_map, location_ptr, s, iterations) unsigned int extra = 4; boolean pcrel = false; asection *section; - ieee_reloc_type *r = - (ieee_reloc_type *) bfd_alloc (ieee->h.abfd, - sizeof (ieee_reloc_type)); + ieee_reloc_type *r; + bfd_size_type amt = sizeof (ieee_reloc_type); + + r = (ieee_reloc_type *) bfd_alloc (ieee->h.abfd, amt); if (!r) return false; @@ -1824,21 +1898,20 @@ do_one (ieee, current_map, location_ptr, s, iterations) if (pcrel == true) { #if KEEPMINUSPCININST - bfd_put_32 (ieee->h.abfd, -current_map->pc, location_ptr + - current_map->pc); + bfd_put_32 (ieee->h.abfd, -current_map->pc, + location_ptr + current_map->pc); r->relent.howto = &rel32_howto; - r->relent.addend -= - current_map->pc; + r->relent.addend -= current_map->pc; #else - bfd_put_32 (ieee->h.abfd, 0, location_ptr + + bfd_put_32 (ieee->h.abfd, (bfd_vma) 0, location_ptr + current_map->pc); r->relent.howto = &rel32_howto; #endif } else { - bfd_put_32 (ieee->h.abfd, 0, location_ptr + - current_map->pc); + bfd_put_32 (ieee->h.abfd, (bfd_vma) 0, + location_ptr + current_map->pc); r->relent.howto = &abs32_howto; } current_map->pc += 4; @@ -1847,19 +1920,22 @@ do_one (ieee, current_map, location_ptr, s, iterations) if (pcrel == true) { #if KEEPMINUSPCININST - bfd_put_16 (ieee->h.abfd, (int) (-current_map->pc), location_ptr + current_map->pc); + bfd_put_16 (ieee->h.abfd, (bfd_vma) -current_map->pc, + location_ptr + current_map->pc); r->relent.addend -= current_map->pc; r->relent.howto = &rel16_howto; #else - bfd_put_16 (ieee->h.abfd, 0, location_ptr + current_map->pc); + bfd_put_16 (ieee->h.abfd, (bfd_vma) 0, + location_ptr + current_map->pc); r->relent.howto = &rel16_howto; #endif } else { - bfd_put_16 (ieee->h.abfd, 0, location_ptr + current_map->pc); + bfd_put_16 (ieee->h.abfd, (bfd_vma) 0, + location_ptr + current_map->pc); r->relent.howto = &abs16_howto; } current_map->pc += 2; @@ -1934,7 +2010,7 @@ ieee_slurp_section_data (abfd) if (ieee->read_data == true) return true; ieee->read_data = true; - ieee_seek (abfd, ieee->w.r.data_part); + ieee_seek (ieee, ieee->w.r.data_part); /* Allocate enough space for all the section contents */ @@ -1983,7 +2059,7 @@ ieee_slurp_section_data (abfd) unsigned int extra; boolean pcrel; next_byte (&(ieee->h)); - must_parse_int (&(ieee->h)); /* Thow away section #*/ + must_parse_int (&(ieee->h)); /* Throw away section #*/ parse_expression (ieee, &value, &symbol, &pcrel, &extra, @@ -2036,7 +2112,7 @@ ieee_slurp_section_data (abfd) { ieee->h.input_p = start; if (!do_one (ieee, current_map, location_ptr, s, - iterations)) + (int) iterations)) return false; iterations--; } @@ -2053,13 +2129,13 @@ ieee_slurp_section_data (abfd) } } -boolean +static boolean ieee_new_section_hook (abfd, newsect) bfd *abfd; asection *newsect; { newsect->used_by_bfd = (PTR) - bfd_alloc (abfd, sizeof (ieee_per_section_type)); + bfd_alloc (abfd, (bfd_size_type) sizeof (ieee_per_section_type)); if (!newsect->used_by_bfd) return false; ieee_per_section (newsect)->data = (bfd_byte *) NULL; @@ -2067,7 +2143,7 @@ ieee_new_section_hook (abfd, newsect) return true; } -long +static long ieee_get_reloc_upper_bound (abfd, asect) bfd *abfd; sec_ptr asect; @@ -2096,7 +2172,7 @@ ieee_get_section_contents (abfd, section, location, offset, count) return true; } -long +static long ieee_canonicalize_reloc (abfd, section, relptr, symbols) bfd *abfd; sec_ptr section; @@ -2141,8 +2217,8 @@ ieee_canonicalize_reloc (abfd, section, relptr, symbols) static int comp (ap, bp) - CONST PTR ap; - CONST PTR bp; + const PTR ap; + const PTR bp; { arelent *a = *((arelent **) ap); arelent *b = *((arelent **) bp); @@ -2215,7 +2291,7 @@ ieee_write_section_part (abfd) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE)) - || ! ieee_write_int (abfd, 1 << s->alignment_power)) + || ! ieee_write_int (abfd, (bfd_vma) 1 << s->alignment_power)) return false; /* Size */ @@ -2269,6 +2345,7 @@ do_with_relocs (abfd, s) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) return false; + if ((abfd->flags & EXEC_P) != 0 && relocs_to_go == 0) { if (! ieee_write_int (abfd, s->lma)) @@ -2276,7 +2353,7 @@ do_with_relocs (abfd, s) } else { - if (! ieee_write_expression (abfd, 0, s->symbol, 0, 0)) + if (! ieee_write_expression (abfd, (bfd_vma) 0, s->symbol, 0, 0)) return false; } @@ -2302,10 +2379,7 @@ do_with_relocs (abfd, s) /* Output a stream of bytes */ if (! ieee_write_int (abfd, run)) return false; - if (bfd_write ((PTR) (stream + current_byte_index), - 1, - run, - abfd) + if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd) != run) return false; current_byte_index += run; @@ -2353,10 +2427,7 @@ do_with_relocs (abfd, s) /* Output a stream of bytes */ if (! ieee_write_int (abfd, run)) return false; - if (bfd_write ((PTR) (stream + current_byte_index), - 1, - run, - abfd) + if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd) != run) return false; current_byte_index += run; @@ -2418,7 +2489,7 @@ do_with_relocs (abfd, s) if (! ieee_write_expression (abfd, r->addend + ov, *(r->sym_ptr_ptr), r->howto->pc_relative, - s->index)) + (unsigned) s->index)) return false; } else @@ -2426,15 +2497,15 @@ do_with_relocs (abfd, s) if (! ieee_write_expression (abfd, r->addend + ov, (asymbol *) NULL, r->howto->pc_relative, - s->index)) + (unsigned) s->index)) return false; } if (number_of_maus_in_address != bfd_get_reloc_size (r->howto)) { - if (! ieee_write_int (abfd, - bfd_get_reloc_size (r->howto))) + bfd_vma rsize = bfd_get_reloc_size (r->howto); + if (! ieee_write_int (abfd, rsize)) return false; } if (! ieee_write_byte (abfd, @@ -2471,9 +2542,21 @@ do_as_repeat (abfd, s) || ! ieee_write_byte (abfd, ieee_set_current_pc_enum & 0xff) || ! ieee_write_byte (abfd, (bfd_byte) (s->index - + IEEE_SECTION_NUMBER_BASE)) - || ! ieee_write_int (abfd, s->lma) - || ! ieee_write_byte (abfd, ieee_repeat_data_enum) + + IEEE_SECTION_NUMBER_BASE))) + return false; + + if ((abfd->flags & EXEC_P) != 0) + { + if (! ieee_write_int (abfd, s->lma)) + return false; + } + else + { + if (! ieee_write_expression (abfd, (bfd_vma) 0, s->symbol, 0, 0)) + return false; + } + + if (! ieee_write_byte (abfd, ieee_repeat_data_enum) || ! ieee_write_int (abfd, s->_raw_size) || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum) || ! ieee_write_byte (abfd, 1) @@ -2526,20 +2609,41 @@ static bfd *input_bfd; static bfd *output_bfd; static int output_buffer; +static boolean +ieee_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt; + + output_ptr_start = NULL; + output_ptr = NULL; + output_ptr_end = NULL; + input_ptr_start = NULL; + input_ptr = NULL; + input_ptr_end = NULL; + input_bfd = NULL; + output_bfd = NULL; + output_buffer = 0; + amt = sizeof (ieee_data_type); + abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, amt); + return abfd->tdata.ieee_data ? true : false; +} + static void fill () { + bfd_size_type amt = input_ptr_end - input_ptr_start; /* FIXME: Check return value. I'm not sure whether it needs to read the entire buffer or not. */ - bfd_read ((PTR) input_ptr_start, 1, input_ptr_end - input_ptr_start, input_bfd); + bfd_bread ((PTR) input_ptr_start, amt, input_bfd); input_ptr = input_ptr_start; } + static void flush () { - if (bfd_write ((PTR) (output_ptr_start), 1, output_ptr - output_ptr_start, - output_bfd) - != (bfd_size_type) (output_ptr - output_ptr_start)) + bfd_size_type amt = output_ptr - output_ptr_start; + if (bfd_bwrite ((PTR) (output_ptr_start), amt, output_bfd) != amt) abort (); output_ptr = output_ptr_start; output_buffer++; @@ -2614,7 +2718,7 @@ copy_expression () { int stack[10]; int *tos = stack; - int value = 0; + int value; while (1) { switch (THIS ()) @@ -2668,16 +2772,13 @@ copy_expression () } *tos++ = THIS (); NEXT (); - value = 0; break; case 0xa5: /* PLUS anything */ - { - int value = *(--tos); - value += *(--tos); - *tos++ = value; - NEXT (); - } + value = *(--tos); + value += *(--tos); + *tos++ = value; + NEXT (); break; case VAR ('R'): { @@ -2690,17 +2791,11 @@ copy_expression () NEXT (); ieee = IEEE_DATA (input_bfd); s = ieee->section_table[section_number]; + value = 0; if (s->output_section) - { - value = s->output_section->lma; - } - else - { - value = 0; - } + value = s->output_section->lma; value += s->output_offset; *tos++ = value; - value = 0; } break; case 0x90: @@ -2709,22 +2804,14 @@ copy_expression () write_int (*(--tos)); OUT (0x90); return; - } } } - } /* Drop the int in the buffer, and copy a null into the gap, which we will overwrite later */ -struct output_buffer_struct -{ - unsigned char *ptrp; - int buffer; -}; - static void fill_int (buf) struct output_buffer_struct *buf; @@ -2812,7 +2899,6 @@ copy_int () #define ID copy_id() #define INT copy_int() #define EXP copy_expression() -static void copy_till_end (); #define INTn(q) copy_int() #define EXPn(q) copy_expression() @@ -2978,7 +3064,6 @@ f2_record () } -static void block (); static void f8_record () { @@ -3189,7 +3274,7 @@ relocate_debug (output, input) input_bfd = input; /* FIXME: Check return value. I'm not sure whether it needs to read the entire buffer or not. */ - bfd_read ((PTR) input_ptr_start, 1, IBS, input); + bfd_bread ((PTR) input_ptr_start, (bfd_size_type) IBS, input); block (); } @@ -3202,13 +3287,13 @@ ieee_write_debug_part (abfd) { ieee_data_type *ieee = IEEE_DATA (abfd); bfd_chain_type *chain = ieee->chain_root; - unsigned char output_buffer[OBS]; + unsigned char obuff[OBS]; boolean some_debug = false; file_ptr here = bfd_tell (abfd); - output_ptr_start = output_ptr = output_buffer; - output_ptr_end = output_buffer + OBS; - output_ptr = output_buffer; + output_ptr_start = output_ptr = obuff; + output_ptr_end = obuff + OBS; + output_ptr = obuff; output_bfd = abfd; if (chain == (bfd_chain_type *) NULL) @@ -3225,7 +3310,7 @@ ieee_write_debug_part (abfd) } ieee->w.r.debug_information_part = here; - if (bfd_write (s->contents, 1, s->_raw_size, abfd) != s->_raw_size) + if (bfd_bwrite (s->contents, s->_raw_size, abfd) != s->_raw_size) return false; } else @@ -3237,8 +3322,7 @@ ieee_write_debug_part (abfd) if (entry_ieee->w.r.debug_information_part) { if (bfd_seek (entry, entry_ieee->w.r.debug_information_part, - SEEK_SET) - != 0) + SEEK_SET) != 0) return false; relocate_debug (abfd, entry); } @@ -3305,7 +3389,8 @@ init_for_output (abfd) continue; if (s->_raw_size != 0) { - ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, s->_raw_size)); + bfd_size_type size = s->_raw_size; + ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, size)); if (!ieee_per_section (s)->data) return false; } @@ -3318,7 +3403,7 @@ init_for_output (abfd) /* set section contents is complicated with IEEE since the format is * not a byte image, but a record stream. */ -boolean +static boolean ieee_set_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; @@ -3330,14 +3415,14 @@ ieee_set_section_contents (abfd, section, location, offset, count) { if (section->contents == NULL) { - section->contents = ((unsigned char *) - bfd_alloc (abfd, section->_raw_size)); + bfd_size_type size = section->_raw_size; + section->contents = (unsigned char *) bfd_alloc (abfd, size); if (section->contents == NULL) return false; } /* bfd_set_section_contents has already checked that everything is within range. */ - memcpy (section->contents + offset, location, count); + memcpy (section->contents + offset, location, (size_t) count); return true; } @@ -3378,7 +3463,7 @@ ieee_write_external_part (abfd) { /* This must be a symbol reference .. */ if (! ieee_write_byte (abfd, ieee_external_reference_enum) - || ! ieee_write_int (abfd, reference_index) + || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_id (abfd, p->name)) return false; p->value = reference_index; @@ -3389,11 +3474,11 @@ ieee_write_external_part (abfd) { /* This is a weak reference */ if (! ieee_write_byte (abfd, ieee_external_reference_enum) - || ! ieee_write_int (abfd, reference_index) + || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_id (abfd, p->name) || ! ieee_write_byte (abfd, ieee_weak_external_reference_enum) - || ! ieee_write_int (abfd, reference_index) + || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_int (abfd, p->value)) return false; p->value = reference_index; @@ -3405,10 +3490,10 @@ ieee_write_external_part (abfd) /* This must be a symbol definition */ if (! ieee_write_byte (abfd, ieee_external_symbol_enum) - || ! ieee_write_int (abfd, public_index) + || ! ieee_write_int (abfd, (bfd_vma) public_index) || ! ieee_write_id (abfd, p->name) || ! ieee_write_2bytes (abfd, ieee_attribute_record_enum) - || ! ieee_write_int (abfd, public_index) + || ! ieee_write_int (abfd, (bfd_vma) public_index) || ! ieee_write_byte (abfd, 15) /* instruction address */ || ! ieee_write_byte (abfd, 19) /* static symbol */ || ! ieee_write_byte (abfd, 1)) /* one of them */ @@ -3416,7 +3501,7 @@ ieee_write_external_part (abfd) /* Write out the value */ if (! ieee_write_2bytes (abfd, ieee_value_record_enum) - || ! ieee_write_int (abfd, public_index)) + || ! ieee_write_int (abfd, (bfd_vma) public_index)) return false; if (! bfd_is_abs_section (p->section)) { @@ -3467,7 +3552,7 @@ ieee_write_external_part (abfd) } -static CONST unsigned char exten[] = +static const unsigned char exten[] = { 0xf0, 0x20, 0x00, 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3 */ @@ -3475,7 +3560,7 @@ static CONST unsigned char exten[] = 0xf1, 0xce, 0x20, 0x00, 38 /* set object type relocateable to x */ }; -static CONST unsigned char envi[] = +static const unsigned char envi[] = { 0xf0, 0x21, 0x00, @@ -3597,7 +3682,7 @@ ieee_write_processor (abfd) return true; } -boolean +static boolean ieee_write_object_contents (abfd) bfd *abfd; { @@ -3632,7 +3717,8 @@ ieee_write_object_contents (abfd) return false; ieee->w.r.extension_record = bfd_tell (abfd); - if (bfd_write ((char *) exten, 1, sizeof (exten), abfd) != sizeof (exten)) + if (bfd_bwrite ((char *) exten, (bfd_size_type) sizeof (exten), abfd) + != sizeof (exten)) return false; if (abfd->flags & EXEC_P) { @@ -3646,7 +3732,8 @@ ieee_write_object_contents (abfd) } ieee->w.r.environmental_record = bfd_tell (abfd); - if (bfd_write ((char *) envi, 1, sizeof (envi), abfd) != sizeof (envi)) + if (bfd_bwrite ((char *) envi, (bfd_size_type) sizeof (envi), abfd) + != sizeof (envi)) return false; /* The HP emulator database requires a timestamp in the file. */ @@ -3660,12 +3747,12 @@ ieee_write_object_contents (abfd) || ! ieee_write_byte (abfd, 0x21) || ! ieee_write_byte (abfd, 0) || ! ieee_write_byte (abfd, 50) - || ! ieee_write_int (abfd, t->tm_year + 1900) - || ! ieee_write_int (abfd, t->tm_mon + 1) - || ! ieee_write_int (abfd, t->tm_mday) - || ! ieee_write_int (abfd, t->tm_hour) - || ! ieee_write_int (abfd, t->tm_min) - || ! ieee_write_int (abfd, t->tm_sec)) + || ! ieee_write_int (abfd, (bfd_vma) (t->tm_year + 1900)) + || ! ieee_write_int (abfd, (bfd_vma) (t->tm_mon + 1)) + || ! ieee_write_int (abfd, (bfd_vma) t->tm_mday) + || ! ieee_write_int (abfd, (bfd_vma) t->tm_hour) + || ! ieee_write_int (abfd, (bfd_vma) t->tm_min) + || ! ieee_write_int (abfd, (bfd_vma) t->tm_sec)) return false; } @@ -3707,7 +3794,7 @@ ieee_write_object_contents (abfd) { if (! ieee_write_2bytes (abfd, ieee_assign_value_to_variable_enum) || ! ieee_write_byte (abfd, (bfd_byte) i) - || ! ieee_write_int5_out (abfd, ieee->w.offset[i])) + || ! ieee_write_int5_out (abfd, (bfd_vma) ieee->w.offset[i])) return false; } @@ -3720,12 +3807,12 @@ ieee_write_object_contents (abfd) function exits. We read the strings into a buffer large enough to hold them all plus all the cached symbol entries. */ -asymbol * +static asymbol * ieee_make_empty_symbol (abfd) bfd *abfd; { - ieee_symbol_type *new = - (ieee_symbol_type *) bfd_zalloc (abfd, sizeof (ieee_symbol_type)); + bfd_size_type amt = sizeof (ieee_symbol_type); + ieee_symbol_type *new = (ieee_symbol_type *) bfd_zalloc (abfd, amt); if (!new) return NULL; new->symbol.the_bfd = abfd; @@ -3770,13 +3857,8 @@ ieee_openr_next_archived_file (arch, prev) } static boolean -ieee_find_nearest_line (abfd, - section, - symbols, - offset, - filename_ptr, - functionname_ptr, - line_ptr) +ieee_find_nearest_line (abfd, section, symbols, offset, filename_ptr, + functionname_ptr, line_ptr) bfd *abfd ATTRIBUTE_UNUSED; asection *section ATTRIBUTE_UNUSED; asymbol **symbols ATTRIBUTE_UNUSED; @@ -3872,7 +3954,8 @@ ieee_bfd_debug_info_accumulate (abfd, section) /* Add to chain */ { - bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, sizeof (bfd_chain_type)); + bfd_size_type amt = sizeof (bfd_chain_type); + bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, amt); if (!n) abort (); /* FIXME */ n->this = section->owner; @@ -3926,6 +4009,7 @@ ieee_bfd_debug_info_accumulate (abfd, section) bfd_generic_get_relocated_section_contents #define ieee_bfd_relax_section bfd_generic_relax_section #define ieee_bfd_gc_sections bfd_generic_gc_sections +#define ieee_bfd_merge_sections bfd_generic_merge_sections #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols #define ieee_bfd_final_link _bfd_generic_final_link @@ -3971,17 +4055,43 @@ const bfd_target ieee_vec = bfd_false, }, + /* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook, + ieee_get_section_contents, ieee_get_section_contents_in_window */ BFD_JUMP_TABLE_GENERIC (ieee), + BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (_bfd_nocore), + + /* ieee_slurp_armap, ieee_slurp_extended_name_table, + ieee_construct_extended_name_table, ieee_truncate_arname, + ieee_write_armap, ieee_read_ar_hdr, ieee_openr_next_archived_file, + ieee_get_elt_at_index, ieee_generic_stat_arch_elt, + ieee_update_armap_timestamp */ BFD_JUMP_TABLE_ARCHIVE (ieee), + + /* ieee_get_symtab_upper_bound, ieee_get_symtab, ieee_make_empty_symbol, + ieee_print_symbol, ieee_get_symbol_info, ieee_bfd_is_local_label_name, + ieee_get_lineno, ieee_find_nearest_line, ieee_bfd_make_debug_symbol, + ieee_read_minisymbols, ieee_minisymbol_to_symbol */ BFD_JUMP_TABLE_SYMBOLS (ieee), + + /* ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, + ieee_bfd_reloc_type_lookup */ BFD_JUMP_TABLE_RELOCS (ieee), + + /* ieee_set_arch_mach, ieee_set_section_contents */ BFD_JUMP_TABLE_WRITE (ieee), + + /* ieee_sizeof_headers, ieee_bfd_get_relocated_section_contents, + ieee_bfd_relax_section, ieee_bfd_link_hash_table_create, + ieee_bfd_link_add_symbols, ieee_bfd_final_link, + ieee_bfd_link_split_section, ieee_bfd_gc_sections, + ieee_bfd_merge_sections */ BFD_JUMP_TABLE_LINK (ieee), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c index 738da81..8bb5134 100644 --- a/contrib/binutils/bfd/ihex.c +++ b/contrib/binutils/bfd/ihex.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -122,8 +123,7 @@ The MRI compiler uses this, which is a repeat of type 5: #include "sysdep.h" #include "libbfd.h" #include "libiberty.h" - -#include +#include "safe-ctype.h" static void ihex_init PARAMS ((void)); static boolean ihex_mkobject PARAMS ((bfd *)); @@ -137,9 +137,8 @@ static boolean ihex_get_section_contents static boolean ihex_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static boolean ihex_write_record - PARAMS ((bfd *, bfd_size_type, bfd_vma, unsigned int, bfd_byte *)); + PARAMS ((bfd *, size_t, unsigned int, unsigned int, bfd_byte *)); static boolean ihex_write_object_contents PARAMS ((bfd *)); -static asymbol *ihex_make_empty_symbol PARAMS ((bfd *)); static boolean ihex_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); static int ihex_sizeof_headers PARAMS ((bfd *, boolean)); @@ -197,9 +196,9 @@ ihex_mkobject (abfd) if (abfd->tdata.ihex_data == NULL) { struct ihex_data_struct *tdata; + bfd_size_type amt = sizeof (struct ihex_data_struct); - tdata = ((struct ihex_data_struct *) - bfd_alloc (abfd, sizeof (struct ihex_data_struct))); + tdata = (struct ihex_data_struct *) bfd_alloc (abfd, amt); if (tdata == NULL) return false; abfd->tdata.ihex_data = tdata; @@ -220,7 +219,7 @@ ihex_get_byte (abfd, errorptr) { bfd_byte c; - if (bfd_read (&c, 1, 1, abfd) != 1) + if (bfd_bread (&c, (bfd_size_type) 1, abfd) != 1) { if (bfd_get_error () != bfd_error_file_truncated) *errorptr = true; @@ -248,7 +247,7 @@ ihex_bad_byte (abfd, lineno, c, error) { char buf[10]; - if (! isprint (c)) + if (! ISPRINT (c)) sprintf (buf, "\\%03o", (unsigned int) c); else { @@ -257,7 +256,7 @@ ihex_bad_byte (abfd, lineno, c, error) } (*_bfd_error_handler) (_("%s:%d: unexpected character `%s' in Intel Hex file\n"), - bfd_get_filename (abfd), lineno, buf); + bfd_archive_filename (abfd), lineno, buf); bfd_set_error (bfd_error_bad_value); } } @@ -272,7 +271,7 @@ ihex_scan (abfd) bfd_vma segbase; bfd_vma extbase; asection *sec; - int lineno; + unsigned int lineno; boolean error; bfd_byte *buf = NULL; size_t bufsize; @@ -320,7 +319,7 @@ ihex_scan (abfd) /* Read the header bytes. */ - if (bfd_read (hdr, 1, 8, abfd) != 8) + if (bfd_bread (hdr, (bfd_size_type) 8, abfd) != 8) goto error_return; for (i = 0; i < 8; i++) @@ -341,13 +340,13 @@ ihex_scan (abfd) chars = len * 2 + 2; if (chars >= bufsize) { - buf = (bfd_byte *) bfd_realloc (buf, chars); + buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) chars); if (buf == NULL) goto error_return; bufsize = chars; } - if (bfd_read (buf, 1, chars, abfd) != chars) + if (bfd_bread (buf, (bfd_size_type) chars, abfd) != chars) goto error_return; for (i = 0; i < chars; i++) @@ -366,8 +365,8 @@ ihex_scan (abfd) if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i)) { (*_bfd_error_handler) - (_("%s:%d: bad checksum in Intel Hex file (expected %u, found %u)"), - bfd_get_filename (abfd), lineno, + (_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"), + bfd_archive_filename (abfd), lineno, (- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i)); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -388,9 +387,11 @@ ihex_scan (abfd) { char secbuf[20]; char *secname; + bfd_size_type amt; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); - secname = (char *) bfd_alloc (abfd, strlen (secbuf) + 1); + amt = strlen (secbuf) + 1; + secname = (char *) bfd_alloc (abfd, amt); if (secname == NULL) goto error_return; strcpy (secname, secbuf); @@ -418,8 +419,8 @@ ihex_scan (abfd) if (len != 2) { (*_bfd_error_handler) - (_("%s:%d: bad extended address record length in Intel Hex file"), - bfd_get_filename (abfd), lineno); + (_("%s:%u: bad extended address record length in Intel Hex file"), + bfd_archive_filename (abfd), lineno); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -435,8 +436,8 @@ ihex_scan (abfd) if (len != 4) { (*_bfd_error_handler) - (_("%s:%d: bad extended start address length in Intel Hex file"), - bfd_get_filename (abfd), lineno); + (_("%s:%u: bad extended start address length in Intel Hex file"), + bfd_archive_filename (abfd), lineno); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -452,8 +453,8 @@ ihex_scan (abfd) if (len != 2) { (*_bfd_error_handler) - (_("%s:%d: bad extended linear address record length in Intel Hex file"), - bfd_get_filename (abfd), lineno); + (_("%s:%u: bad extended linear address record length in Intel Hex file"), + bfd_archive_filename (abfd), lineno); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -469,8 +470,8 @@ ihex_scan (abfd) if (len != 2 && len != 4) { (*_bfd_error_handler) - (_("%s:%d: bad extended linear start address length in Intel Hex file"), - bfd_get_filename (abfd), lineno); + (_("%s:%u: bad extended linear start address length in Intel Hex file"), + bfd_archive_filename (abfd), lineno); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -486,8 +487,8 @@ ihex_scan (abfd) default: (*_bfd_error_handler) - (_("%s:%d: unrecognized ihex type %u in Intel Hex file\n"), - bfd_get_filename (abfd), lineno, type); + (_("%s:%u: unrecognized ihex type %u in Intel Hex file\n"), + bfd_archive_filename (abfd), lineno, type); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -522,7 +523,7 @@ ihex_object_p (abfd) if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return NULL; - if (bfd_read (b, 1, 9, abfd) != 9) + if (bfd_bread (b, (bfd_size_type) 9, abfd) != 9) { if (bfd_get_error () == bfd_error_file_truncated) bfd_set_error (bfd_error_wrong_format); @@ -595,7 +596,7 @@ ihex_read_section (abfd, section, contents) know the exact format. */ BFD_ASSERT (c == ':'); - if (bfd_read (hdr, 1, 8, abfd) != 8) + if (bfd_bread (hdr, (bfd_size_type) 8, abfd) != 8) goto error_return; len = HEX2 (hdr); @@ -607,20 +608,20 @@ ihex_read_section (abfd, section, contents) { (*_bfd_error_handler) (_("%s: internal error in ihex_read_section"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); bfd_set_error (bfd_error_bad_value); goto error_return; } if (len * 2 > bufsize) { - buf = (bfd_byte *) bfd_realloc (buf, len * 2); + buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) len * 2); if (buf == NULL) goto error_return; bufsize = len * 2; } - if (bfd_read (buf, 1, len * 2, abfd) != len * 2) + if (bfd_bread (buf, (bfd_size_type) len * 2, abfd) != len * 2) goto error_return; for (i = 0; i < len; i++) @@ -634,7 +635,7 @@ ihex_read_section (abfd, section, contents) } /* Skip the checksum. */ - if (bfd_read (buf, 1, 2, abfd) != 2) + if (bfd_bread (buf, (bfd_size_type) 2, abfd) != 2) goto error_return; } @@ -642,7 +643,7 @@ ihex_read_section (abfd, section, contents) { (*_bfd_error_handler) (_("%s: bad section length in ihex_read_section"), - bfd_get_filename (abfd)); + bfd_archive_filename (abfd)); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -696,14 +697,15 @@ ihex_set_section_contents (abfd, section, location, offset, count) struct ihex_data_list *n; bfd_byte *data; struct ihex_data_struct *tdata; + bfd_size_type amt; if (count == 0 || (section->flags & SEC_ALLOC) == 0 || (section->flags & SEC_LOAD) == 0) return true; - n = ((struct ihex_data_list *) - bfd_alloc (abfd, sizeof (struct ihex_data_list))); + amt = sizeof (struct ihex_data_list); + n = (struct ihex_data_list *) bfd_alloc (abfd, amt); if (n == NULL) return false; @@ -748,8 +750,8 @@ ihex_set_section_contents (abfd, section, location, offset, count) static boolean ihex_write_record (abfd, count, addr, type, data) bfd *abfd; - bfd_size_type count; - bfd_vma addr; + size_t count; + unsigned int addr; unsigned int type; bfd_byte *data; { @@ -758,6 +760,7 @@ ihex_write_record (abfd, count, addr, type, data) char *p; unsigned int chksum; unsigned int i; + size_t total; #define TOHEX(buf, v) \ ((buf)[0] = digs[((v) >> 4) & 0xf], (buf)[1] = digs[(v) & 0xf]) @@ -780,7 +783,8 @@ ihex_write_record (abfd, count, addr, type, data) p[2] = '\r'; p[3] = '\n'; - if (bfd_write (buf, 1, 9 + count * 2 + 4, abfd) != 9 + count * 2 + 4) + total = 9 + count * 2 + 4; + if (bfd_bwrite (buf, (bfd_size_type) total, abfd) != total) return false; return true; @@ -809,10 +813,11 @@ ihex_write_object_contents (abfd) count = l->size; while (count > 0) { - bfd_size_type now; + size_t now; + unsigned int rec_addr; now = count; - if (now > CHUNK) + if (count > CHUNK) now = CHUNK; if (where > segbase + extbase + 0xffff) @@ -867,8 +872,8 @@ ihex_write_object_contents (abfd) } } - if (! ihex_write_record (abfd, now, where - (extbase + segbase), - 0, p)) + rec_addr = where - (extbase + segbase); + if (! ihex_write_record (abfd, now, rec_addr, 0, p)) return false; where += now; @@ -910,21 +915,6 @@ ihex_write_object_contents (abfd) return true; } -/* Make an empty symbol. This is required only because - bfd_make_section_anyway wants to create a symbol for the section. */ - -static asymbol * -ihex_make_empty_symbol (abfd) - bfd *abfd; -{ - asymbol *new; - - new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); - if (new != NULL) - new->the_bfd = abfd; - return new; -} - /* Set the architecture for the output file. The architecture is irrelevant, so we ignore errors about unknown architectures. */ @@ -964,6 +954,7 @@ ihex_sizeof_headers (abfd, exec) #define ihex_get_symtab_upper_bound bfd_0l #define ihex_get_symtab \ ((long (*) PARAMS ((bfd *, asymbol **))) bfd_0l) +#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol #define ihex_print_symbol _bfd_nosymbols_print_symbol #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name @@ -983,6 +974,7 @@ ihex_sizeof_headers (abfd, exec) bfd_generic_get_relocated_section_contents #define ihex_bfd_relax_section bfd_generic_relax_section #define ihex_bfd_gc_sections bfd_generic_gc_sections +#define ihex_bfd_merge_sections bfd_generic_merge_sections #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols #define ihex_bfd_final_link _bfd_generic_final_link @@ -1038,6 +1030,6 @@ const bfd_target ihex_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h index b3efdce..d7e5c71 100644 --- a/contrib/binutils/bfd/libaout.h +++ b/contrib/binutils/bfd/libaout.h @@ -29,27 +29,94 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfdlink.h" +/* Macros for accessing components in an aout header. Saves cluttering + the source with (bfd_vma) and (bfd_byte *) casts. */ + +#define H_PUT_64(abfd, val, where) \ + bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_32(abfd, val, where) \ + bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_16(abfd, val, where) \ + bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_8 bfd_h_put_8 + +#define H_PUT_S64(abfd, val, where) \ + bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S32(abfd, val, where) \ + bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S16(abfd, val, where) \ + bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) + +#define H_PUT_S8 bfd_h_put_signed_8 + +#define H_GET_64(abfd, where) \ + bfd_h_get_64 ((abfd), (bfd_byte *) (where)) + +#define H_GET_32(abfd, where) \ + bfd_h_get_32 ((abfd), (bfd_byte *) (where)) + +#define H_GET_16(abfd, where) \ + bfd_h_get_16 ((abfd), (bfd_byte *) (where)) + +#define H_GET_8 bfd_h_get_8 + +#define H_GET_S64(abfd, where) \ + bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S32(abfd, where) \ + bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S16(abfd, where) \ + bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) + +#define H_GET_S8 bfd_h_get_signed_8 + /* Parameterize the a.out code based on whether it is being built for a 32-bit architecture or a 64-bit architecture. */ +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ #if ARCH_SIZE==64 -#define GET_WORD bfd_h_get_64 -#define GET_SWORD bfd_h_get_signed_64 -#define PUT_WORD bfd_h_put_64 +#define GET_WORD H_GET_64 +#define GET_SWORD H_GET_S64 +#define GET_MAGIC H_GET_32 +#define PUT_WORD H_PUT_64 +#define PUT_MAGIC H_PUT_32 #ifndef NAME -#define NAME(x,y) CAT3(x,_64_,y) +#define NAME(x,y) CONCAT3 (x,_64_,y) #endif -#define JNAME(x) CAT(x,_64) +#define JNAME(x) CONCAT2 (x,_64) #define BYTES_IN_WORD 8 +#else +#if ARCH_SIZE==16 +#define GET_WORD H_GET_16 +#define GET_SWORD H_GET_S16 +#define GET_MAGIC H_GET_16 +#define PUT_WORD H_PUT_16 +#define PUT_MAGIC H_PUT_16 +#ifndef NAME +#define NAME(x,y) CONCAT3 (x,_16_,y) +#endif +#define JNAME(x) CONCAT2 (x,_16) +#define BYTES_IN_WORD 2 #else /* ARCH_SIZE == 32 */ -#define GET_WORD bfd_h_get_32 -#define GET_SWORD bfd_h_get_signed_32 -#define PUT_WORD bfd_h_put_32 +#define GET_WORD H_GET_32 +#define GET_SWORD H_GET_S32 +#define GET_MAGIC H_GET_32 +#define PUT_WORD H_PUT_32 +#define PUT_MAGIC H_PUT_32 #ifndef NAME -#define NAME(x,y) CAT3(x,_32_,y) +#define NAME(x,y) CONCAT3 (x,_32_,y) #endif -#define JNAME(x) CAT(x,_32) +#define JNAME(x) CONCAT2 (x,_32) #define BYTES_IN_WORD 4 #endif /* ARCH_SIZE==32 */ +#endif /* ARCH_SIZE==64 */ /* Declare at file level, since used in parameter lists, which have weird scope. */ @@ -126,7 +193,8 @@ struct aout_backend_data /* Callback for setting the page and segment sizes, if they can't be trivially determined from the architecture. */ - boolean (*set_sizes) PARAMS ((bfd *)); + boolean (*set_sizes) + PARAMS ((bfd *)); /* zmagic files only. For go32, the length of the exec header contributes to the size of the text section in the file for alignment purposes but @@ -135,44 +203,43 @@ struct aout_backend_data /* Callback from the add symbols phase of the linker code to handle a dynamic object. */ - boolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *, - struct external_nlist **, - bfd_size_type *, char **)); + boolean (*add_dynamic_symbols) + PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **, + bfd_size_type *, char **)); /* Callback from the add symbols phase of the linker code to handle adding a single symbol to the global linker hash table. */ - boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, - const char *, flagword, asection *, - bfd_vma, const char *, boolean, - boolean, - struct bfd_link_hash_entry **)); + boolean (*add_one_symbol) + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, + asection *, bfd_vma, const char *, boolean, boolean, + struct bfd_link_hash_entry **)); /* Called to handle linking a dynamic object. */ - boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *)); + boolean (*link_dynamic_object) + PARAMS ((struct bfd_link_info *, bfd *)); /* Called for each global symbol being written out by the linker. This should write out the dynamic symbol information. */ - boolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *, - struct aout_link_hash_entry *)); + boolean (*write_dynamic_symbol) + PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *)); /* If this callback is not NULL, the linker calls it for each reloc. RELOC is a pointer to the unswapped reloc. If *SKIP is set to true, the reloc will be skipped. *RELOCATION may be changed to change the effects of the relocation. */ - boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info, - bfd *input_bfd, - asection *input_section, - struct aout_link_hash_entry *h, - PTR reloc, bfd_byte *contents, - boolean *skip, - bfd_vma *relocation)); + boolean (*check_dynamic_reloc) + PARAMS ((struct bfd_link_info *info, bfd *input_bfd, + asection *input_section, struct aout_link_hash_entry *h, + PTR reloc, bfd_byte *contents, boolean *skip, + bfd_vma *relocation)); /* Called at the end of a link to finish up any dynamic linking information. */ - boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *)); + boolean (*finish_dynamic_link) + PARAMS ((bfd *, struct bfd_link_info *)); }; #define aout_backend_info(abfd) \ - ((CONST struct aout_backend_data *)((abfd)->xvec->backend_data)) + ((const struct aout_backend_data *)((abfd)->xvec->backend_data)) /* This is the layout in memory of a "struct exec" while we process it. All 'lengths' are given as a number of bytes. @@ -199,7 +266,7 @@ struct internal_exec char a_relaxable; /* Enough info for linker relax */ }; -/* Magic number is written +/* Magic number is written < MSB > 3130292827262524232221201918171615141312111009080706050403020100 < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > @@ -273,7 +340,7 @@ enum machine_type { #ifndef N_SET_DYNAMIC # define N_SET_DYNAMIC(exec, dynamic) \ -((exec).a_info = (dynamic) ? ((exec).a_info | 0x80000000) : \ +((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \ ((exec).a_info & 0x7fffffff)) #endif @@ -308,7 +375,7 @@ typedef struct aout_symbol { struct aoutdata { struct internal_exec *hdr; /* exec file header */ aout_symbol_type *symbols; /* symtab for input bfd */ - + /* For ease, we do this */ asection *textsec; asection *datasec; @@ -423,151 +490,131 @@ struct aout_section_data_struct /* Prototype declarations for functions defined in aoutx.h */ -boolean -NAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section)); +extern boolean NAME(aout,squirt_out_relocs) + PARAMS ((bfd *, asection *)); -boolean -NAME(aout,make_sections) PARAMS ((bfd *)); +extern boolean NAME(aout,make_sections) + PARAMS ((bfd *)); -const bfd_target * -NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback)(bfd *))); +extern const bfd_target * NAME(aout,some_aout_object_p) + PARAMS ((bfd *, struct internal_exec *, const bfd_target *(*) (bfd *))); -boolean -NAME(aout,mkobject) PARAMS ((bfd *abfd)); +extern boolean NAME(aout,mkobject) + PARAMS ((bfd *)); -enum machine_type -NAME(aout,machine_type) PARAMS ((enum bfd_architecture arch, - unsigned long machine, - boolean *unknown)); +extern enum machine_type NAME(aout,machine_type) + PARAMS ((enum bfd_architecture, unsigned long, boolean *)); -boolean -NAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch, - unsigned long machine)); +extern boolean NAME(aout,set_arch_mach) + PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -boolean -NAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect)); +extern boolean NAME(aout,new_section_hook) + PARAMS ((bfd *, asection *)); -boolean -NAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section, - PTR location, file_ptr offset, bfd_size_type count)); +extern boolean NAME(aout,set_section_contents) + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); -asymbol * -NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd)); +extern asymbol * NAME(aout,make_empty_symbol) + PARAMS ((bfd *)); -boolean -NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *, - struct external_nlist *, - bfd_size_type, char *, - bfd_size_type, - boolean dynamic)); +extern boolean NAME(aout,translate_symbol_table) + PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type, + char *, bfd_size_type, boolean)); -boolean -NAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd)); +extern boolean NAME(aout,slurp_symbol_table) + PARAMS ((bfd *)); -boolean -NAME(aout,write_syms) PARAMS ((bfd *abfd)); +extern boolean NAME(aout,write_syms) + PARAMS ((bfd *)); -void -NAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd)); +extern void NAME(aout,reclaim_symbol_table) + PARAMS ((bfd *)); -long -NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd)); +extern long NAME(aout,get_symtab_upper_bound) + PARAMS ((bfd *)); -long -NAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location)); +extern long NAME(aout,get_symtab) + PARAMS ((bfd *, asymbol **)); -void -NAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *, - arelent *, asymbol **, bfd_size_type)); -void -NAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, - arelent *, asymbol **, bfd_size_type)); +extern void NAME(aout,swap_ext_reloc_in) + PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **, + bfd_size_type)); +extern void NAME(aout,swap_std_reloc_in) + PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, + bfd_size_type)); -reloc_howto_type * -NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd, - bfd_reloc_code_real_type code)); +extern reloc_howto_type * NAME(aout,reloc_type_lookup) + PARAMS ((bfd *, bfd_reloc_code_real_type)); -boolean -NAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect, - asymbol **symbols)); +extern boolean NAME(aout,slurp_reloc_table) + PARAMS ((bfd *, sec_ptr, asymbol **)); -long -NAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section, - arelent **relptr, asymbol **symbols)); +extern long NAME(aout,canonicalize_reloc) + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); -long -NAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect)); +extern long NAME(aout,get_reloc_upper_bound) + PARAMS ((bfd *, sec_ptr)); -void -NAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore)); +extern void NAME(aout,reclaim_reloc) + PARAMS ((bfd *, sec_ptr)); -alent * -NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol)); +extern alent * NAME(aout,get_lineno) + PARAMS ((bfd *, asymbol *)); -void -NAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file, - asymbol *symbol, bfd_print_symbol_type how)); +extern void NAME(aout,print_symbol) + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); -void -NAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd, - asymbol *symbol, symbol_info *ret)); +extern void NAME(aout,get_symbol_info) + PARAMS ((bfd *, asymbol *, symbol_info *)); -boolean -NAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section, - asymbol **symbols, bfd_vma offset, CONST char **filename_ptr, - CONST char **functionname_ptr, unsigned int *line_ptr)); +extern boolean NAME(aout,find_nearest_line) + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); -long -NAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *)); +extern long NAME(aout,read_minisymbols) + PARAMS ((bfd *, boolean, PTR *, unsigned int *)); -asymbol * -NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, - asymbol *)); +extern asymbol * NAME(aout,minisymbol_to_symbol) + PARAMS ((bfd *, boolean, const PTR, asymbol *)); -int -NAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec)); +extern int NAME(aout,sizeof_headers) + PARAMS ((bfd *, boolean)); -boolean -NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd, - bfd_size_type *text_size, file_ptr *text_end)); +extern boolean NAME(aout,adjust_sizes_and_vmas) + PARAMS ((bfd *, bfd_size_type *, file_ptr *)); -void -NAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd, - struct external_exec *raw_bytes, struct internal_exec *execp)); +extern void NAME(aout,swap_exec_header_in) + PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); -void -NAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd, - struct internal_exec *execp, struct external_exec *raw_bytes)); +extern void NAME(aout,swap_exec_header_out) + PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); -struct bfd_hash_entry * -NAME(aout,link_hash_newfunc) +extern struct bfd_hash_entry * NAME(aout,link_hash_newfunc) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -boolean -NAME(aout,link_hash_table_init) - PARAMS ((struct aout_link_hash_table *, bfd *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); +extern boolean NAME(aout,link_hash_table_init) + PARAMS ((struct aout_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *))); -struct bfd_link_hash_table * -NAME(aout,link_hash_table_create) PARAMS ((bfd *)); +extern struct bfd_link_hash_table * NAME(aout,link_hash_table_create) + PARAMS ((bfd *)); -boolean -NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean NAME(aout,link_add_symbols) + PARAMS ((bfd *, struct bfd_link_info *)); -boolean -NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *, - void (*) (bfd *, file_ptr *, file_ptr *, - file_ptr *))); +extern boolean NAME(aout,final_link) + PARAMS ((bfd *, struct bfd_link_info *, + void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *))); -boolean -NAME(aout,bfd_free_cached_info) PARAMS ((bfd *)); +extern boolean NAME(aout,bfd_free_cached_info) + PARAMS ((bfd *)); /* A.out uses the generic versions of these routines... */ +#define aout_16_get_section_contents _bfd_generic_get_section_contents + #define aout_32_get_section_contents _bfd_generic_get_section_contents #define aout_64_get_section_contents _bfd_generic_get_section_contents @@ -596,31 +643,32 @@ NAME(aout,bfd_free_cached_info) PARAMS ((bfd *)); obj_reloc_entry_size (abfd)); \ NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \ \ - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false; \ - if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) \ - != EXEC_BYTES_SIZE) \ + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \ + || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \ + 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) \ + if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\ return false; \ \ - if (! NAME(aout,write_syms)(abfd)) return false; \ + if (! NAME(aout,write_syms) (abfd)) \ + return false; \ } \ \ - if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET) != 0) \ + 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) \ + if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0) \ return false; \ - if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) \ + if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd))) \ return false; \ - } + } #endif #endif /* ! defined (LIBAOUT_H) */ diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h index dc2cd11..ed417ca 100644 --- a/contrib/binutils/bfd/libbfd-in.h +++ b/contrib/binutils/bfd/libbfd-in.h @@ -5,10 +5,6 @@ Free Software Foundation, Inc. Written by Cygnus Support. -** NOTE: libbfd.h is a GENERATED file. Don't change it; instead, -** change libbfd-in.h or the other BFD source files processed to -** generate this file. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -29,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 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))) \ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ : ~ (bfd_vma) 0) /* If you want to read and write large blocks, you might want to do it @@ -87,20 +83,20 @@ struct areltdata { #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) -extern PTR bfd_malloc PARAMS ((size_t)); -extern PTR bfd_realloc PARAMS ((PTR, size_t)); -extern PTR bfd_zmalloc PARAMS ((size_t)); +extern PTR bfd_malloc PARAMS ((bfd_size_type)); +extern PTR bfd_realloc PARAMS ((PTR, bfd_size_type)); +extern PTR bfd_zmalloc PARAMS ((bfd_size_type)); extern bfd_error_handler_type _bfd_error_handler; /* These routines allocate and free things on the BFD's objalloc. */ -extern PTR bfd_alloc PARAMS ((bfd *, size_t)); -extern PTR bfd_zalloc PARAMS ((bfd *, size_t)); +extern PTR bfd_alloc PARAMS ((bfd *, bfd_size_type)); +extern PTR bfd_zalloc PARAMS ((bfd *, bfd_size_type)); extern void bfd_release PARAMS ((bfd *, PTR)); bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd)); -bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index)); +bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *, file_ptr)); boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *)); boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd)); const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd)); @@ -116,6 +112,7 @@ boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength)); bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos)); extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex)); bfd * _bfd_new_bfd PARAMS ((void)); +void _bfd_delete_bfd PARAMS ((bfd *)); boolean bfd_false PARAMS ((bfd *ignore)); boolean bfd_true PARAMS ((bfd *ignore)); @@ -162,8 +159,7 @@ int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); #define _bfd_generic_new_section_hook \ ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) extern boolean _bfd_generic_get_section_contents - PARAMS ((bfd *, asection *, PTR location, file_ptr offset, - bfd_size_type count)); + PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); extern boolean _bfd_generic_get_section_contents_in_window PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type)); @@ -255,8 +251,7 @@ extern boolean _bfd_archive_coff_construct_extended_name_table #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 #define _bfd_nosymbols_get_symtab \ ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) -#define _bfd_nosymbols_make_empty_symbol \ - ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) #define _bfd_nosymbols_get_symbol_info \ @@ -323,6 +318,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_merge_sections \ + ((boolean (*) \ + PARAMS ((bfd *, struct bfd_link_info *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_add_symbols \ @@ -369,6 +368,10 @@ extern boolean _bfd_dwarf2_find_nearest_line const char **, unsigned int *, unsigned int, PTR *)); +/* Create a new section entry. */ +extern struct bfd_hash_entry *bfd_section_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + /* 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, @@ -436,7 +439,7 @@ extern unsigned int _bfd_count_link_order_relocs /* Final link relocation routine. */ extern bfd_reloc_status_type _bfd_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, - bfd_vma address, bfd_vma value, bfd_vma addend)); + bfd_vma, bfd_vma, bfd_vma)); /* Relocate a particular location by a howto and a value. */ extern bfd_reloc_status_type _bfd_relocate_contents @@ -447,6 +450,11 @@ extern bfd_reloc_status_type _bfd_relocate_contents extern boolean _bfd_link_section_stabs PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); +/* Eliminate stabs for discarded functions and symbols. */ +extern boolean _bfd_discard_section_stabs + PARAMS ((bfd *, asection *, PTR, + boolean (*) (bfd_vma, PTR), PTR)); + /* Write out the .stab section when linking stabs in sections. */ extern boolean _bfd_write_section_stabs @@ -462,6 +470,26 @@ extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); extern bfd_vma _bfd_stab_section_offset PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma)); +/* Attempt to merge a SEC_MERGE section. */ + +extern boolean _bfd_merge_section + PARAMS ((bfd *, PTR *, asection *, PTR *)); + +/* Attempt to merge SEC_MERGE sections. */ + +extern boolean _bfd_merge_sections + PARAMS ((bfd *, PTR, void (*)(bfd *, asection *))); + +/* Write out a merged section. */ + +extern boolean _bfd_write_merged_section + PARAMS ((bfd *, asection *, PTR)); + +/* Find an offset within a modified SEC_MERGE section. */ + +extern bfd_vma _bfd_merged_section_offset + PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma)); + /* Create a string table. */ extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c index 695df8d..5aa51ae 100644 --- a/contrib/binutils/bfd/libbfd.c +++ b/contrib/binutils/bfd/libbfd.c @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define getpagesize() 2048 #endif -static int real_read PARAMS ((PTR, size_t, size_t, FILE *)); +static size_t real_read PARAMS ((PTR, size_t, size_t, FILE *)); /* SECTION @@ -153,13 +153,20 @@ _bfd_dummy_target (ignore_abfd) PTR bfd_malloc (size) - size_t size; + bfd_size_type size; { PTR ptr; - ptr = (PTR) malloc (size); - if (ptr == NULL && size != 0) + if (size != (size_t) size) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } + + ptr = (PTR) malloc ((size_t) size); + if (ptr == NULL && (size_t) size != 0) bfd_set_error (bfd_error_no_memory); + return ptr; } @@ -168,16 +175,22 @@ bfd_malloc (size) PTR bfd_realloc (ptr, size) PTR ptr; - size_t size; + bfd_size_type size; { PTR ret; + if (size != (size_t) size) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } + if (ptr == NULL) - ret = malloc (size); + ret = malloc ((size_t) size); else - ret = realloc (ptr, size); + ret = realloc (ptr, (size_t) size); - if (ret == NULL) + if (ret == NULL && (size_t) size != 0) bfd_set_error (bfd_error_no_memory); return ret; @@ -187,18 +200,24 @@ bfd_realloc (ptr, size) PTR bfd_zmalloc (size) - size_t size; + bfd_size_type size; { PTR ptr; - ptr = (PTR) malloc (size); + if (size != (size_t) size) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } - if (size != 0) + ptr = (PTR) malloc ((size_t) size); + + if ((size_t) size != 0) { if (ptr == NULL) bfd_set_error (bfd_error_no_memory); else - memset (ptr, 0, size); + memset (ptr, 0, (size_t) size); } return ptr; @@ -213,8 +232,8 @@ bfd_zmalloc (size) contents (0 for non-archive elements). For archive entries this is the first octet in the file, NOT the beginning of the archive header. */ -static int -real_read (where, a,b, file) +static size_t +real_read (where, a, b, file) PTR where; size_t a; size_t b; @@ -242,17 +261,15 @@ real_read (where, a,b, file) #endif } -/* Return value is amount read (FIXME: how are errors and end of file dealt - with? We never call bfd_set_error, which is probably a mistake). */ +/* Return value is amount read. */ bfd_size_type -bfd_read (ptr, size, nitems, abfd) +bfd_bread (ptr, size, abfd) PTR ptr; bfd_size_type size; - bfd_size_type nitems; bfd *abfd; { - int nread; + size_t nread; if ((abfd->flags & BFD_IN_MEMORY) != 0) { @@ -260,7 +277,7 @@ bfd_read (ptr, size, nitems, abfd) bfd_size_type get; bim = (struct bfd_in_memory *) abfd->iostream; - get = size * nitems; + get = size; if (abfd->where + get > bim->size) { if (bim->size < (bfd_size_type) abfd->where) @@ -269,13 +286,13 @@ bfd_read (ptr, size, nitems, abfd) get = bim->size - abfd->where; bfd_set_error (bfd_error_file_truncated); } - memcpy (ptr, bim->buffer + abfd->where, get); + memcpy (ptr, bim->buffer + abfd->where, (size_t) get); abfd->where += get; return get; } - nread = real_read (ptr, 1, (size_t) (size*nitems), bfd_cache_lookup(abfd)); - if (nread > 0) + nread = real_read (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); + if (nread != (size_t) -1) abfd->where += nread; /* Set bfd_error if we did not read as much data as we expected. @@ -285,7 +302,7 @@ bfd_read (ptr, size, nitems, abfd) A BFD backend may wish to override bfd_error_file_truncated to provide something more useful (eg. no_symbols or wrong_format). */ - if (nread != (int) (size * nitems)) + if (nread != size) { if (ferror (bfd_cache_lookup (abfd))) bfd_set_error (bfd_error_system_call); @@ -386,7 +403,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) { static size_t pagesize; bfd_window_internal *i = windowp->i; - size_t size_to_alloc = size; + bfd_size_type size_to_alloc = size; if (debug_windows) fprintf (stderr, "bfd_get_file_window (%p, %6ld, %6ld, %p<%p,%lx,%p>, %d)", @@ -402,7 +419,9 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) if (i == 0) { - windowp->i = i = (bfd_window_internal *) bfd_zmalloc (sizeof (bfd_window_internal)); + i = ((bfd_window_internal *) + bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); + windowp->i = i; if (i == 0) return false; i->data = 0; @@ -497,12 +516,11 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) { if (size_to_alloc == 0) return true; - bfd_set_error (bfd_error_no_memory); return false; } if (bfd_seek (abfd, offset, SEEK_SET) != 0) return false; - i->size = bfd_read (i->data, size, 1, abfd); + i->size = bfd_bread (i->data, size, abfd); if (i->size != size) return false; i->mapped = 0; @@ -523,24 +541,25 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) #endif /* USE_MMAP */ bfd_size_type -bfd_write (ptr, size, nitems, abfd) - CONST PTR ptr; +bfd_bwrite (ptr, size, abfd) + const PTR ptr; bfd_size_type size; - bfd_size_type nitems; bfd *abfd; { - long nwrote; + size_t nwrote; if ((abfd->flags & BFD_IN_MEMORY) != 0) { struct bfd_in_memory *bim = (struct bfd_in_memory *) (abfd->iostream); - size *= nitems; + size = (size_t) size; if (abfd->where + size > bim->size) { - long newsize, oldsize = (bim->size + 127) & ~127; + bfd_size_type newsize, oldsize; + + oldsize = (bim->size + 127) & ~(bfd_size_type) 127; bim->size = abfd->where + size; /* Round up to cut down on memory fragmentation */ - newsize = (bim->size + 127) & ~127; + newsize = (bim->size + 127) & ~(bfd_size_type) 127; if (newsize > oldsize) { bim->buffer = bfd_realloc (bim->buffer, newsize); @@ -551,20 +570,18 @@ bfd_write (ptr, size, nitems, abfd) } } } - memcpy (bim->buffer + abfd->where, ptr, size); + memcpy (bim->buffer + abfd->where, ptr, (size_t) size); abfd->where += size; return size; } - nwrote = fwrite (ptr, 1, (size_t) (size * nitems), - bfd_cache_lookup (abfd)); - if (nwrote > 0) + nwrote = fwrite (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); + if (nwrote != (size_t) -1) abfd->where += nwrote; - if ((bfd_size_type) nwrote != size * nitems) + if (nwrote != size) { #ifdef ENOSPC - if (nwrote >= 0) - errno = ENOSPC; + errno = ENOSPC; #endif bfd_set_error (bfd_error_system_call); } @@ -576,7 +593,7 @@ INTERNAL_FUNCTION bfd_write_bigendian_4byte_int SYNOPSIS - void bfd_write_bigendian_4byte_int(bfd *abfd, int i); + void bfd_write_bigendian_4byte_int (bfd *, unsigned int); DESCRIPTION Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big @@ -587,15 +604,15 @@ DESCRIPTION void bfd_write_bigendian_4byte_int (abfd, i) bfd *abfd; - int i; + unsigned int i; { bfd_byte buffer[4]; - bfd_putb32(i, buffer); - if (bfd_write((PTR)buffer, 4, 1, abfd) != 4) + bfd_putb32 ((bfd_vma) i, buffer); + if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) != 4) abort (); } -long +bfd_vma bfd_tell (abfd) bfd *abfd; { @@ -604,7 +621,7 @@ bfd_tell (abfd) if ((abfd->flags & BFD_IN_MEMORY) != 0) return abfd->where; - ptr = ftell (bfd_cache_lookup(abfd)); + ptr = ftell (bfd_cache_lookup (abfd)); if (abfd->my_archive) ptr -= abfd->origin; @@ -657,7 +674,7 @@ bfd_seek (abfd, position, direction) { int result; FILE *f; - file_ptr file_position; + long file_position; /* For the time being, a BFD may not seek to it's end. The problem is that we don't easily have a way to recognize the end of an element in an archive. */ @@ -678,22 +695,22 @@ bfd_seek (abfd, position, direction) else abfd->where += position; - if ((bfd_size_type) abfd->where > bim->size) + if (abfd->where > bim->size) { if ((abfd->direction == write_direction) || (abfd->direction == both_direction)) { - long newsize, oldsize = (bim->size + 127) & ~127; + bfd_size_type newsize, oldsize; + oldsize = (bim->size + 127) & ~(bfd_size_type) 127; bim->size = abfd->where; /* Round up to cut down on memory fragmentation */ - newsize = (bim->size + 127) & ~127; + newsize = (bim->size + 127) & ~(bfd_size_type) 127; if (newsize > oldsize) { bim->buffer = bfd_realloc (bim->buffer, newsize); if (bim->buffer == 0) { bim->size = 0; - bfd_set_error (bfd_error_no_memory); return -1; } } @@ -724,7 +741,7 @@ bfd_seek (abfd, position, direction) if (where_am_i_now != abfd->where) abort (); #endif - if (direction == SEEK_SET && position == abfd->where) + if (direction == SEEK_SET && (bfd_vma) position == abfd->where) return 0; } else @@ -819,9 +836,9 @@ DESCRIPTION .#define bfd_put_signed_8 \ . bfd_put_8 .#define bfd_get_8(abfd, ptr) \ -. (*(unsigned char *) (ptr)) +. (*(unsigned char *) (ptr) & 0xff) .#define bfd_get_signed_8(abfd, ptr) \ -. ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) +. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) . .#define bfd_put_16(abfd, val, ptr) \ . BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -851,14 +868,14 @@ DESCRIPTION . BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) . .#define bfd_get(bits, abfd, ptr) \ -. ((bits) == 8 ? bfd_get_8 (abfd, ptr) \ +. ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ . : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ . : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ . : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ . : (abort (), (bfd_vma) - 1)) . .#define bfd_put(bits, abfd, val, ptr) \ -. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ +. ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ . : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ . : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ . : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ @@ -873,7 +890,7 @@ FUNCTION DESCRIPTION These macros have the same function as their <> - bretheren, except that they are used for removing information + brethren, except that they are used for removing information for the header records of object files. Believe it or not, some object files keep their header records in big endian order and their data in little endian order. @@ -881,42 +898,89 @@ DESCRIPTION .{* 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)) +. 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)) +. 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)) +. 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)) +. 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)) +. 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)) +. 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)) . -*/ +.{* Refinements on the above, which should eventually go away. Save +. cluttering the source with (bfd_vma) and (bfd_byte *) casts. *} +. +.#define H_PUT_64(abfd, val, where) \ +. bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_32(abfd, val, where) \ +. bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_16(abfd, val, where) \ +. bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_8 bfd_h_put_8 +. +.#define H_PUT_S64(abfd, val, where) \ +. bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_S32(abfd, val, where) \ +. bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_S16(abfd, val, where) \ +. bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +. +.#define H_PUT_S8 bfd_h_put_signed_8 +. +.#define H_GET_64(abfd, where) \ +. bfd_h_get_64 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_32(abfd, where) \ +. bfd_h_get_32 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_16(abfd, where) \ +. bfd_h_get_16 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_8 bfd_h_get_8 +. +.#define H_GET_S64(abfd, where) \ +. bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_S32(abfd, where) \ +. bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_S16(abfd, where) \ +. bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) +. +.#define H_GET_S8 bfd_h_get_signed_8 +. +.*/ /* Sign extension to bfd_signed_vma. */ #define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000) @@ -1240,14 +1304,14 @@ _bfd_generic_get_section_contents (abfd, section, location, offset, count) if (count == 0) return true; - if ((bfd_size_type) (offset + count) > section->_raw_size) + if (offset + count > section->_raw_size) { bfd_set_error (bfd_error_invalid_operation); return false; } if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 - || bfd_read (location, (bfd_size_type) 1, count, abfd) != count) + || bfd_bread (location, count, abfd) != count) return false; return true; @@ -1272,10 +1336,11 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) /* @@ FIXME : If the internal window has a refcount of 1 and was allocated with malloc instead of mmap, just reuse it. */ bfd_free_window (w); - w->i = (bfd_window_internal *) bfd_zmalloc (sizeof (bfd_window_internal)); + w->i = ((bfd_window_internal *) + bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); if (w->i == NULL) return false; - w->i->data = (PTR) bfd_malloc ((size_t) count); + w->i->data = (PTR) bfd_malloc (count); if (w->i->data == NULL) { free (w->i); @@ -1288,7 +1353,7 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) w->data = w->i->data; return bfd_get_section_contents (abfd, section, w->data, offset, count); } - if ((bfd_size_type) (offset+count) > section->_raw_size + if (offset + count > section->_raw_size || (bfd_get_file_window (abfd, section->filepos + offset, count, w, true) == false)) return false; @@ -1313,8 +1378,8 @@ _bfd_generic_set_section_contents (abfd, section, location, offset, count) if (count == 0) return true; - if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) == -1 - || bfd_write (location, (bfd_size_type) 1, count, abfd) != count) + if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 + || bfd_bwrite (location, count, abfd) != count) return false; return true; @@ -1325,11 +1390,11 @@ INTERNAL_FUNCTION bfd_log2 SYNOPSIS - unsigned int bfd_log2(bfd_vma x); + unsigned int bfd_log2 (bfd_vma x); DESCRIPTION Return the log base 2 of the value supplied, rounded up. E.g., an - @var{x} of 1025 returns 11. + @var{x} of 1025 returns 11. A @var{x} of 0 returns 0. */ unsigned int @@ -1372,7 +1437,7 @@ _bfd_generic_verify_endian_match (ibfd, obfd) else msg = _("%s: compiled for a little endian system and target is big endian"); - (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); + (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_wrong_format); return false; @@ -1380,3 +1445,26 @@ _bfd_generic_verify_endian_match (ibfd, obfd) return true; } + +/* Give a warning at runtime if someone compiles code which calls + old routines. */ +void +warn_deprecated (what, file, line, func) + const char *what; + const char *file; + int line; + const char *func; +{ + /* Poor man's tracking of functions we've already warned about. */ + static size_t mask = 0; + + if (~(size_t) func & ~mask) + { + fprintf (stderr, _("Deprecated %s called"), what); + if (func) + fprintf (stderr, _(" at %s line %d in %s\n"), file, line, func); + else + fprintf (stderr, "\n"); + mask |= ~(size_t) func; + } +} diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h index 997856a..d055651 100644 --- a/contrib/binutils/bfd/libbfd.h +++ b/contrib/binutils/bfd/libbfd.h @@ -1,3 +1,8 @@ +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "libbfd-in.h", "init.c", "libbfd.c", "cache.c", + "reloc.c", "archures.c" and "elf.c". + Run "make headers" in your build bfd/ to regenerate. */ + /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, @@ -5,10 +10,6 @@ Free Software Foundation, Inc. Written by Cygnus Support. -** NOTE: libbfd.h is a GENERATED file. Don't change it; instead, -** change libbfd-in.h or the other BFD source files processed to -** generate this file. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -29,9 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 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))) \ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ : ~ (bfd_vma) 0) /* If you want to read and write large blocks, you might want to do it @@ -87,20 +88,20 @@ struct areltdata { #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) -extern PTR bfd_malloc PARAMS ((size_t)); -extern PTR bfd_realloc PARAMS ((PTR, size_t)); -extern PTR bfd_zmalloc PARAMS ((size_t)); +extern PTR bfd_malloc PARAMS ((bfd_size_type)); +extern PTR bfd_realloc PARAMS ((PTR, bfd_size_type)); +extern PTR bfd_zmalloc PARAMS ((bfd_size_type)); extern bfd_error_handler_type _bfd_error_handler; /* These routines allocate and free things on the BFD's objalloc. */ -extern PTR bfd_alloc PARAMS ((bfd *, size_t)); -extern PTR bfd_zalloc PARAMS ((bfd *, size_t)); +extern PTR bfd_alloc PARAMS ((bfd *, bfd_size_type)); +extern PTR bfd_zalloc PARAMS ((bfd *, bfd_size_type)); extern void bfd_release PARAMS ((bfd *, PTR)); bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd)); -bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index)); +bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *, file_ptr)); boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *)); boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd)); const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd)); @@ -116,6 +117,7 @@ boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength)); bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos)); extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex)); bfd * _bfd_new_bfd PARAMS ((void)); +void _bfd_delete_bfd PARAMS ((bfd *)); boolean bfd_false PARAMS ((bfd *ignore)); boolean bfd_true PARAMS ((bfd *ignore)); @@ -162,8 +164,7 @@ int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); #define _bfd_generic_new_section_hook \ ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) extern boolean _bfd_generic_get_section_contents - PARAMS ((bfd *, asection *, PTR location, file_ptr offset, - bfd_size_type count)); + PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); extern boolean _bfd_generic_get_section_contents_in_window PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type)); @@ -255,8 +256,7 @@ extern boolean _bfd_archive_coff_construct_extended_name_table #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 #define _bfd_nosymbols_get_symtab \ ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) -#define _bfd_nosymbols_make_empty_symbol \ - ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) #define _bfd_nosymbols_get_symbol_info \ @@ -323,6 +323,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_merge_sections \ + ((boolean (*) \ + PARAMS ((bfd *, struct bfd_link_info *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_add_symbols \ @@ -369,6 +373,10 @@ extern boolean _bfd_dwarf2_find_nearest_line const char **, unsigned int *, unsigned int, PTR *)); +/* Create a new section entry. */ +extern struct bfd_hash_entry *bfd_section_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + /* 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, @@ -436,7 +444,7 @@ extern unsigned int _bfd_count_link_order_relocs /* Final link relocation routine. */ extern bfd_reloc_status_type _bfd_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, - bfd_vma address, bfd_vma value, bfd_vma addend)); + bfd_vma, bfd_vma, bfd_vma)); /* Relocate a particular location by a howto and a value. */ extern bfd_reloc_status_type _bfd_relocate_contents @@ -447,6 +455,11 @@ extern bfd_reloc_status_type _bfd_relocate_contents extern boolean _bfd_link_section_stabs PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); +/* Eliminate stabs for discarded functions and symbols. */ +extern boolean _bfd_discard_section_stabs + PARAMS ((bfd *, asection *, PTR, + boolean (*) (bfd_vma, PTR), PTR)); + /* Write out the .stab section when linking stabs in sections. */ extern boolean _bfd_write_section_stabs @@ -462,6 +475,26 @@ extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); extern bfd_vma _bfd_stab_section_offset PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma)); +/* Attempt to merge a SEC_MERGE section. */ + +extern boolean _bfd_merge_section + PARAMS ((bfd *, PTR *, asection *, PTR *)); + +/* Attempt to merge SEC_MERGE sections. */ + +extern boolean _bfd_merge_sections + PARAMS ((bfd *, PTR, void (*)(bfd *, asection *))); + +/* Write out a merged section. */ + +extern boolean _bfd_write_merged_section + PARAMS ((bfd *, asection *, PTR)); + +/* Find an offset within a modified SEC_MERGE section. */ + +extern bfd_vma _bfd_merged_section_offset + PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma)); + /* Create a string table. */ extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); @@ -554,7 +587,7 @@ extern boolean _bfd_sh_align_load_span /* And more follows */ void -bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i)); +bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int)); unsigned int bfd_log2 PARAMS ((bfd_vma x)); @@ -604,10 +637,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_HI16_GOTOFF", "BFD_RELOC_HI16_S_GOTOFF", "BFD_RELOC_8_GOTOFF", + "BFD_RELOC_64_PLT_PCREL", "BFD_RELOC_32_PLT_PCREL", "BFD_RELOC_24_PLT_PCREL", "BFD_RELOC_16_PLT_PCREL", "BFD_RELOC_8_PLT_PCREL", + "BFD_RELOC_64_PLTOFF", "BFD_RELOC_32_PLTOFF", "BFD_RELOC_16_PLTOFF", "BFD_RELOC_LO16_PLTOFF", @@ -666,6 +701,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_7", "BFD_RELOC_SPARC_6", "BFD_RELOC_SPARC_5", + "BFD_RELOC_SPARC_PLT32", "BFD_RELOC_SPARC_PLT64", "BFD_RELOC_SPARC_HIX22", "BFD_RELOC_SPARC_LOX10", @@ -680,16 +716,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ALPHA_LITERAL", "BFD_RELOC_ALPHA_ELF_LITERAL", "BFD_RELOC_ALPHA_LITUSE", - "BFD_RELOC_ALPHA_USER_LITERAL", - "BFD_RELOC_ALPHA_USER_LITUSE_BASE", - "BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF", - "BFD_RELOC_ALPHA_USER_LITUSE_JSR", - "BFD_RELOC_ALPHA_USER_GPDISP", - "BFD_RELOC_ALPHA_USER_GPRELHIGH", - "BFD_RELOC_ALPHA_USER_GPRELLOW", "BFD_RELOC_ALPHA_HINT", "BFD_RELOC_ALPHA_LINKAGE", "BFD_RELOC_ALPHA_CODEADDR", + "BFD_RELOC_ALPHA_GPREL_HI16", + "BFD_RELOC_ALPHA_GPREL_LO16", "BFD_RELOC_MIPS_JMP", "BFD_RELOC_MIPS16_JMP", "BFD_RELOC_MIPS16_GPREL", @@ -749,6 +780,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_NS32K_DISP_8_PCREL", "BFD_RELOC_NS32K_DISP_16_PCREL", "BFD_RELOC_NS32K_DISP_32_PCREL", + "BFD_RELOC_PDP11_DISP_8_PCREL", + "BFD_RELOC_PDP11_DISP_6_PCREL", "BFD_RELOC_PJ_CODE_HI16", "BFD_RELOC_PJ_CODE_LO16", "BFD_RELOC_PJ_CODE_DIR16", @@ -785,6 +818,29 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_PPC_EMB_RELST_HA", "BFD_RELOC_PPC_EMB_BIT_FLD", "BFD_RELOC_PPC_EMB_RELSDA", + "BFD_RELOC_PPC64_HIGHER", + "BFD_RELOC_PPC64_HIGHER_S", + "BFD_RELOC_PPC64_HIGHEST", + "BFD_RELOC_PPC64_HIGHEST_S", + "BFD_RELOC_PPC64_TOC16_LO", + "BFD_RELOC_PPC64_TOC16_HI", + "BFD_RELOC_PPC64_TOC16_HA", + "BFD_RELOC_PPC64_TOC", + "BFD_RELOC_PPC64_PLTGOT16", + "BFD_RELOC_PPC64_PLTGOT16_LO", + "BFD_RELOC_PPC64_PLTGOT16_HI", + "BFD_RELOC_PPC64_PLTGOT16_HA", + "BFD_RELOC_PPC64_ADDR16_DS", + "BFD_RELOC_PPC64_ADDR16_LO_DS", + "BFD_RELOC_PPC64_GOT16_DS", + "BFD_RELOC_PPC64_GOT16_LO_DS", + "BFD_RELOC_PPC64_PLT16_LO_DS", + "BFD_RELOC_PPC64_SECTOFF_DS", + "BFD_RELOC_PPC64_SECTOFF_LO_DS", + "BFD_RELOC_PPC64_TOC16_DS", + "BFD_RELOC_PPC64_TOC16_LO_DS", + "BFD_RELOC_PPC64_PLTGOT16_DS", + "BFD_RELOC_PPC64_PLTGOT16_LO_DS", "BFD_RELOC_I370_D12", "BFD_RELOC_CTOR", "BFD_RELOC_ARM_PCREL_BRANCH", @@ -908,6 +964,29 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MCORE_PCREL_32", "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2", "BFD_RELOC_MCORE_RVA", + "BFD_RELOC_MMIX_GETA", + "BFD_RELOC_MMIX_GETA_1", + "BFD_RELOC_MMIX_GETA_2", + "BFD_RELOC_MMIX_GETA_3", + "BFD_RELOC_MMIX_CBRANCH", + "BFD_RELOC_MMIX_CBRANCH_J", + "BFD_RELOC_MMIX_CBRANCH_1", + "BFD_RELOC_MMIX_CBRANCH_2", + "BFD_RELOC_MMIX_CBRANCH_3", + "BFD_RELOC_MMIX_PUSHJ", + "BFD_RELOC_MMIX_PUSHJ_1", + "BFD_RELOC_MMIX_PUSHJ_2", + "BFD_RELOC_MMIX_PUSHJ_3", + "BFD_RELOC_MMIX_JMP", + "BFD_RELOC_MMIX_JMP_1", + "BFD_RELOC_MMIX_JMP_2", + "BFD_RELOC_MMIX_JMP_3", + "BFD_RELOC_MMIX_ADDR19", + "BFD_RELOC_MMIX_ADDR27", + "BFD_RELOC_MMIX_REG_OR_BYTE", + "BFD_RELOC_MMIX_REG", + "BFD_RELOC_MMIX_BASE_PLUS_OFFSET", + "BFD_RELOC_MMIX_LOCAL", "BFD_RELOC_AVR_7_PCREL", "BFD_RELOC_AVR_13_PCREL", "BFD_RELOC_AVR_16_PM", @@ -924,6 +1003,23 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AVR_HI8_LDI_PM_NEG", "BFD_RELOC_AVR_HH8_LDI_PM_NEG", "BFD_RELOC_AVR_CALL", + "BFD_RELOC_390_12", + "BFD_RELOC_390_GOT12", + "BFD_RELOC_390_PLT32", + "BFD_RELOC_390_COPY", + "BFD_RELOC_390_GLOB_DAT", + "BFD_RELOC_390_JMP_SLOT", + "BFD_RELOC_390_RELATIVE", + "BFD_RELOC_390_GOTPC", + "BFD_RELOC_390_GOT16", + "BFD_RELOC_390_PC16DBL", + "BFD_RELOC_390_PLT16DBL", + "BFD_RELOC_390_PC32DBL", + "BFD_RELOC_390_PLT32DBL", + "BFD_RELOC_390_GOTPCDBL", + "BFD_RELOC_390_GOT64", + "BFD_RELOC_390_PLT64", + "BFD_RELOC_390_GOTENT", "BFD_RELOC_VTABLE_INHERIT", "BFD_RELOC_VTABLE_ENTRY", "BFD_RELOC_IA64_IMM14", @@ -963,6 +1059,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_IA64_PCREL64LSB", "BFD_RELOC_IA64_LTOFF_FPTR22", "BFD_RELOC_IA64_LTOFF_FPTR64I", + "BFD_RELOC_IA64_LTOFF_FPTR32MSB", + "BFD_RELOC_IA64_LTOFF_FPTR32LSB", "BFD_RELOC_IA64_LTOFF_FPTR64MSB", "BFD_RELOC_IA64_LTOFF_FPTR64LSB", "BFD_RELOC_IA64_SEGREL32MSB", @@ -998,6 +1096,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_CRIS_SIGNED_6", "BFD_RELOC_CRIS_UNSIGNED_6", "BFD_RELOC_CRIS_UNSIGNED_4", + "BFD_RELOC_CRIS_COPY", + "BFD_RELOC_CRIS_GLOB_DAT", + "BFD_RELOC_CRIS_JUMP_SLOT", + "BFD_RELOC_CRIS_RELATIVE", + "BFD_RELOC_CRIS_32_GOT", + "BFD_RELOC_CRIS_16_GOT", + "BFD_RELOC_CRIS_32_GOTPLT", + "BFD_RELOC_CRIS_16_GOTPLT", + "BFD_RELOC_CRIS_32_GOTREL", + "BFD_RELOC_CRIS_32_PLT_GOTREL", + "BFD_RELOC_CRIS_32_PLT_PCREL", "BFD_RELOC_860_COPY", "BFD_RELOC_860_GLOB_DAT", "BFD_RELOC_860_JUMP_SLOT", @@ -1030,6 +1139,16 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_860_HIGH", "BFD_RELOC_860_HIGOT", "BFD_RELOC_860_HIGOTOFF", + "BFD_RELOC_OPENRISC_ABS_26", + "BFD_RELOC_OPENRISC_REL_26", + "BFD_RELOC_H8_DIR16A8", + "BFD_RELOC_H8_DIR16R8", + "BFD_RELOC_H8_DIR24A8", + "BFD_RELOC_H8_DIR24R8", + "BFD_RELOC_H8_DIR32A16", + "BFD_RELOC_XSTORMY16_REL_12", + "BFD_RELOC_XSTORMY16_24", + "BFD_RELOC_XSTORMY16_FPTR16", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif @@ -1046,6 +1165,9 @@ bfd_generic_relax_section PARAMS ((bfd *abfd, boolean bfd_generic_gc_sections PARAMS ((bfd *, struct bfd_link_info *)); +boolean +bfd_generic_merge_sections PARAMS ((bfd *, struct bfd_link_info *)); + bfd_byte * bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *link_info, diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h index 8368cc8..bbccbba 100644 --- a/contrib/binutils/bfd/libcoff-in.h +++ b/contrib/binutils/bfd/libcoff-in.h @@ -4,9 +4,6 @@ Free Software Foundation, Inc. Written by Cygnus Support. -** NOTE: libcoff.h is a GENERATED file. Don't change it; instead, -** change libcoff-in.h or coffcode.h. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -176,7 +173,7 @@ struct xcoff_tdata #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data) -/* We take the address of the first element of a asymbol to ensure that the +/* We take the address of the first element of an asymbol to ensure that the * macro is only ever applied to an asymbol. */ #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) @@ -302,50 +299,64 @@ struct coff_link_hash_table #define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash)) /* Functions in coffgen.c. */ -extern const bfd_target *coff_object_p PARAMS ((bfd *)); -extern struct sec *coff_section_from_bfd_index PARAMS ((bfd *, int)); -extern long coff_get_symtab_upper_bound PARAMS ((bfd *)); -extern long coff_get_symtab PARAMS ((bfd *, asymbol **)); -extern int coff_count_linenumbers PARAMS ((bfd *)); -extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *)); -extern boolean coff_renumber_symbols PARAMS ((bfd *, int *)); -extern void coff_mangle_symbols PARAMS ((bfd *)); -extern boolean coff_write_symbols PARAMS ((bfd *)); -extern boolean coff_write_linenumbers PARAMS ((bfd *)); -extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *)); -extern asymbol *coff_section_symbol PARAMS ((bfd *, char *)); -extern boolean _bfd_coff_get_external_symbols PARAMS ((bfd *)); -extern const char *_bfd_coff_read_string_table PARAMS ((bfd *)); -extern boolean _bfd_coff_free_symbols PARAMS ((bfd *)); -extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *)); -extern long coff_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); -extern asymbol *coff_make_empty_symbol PARAMS ((bfd *)); -extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, - bfd_print_symbol_type how)); -extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *, - symbol_info *ret)); -extern boolean _bfd_coff_is_local_label_name PARAMS ((bfd *, const char *)); -extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, - unsigned long)); -extern boolean coff_find_nearest_line PARAMS ((bfd *, - asection *, - asymbol **, - bfd_vma offset, - CONST char **filename_ptr, - CONST char **functionname_ptr, - unsigned int *line_ptr)); -extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc)); +extern const bfd_target *coff_object_p + PARAMS ((bfd *)); +extern struct sec *coff_section_from_bfd_index + PARAMS ((bfd *, int)); +extern long coff_get_symtab_upper_bound + PARAMS ((bfd *)); +extern long coff_get_symtab + PARAMS ((bfd *, asymbol **)); +extern int coff_count_linenumbers + PARAMS ((bfd *)); +extern struct coff_symbol_struct *coff_symbol_from + PARAMS ((bfd *, asymbol *)); +extern boolean coff_renumber_symbols + PARAMS ((bfd *, int *)); +extern void coff_mangle_symbols + PARAMS ((bfd *)); +extern boolean coff_write_symbols + PARAMS ((bfd *)); +extern boolean coff_write_linenumbers + PARAMS ((bfd *)); +extern alent *coff_get_lineno + PARAMS ((bfd *, asymbol *)); +extern asymbol *coff_section_symbol + PARAMS ((bfd *, char *)); +extern boolean _bfd_coff_get_external_symbols + PARAMS ((bfd *)); +extern const char *_bfd_coff_read_string_table + PARAMS ((bfd *)); +extern boolean _bfd_coff_free_symbols + PARAMS ((bfd *)); +extern struct coff_ptr_struct *coff_get_normalized_symtab + PARAMS ((bfd *)); +extern long coff_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +extern asymbol *coff_make_empty_symbol + PARAMS ((bfd *)); +extern void coff_print_symbol + PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type)); +extern void coff_get_symbol_info + PARAMS ((bfd *, asymbol *, symbol_info *ret)); +extern boolean _bfd_coff_is_local_label_name + PARAMS ((bfd *, const char *)); +extern asymbol *coff_bfd_make_debug_symbol + PARAMS ((bfd *, PTR, unsigned long)); +extern boolean coff_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +extern int coff_sizeof_headers + PARAMS ((bfd *, boolean)); extern boolean bfd_coff_reloc16_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean relocateable, asymbol **)); -extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, - struct bfd_link_info *, - asection *)); -extern void bfd_perform_slip PARAMS ((bfd *abfd, unsigned int slip, - asection *input_section, - bfd_vma val)); + bfd_byte *, boolean, asymbol **)); +extern bfd_vma bfd_coff_reloc16_get_value + PARAMS ((arelent *, struct bfd_link_info *, asection *)); +extern void bfd_perform_slip + PARAMS ((bfd *, unsigned int, asection *, bfd_vma)); /* Functions and types in cofflink.c. */ @@ -559,10 +570,12 @@ extern boolean _bfd_coff_reloc_link_order /* Functions in xcofflink.c. */ -extern long _bfd_xcoff_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); +extern long _bfd_xcoff_get_dynamic_symtab_upper_bound + PARAMS ((bfd *)); extern long _bfd_xcoff_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); -extern long _bfd_xcoff_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); +extern long _bfd_xcoff_get_dynamic_reloc_upper_bound + PARAMS ((bfd *)); extern long _bfd_xcoff_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create @@ -578,7 +591,8 @@ extern boolean _bfd_ppc_xcoff_relocate_section /* Functions in coff-ppc.c. FIXME: These are called be pe.em in the linker, and so should start with bfd and be declared in bfd.h. */ -extern boolean ppc_allocate_toc_section PARAMS ((struct bfd_link_info *)); +extern boolean ppc_allocate_toc_section + PARAMS ((struct bfd_link_info *)); extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h index 34fed2d..f26a692 100644 --- a/contrib/binutils/bfd/libcoff.h +++ b/contrib/binutils/bfd/libcoff.h @@ -1,12 +1,13 @@ +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "libcoff-in.h" and "coffcode.h". + Run "make headers" in your build bfd/ to regenerate. */ + /* BFD COFF object file private structure. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. -** NOTE: libcoff.h is a GENERATED file. Don't change it; instead, -** change libcoff-in.h or coffcode.h. - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -176,7 +177,7 @@ struct xcoff_tdata #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data) -/* We take the address of the first element of a asymbol to ensure that the +/* We take the address of the first element of an asymbol to ensure that the * macro is only ever applied to an asymbol. */ #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) @@ -302,50 +303,64 @@ struct coff_link_hash_table #define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash)) /* Functions in coffgen.c. */ -extern const bfd_target *coff_object_p PARAMS ((bfd *)); -extern struct sec *coff_section_from_bfd_index PARAMS ((bfd *, int)); -extern long coff_get_symtab_upper_bound PARAMS ((bfd *)); -extern long coff_get_symtab PARAMS ((bfd *, asymbol **)); -extern int coff_count_linenumbers PARAMS ((bfd *)); -extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *)); -extern boolean coff_renumber_symbols PARAMS ((bfd *, int *)); -extern void coff_mangle_symbols PARAMS ((bfd *)); -extern boolean coff_write_symbols PARAMS ((bfd *)); -extern boolean coff_write_linenumbers PARAMS ((bfd *)); -extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *)); -extern asymbol *coff_section_symbol PARAMS ((bfd *, char *)); -extern boolean _bfd_coff_get_external_symbols PARAMS ((bfd *)); -extern const char *_bfd_coff_read_string_table PARAMS ((bfd *)); -extern boolean _bfd_coff_free_symbols PARAMS ((bfd *)); -extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *)); -extern long coff_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); -extern asymbol *coff_make_empty_symbol PARAMS ((bfd *)); -extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, - bfd_print_symbol_type how)); -extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *, - symbol_info *ret)); -extern boolean _bfd_coff_is_local_label_name PARAMS ((bfd *, const char *)); -extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, - unsigned long)); -extern boolean coff_find_nearest_line PARAMS ((bfd *, - asection *, - asymbol **, - bfd_vma offset, - CONST char **filename_ptr, - CONST char **functionname_ptr, - unsigned int *line_ptr)); -extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc)); +extern const bfd_target *coff_object_p + PARAMS ((bfd *)); +extern struct sec *coff_section_from_bfd_index + PARAMS ((bfd *, int)); +extern long coff_get_symtab_upper_bound + PARAMS ((bfd *)); +extern long coff_get_symtab + PARAMS ((bfd *, asymbol **)); +extern int coff_count_linenumbers + PARAMS ((bfd *)); +extern struct coff_symbol_struct *coff_symbol_from + PARAMS ((bfd *, asymbol *)); +extern boolean coff_renumber_symbols + PARAMS ((bfd *, int *)); +extern void coff_mangle_symbols + PARAMS ((bfd *)); +extern boolean coff_write_symbols + PARAMS ((bfd *)); +extern boolean coff_write_linenumbers + PARAMS ((bfd *)); +extern alent *coff_get_lineno + PARAMS ((bfd *, asymbol *)); +extern asymbol *coff_section_symbol + PARAMS ((bfd *, char *)); +extern boolean _bfd_coff_get_external_symbols + PARAMS ((bfd *)); +extern const char *_bfd_coff_read_string_table + PARAMS ((bfd *)); +extern boolean _bfd_coff_free_symbols + PARAMS ((bfd *)); +extern struct coff_ptr_struct *coff_get_normalized_symtab + PARAMS ((bfd *)); +extern long coff_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +extern asymbol *coff_make_empty_symbol + PARAMS ((bfd *)); +extern void coff_print_symbol + PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type)); +extern void coff_get_symbol_info + PARAMS ((bfd *, asymbol *, symbol_info *ret)); +extern boolean _bfd_coff_is_local_label_name + PARAMS ((bfd *, const char *)); +extern asymbol *coff_bfd_make_debug_symbol + PARAMS ((bfd *, PTR, unsigned long)); +extern boolean coff_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +extern int coff_sizeof_headers + PARAMS ((bfd *, boolean)); extern boolean bfd_coff_reloc16_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean relocateable, asymbol **)); -extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, - struct bfd_link_info *, - asection *)); -extern void bfd_perform_slip PARAMS ((bfd *abfd, unsigned int slip, - asection *input_section, - bfd_vma val)); + bfd_byte *, boolean, asymbol **)); +extern bfd_vma bfd_coff_reloc16_get_value + PARAMS ((arelent *, struct bfd_link_info *, asection *)); +extern void bfd_perform_slip + PARAMS ((bfd *, unsigned int, asection *, bfd_vma)); /* Functions and types in cofflink.c. */ @@ -559,10 +574,12 @@ extern boolean _bfd_coff_reloc_link_order /* Functions in xcofflink.c. */ -extern long _bfd_xcoff_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); +extern long _bfd_xcoff_get_dynamic_symtab_upper_bound + PARAMS ((bfd *)); extern long _bfd_xcoff_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); -extern long _bfd_xcoff_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); +extern long _bfd_xcoff_get_dynamic_reloc_upper_bound + PARAMS ((bfd *)); extern long _bfd_xcoff_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create @@ -578,7 +595,8 @@ extern boolean _bfd_ppc_xcoff_relocate_section /* Functions in coff-ppc.c. FIXME: These are called be pe.em in the linker, and so should start with bfd and be declared in bfd.h. */ -extern boolean ppc_allocate_toc_section PARAMS ((struct bfd_link_info *)); +extern boolean ppc_allocate_toc_section + PARAMS ((struct bfd_link_info *)); extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); @@ -586,39 +604,37 @@ extern boolean ppc_process_before_allocation typedef struct coff_ptr_struct { - - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ -unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ -unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ -unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ -unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ -unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by - coff_slurp_symbol_table. */ -unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - -union { - union internal_auxent auxent; - struct internal_syment syment; - } u; + /* Remembers the offset from the first symbol in the file for + this symbol. Generated by coff_renumber_symbols. */ + unsigned int offset; + + /* Should the value of this symbol be renumbered. Used for + XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ + unsigned int fix_value : 1; + + /* Should the tag field of this symbol be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_tag : 1; + + /* Should the endidx field of this symbol be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_end : 1; + + /* Should the x_csect.x_scnlen field be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_scnlen : 1; + + /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the + index into the line number entries. Set by coff_slurp_symbol_table. */ + unsigned int fix_line : 1; + + /* The container for the symbol structure as read and translated + from the file. */ + union + { + union internal_auxent auxent; + struct internal_syment syment; + } u; } combined_entry_type; @@ -626,17 +642,17 @@ union { typedef struct coff_symbol_struct { - /* The actual symbol which the rest of BFD works with */ -asymbol symbol; + /* The actual symbol which the rest of BFD works with */ + asymbol symbol; - /* A pointer to the hidden information for this symbol */ -combined_entry_type *native; + /* A pointer to the hidden information for this symbol */ + combined_entry_type *native; - /* A pointer to the linenumber information for this symbol */ -struct lineno_cache_entry *lineno; + /* A pointer to the linenumber information for this symbol */ + struct lineno_cache_entry *lineno; - /* Have the line numbers been relocated yet ? */ -boolean done_lineno; + /* Have the line numbers been relocated yet ? */ + boolean done_lineno; } coff_symbol_type; /* COFF symbol classifications. */ @@ -656,227 +672,166 @@ enum coff_symbol_classification typedef struct { - void (*_bfd_coff_swap_aux_in) PARAMS (( - bfd *abfd, - PTR ext, - int type, - int class, - int indaux, - int numaux, - PTR in)); - - void (*_bfd_coff_swap_sym_in) PARAMS (( - bfd *abfd , - PTR ext, - PTR in)); - - void (*_bfd_coff_swap_lineno_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - - unsigned int (*_bfd_coff_swap_aux_out) PARAMS (( - bfd *abfd, - PTR in, - int type, - int class, - int indaux, - int numaux, - PTR ext)); - - unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( - bfd *abfd, - PTR in, - PTR ext)); - - unsigned int (*_bfd_coff_swap_lineno_out) PARAMS (( - bfd *abfd, - PTR in, - PTR ext)); - - unsigned int (*_bfd_coff_swap_reloc_out) PARAMS (( - bfd *abfd, - PTR src, - PTR dst)); - - unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - - unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - - unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - boolean _bfd_coff_long_filenames; - boolean _bfd_coff_long_section_names; - unsigned int _bfd_coff_default_section_alignment_power; - boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - void (*_bfd_coff_swap_filehdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_aouthdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_scnhdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_reloc_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - boolean (*_bfd_coff_bad_format_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr)); - boolean (*_bfd_coff_set_arch_mach_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr)); - PTR (*_bfd_coff_mkobject_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr, - PTR internal_aouthdr)); - flagword (*_bfd_styp_to_sec_flags_hook) PARAMS (( - bfd *abfd, - PTR internal_scnhdr, - const char *name, - asection *section)); - void (*_bfd_set_alignment_hook) PARAMS (( - bfd *abfd, - asection *sec, - PTR internal_scnhdr)); - boolean (*_bfd_coff_slurp_symbol_table) PARAMS (( - bfd *abfd)); - boolean (*_bfd_coff_symname_in_debug) PARAMS (( - bfd *abfd, - struct internal_syment *sym)); - boolean (*_bfd_coff_pointerize_aux_hook) PARAMS (( - bfd *abfd, - combined_entry_type *table_base, - combined_entry_type *symbol, - unsigned int indaux, - combined_entry_type *aux)); - boolean (*_bfd_coff_print_aux) PARAMS (( - bfd *abfd, - FILE *file, - combined_entry_type *table_base, - combined_entry_type *symbol, - combined_entry_type *aux, - unsigned int indaux)); - void (*_bfd_coff_reloc16_extra_cases) PARAMS (( - bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - arelent *reloc, - bfd_byte *data, - unsigned int *src_ptr, - unsigned int *dst_ptr)); - int (*_bfd_coff_reloc16_estimate) PARAMS (( - bfd *abfd, - asection *input_section, - arelent *r, - unsigned int shrink, - struct bfd_link_info *link_info)); - enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS (( - bfd *abfd, - struct internal_syment *)); - boolean (*_bfd_coff_compute_section_file_positions) PARAMS (( - bfd *abfd)); - boolean (*_bfd_coff_start_final_link) PARAMS (( - bfd *output_bfd, - struct bfd_link_info *info)); - boolean (*_bfd_coff_relocate_section) PARAMS (( - 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)); - reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS (( - bfd *abfd, - asection *sec, - struct internal_reloc *rel, - struct coff_link_hash_entry *h, - struct internal_syment *sym, - bfd_vma *addendp)); - boolean (*_bfd_coff_adjust_symndx) PARAMS (( - bfd *obfd, - struct bfd_link_info *info, - bfd *ibfd, - asection *sec, - struct internal_reloc *reloc, - boolean *adjustedp)); - boolean (*_bfd_coff_link_add_one_symbol) PARAMS (( - struct bfd_link_info *info, - bfd *abfd, - const char *name, - flagword flags, - asection *section, - bfd_vma value, - const char *string, - boolean copy, - boolean collect, - struct bfd_link_hash_entry **hashp)); - - boolean (*_bfd_coff_link_output_has_begun) PARAMS (( - bfd * abfd, - struct coff_final_link_info * pfinfo)); - boolean (*_bfd_coff_final_link_postscript) PARAMS (( - bfd * abfd, - struct coff_final_link_info * pfinfo)); + void (*_bfd_coff_swap_aux_in) + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + + void (*_bfd_coff_swap_sym_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_lineno_in) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_aux_out) + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + + unsigned int (*_bfd_coff_swap_sym_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_lineno_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_reloc_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_filehdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_aouthdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_scnhdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int _bfd_filhsz; + unsigned int _bfd_aoutsz; + unsigned int _bfd_scnhsz; + unsigned int _bfd_symesz; + unsigned int _bfd_auxesz; + unsigned int _bfd_relsz; + unsigned int _bfd_linesz; + unsigned int _bfd_filnmlen; + boolean _bfd_coff_long_filenames; + boolean _bfd_coff_long_section_names; + unsigned int _bfd_coff_default_section_alignment_power; + boolean _bfd_coff_force_symnames_in_strings; + unsigned int _bfd_coff_debug_string_prefix_length; + + void (*_bfd_coff_swap_filehdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_aouthdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_scnhdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_reloc_in) + PARAMS ((bfd *abfd, PTR, PTR)); + + boolean (*_bfd_coff_bad_format_hook) + PARAMS ((bfd *, PTR)); + + boolean (*_bfd_coff_set_arch_mach_hook) + PARAMS ((bfd *, PTR)); + + PTR (*_bfd_coff_mkobject_hook) + PARAMS ((bfd *, PTR, PTR)); + + boolean (*_bfd_styp_to_sec_flags_hook) + PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); + + void (*_bfd_set_alignment_hook) + PARAMS ((bfd *, asection *, PTR)); + + boolean (*_bfd_coff_slurp_symbol_table) + PARAMS ((bfd *)); + + boolean (*_bfd_coff_symname_in_debug) + PARAMS ((bfd *, struct internal_syment *)); + + boolean (*_bfd_coff_pointerize_aux_hook) + PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, + unsigned int, combined_entry_type *)); + + boolean (*_bfd_coff_print_aux) + PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, + combined_entry_type *, unsigned int)); + + void (*_bfd_coff_reloc16_extra_cases) + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, + bfd_byte *, unsigned int *, unsigned int *)); + + int (*_bfd_coff_reloc16_estimate) + PARAMS ((bfd *, asection *, arelent *, unsigned int, + struct bfd_link_info *)); + + enum coff_symbol_classification (*_bfd_coff_classify_symbol) + PARAMS ((bfd *, struct internal_syment *)); + + boolean (*_bfd_coff_compute_section_file_positions) + PARAMS ((bfd *)); + + boolean (*_bfd_coff_start_final_link) + PARAMS ((bfd *, struct bfd_link_info *)); + + boolean (*_bfd_coff_relocate_section) + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + struct internal_reloc *, struct internal_syment *, asection **)); + + reloc_howto_type *(*_bfd_coff_rtype_to_howto) + PARAMS ((bfd *, asection *, struct internal_reloc *, + struct coff_link_hash_entry *, struct internal_syment *, + bfd_vma *)); + + boolean (*_bfd_coff_adjust_symndx)\ + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + struct internal_reloc *, boolean *)); + + boolean (*_bfd_coff_link_add_one_symbol) + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, + asection *, bfd_vma, const char *, boolean, boolean, + struct bfd_link_hash_entry **)); + + boolean (*_bfd_coff_link_output_has_begun) + PARAMS ((bfd *, struct coff_final_link_info *)); + + boolean (*_bfd_coff_final_link_postscript) + PARAMS ((bfd *, struct coff_final_link_info *)); } bfd_coff_backend_data; -#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) +#define coff_backend_info(abfd) \ + ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) + ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) #define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) + ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) #define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) + ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) #define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) #define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) + ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) #define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) #define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) @@ -886,88 +841,89 @@ typedef struct #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) -#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames) +#define bfd_coff_long_filenames(abfd) \ + (coff_backend_info (abfd)->_bfd_coff_long_filenames) #define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) + (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)) + ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) #define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) + ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) #define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) + ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) + ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) + ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) -#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section)) +#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ + ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ + (abfd, scnhdr, name, section, flags_ptr)) #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) + ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) #define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) + ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) #define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) + ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) #define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) + (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) #define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) + (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) + ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ + (abfd, file, base, symbol, aux, indaux)) #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) + ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ + (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) + ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ + (abfd, section, reloc, shrink, link_info)) #define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) + ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ + (abfd, sym)) #define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) + ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ + (abfd)) #define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) + ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ + (obfd, info)) #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) + ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ + (obfd, info, ibfd, o, con, rel, isyms, secs)) #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) + ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ + (abfd, sec, rel, h, sym, addendp)) #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) + ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ + (obfd, info, ibfd, sec, rel, adjustedp)) #define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) + ((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,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) + ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) #define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) + ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) diff --git a/contrib/binutils/bfd/libecoff.h b/contrib/binutils/bfd/libecoff.h index 934ada1..5f9e016 100644 --- a/contrib/binutils/bfd/libecoff.h +++ b/contrib/binutils/bfd/libecoff.h @@ -1,5 +1,6 @@ /* BFD ECOFF object file private structure. - Copyright 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1999, 2001 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -165,7 +166,7 @@ typedef struct ecoff_symbol_struct PTR native; } ecoff_symbol_type; -/* We take the address of the first element of a asymbol to ensure that the +/* We take the address of the first element of an asymbol to ensure that the macro is only ever applied to an asymbol. */ #define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd))) @@ -320,7 +321,7 @@ extern long _bfd_ecoff_canonicalize_reloc /* ecoff_bfd_reloc_type_lookup defined by backend. */ extern boolean _bfd_ecoff_set_arch_mach - PARAMS ((bfd *, enum bfd_architecture, unsigned long machine)); + PARAMS ((bfd *, enum bfd_architecture, unsigned long)); extern boolean _bfd_ecoff_set_section_contents PARAMS ((bfd *, asection *, PTR location, file_ptr, bfd_size_type)); @@ -340,8 +341,8 @@ extern PTR _bfd_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); #define _bfd_ecoff_set_alignment_hook \ ((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void) extern boolean _bfd_ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr)); -extern flagword _bfd_ecoff_styp_to_sec_flags - PARAMS ((bfd *abfd, PTR hdr, const char *name, asection *section)); +extern boolean _bfd_ecoff_styp_to_sec_flags + PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd)); /* ECOFF auxiliary information swapping routines. These are the same diff --git a/contrib/binutils/bfd/libieee.h b/contrib/binutils/bfd/libieee.h index aba9cb9..c48566c 100644 --- a/contrib/binutils/bfd/libieee.h +++ b/contrib/binutils/bfd/libieee.h @@ -1,5 +1,6 @@ /* IEEE-695 object file formats: definitions internal to BFD. - Copyright 1990, 1991, 1992, 1994, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. Mostly Steve Chamberlain's fault. This file is part of BFD, the Binary File Descriptor library. @@ -28,7 +29,7 @@ typedef struct ct { struct ct *next; } bfd_chain_type; -typedef struct ieee_symbol +typedef struct ieee_symbol { asymbol symbol; struct ieee_symbol *next; @@ -60,10 +61,11 @@ typedef struct ieee_per_section } ieee_per_section_type; #define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd)) - + typedef struct { - unsigned char *input_p; + unsigned char *input_p; unsigned char *first_byte; + unsigned char *last_byte; bfd *abfd; } common_header_type ; @@ -71,7 +73,7 @@ typedef struct ieee_data_struct { common_header_type h; boolean read_symbols; - boolean read_data; + boolean read_data; file_ptr output_cursor; /* Map of section indexes to section ptrs */ asection **section_table; @@ -79,31 +81,31 @@ typedef struct ieee_data_struct ieee_address_descriptor_type ad; ieee_module_begin_type mb; ieee_w_variable_type w; - + unsigned int section_count; - + unsigned int map_idx; /* List of GLOBAL EXPORT symbols */ ieee_symbol_type *external_symbols; /* List of UNDEFINED symbols */ ieee_symbol_type *external_reference; - + /* When the symbols have been canonicalized, they are in a * special order, we remember various bases here.. */ unsigned int external_symbol_max_index; unsigned int external_symbol_min_index; unsigned int external_symbol_count; int external_symbol_base_offset; - + unsigned int external_reference_max_index; unsigned int external_reference_min_index; unsigned int external_reference_count; int external_reference_base_offset; - + boolean symbol_table_full; - + boolean done_debug; @@ -117,11 +119,11 @@ typedef struct { bfd *abfd; } ieee_ar_obstack_type; -typedef struct ieee_ar_data_struct +typedef struct ieee_ar_data_struct { common_header_type h; ieee_ar_obstack_type *elements; - + unsigned int element_index ; unsigned int element_count; diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c index 82805f9..e382895 100644 --- a/contrib/binutils/bfd/linker.c +++ b/contrib/binutils/bfd/linker.c @@ -445,28 +445,27 @@ _bfd_link_hash_newfunc (entry, table, string) struct bfd_hash_table *table; const char *string; { - struct bfd_link_hash_entry *ret = (struct bfd_link_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct bfd_link_hash_entry *) NULL) - ret = ((struct bfd_link_hash_entry *) - bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry))); - if (ret == (struct bfd_link_hash_entry *) NULL) - return NULL; + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry)); + if (entry == NULL) + return entry; + } /* Call the allocation method of the superclass. */ - ret = ((struct bfd_link_hash_entry *) - bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); - - if (ret) + entry = bfd_hash_newfunc (entry, table, string); + if (entry) { + struct bfd_link_hash_entry *h = (struct bfd_link_hash_entry *) entry; + /* Initialize the local fields. */ - ret->type = bfd_link_hash_new; - ret->next = NULL; + h->type = bfd_link_hash_new; + h->next = NULL; } - return (struct bfd_hash_entry *) ret; + return entry; } /* Initialize a link hash table. The BFD argument is the one @@ -483,6 +482,8 @@ _bfd_link_hash_table_init (table, abfd, newfunc) table->creator = abfd->xvec; table->undefs = NULL; table->undefs_tail = NULL; + table->type = bfd_link_generic_hash_table; + return bfd_hash_table_init (&table->table, newfunc); } @@ -526,6 +527,8 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) boolean copy; boolean follow; { + bfd_size_type amt; + if (info->wrap_hash != NULL) { const char *l; @@ -545,7 +548,8 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) /* This symbol is being wrapped. We want to replace all references to SYM with references to __wrap_SYM. */ - n = (char *) bfd_malloc (strlen (l) + sizeof WRAP + 1); + amt = strlen (l) + sizeof WRAP + 1; + n = (char *) bfd_malloc (amt); if (n == NULL) return NULL; @@ -576,7 +580,8 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) wrapped. We want to replace all references to __real_SYM with references to SYM. */ - n = (char *) bfd_malloc (strlen (l + sizeof REAL - 1) + 2); + amt = strlen (l + sizeof REAL - 1) + 2; + n = (char *) bfd_malloc (amt); if (n == NULL) return NULL; @@ -636,30 +641,29 @@ _bfd_generic_link_hash_newfunc (entry, table, string) struct bfd_hash_table *table; const char *string; { - struct generic_link_hash_entry *ret = - (struct generic_link_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct generic_link_hash_entry *) NULL) - ret = ((struct generic_link_hash_entry *) - bfd_hash_allocate (table, sizeof (struct generic_link_hash_entry))); - if (ret == (struct generic_link_hash_entry *) NULL) - return NULL; + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct generic_link_hash_entry)); + if (entry == NULL) + return entry; + } /* Call the allocation method of the superclass. */ - ret = ((struct generic_link_hash_entry *) - _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret, - table, string)); - - if (ret) + entry = _bfd_link_hash_newfunc (entry, table, string); + if (entry) { + struct generic_link_hash_entry *ret; + /* Set local fields. */ + ret = (struct generic_link_hash_entry *) entry; ret->written = false; ret->sym = NULL; } - return (struct bfd_hash_entry *) ret; + return entry; } /* Create an generic link hash table. */ @@ -669,9 +673,9 @@ _bfd_generic_link_hash_table_create (abfd) bfd *abfd; { struct generic_link_hash_table *ret; + bfd_size_type amt = sizeof (struct generic_link_hash_table); - ret = ((struct generic_link_hash_table *) - bfd_alloc (abfd, sizeof (struct generic_link_hash_table))); + ret = (struct generic_link_hash_table *) bfd_alloc (abfd, amt); if (ret == NULL) return (struct bfd_link_hash_table *) NULL; if (! _bfd_link_hash_table_init (&ret->root, abfd, @@ -702,7 +706,8 @@ generic_link_read_symbols (abfd) symsize = bfd_get_symtab_upper_bound (abfd); if (symsize < 0) return false; - bfd_get_outsymbols (abfd) = (asymbol **) bfd_alloc (abfd, symsize); + bfd_get_outsymbols (abfd) = + (asymbol **) bfd_alloc (abfd, (bfd_size_type) symsize); if (bfd_get_outsymbols (abfd) == NULL && symsize != 0) return false; symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd)); @@ -779,12 +784,14 @@ generic_link_add_object_symbols (abfd, info, collect) struct bfd_link_info *info; boolean collect; { + bfd_size_type symcount; + struct symbol_cache_entry **outsyms; + if (! generic_link_read_symbols (abfd)) return false; - return generic_link_add_symbol_list (abfd, info, - _bfd_generic_link_get_symcount (abfd), - _bfd_generic_link_get_symbols (abfd), - collect); + symcount = _bfd_generic_link_get_symcount (abfd); + outsyms = _bfd_generic_link_get_symbols (abfd); + return generic_link_add_symbol_list (abfd, info, symcount, outsyms, collect); } /* We build a hash table of all symbols defined in an archive. */ @@ -795,7 +802,7 @@ generic_link_add_object_symbols (abfd, info, collect) struct archive_list { struct archive_list *next; - int indx; + unsigned int indx; }; /* An entry in an archive hash table. */ @@ -924,7 +931,7 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) register carsym *arsym; int pass; struct archive_hash_table arsym_hash; - int indx; + unsigned int indx; struct bfd_link_hash_entry **pundef; if (! bfd_has_map (abfd)) @@ -1003,10 +1010,25 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) arh = archive_hash_lookup (&arsym_hash, h->root.string, false, false); if (arh == (struct archive_hash_entry *) NULL) { - pundef = &(*pundef)->next; - continue; - } + /* If we haven't found the exact symbol we're looking for, + let's look for its import thunk */ + if (info->pei386_auto_import) + { + bfd_size_type amt = strlen (h->root.string) + 10; + char *buf = (char *) bfd_malloc (amt); + if (buf == NULL) + return false; + sprintf (buf, "__imp_%s", h->root.string); + arh = archive_hash_lookup (&arsym_hash, buf, false, false); + free(buf); + } + if (arh == (struct archive_hash_entry *) NULL) + { + pundef = &(*pundef)->next; + continue; + } + } /* Look at all the objects which define this symbol. */ for (l = arh->defs; l != (struct archive_list *) NULL; l = l->next) { @@ -1395,7 +1417,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, REFC, WARNC }, + /* COMMON_ROW */ {COM, COM, COM, CREF, COM, 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 } @@ -1698,7 +1720,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, case BIG: /* We have found a common definition for a symbol which already had a common definition. Use the maximum of the - two sizes. */ + two sizes, and use the section required by the larger symbol. */ BFD_ASSERT (h->type == bfd_link_hash_common); if (! ((*info->callbacks->multiple_common) (info, h->root.string, @@ -1717,6 +1739,25 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (power > 4) power = 4; h->u.c.p->alignment_power = power; + + /* Some systems have special treatment for small commons, + hence we want to select the section used by the larger + symbol. This makes sure the symbol does not go in a + small common section if it is now too large. */ + if (section == bfd_com_section_ptr) + { + h->u.c.p->section + = bfd_make_section_old_way (abfd, "COMMON"); + h->u.c.p->section->flags = SEC_ALLOC; + } + else if (section->owner != abfd) + { + h->u.c.p->section + = bfd_make_section_old_way (abfd, section->name); + h->u.c.p->section->flags = SEC_ALLOC; + } + else + h->u.c.p->section = section; } break; @@ -1805,8 +1846,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, && inh->u.i.link == h) { (*_bfd_error_handler) - (_("%s: indirect symbol `%s' to `%s' is a loop"), - bfd_get_filename (abfd), name, string); + (_("%s: indirect symbol `%s' to `%s' is a loop"), + bfd_archive_filename (abfd), name, string); bfd_set_error (bfd_error_invalid_operation); return false; } @@ -2004,7 +2045,7 @@ _bfd_generic_final_link (abfd, info) input_section); if (relsize < 0) return false; - relocs = (arelent **) bfd_malloc ((size_t) relsize); + relocs = (arelent **) bfd_malloc ((bfd_size_type) relsize); if (!relocs && relsize != 0) return false; symbols = _bfd_generic_link_get_symbols (input_bfd); @@ -2022,10 +2063,11 @@ _bfd_generic_final_link (abfd, info) } if (o->reloc_count > 0) { - o->orelocation = ((arelent **) - bfd_alloc (abfd, - (o->reloc_count - * sizeof (arelent *)))); + bfd_size_type amt; + + amt = o->reloc_count; + amt *= sizeof (arelent *); + o->orelocation = (arelent **) bfd_alloc (abfd, amt); if (!o->orelocation) return false; o->flags |= SEC_RELOC; @@ -2078,13 +2120,15 @@ generic_add_output_symbol (output_bfd, psymalloc, sym) if (bfd_get_symcount (output_bfd) >= *psymalloc) { asymbol **newsyms; + bfd_size_type amt; if (*psymalloc == 0) *psymalloc = 124; else *psymalloc *= 2; - newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd), - *psymalloc * sizeof (asymbol *)); + amt = *psymalloc; + amt *= sizeof (asymbol *); + newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd), amt); if (newsyms == (asymbol **) NULL) return false; bfd_get_outsymbols (output_bfd) = newsyms; @@ -2288,6 +2332,12 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) case discard_all: output = false; break; + case discard_sec_merge: + output = true; + if (info->relocateable + || ! (sym->section->flags & SEC_MERGE)) + break; + /* FALLTHROUGH */ case discard_l: if (bfd_is_local_label (input_bfd, sym)) output = false; @@ -2458,7 +2508,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) if (sec->orelocation == (arelent **) NULL) abort (); - r = (arelent *) bfd_alloc (abfd, sizeof (arelent)); + r = (arelent *) bfd_alloc (abfd, (bfd_size_type) sizeof (arelent)); if (r == (arelent *) NULL) return false; @@ -2504,13 +2554,15 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) bfd_reloc_status_type rstat; bfd_byte *buf; boolean ok; + file_ptr loc; size = bfd_get_reloc_size (r->howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) return false; rstat = _bfd_relocate_contents (r->howto, abfd, - link_order->u.reloc.p->addend, buf); + (bfd_vma) link_order->u.reloc.p->addend, + buf); switch (rstat) { case bfd_reloc_ok: @@ -2532,10 +2584,9 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) } break; } - ok = bfd_set_section_contents (abfd, sec, (PTR) buf, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (abfd)), size); + loc = link_order->offset * bfd_octets_per_byte (abfd); + ok = bfd_set_section_contents (abfd, sec, (PTR) buf, loc, + (bfd_size_type) size); free (buf); if (! ok) return false; @@ -2556,10 +2607,8 @@ bfd_new_link_order (abfd, section) bfd *abfd; asection *section; { - struct bfd_link_order *new; - - new = ((struct bfd_link_order *) - bfd_alloc (abfd, sizeof (struct bfd_link_order))); + bfd_size_type amt = sizeof (struct bfd_link_order); + struct bfd_link_order *new = (struct bfd_link_order *) bfd_alloc (abfd, amt); if (!new) return NULL; @@ -2588,6 +2637,8 @@ _bfd_default_link_order (abfd, info, sec, link_order) asection *sec; struct bfd_link_order *link_order; { + file_ptr loc; + switch (link_order->type) { case bfd_undefined_link_order: @@ -2601,12 +2652,10 @@ _bfd_default_link_order (abfd, info, sec, link_order) case bfd_fill_link_order: return default_fill_link_order (abfd, info, sec, link_order); case bfd_data_link_order: + loc = link_order->offset * bfd_octets_per_byte (abfd); return bfd_set_section_contents (abfd, sec, (PTR) link_order->u.data.contents, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (abfd)), - link_order->size); + loc, link_order->size); } } @@ -2619,29 +2668,36 @@ default_fill_link_order (abfd, info, sec, link_order) asection *sec; struct bfd_link_order *link_order; { - size_t size; - char *space; + bfd_size_type size; + unsigned char *space; size_t i; - int fill; + unsigned int fill; + file_ptr loc; boolean result; BFD_ASSERT ((sec->flags & SEC_HAS_CONTENTS) != 0); - size = (size_t) link_order->size; - space = (char *) bfd_malloc (size); - if (space == NULL && size != 0) + size = link_order->size; + if (size == 0) + return true; + + space = (unsigned char *) bfd_malloc (size); + if (space == NULL) return false; fill = link_order->u.fill.value; - for (i = 0; i < size; i += 2) + for (i = 0; i < size; i += 4) + space[i] = fill >> 24; + for (i = 1; i < size; i += 4) + space[i] = fill >> 16; + for (i = 2; i < size; i += 4) space[i] = fill >> 8; - for (i = 1; i < size; i += 2) + for (i = 3; i < size; i += 4) space[i] = fill; - result = bfd_set_section_contents (abfd, sec, space, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (abfd)), - link_order->size); + + loc = link_order->offset * bfd_octets_per_byte (abfd); + result = bfd_set_section_contents (abfd, sec, space, loc, size); + free (space); return result; } @@ -2661,6 +2717,8 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, bfd *input_bfd; bfd_byte *contents = NULL; bfd_byte *new_contents; + bfd_size_type sec_size; + file_ptr loc; BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0); @@ -2744,9 +2802,9 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, } /* Get and relocate the section contents. */ - contents = ((bfd_byte *) - bfd_malloc (bfd_section_size (input_bfd, input_section))); - if (contents == NULL && bfd_section_size (input_bfd, input_section) != 0) + sec_size = bfd_section_size (input_bfd, input_section); + contents = ((bfd_byte *) bfd_malloc (sec_size)); + if (contents == NULL && sec_size != 0) goto error_return; new_contents = (bfd_get_relocated_section_contents (output_bfd, info, link_order, contents, info->relocateable, @@ -2755,12 +2813,9 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, goto error_return; /* Output the section contents. */ + loc = link_order->offset * bfd_octets_per_byte (output_bfd); if (! bfd_set_section_contents (output_bfd, output_section, - (PTR) new_contents, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (output_bfd)), - link_order->size)) + (PTR) new_contents, loc, link_order->size)) goto error_return; if (contents != NULL) diff --git a/contrib/binutils/bfd/merge.c b/contrib/binutils/bfd/merge.c new file mode 100644 index 0000000..7b06c10 --- /dev/null +++ b/contrib/binutils/bfd/merge.c @@ -0,0 +1,955 @@ +/* SEC_MERGE support. + Copyright 2001 Free Software Foundation, Inc. + Written by Jakub Jelinek . + +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 contains support for merging duplicate entities within sections, + as used in ELF SHF_MERGE. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "hashtab.h" + +struct sec_merge_sec_info; + +/* An entry in the section merge hash table. */ + +struct sec_merge_hash_entry +{ + struct bfd_hash_entry root; + /* Length of this entry. */ + unsigned int len; + /* Start of this string needs to be aligned to + alignment octets (not 1 << align). */ + unsigned int alignment; + union { + /* Index within the merged section. */ + bfd_size_type index; + /* Entity size (if present in suffix hash tables). */ + unsigned int entsize; + /* Entry this is a suffix of (if alignment is 0). */ + struct sec_merge_hash_entry *suffix; + } u; + /* Which section is it in. */ + struct sec_merge_sec_info *secinfo; + /* Next entity in the hash table. */ + struct sec_merge_hash_entry *next; +}; + +/* The section merge hash table. */ + +struct sec_merge_hash +{ + struct bfd_hash_table table; + /* Next available index. */ + bfd_size_type size; + /* First entity in the SEC_MERGE sections of this type. */ + struct sec_merge_hash_entry *first; + /* Last entity in the SEC_MERGE sections of this type. */ + struct sec_merge_hash_entry *last; + /* Entity size. */ + unsigned int entsize; + /* Are entries fixed size or zero terminated strings? */ + boolean strings; +}; + +struct sec_merge_info +{ + /* Chain of sec_merge_infos. */ + struct sec_merge_info *next; + /* Chain of sec_merge_sec_infos. */ + struct sec_merge_sec_info *chain; + /* A hash table used to hold section content. */ + struct sec_merge_hash *htab; +}; + +struct sec_merge_sec_info +{ + /* Chain of sec_merge_sec_infos. */ + struct sec_merge_sec_info *next; + /* The corresponding section. */ + asection *sec; + /* Pointer to merge_info pointing to us. */ + PTR *psecinfo; + /* A hash table used to hold section content. */ + struct sec_merge_hash *htab; + /* First string in this section. */ + struct sec_merge_hash_entry *first; + /* Original section content. */ + unsigned char contents[1]; +}; + +static struct bfd_hash_entry *sec_merge_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static struct sec_merge_hash_entry *sec_merge_hash_lookup + PARAMS ((struct sec_merge_hash *, const char *, unsigned int, boolean)); +static struct sec_merge_hash *sec_merge_init + PARAMS ((unsigned int, boolean)); +static struct sec_merge_hash_entry *sec_merge_add + PARAMS ((struct sec_merge_hash *, const char *, unsigned int, + struct sec_merge_sec_info *)); +static boolean sec_merge_emit + PARAMS ((bfd *, struct sec_merge_hash_entry *)); +static int cmplengthentry PARAMS ((const PTR, const PTR)); +static int last4_eq PARAMS ((const PTR, const PTR)); +static int last_eq PARAMS ((const PTR, const PTR)); +static boolean record_section + PARAMS ((struct sec_merge_info *, struct sec_merge_sec_info *)); +static void merge_strings PARAMS ((struct sec_merge_info *)); + +/* Routine to create an entry in a section merge hashtab. */ + +static struct bfd_hash_entry * +sec_merge_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct sec_merge_hash_entry *ret = (struct sec_merge_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == (struct sec_merge_hash_entry *) NULL) + ret = ((struct sec_merge_hash_entry *) + bfd_hash_allocate (table, sizeof (struct sec_merge_hash_entry))); + if (ret == (struct sec_merge_hash_entry *) NULL) + return NULL; + + /* Call the allocation method of the superclass. */ + ret = ((struct sec_merge_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + if (ret) + { + /* Initialize the local fields. */ + ret->u.suffix = NULL; + ret->alignment = 0; + ret->secinfo = NULL; + ret->next = NULL; + } + + return (struct bfd_hash_entry *)ret; +} + +/* Look up an entry in a section merge hash table. */ + +static struct sec_merge_hash_entry * +sec_merge_hash_lookup (table, string, alignment, create) + struct sec_merge_hash *table; + const char *string; + unsigned int alignment; + boolean create; +{ + register const unsigned char *s; + register unsigned long hash; + register unsigned int c; + struct sec_merge_hash_entry *hashp; + unsigned int len, i; + unsigned int index; + + hash = 0; + len = 0; + s = (const unsigned char *) string; + if (table->strings) + { + if (table->entsize == 1) + { + while ((c = *s++) != '\0') + { + hash += c + (c << 17); + hash ^= hash >> 2; + ++len; + } + hash += len + (len << 17); + } + else + { + for (;;) + { + for (i = 0; i < table->entsize; ++i) + if (s[i] != '\0') + break; + if (i == table->entsize) + break; + for (i = 0; i < table->entsize; ++i) + { + c = *s++; + hash += c + (c << 17); + hash ^= hash >> 2; + } + ++len; + } + hash += len + (len << 17); + len *= table->entsize; + } + hash ^= hash >> 2; + len += table->entsize; + } + else + { + for (i = 0; i < table->entsize; ++i) + { + c = *s++; + hash += c + (c << 17); + hash ^= hash >> 2; + } + len = table->entsize; + } + + index = hash % table->table.size; + for (hashp = (struct sec_merge_hash_entry *) table->table.table[index]; + hashp != (struct sec_merge_hash_entry *) NULL; + hashp = (struct sec_merge_hash_entry *) hashp->root.next) + { + if (hashp->root.hash == hash + && len == hashp->len + && memcmp (hashp->root.string, string, len) == 0) + { + /* If the string we found does not have at least the required + alignment, we need to insert another copy. */ + if (hashp->alignment < alignment) + { + /* Mark the less aligned copy as deleted. */ + hashp->len = 0; + hashp->alignment = 0; + break; + } + return hashp; + } + } + + if (! create) + return (struct sec_merge_hash_entry *) NULL; + + hashp = (struct sec_merge_hash_entry *) + sec_merge_hash_newfunc ((struct bfd_hash_entry *) NULL, + (struct bfd_hash_table *) table, string); + if (hashp == (struct sec_merge_hash_entry *) NULL) + return (struct sec_merge_hash_entry *) NULL; + hashp->root.string = string; + hashp->root.hash = hash; + hashp->len = len; + hashp->alignment = alignment; + hashp->root.next = table->table.table[index]; + table->table.table[index] = (struct bfd_hash_entry *) hashp; + + return hashp; +} + +/* Create a new hash table. */ + +static struct sec_merge_hash * +sec_merge_init (entsize, strings) + unsigned int entsize; + boolean strings; +{ + struct sec_merge_hash *table; + bfd_size_type amt = sizeof (struct sec_merge_hash); + + table = (struct sec_merge_hash *) bfd_malloc (amt); + if (table == NULL) + return NULL; + + if (! bfd_hash_table_init (&table->table, sec_merge_hash_newfunc)) + { + free (table); + return NULL; + } + + table->size = 0; + table->first = NULL; + table->last = NULL; + table->entsize = entsize; + table->strings = strings; + + return table; +} + +/* Get the index of an entity in a hash table, adding it if it is not + already present. */ + +static struct sec_merge_hash_entry * +sec_merge_add (tab, str, alignment, secinfo) + struct sec_merge_hash *tab; + const char *str; + unsigned int alignment; + struct sec_merge_sec_info *secinfo; +{ + register struct sec_merge_hash_entry *entry; + + entry = sec_merge_hash_lookup (tab, str, alignment, true); + if (entry == NULL) + return NULL; + + if (entry->secinfo == NULL) + { + tab->size++; + entry->secinfo = secinfo; + if (tab->first == NULL) + tab->first = entry; + else + tab->last->next = entry; + tab->last = entry; + } + + return entry; +} + +static boolean +sec_merge_emit (abfd, entry) + register bfd *abfd; + struct sec_merge_hash_entry *entry; +{ + struct sec_merge_sec_info *secinfo = entry->secinfo; + asection *sec = secinfo->sec; + char *pad = ""; + bfd_size_type off = 0; + int alignment_power = bfd_get_section_alignment (abfd, sec->output_section); + + if (alignment_power) + pad = bfd_zmalloc ((bfd_size_type) 1 << alignment_power); + + for (; entry != NULL && entry->secinfo == secinfo; entry = entry->next) + { + register const char *str; + register size_t len; + + len = off & (entry->alignment - 1); + if (len) + { + len = entry->alignment - len; + if (bfd_bwrite ((PTR) pad, (bfd_size_type) len, abfd) != len) + break; + off += len; + } + + str = entry->root.string; + len = entry->len; + + if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) + break; + + off += len; + } + + if (alignment_power) + free (pad); + + return entry == NULL || entry->secinfo != secinfo; +} + +/* This function is called for each input file from the add_symbols + pass of the linker. */ + +boolean +_bfd_merge_section (abfd, psinfo, sec, psecinfo) + bfd *abfd; + PTR *psinfo; + asection *sec; + PTR *psecinfo; +{ + struct sec_merge_info *sinfo; + struct sec_merge_sec_info *secinfo; + unsigned int align; + bfd_size_type amt; + + if (sec->_raw_size == 0 + || (sec->flags & SEC_EXCLUDE) + || (sec->flags & SEC_MERGE) == 0 + || sec->entsize == 0) + return true; + + if ((sec->flags & SEC_RELOC) != 0) + { + /* We aren't prepared to handle relocations in merged sections. */ + return true; + } + + if (sec->output_section != NULL + && bfd_is_abs_section (sec->output_section)) + { + /* The section is being discarded from the link, so we should + just ignore it. */ + return true; + } + + align = bfd_get_section_alignment (sec->owner, sec); + if ((sec->entsize < (unsigned int)(1 << align) + && ((sec->entsize & (sec->entsize - 1)) + || !(sec->flags & SEC_STRINGS))) + || (sec->entsize > (unsigned int)(1 << align) + && (sec->entsize & ((1 << align) - 1)))) + { + /* Sanity check. If string character size is smaller than + alignment, then we require character size to be a power + of 2, otherwise character size must be integer multiple + of alignment. For non-string constants, alignment must + be smaller than or equal to entity size and entity size + must be integer multiple of alignment. */ + return true; + } + + for (sinfo = (struct sec_merge_info *) *psinfo; sinfo; sinfo = sinfo->next) + if ((secinfo = sinfo->chain) + && ! ((secinfo->sec->flags ^ sec->flags) & (SEC_MERGE | SEC_STRINGS)) + && secinfo->sec->entsize == sec->entsize + && ! strcmp (secinfo->sec->name, sec->name)) + break; + + if (sinfo == NULL) + { + /* Initialize the information we need to keep track of. */ + sinfo = (struct sec_merge_info *) + bfd_alloc (abfd, (bfd_size_type) sizeof (struct sec_merge_info)); + if (sinfo == NULL) + goto error_return; + sinfo->next = (struct sec_merge_info *) *psinfo; + sinfo->chain = NULL; + *psinfo = (PTR) sinfo; + sinfo->htab = + sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS)); + if (sinfo->htab == NULL) + goto error_return; + } + + /* Read the section from abfd. */ + + amt = sizeof (struct sec_merge_sec_info) + sec->_raw_size - 1; + *psecinfo = bfd_alloc (abfd, amt); + if (*psecinfo == NULL) + goto error_return; + + secinfo = (struct sec_merge_sec_info *)*psecinfo; + if (sinfo->chain) + { + secinfo->next = sinfo->chain->next; + sinfo->chain->next = secinfo; + } + else + secinfo->next = secinfo; + sinfo->chain = secinfo; + secinfo->sec = sec; + secinfo->psecinfo = psecinfo; + secinfo->htab = sinfo->htab; + secinfo->first = NULL; + + if (! bfd_get_section_contents (sec->owner, sec, secinfo->contents, + (bfd_vma) 0, sec->_raw_size)) + goto error_return; + + return true; + + error_return: + *psecinfo = NULL; + return false; +} + +/* Compare two sec_merge_hash_entry structures. This is called via qsort. */ + +static int +cmplengthentry (a, b) + const PTR a; + const PTR b; +{ + struct sec_merge_hash_entry * A = *(struct sec_merge_hash_entry **) a; + struct sec_merge_hash_entry * B = *(struct sec_merge_hash_entry **) b; + + if (A->len < B->len) + return 1; + else if (A->len > B->len) + return -1; + + return memcmp (A->root.string, B->root.string, A->len); +} + +static int +last4_eq (a, b) + const PTR a; + const PTR b; +{ + struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; + struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; + + if (memcmp (A->root.string + A->len - 5 * A->u.entsize, + B->root.string + B->len - 5 * A->u.entsize, + 4 * A->u.entsize) != 0) + /* This was a hashtable collision. */ + return 0; + + if (A->len <= B->len) + /* B cannot be a suffix of A unless A is equal to B, which is guaranteed + not to be equal by the hash table. */ + return 0; + + if (A->alignment < B->alignment + || ((A->len - B->len) & (B->alignment - 1))) + /* The suffix is not sufficiently aligned. */ + return 0; + + return memcmp (A->root.string + (A->len - B->len), + B->root.string, B->len - 5 * A->u.entsize) == 0; +} + +static int +last_eq (a, b) + const PTR a; + const PTR b; +{ + struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; + struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; + + if (B->len >= 5 * A->u.entsize) + /* Longer strings are just pushed into the hash table, + they'll be used when looking up for very short strings. */ + return 0; + + if (memcmp (A->root.string + A->len - 2 * A->u.entsize, + B->root.string + B->len - 2 * A->u.entsize, + A->u.entsize) != 0) + /* This was a hashtable collision. */ + return 0; + + if (A->len <= B->len) + /* B cannot be a suffix of A unless A is equal to B, which is guaranteed + not to be equal by the hash table. */ + return 0; + + if (A->alignment < B->alignment + || ((A->len - B->len) & (B->alignment - 1))) + /* The suffix is not sufficiently aligned. */ + return 0; + + return memcmp (A->root.string + (A->len - B->len), + B->root.string, B->len - 2 * A->u.entsize) == 0; +} + +/* Record one section into the hash table. */ +static boolean +record_section (sinfo, secinfo) + struct sec_merge_info *sinfo; + struct sec_merge_sec_info *secinfo; +{ + asection *sec = secinfo->sec; + struct sec_merge_hash_entry *entry; + boolean nul; + unsigned char *p, *end; + bfd_vma mask, eltalign; + unsigned int align, i; + + align = bfd_get_section_alignment (sec->owner, sec); + end = secinfo->contents + sec->_raw_size; + nul = false; + mask = ((bfd_vma) 1 << align) - 1; + if (sec->flags & SEC_STRINGS) + { + for (p = secinfo->contents; p < end; ) + { + eltalign = p - secinfo->contents; + eltalign = ((eltalign ^ (eltalign - 1)) + 1) >> 1; + if (!eltalign || eltalign > mask) + eltalign = mask + 1; + entry = sec_merge_add (sinfo->htab, p, (unsigned) eltalign, secinfo); + if (! entry) + goto error_return; + p += entry->len; + if (sec->entsize == 1) + { + while (p < end && *p == 0) + { + if (!nul && !((p - secinfo->contents) & mask)) + { + nul = true; + entry = sec_merge_add (sinfo->htab, "", + (unsigned) mask + 1, secinfo); + if (! entry) + goto error_return; + } + p++; + } + } + else + { + while (p < end) + { + for (i = 0; i < sec->entsize; i++) + if (p[i] != '\0') + break; + if (i != sec->entsize) + break; + if (!nul && !((p - secinfo->contents) & mask)) + { + nul = true; + entry = sec_merge_add (sinfo->htab, p, + (unsigned) mask + 1, secinfo); + if (! entry) + goto error_return; + } + p += sec->entsize; + } + } + } + } + else + { + for (p = secinfo->contents; p < end; p += sec->entsize) + { + entry = sec_merge_add (sinfo->htab, p, 1, secinfo); + if (! entry) + goto error_return; + } + } + + return true; + +error_return: + for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) + *secinfo->psecinfo = NULL; + return false; +} + +/* This is a helper function for _bfd_merge_sections. It attempts to + merge strings matching suffixes of longer strings. */ +static void +merge_strings (sinfo) + struct sec_merge_info *sinfo; +{ + struct sec_merge_hash_entry **array, **a, **end, *e; + struct sec_merge_sec_info *secinfo; + htab_t lasttab = NULL, last4tab = NULL; + bfd_size_type size, amt; + + /* Now sort the strings by length, longest first. */ + array = NULL; + amt = sinfo->htab->size * sizeof (struct sec_merge_hash_entry *); + array = (struct sec_merge_hash_entry **) bfd_malloc (amt); + if (array == NULL) + goto alloc_failure; + + for (e = sinfo->htab->first, a = array; e; e = e->next) + if (e->alignment) + *a++ = e; + + sinfo->htab->size = a - array; + + qsort (array, (size_t) sinfo->htab->size, + sizeof (struct sec_merge_hash_entry *), cmplengthentry); + + last4tab = htab_create ((size_t) sinfo->htab->size * 4, NULL, last4_eq, NULL); + lasttab = htab_create ((size_t) sinfo->htab->size * 4, NULL, last_eq, NULL); + if (lasttab == NULL || last4tab == NULL) + goto alloc_failure; + + /* Now insert the strings into hash tables (strings with last 4 characters + and strings with last character equal), look for longer strings which + we're suffix of. */ + for (a = array, end = array + sinfo->htab->size; a < end; a++) + { + register hashval_t hash; + unsigned int c; + unsigned int i; + const unsigned char *s; + PTR *p; + + e = *a; + e->u.entsize = sinfo->htab->entsize; + if (e->len <= e->u.entsize) + break; + if (e->len > 4 * e->u.entsize) + { + s = e->root.string + e->len - e->u.entsize; + hash = 0; + for (i = 0; i < 4 * e->u.entsize; i++) + { + c = *--s; + hash += c + (c << 17); + hash ^= hash >> 2; + } + p = htab_find_slot_with_hash (last4tab, e, hash, INSERT); + if (p == NULL) + goto alloc_failure; + if (*p) + { + struct sec_merge_hash_entry *ent; + + ent = (struct sec_merge_hash_entry *) *p; + e->u.suffix = ent; + e->alignment = 0; + continue; + } + else + *p = (PTR) e; + } + s = e->root.string + e->len - e->u.entsize; + hash = 0; + for (i = 0; i < e->u.entsize; i++) + { + c = *--s; + hash += c + (c << 17); + hash ^= hash >> 2; + } + p = htab_find_slot_with_hash (lasttab, e, hash, INSERT); + if (p == NULL) + goto alloc_failure; + if (*p) + { + struct sec_merge_hash_entry *ent; + + ent = (struct sec_merge_hash_entry *) *p; + e->u.suffix = ent; + e->alignment = 0; + } + else + *p = (PTR) e; + } + +alloc_failure: + if (array) + free (array); + if (lasttab) + htab_delete (lasttab); + if (last4tab) + htab_delete (last4tab); + + /* Now assign positions to the strings we want to keep. */ + size = 0; + secinfo = sinfo->htab->first->secinfo; + for (e = sinfo->htab->first; e; e = e->next) + { + if (e->secinfo != secinfo) + { + secinfo->sec->_cooked_size = size; + secinfo = e->secinfo; + } + if (e->alignment) + { + if (e->secinfo->first == NULL) + { + e->secinfo->first = e; + size = 0; + } + size = (size + e->alignment - 1) & ~((bfd_vma) e->alignment - 1); + e->u.index = size; + size += e->len; + } + } + secinfo->sec->_cooked_size = size; + + /* And now adjust the rest, removing them from the chain (but not hashtable) + at the same time. */ + for (a = &sinfo->htab->first, e = *a; e; e = e->next) + if (e->alignment) + a = &e->next; + else + { + *a = e->next; + if (e->len) + { + e->secinfo = e->u.suffix->secinfo; + e->alignment = e->u.suffix->alignment; + e->u.index = e->u.suffix->u.index + (e->u.suffix->len - e->len); + } + } +} + +/* This function is called once after all SEC_MERGE sections are registered + with _bfd_merge_section. */ + +boolean +_bfd_merge_sections (abfd, xsinfo, remove_hook) + bfd *abfd ATTRIBUTE_UNUSED; + PTR xsinfo; + void (*remove_hook) PARAMS((bfd *, asection *)); +{ + struct sec_merge_info *sinfo; + + for (sinfo = (struct sec_merge_info *) xsinfo; sinfo; sinfo = sinfo->next) + { + struct sec_merge_sec_info * secinfo; + + if (! sinfo->chain) + continue; + + /* Move sinfo->chain to head of the chain, terminate it. */ + secinfo = sinfo->chain; + sinfo->chain = secinfo->next; + secinfo->next = NULL; + + /* Record the sections into the hash table. */ + for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) + if (secinfo->sec->flags & SEC_EXCLUDE) + { + *secinfo->psecinfo = NULL; + if (remove_hook) + (*remove_hook) (abfd, secinfo->sec); + } + else if (! record_section (sinfo, secinfo)) + break; + + if (secinfo) + continue; + + if (sinfo->htab->strings) + merge_strings (sinfo); + else + { + struct sec_merge_hash_entry *e; + bfd_size_type size = 0; + + /* Things are much simpler for non-strings. + Just assign them slots in the section. */ + secinfo = NULL; + for (e = sinfo->htab->first; e; e = e->next) + { + if (e->secinfo->first == NULL) + { + if (secinfo) + secinfo->sec->_cooked_size = size; + e->secinfo->first = e; + size = 0; + } + size = (size + e->alignment - 1) + & ~((bfd_vma) e->alignment - 1); + e->u.index = size; + size += e->len; + secinfo = e->secinfo; + } + secinfo->sec->_cooked_size = size; + } + + /* Finally shrink all input sections which have not made it into + the hash table at all. */ + for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) + if (secinfo->first == NULL) + { + secinfo->sec->_cooked_size = 0; + secinfo->sec->flags |= SEC_EXCLUDE; + } + } + + return true; +} + +/* Write out the merged section. */ + +boolean +_bfd_write_merged_section (output_bfd, sec, psecinfo) + bfd *output_bfd; + asection *sec; + PTR psecinfo; +{ + struct sec_merge_sec_info *secinfo; + file_ptr pos; + + secinfo = (struct sec_merge_sec_info *) psecinfo; + + if (!secinfo->first) + return true; + + pos = sec->output_section->filepos + sec->output_offset; + if (bfd_seek (output_bfd, pos, SEEK_SET) != 0) + return false; + + if (! sec_merge_emit (output_bfd, secinfo->first)) + return false; + + return true; +} + +/* Adjust an address in the SEC_MERGE section. Given OFFSET within + *PSEC, this returns the new offset in the adjusted SEC_MERGE + section and writes the new section back into *PSEC. */ + +bfd_vma +_bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend) + bfd *output_bfd ATTRIBUTE_UNUSED; + asection **psec; + PTR psecinfo; + bfd_vma offset, addend; +{ + struct sec_merge_sec_info *secinfo; + struct sec_merge_hash_entry *entry; + unsigned char *p; + asection *sec = *psec; + + secinfo = (struct sec_merge_sec_info *) psecinfo; + + if (offset + addend >= sec->_raw_size) + { + if (offset + addend > sec->_raw_size) + { + (*_bfd_error_handler) + (_("%s: access beyond end of merged section (%ld + %ld)"), + bfd_get_filename (sec->owner), (long) offset, (long) addend); + } + return (secinfo->first ? sec->_cooked_size : 0); + } + + if (secinfo->htab->strings) + { + if (sec->entsize == 1) + { + p = secinfo->contents + offset + addend - 1; + while (*p && p >= secinfo->contents) + --p; + ++p; + } + else + { + p = secinfo->contents + + ((offset + addend) / sec->entsize) * sec->entsize; + p -= sec->entsize; + while (p >= secinfo->contents) + { + unsigned int i; + + for (i = 0; i < sec->entsize; ++i) + if (p[i] != '\0') + break; + if (i == sec->entsize) + break; + p -= sec->entsize; + } + p += sec->entsize; + } + } + else + { + p = secinfo->contents + + ((offset + addend) / sec->entsize) * sec->entsize; + } + entry = sec_merge_hash_lookup (secinfo->htab, p, 0, false); + if (!entry) + { + if (! secinfo->htab->strings) + abort (); + /* This should only happen if somebody points into the padding + after a NUL character but before next entity. */ + if (*p) + abort (); + if (! secinfo->htab->first) + abort (); + entry = secinfo->htab->first; + p = secinfo->contents + + ((offset + addend) / sec->entsize + 1) * sec->entsize + - entry->len; + } + + *psec = entry->secinfo->sec; + return entry->u.index + (secinfo->contents + offset - p); +} diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c index c93d6a4..2787c46 100644 --- a/contrib/binutils/bfd/netbsd-core.c +++ b/contrib/binutils/bfd/netbsd-core.c @@ -1,5 +1,6 @@ /* BFD back end for NetBSD style core files - Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000 + Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. Written by Paul Kranenburg, EUR @@ -39,12 +40,12 @@ struct netbsd_core_struct { /* forward declarations */ -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)); +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)); /* Handle NetBSD-style core dump file. */ @@ -54,117 +55,116 @@ netbsd_core_file_p (abfd) bfd *abfd; { - int i, val, offset; - asection *asect, *asect2; - struct core core; - struct coreseg coreseg; - - val = bfd_read ((void *)&core, 1, sizeof core, abfd); - if (val != sizeof core) { - /* Too small to be a core file */ - bfd_set_error(bfd_error_wrong_format); - return 0; + int i, val; + file_ptr offset; + asection *asect, *asect2; + struct core core; + struct coreseg coreseg; + bfd_size_type amt = sizeof core; + + val = bfd_bread ((void *) &core, amt, abfd); + if (val != sizeof core) + { + /* Too small to be a core file */ + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + if (CORE_GETMAGIC (core) != COREMAGIC) + { + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + amt = sizeof (struct netbsd_core_struct); + rawptr = (struct netbsd_core_struct *) bfd_zalloc (abfd, amt); + if (rawptr == NULL) + return 0; + + rawptr->core = core; + abfd->tdata.netbsd_core_data = rawptr; + + offset = core.c_hdrsize; + for (i = 0; i < core.c_nseg; i++) + { + const char *sname; + flagword flags; + + if (bfd_seek (abfd, offset, SEEK_SET) != 0) + goto punt; + + val = bfd_bread ((void *) &coreseg, (bfd_size_type) sizeof coreseg, abfd); + if (val != sizeof coreseg) + { + bfd_set_error (bfd_error_file_truncated); + goto punt; } - - if (CORE_GETMAGIC(core) != COREMAGIC) { - bfd_set_error(bfd_error_wrong_format); - return 0; + if (CORE_GETMAGIC (coreseg) != CORESEGMAGIC) + { + bfd_set_error (bfd_error_wrong_format); + goto punt; } - rawptr = (struct netbsd_core_struct *) - bfd_zalloc (abfd, sizeof (struct netbsd_core_struct)); - if (rawptr == NULL) { - bfd_set_error(bfd_error_no_memory); - return 0; + offset += core.c_seghdrsize; + + switch (CORE_GETFLAG (coreseg)) + { + case CORE_CPU: + sname = ".reg"; + flags = SEC_ALLOC + SEC_HAS_CONTENTS; + break; + case CORE_DATA: + sname = ".data"; + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + break; + case CORE_STACK: + sname = ".stack"; + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + break; + default: + sname = ".unknown"; + flags = SEC_ALLOC + SEC_HAS_CONTENTS; + break; } + asect = bfd_make_section_anyway (abfd, sname); + if (asect == NULL) + goto punt; - rawptr->core = core; - abfd->tdata.netbsd_core_data = rawptr; - - offset = core.c_hdrsize; - for (i = 0; i < core.c_nseg; i++) { - - if (bfd_seek (abfd, offset, SEEK_SET) != 0) - goto punt; - - val = bfd_read ((void *)&coreseg, 1, sizeof coreseg, abfd); - if (val != sizeof coreseg) { - bfd_set_error(bfd_error_file_truncated); - goto punt; - } - if (CORE_GETMAGIC(coreseg) != CORESEGMAGIC) { - bfd_set_error(bfd_error_wrong_format); - goto punt; - } - - offset += core.c_seghdrsize; - - 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; - asect->vma = coreseg.c_addr; - asect->filepos = offset; - asect->alignment_power = 2; - asect->next = abfd->sections; - abfd->sections = asect; - abfd->section_count++; - offset += coreseg.c_size; - - switch (CORE_GETFLAG(coreseg)) { - case CORE_CPU: - asect->name = ".reg"; - asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; -#ifdef CORE_FPU_OFFSET - /* Hackish... */ - asect->_raw_size = CORE_FPU_OFFSET; - asect2 = (asection *)bfd_zalloc (abfd, - sizeof (asection)); - if (asect2 == NULL) { - bfd_set_error(bfd_error_no_memory); - goto punt; - } - asect2->_raw_size = coreseg.c_size - CORE_FPU_OFFSET; - asect2->vma = 0; - asect2->filepos = asect->filepos + CORE_FPU_OFFSET; - asect2->alignment_power = 2; - asect2->next = abfd->sections; - asect2->name = ".reg2"; - asect2->flags = SEC_ALLOC + SEC_HAS_CONTENTS; - abfd->sections = asect2; - abfd->section_count++; -#endif + asect->flags = flags; + asect->_raw_size = coreseg.c_size; + asect->vma = coreseg.c_addr; + asect->filepos = offset; + asect->alignment_power = 2; + + offset += coreseg.c_size; - break; - case CORE_DATA: - asect->name = ".data"; - asect->flags = SEC_ALLOC+SEC_LOAD+SEC_HAS_CONTENTS; - break; - case CORE_STACK: - asect->name = ".stack"; - asect->flags = SEC_ALLOC+SEC_LOAD+SEC_HAS_CONTENTS; - break; - } +#ifdef CORE_FPU_OFFSET + switch (CORE_GETFLAG (coreseg)) + { + case CORE_CPU: + /* Hackish... */ + asect->_raw_size = CORE_FPU_OFFSET; + asect2 = bfd_make_section_anyway (abfd, ".reg2"); + if (asect2 == NULL) + goto punt; + asect2->_raw_size = coreseg.c_size - CORE_FPU_OFFSET; + asect2->vma = 0; + asect2->filepos = asect->filepos + CORE_FPU_OFFSET; + asect2->alignment_power = 2; + asect2->flags = SEC_ALLOC + SEC_HAS_CONTENTS; + break; } +#endif + } - /* OK, we believe you. You're a core file (sure, sure). */ - return abfd->xvec; + /* OK, we believe you. You're a core file (sure, sure). */ + return abfd->xvec; -punt: { - asection *anext; - for (asect = abfd->sections; asect; asect = anext) { - anext = asect->next; - free((void *)asect); - } - } - free ((void *)rawptr); - abfd->tdata.netbsd_core_data = NULL; - abfd->sections = NULL; - abfd->section_count = 0; - return 0; + punt: + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = NULL; + bfd_section_list_clear (abfd); + return 0; } static char* @@ -187,7 +187,8 @@ netbsd_core_file_failing_signal (abfd) /* ARGSUSED */ static boolean netbsd_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; + bfd *core_bfd ATTRIBUTE_UNUSED; + bfd *exec_bfd ATTRIBUTE_UNUSED; { return true; /* FIXME, We have no way of telling at this point */ } diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index 0c3d2c9..0b285d4 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -49,7 +49,7 @@ _bfd_new_bfd () { bfd *nbfd; - nbfd = (bfd *) bfd_zmalloc (sizeof (bfd)); + nbfd = (bfd *) bfd_zmalloc ((bfd_size_type) sizeof (bfd)); if (nbfd == NULL) return NULL; @@ -57,6 +57,7 @@ _bfd_new_bfd () if (nbfd->memory == NULL) { bfd_set_error (bfd_error_no_memory); + free (nbfd); return NULL; } @@ -65,10 +66,16 @@ _bfd_new_bfd () nbfd->direction = no_direction; nbfd->iostream = NULL; nbfd->where = 0; + if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc)) + { + free (nbfd); + return NULL; + } nbfd->sections = (asection *) NULL; + nbfd->section_tail = &nbfd->sections; nbfd->format = bfd_unknown; nbfd->my_archive = (bfd *) NULL; - nbfd->origin = 0; + nbfd->origin = 0; nbfd->opened_once = false; nbfd->output_has_begun = false; nbfd->section_count = 0; @@ -96,6 +103,17 @@ _bfd_new_bfd_contained_in (obfd) return nbfd; } +/* Delete a BFD. */ + +void +_bfd_delete_bfd (abfd) + bfd *abfd; +{ + bfd_hash_table_free (&abfd->section_htab); + objalloc_free ((struct objalloc *) abfd->memory); + free (abfd); +} + /* SECTION Opening and closing BFDs @@ -107,7 +125,7 @@ FUNCTION bfd_openr SYNOPSIS - bfd *bfd_openr(CONST char *filename, CONST char *target); + bfd *bfd_openr(const char *filename, const char *target); DESCRIPTION Open the file @var{filename} (using <>) with the target @@ -122,8 +140,8 @@ DESCRIPTION bfd * bfd_openr (filename, target) - CONST char *filename; - CONST char *target; + const char *filename; + const char *target; { bfd *nbfd; const bfd_target *target_vec; @@ -135,9 +153,8 @@ bfd_openr (filename, target) target_vec = bfd_find_target (target, nbfd); if (target_vec == NULL) { - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); bfd_set_error (bfd_error_invalid_target); + _bfd_delete_bfd (nbfd); return NULL; } @@ -148,8 +165,7 @@ bfd_openr (filename, target) { /* File didn't exist, or some such */ bfd_set_error (bfd_error_system_call); - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -169,7 +185,7 @@ FUNCTION bfd_fdopenr SYNOPSIS - bfd *bfd_fdopenr(CONST char *filename, CONST char *target, int fd); + bfd *bfd_fdopenr(const char *filename, const char *target, int fd); DESCRIPTION <> is to <> much like <> is to <>. @@ -192,8 +208,8 @@ DESCRIPTION bfd * bfd_fdopenr (filename, target, fd) - CONST char *filename; - CONST char *target; + const char *filename; + const char *target; int fd; { bfd *nbfd; @@ -216,8 +232,7 @@ bfd_fdopenr (filename, target, fd) if (target_vec == NULL) { bfd_set_error (bfd_error_invalid_target); - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -236,8 +251,7 @@ bfd_fdopenr (filename, target, fd) if (nbfd->iostream == NULL) { - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -259,8 +273,7 @@ bfd_fdopenr (filename, target, fd) if (! bfd_cache_init (nbfd)) { - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } nbfd->opened_once = true; @@ -299,19 +312,17 @@ bfd_openstreamr (filename, target, streamarg) if (target_vec == NULL) { bfd_set_error (bfd_error_invalid_target); - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } nbfd->iostream = (PTR) stream; nbfd->filename = filename; nbfd->direction = read_direction; - + if (! bfd_cache_init (nbfd)) { - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -328,7 +339,7 @@ FUNCTION bfd_openw SYNOPSIS - bfd *bfd_openw(CONST char *filename, CONST char *target); + bfd *bfd_openw(const char *filename, const char *target); DESCRIPTION Create a BFD, associated with file @var{filename}, using the @@ -340,8 +351,8 @@ DESCRIPTION bfd * bfd_openw (filename, target) - CONST char *filename; - CONST char *target; + const char *filename; + const char *target; { bfd *nbfd; const bfd_target *target_vec; @@ -358,8 +369,7 @@ bfd_openw (filename, target) target_vec = bfd_find_target (target, nbfd); if (target_vec == NULL) { - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -369,8 +379,7 @@ bfd_openw (filename, target) if (bfd_open_file (nbfd) == NULL) { bfd_set_error (bfd_error_system_call); /* File not writeable, etc */ - objalloc_free ((struct objalloc *) nbfd->memory); - free (nbfd); + _bfd_delete_bfd (nbfd); return NULL; } @@ -429,7 +438,7 @@ bfd_close (abfd) if (stat (abfd->filename, &buf) == 0) { - int mask = umask (0); + unsigned int mask = umask (0); umask (mask); chmod (abfd->filename, (0777 @@ -437,8 +446,7 @@ bfd_close (abfd) } } - objalloc_free ((struct objalloc *) abfd->memory); - free (abfd); + _bfd_delete_bfd (abfd); return ret; } @@ -484,7 +492,7 @@ bfd_close_all_done (abfd) if (stat (abfd->filename, &buf) == 0) { - int mask = umask (0); + unsigned int mask = umask (0); umask (mask); chmod (abfd->filename, (0777 @@ -492,8 +500,7 @@ bfd_close_all_done (abfd) } } - objalloc_free ((struct objalloc *) abfd->memory); - free (abfd); + _bfd_delete_bfd (abfd); return ret; } @@ -503,7 +510,7 @@ FUNCTION bfd_create SYNOPSIS - bfd *bfd_create(CONST char *filename, bfd *templ); + bfd *bfd_create(const char *filename, bfd *templ); DESCRIPTION Create a new BFD in the manner of @@ -515,7 +522,7 @@ DESCRIPTION bfd * bfd_create (filename, templ) - CONST char *filename; + const char *filename; bfd *templ; { bfd *nbfd; @@ -560,9 +567,10 @@ bfd_make_writable(abfd) return false; } - bim = (struct bfd_in_memory *) bfd_malloc (sizeof (struct bfd_in_memory)); + bim = ((struct bfd_in_memory *) + bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory))); abfd->iostream = (PTR) bim; - /* bfd_write will grow these as needed */ + /* bfd_bwrite will grow these as needed */ bim->size = 0; bim->buffer = 0; @@ -613,7 +621,7 @@ bfd_make_readable(abfd) abfd->sections = (asection *) NULL; abfd->format = bfd_unknown; abfd->my_archive = (bfd *) NULL; - abfd->origin = 0; + abfd->origin = 0; abfd->opened_once = false; abfd->output_has_begun = false; abfd->section_count = 0; @@ -650,10 +658,16 @@ DESCRIPTION PTR bfd_alloc (abfd, size) bfd *abfd; - size_t size; + bfd_size_type size; { PTR ret; + if (size != (unsigned long) size) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } + ret = objalloc_alloc (abfd->memory, (unsigned long) size); if (ret == NULL) bfd_set_error (bfd_error_no_memory); @@ -663,17 +677,18 @@ bfd_alloc (abfd, size) PTR bfd_zalloc (abfd, size) bfd *abfd; - size_t size; + bfd_size_type size; { PTR res; res = bfd_alloc (abfd, size); if (res) - memset (res, 0, size); + memset (res, 0, (size_t) size); return res; } -/* Free a block allocated for a BFD. */ +/* Free a block allocated for a BFD. + Note: Also frees all more recently allocated blocks! */ void bfd_release (abfd, block) diff --git a/contrib/binutils/bfd/osf-core.c b/contrib/binutils/bfd/osf-core.c index c458ecf..edf5470 100644 --- a/contrib/binutils/bfd/osf-core.c +++ b/contrib/binutils/bfd/osf-core.c @@ -1,5 +1,6 @@ /* BFD back-end for OSF/1 core files. - Copyright 1993, 1994, 1995, 1998, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -29,25 +30,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* forward declarations */ -static asection * -make_bfd_asection PARAMS ((bfd *, CONST char *, flagword, bfd_size_type, - bfd_vma, file_ptr)); -static asymbol * -osf_core_make_empty_symbol PARAMS ((bfd *)); -static const bfd_target * -osf_core_core_file_p PARAMS ((bfd *)); -static char * -osf_core_core_file_failing_command PARAMS ((bfd *)); -static int -osf_core_core_file_failing_signal PARAMS ((bfd *)); -static boolean -osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); -static void -swap_abort PARAMS ((void)); +static asection *make_bfd_asection + PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr)); +static const bfd_target *osf_core_core_file_p PARAMS ((bfd *)); +static char *osf_core_core_file_failing_command PARAMS ((bfd *)); +static int osf_core_core_file_failing_signal PARAMS ((bfd *)); +static boolean osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); +static void swap_abort PARAMS ((void)); /* These are stored in the bfd's tdata */ -struct osf_core_struct +struct osf_core_struct { int sig; char cmd[MAXCOMLEN + 1]; @@ -60,7 +53,7 @@ struct osf_core_struct static asection * make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) bfd *abfd; - CONST char *name; + const char *name; flagword flags; bfd_size_type _raw_size; bfd_vma vma; @@ -81,16 +74,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) return asect; } -static asymbol * -osf_core_make_empty_symbol (abfd) - bfd *abfd; -{ - asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); - if (new) - new->the_bfd = abfd; - return new; -} - static const bfd_target * osf_core_core_file_p (abfd) bfd *abfd; @@ -99,8 +82,10 @@ osf_core_core_file_p (abfd) int i; char *secname; struct core_filehdr core_header; + bfd_size_type amt; - val = bfd_read ((PTR)&core_header, 1, sizeof core_header, abfd); + amt = sizeof core_header; + val = bfd_bread ((PTR) &core_header, amt, abfd); if (val != sizeof core_header) return NULL; @@ -108,7 +93,7 @@ osf_core_core_file_p (abfd) return NULL; core_hdr (abfd) = (struct osf_core_struct *) - bfd_zalloc (abfd, sizeof (struct osf_core_struct)); + bfd_zalloc (abfd, (bfd_size_type) sizeof (struct osf_core_struct)); if (!core_hdr (abfd)) return NULL; @@ -120,7 +105,8 @@ osf_core_core_file_p (abfd) struct core_scnhdr core_scnhdr; flagword flags; - val = bfd_read ((PTR)&core_scnhdr, 1, sizeof core_scnhdr, abfd); + amt = sizeof core_scnhdr; + val = bfd_bread ((PTR) &core_scnhdr, amt, abfd); if (val != sizeof core_scnhdr) break; @@ -152,12 +138,18 @@ osf_core_core_file_p (abfd) (bfd_size_type) core_scnhdr.size, (bfd_vma) core_scnhdr.vaddr, (file_ptr) core_scnhdr.scnptr)) - return NULL; + goto fail; } /* OK, we believe you. You're a core file (sure, sure). */ return abfd->xvec; + + fail: + bfd_release (abfd, core_hdr (abfd)); + core_hdr (abfd) = NULL; + bfd_section_list_clear (abfd); + return NULL; } static char * @@ -178,22 +170,12 @@ osf_core_core_file_failing_signal (abfd) /* ARGSUSED */ static boolean osf_core_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; + bfd *core_bfd ATTRIBUTE_UNUSED; + bfd *exec_bfd ATTRIBUTE_UNUSED; { return true; /* FIXME, We have no way of telling at this point */ } -#define osf_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound -#define osf_core_get_symtab _bfd_nosymbols_get_symtab -#define osf_core_print_symbol _bfd_nosymbols_print_symbol -#define osf_core_get_symbol_info _bfd_nosymbols_get_symbol_info -#define osf_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name -#define osf_core_get_lineno _bfd_nosymbols_get_lineno -#define osf_core_find_nearest_line _bfd_nosymbols_find_nearest_line -#define osf_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol -#define osf_core_read_minisymbols _bfd_nosymbols_read_minisymbols -#define osf_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol - /* If somebody calls any byte-swapping routines, shoot them. */ static void swap_abort() @@ -239,18 +221,18 @@ const bfd_target osf_core_vec = bfd_false, bfd_false, bfd_false, bfd_false }, - - BFD_JUMP_TABLE_GENERIC (_bfd_generic), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (osf_core), - BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), - BFD_JUMP_TABLE_SYMBOLS (osf_core), - BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), - BFD_JUMP_TABLE_WRITE (_bfd_generic), - BFD_JUMP_TABLE_LINK (_bfd_nolink), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (osf_core), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/contrib/binutils/bfd/peXXigen.c b/contrib/binutils/bfd/peXXigen.c index a3141ba..37f4d1a 100644 --- a/contrib/binutils/bfd/peXXigen.c +++ b/contrib/binutils/bfd/peXXigen.c @@ -95,8 +95,9 @@ static void add_data_entry PARAMS ((bfd *, struct internal_extra_pe_aouthdr *, int, char *, bfd_vma)); static boolean pe_print_pdata PARAMS ((bfd *, PTR)); static boolean pe_print_reloc PARAMS ((bfd *, PTR)); - -/**********************************************************************/ +static boolean pe_print_idata PARAMS ((bfd *, PTR)); +static boolean pe_print_edata PARAMS ((bfd *, PTR)); + void _bfd_XXi_swap_sym_in (abfd, ext1, in1) @@ -110,26 +111,21 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) if (ext->e.e_name[0] == 0) { in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = - bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset); + in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e.e.e_offset); } else - { - memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); - } + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); + + in->n_value = H_GET_32 (abfd, ext->e_value); + in->n_scnum = H_GET_16 (abfd, ext->e_scnum); - in->n_value = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_value); - in->n_scnum = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_scnum); if (sizeof (ext->e_type) == 2) - { - in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type); - } + in->n_type = H_GET_16 (abfd, ext->e_type); else - { - in->n_type = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_type); - } - in->n_sclass = bfd_h_get_8 (abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_8 (abfd, ext->e_numaux); + in->n_type = H_GET_32 (abfd, ext->e_type); + + in->n_sclass = H_GET_8 (abfd, ext->e_sclass); + in->n_numaux = H_GET_8 (abfd, ext->e_numaux); #ifndef STRICT_PE_FORMAT /* This is for Gnu-created DLLs. */ @@ -166,6 +162,7 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) if (in->n_scnum == 0) { asection *sec; + for (sec = abfd->sections; sec; sec = sec->next) { if (strcmp (sec->name, in->n_name) == 0) @@ -175,16 +172,18 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) } } } + if (in->n_scnum == 0) { int unused_section_number = 0; asection *sec; char *name; + for (sec = abfd->sections; sec; sec = sec->next) if (unused_section_number <= sec->target_index) unused_section_number = sec->target_index + 1; - name = bfd_alloc (abfd, strlen (in->n_name) + 10); + name = bfd_alloc (abfd, (bfd_size_type) strlen (in->n_name) + 10); if (name == NULL) return; strcpy (name, in->n_name); @@ -229,28 +228,25 @@ _bfd_XXi_swap_sym_out (abfd, inp, extp) { struct internal_syment *in = (struct internal_syment *) inp; SYMENT *ext = (SYMENT *) extp; + if (in->_n._n_name[0] == 0) { - bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); - bfd_h_put_32 (abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e.e.e_offset); + H_PUT_32 (abfd, 0, ext->e.e.e_zeroes); + H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); } else - { - memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); - } + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); + + H_PUT_32 (abfd, in->n_value, ext->e_value); + H_PUT_16 (abfd, in->n_scnum, ext->e_scnum); - bfd_h_put_32 (abfd, in->n_value, (bfd_byte *) ext->e_value); - bfd_h_put_16 (abfd, in->n_scnum, (bfd_byte *) ext->e_scnum); if (sizeof (ext->e_type) == 2) - { - bfd_h_put_16 (abfd, in->n_type, (bfd_byte *) ext->e_type); - } + H_PUT_16 (abfd, in->n_type, ext->e_type); else - { - bfd_h_put_32 (abfd, in->n_type, (bfd_byte *) ext->e_type); - } - bfd_h_put_8 (abfd, in->n_sclass, ext->e_sclass); - bfd_h_put_8 (abfd, in->n_numaux, ext->e_numaux); + H_PUT_32 (abfd, in->n_type, ext->e_type); + + H_PUT_8 (abfd, in->n_sclass, ext->e_sclass); + H_PUT_8 (abfd, in->n_numaux, ext->e_numaux); return SYMESZ; } @@ -274,13 +270,10 @@ _bfd_XXi_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) if (ext->x_file.x_fname[0] == 0) { in->x_file.x_n.x_zeroes = 0; - in->x_file.x_n.x_offset = - bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + in->x_file.x_n.x_offset = H_GET_32 (abfd, ext->x_file.x_n.x_offset); } else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); return; case C_STAT: @@ -291,19 +284,16 @@ _bfd_XXi_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) in->x_scn.x_scnlen = GET_SCN_SCNLEN (abfd, ext); in->x_scn.x_nreloc = GET_SCN_NRELOC (abfd, ext); in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext); - in->x_scn.x_checksum = - bfd_h_get_32 (abfd, (bfd_byte *) ext->x_scn.x_checksum); - in->x_scn.x_associated = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_scn.x_associated); - in->x_scn.x_comdat = - bfd_h_get_8 (abfd, (bfd_byte *) ext->x_scn.x_comdat); + in->x_scn.x_checksum = H_GET_32 (abfd, ext->x_scn.x_checksum); + in->x_scn.x_associated = H_GET_16 (abfd, ext->x_scn.x_associated); + in->x_scn.x_comdat = H_GET_8 (abfd, ext->x_scn.x_comdat); return; } break; } - in->x_sym.x_tagndx.l = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_tagndx); - in->x_sym.x_tvndx = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_tvndx); + in->x_sym.x_tagndx.l = H_GET_32 (abfd, ext->x_sym.x_tagndx); + in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { @@ -313,19 +303,18 @@ _bfd_XXi_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) else { in->x_sym.x_fcnary.x_ary.x_dimen[0] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]); in->x_sym.x_fcnary.x_ary.x_dimen[1] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]); in->x_sym.x_fcnary.x_ary.x_dimen[2] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]); in->x_sym.x_fcnary.x_ary.x_dimen[3] = - bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } if (ISFCN (type)) { - in->x_sym.x_misc.x_fsize = - bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize); } else { @@ -353,15 +342,12 @@ _bfd_XXi_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) case C_FILE: if (in->x_file.x_fname[0] == 0) { - bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); - bfd_h_put_32 (abfd, - in->x_file.x_n.x_offset, - (bfd_byte *) ext->x_file.x_n.x_offset); + H_PUT_32 (abfd, 0, ext->x_file.x_n.x_zeroes); + H_PUT_32 (abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset); } else - { - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); - } + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + return AUXESZ; case C_STAT: @@ -372,19 +358,16 @@ _bfd_XXi_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); - bfd_h_put_32 (abfd, in->x_scn.x_checksum, - (bfd_byte *) ext->x_scn.x_checksum); - bfd_h_put_16 (abfd, in->x_scn.x_associated, - (bfd_byte *) ext->x_scn.x_associated); - bfd_h_put_8 (abfd, in->x_scn.x_comdat, - (bfd_byte *) ext->x_scn.x_comdat); + H_PUT_32 (abfd, in->x_scn.x_checksum, ext->x_scn.x_checksum); + H_PUT_16 (abfd, in->x_scn.x_associated, ext->x_scn.x_associated); + H_PUT_8 (abfd, in->x_scn.x_comdat, ext->x_scn.x_comdat); return AUXESZ; } break; } - bfd_h_put_32 (abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); - bfd_h_put_16 (abfd, in->x_sym.x_tvndx, (bfd_byte *) ext->x_sym.x_tvndx); + H_PUT_32 (abfd, in->x_sym.x_tagndx.l, ext->x_sym.x_tagndx); + H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { @@ -393,19 +376,18 @@ _bfd_XXi_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) } else { - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], - (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } if (ISFCN (type)) - bfd_h_put_32 (abfd, in->x_sym.x_misc.x_fsize, - (bfd_byte *) ext->x_sym.x_misc.x_fsize); + H_PUT_32 (abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize); else { PUT_LNSZ_LNNO (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); @@ -424,7 +406,7 @@ _bfd_XXi_swap_lineno_in (abfd, ext1, in1) LINENO *ext = (LINENO *) ext1; struct internal_lineno *in = (struct internal_lineno *) in1; - in->l_addr.l_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->l_addr.l_symndx); + in->l_addr.l_symndx = H_GET_32 (abfd, ext->l_addr.l_symndx); in->l_lnno = GET_LINENO_LNNO (abfd, ext); } @@ -436,8 +418,7 @@ _bfd_XXi_swap_lineno_out (abfd, inp, outp) { struct internal_lineno *in = (struct internal_lineno *) inp; struct external_lineno *ext = (struct external_lineno *) outp; - bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *) - ext->l_addr.l_symndx); + H_PUT_32 (abfd, in->l_addr.l_symndx, ext->l_addr.l_symndx); PUT_LINENO_LNNO (abfd, in->l_lnno, ext); return LINESZ; @@ -454,63 +435,62 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) AOUTHDR *aouthdr_ext = (AOUTHDR *) aouthdr_ext1; struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1; - aouthdr_int->magic = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->magic); - aouthdr_int->vstamp = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->vstamp); - aouthdr_int->tsize = - GET_AOUTHDR_TSIZE (abfd, (bfd_byte *) aouthdr_ext->tsize); - aouthdr_int->dsize = - GET_AOUTHDR_DSIZE (abfd, (bfd_byte *) aouthdr_ext->dsize); - aouthdr_int->bsize = - GET_AOUTHDR_BSIZE (abfd, (bfd_byte *) aouthdr_ext->bsize); - aouthdr_int->entry = - GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry); + aouthdr_int->magic = H_GET_16 (abfd, aouthdr_ext->magic); + aouthdr_int->vstamp = H_GET_16 (abfd, aouthdr_ext->vstamp); + aouthdr_int->tsize = GET_AOUTHDR_TSIZE (abfd, aouthdr_ext->tsize); + aouthdr_int->dsize = GET_AOUTHDR_DSIZE (abfd, aouthdr_ext->dsize); + aouthdr_int->bsize = GET_AOUTHDR_BSIZE (abfd, aouthdr_ext->bsize); + aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry); aouthdr_int->text_start = - GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start); + GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start); #ifndef COFF_WITH_pep /* PE32+ does not have data_start member! */ aouthdr_int->data_start = - GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start); + GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start); #endif a = &aouthdr_int->pe; - a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, (bfd_byte *) src->ImageBase); - a->SectionAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->SectionAlignment); - a->FileAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->FileAlignment); + a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, src->ImageBase); + a->SectionAlignment = H_GET_32 (abfd, src->SectionAlignment); + a->FileAlignment = H_GET_32 (abfd, src->FileAlignment); a->MajorOperatingSystemVersion = - bfd_h_get_16 (abfd, (bfd_byte *) src->MajorOperatingSystemVersion); + H_GET_16 (abfd, src->MajorOperatingSystemVersion); a->MinorOperatingSystemVersion = - bfd_h_get_16 (abfd, (bfd_byte *) src->MinorOperatingSystemVersion); - a->MajorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorImageVersion); - a->MinorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorImageVersion); - a->MajorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorSubsystemVersion); - a->MinorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorSubsystemVersion); - a->Reserved1 = bfd_h_get_32 (abfd, (bfd_byte *) src->Reserved1); - a->SizeOfImage = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfImage); - a->SizeOfHeaders = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfHeaders); - a->CheckSum = bfd_h_get_32 (abfd, (bfd_byte *) src->CheckSum); - a->Subsystem = bfd_h_get_16 (abfd, (bfd_byte *) src->Subsystem); - a->DllCharacteristics = bfd_h_get_16 (abfd, (bfd_byte *) src->DllCharacteristics); - a->SizeOfStackReserve = GET_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, (bfd_byte *) src->SizeOfStackReserve); - a->SizeOfStackCommit = GET_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, (bfd_byte *) src->SizeOfStackCommit); - a->SizeOfHeapReserve = GET_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, (bfd_byte *) src->SizeOfHeapReserve); - a->SizeOfHeapCommit = GET_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, (bfd_byte *) src->SizeOfHeapCommit); - a->LoaderFlags = bfd_h_get_32 (abfd, (bfd_byte *) src->LoaderFlags); - a->NumberOfRvaAndSizes = bfd_h_get_32 (abfd, (bfd_byte *) src->NumberOfRvaAndSizes); + H_GET_16 (abfd, src->MinorOperatingSystemVersion); + a->MajorImageVersion = H_GET_16 (abfd, src->MajorImageVersion); + a->MinorImageVersion = H_GET_16 (abfd, src->MinorImageVersion); + a->MajorSubsystemVersion = H_GET_16 (abfd, src->MajorSubsystemVersion); + a->MinorSubsystemVersion = H_GET_16 (abfd, src->MinorSubsystemVersion); + a->Reserved1 = H_GET_32 (abfd, src->Reserved1); + a->SizeOfImage = H_GET_32 (abfd, src->SizeOfImage); + a->SizeOfHeaders = H_GET_32 (abfd, src->SizeOfHeaders); + a->CheckSum = H_GET_32 (abfd, src->CheckSum); + a->Subsystem = H_GET_16 (abfd, src->Subsystem); + a->DllCharacteristics = H_GET_16 (abfd, src->DllCharacteristics); + a->SizeOfStackReserve = + GET_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, src->SizeOfStackReserve); + a->SizeOfStackCommit = + GET_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, src->SizeOfStackCommit); + a->SizeOfHeapReserve = + GET_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, src->SizeOfHeapReserve); + a->SizeOfHeapCommit = + GET_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, src->SizeOfHeapCommit); + a->LoaderFlags = H_GET_32 (abfd, src->LoaderFlags); + a->NumberOfRvaAndSizes = H_GET_32 (abfd, src->NumberOfRvaAndSizes); { int idx; + for (idx = 0; idx < 16; idx++) { /* If data directory is empty, rva also should be 0. */ int size = - bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][1]); + H_GET_32 (abfd, src->DataDirectory[idx][1]); a->DataDirectory[idx].Size = size; if (size) - { - a->DataDirectory[idx].VirtualAddress = - bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]); - } + a->DataDirectory[idx].VirtualAddress = + H_GET_32 (abfd, src->DataDirectory[idx][0]); else a->DataDirectory[idx].VirtualAddress = 0; } @@ -523,6 +503,7 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) aouthdr_int->entry &= 0xffffffff; #endif } + if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; @@ -530,6 +511,7 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) aouthdr_int->text_start &= 0xffffffff; #endif } + #ifndef COFF_WITH_pep /* PE32+ does not have data_start member! */ if (aouthdr_int->dsize) @@ -547,7 +529,6 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) thunk_size = a->DataDirectory[12].Size; import_table_size = a->DataDirectory[1].Size; #endif - } /* A support function for below. */ @@ -562,12 +543,12 @@ add_data_entry (abfd, aout, idx, name, base) { asection *sec = bfd_get_section_by_name (abfd, name); - /* add import directory information if it exists */ + /* Add import directory information if it exists. */ if ((sec != NULL) && (coff_section_data (abfd, sec) != NULL) && (pei_section_data (abfd, sec) != NULL)) { - /* If data directory is empty, rva also should be 0 */ + /* If data directory is empty, rva also should be 0. */ int size = pei_section_data (abfd, sec)->virt_size; aout->DataDirectory[idx].Size = size; @@ -614,6 +595,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) aouthdr_in->text_start &= 0xffffffff; #endif } + if (aouthdr_in->dsize) { aouthdr_in->data_start -= ib; @@ -621,6 +603,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) aouthdr_in->data_start &= 0xffffffff; #endif } + if (aouthdr_in->entry) { aouthdr_in->entry -= ib; @@ -691,79 +674,67 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) } extra->SizeOfHeaders = abfd->sections->filepos; - bfd_h_put_16 (abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->standard.magic); + H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->standard.magic); #define LINKER_VERSION 256 /* That is, 2.56 */ /* This piece of magic sets the "linker version" field to LINKER_VERSION. */ - bfd_h_put_16 (abfd, - LINKER_VERSION / 100 + (LINKER_VERSION % 100) * 256, - (bfd_byte *) aouthdr_out->standard.vstamp); - - PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, (bfd_byte *) aouthdr_out->standard.tsize); - PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, (bfd_byte *) aouthdr_out->standard.dsize); - PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, (bfd_byte *) aouthdr_out->standard.bsize); - PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, (bfd_byte *) aouthdr_out->standard.entry); + H_PUT_16 (abfd, (LINKER_VERSION / 100 + (LINKER_VERSION % 100) * 256), + aouthdr_out->standard.vstamp); + + PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, aouthdr_out->standard.tsize); + PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, aouthdr_out->standard.dsize); + PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, aouthdr_out->standard.bsize); + PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, aouthdr_out->standard.entry); PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, - (bfd_byte *) aouthdr_out->standard.text_start); + aouthdr_out->standard.text_start); #ifndef COFF_WITH_pep /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, - (bfd_byte *) aouthdr_out->standard.data_start); + aouthdr_out->standard.data_start); #endif - PUT_OPTHDR_IMAGE_BASE (abfd, extra->ImageBase, - (bfd_byte *) aouthdr_out->ImageBase); - bfd_h_put_32 (abfd, extra->SectionAlignment, - (bfd_byte *) aouthdr_out->SectionAlignment); - bfd_h_put_32 (abfd, extra->FileAlignment, - (bfd_byte *) aouthdr_out->FileAlignment); - bfd_h_put_16 (abfd, extra->MajorOperatingSystemVersion, - (bfd_byte *) aouthdr_out->MajorOperatingSystemVersion); - bfd_h_put_16 (abfd, extra->MinorOperatingSystemVersion, - (bfd_byte *) aouthdr_out->MinorOperatingSystemVersion); - bfd_h_put_16 (abfd, extra->MajorImageVersion, - (bfd_byte *) aouthdr_out->MajorImageVersion); - bfd_h_put_16 (abfd, extra->MinorImageVersion, - (bfd_byte *) aouthdr_out->MinorImageVersion); - bfd_h_put_16 (abfd, extra->MajorSubsystemVersion, - (bfd_byte *) aouthdr_out->MajorSubsystemVersion); - bfd_h_put_16 (abfd, extra->MinorSubsystemVersion, - (bfd_byte *) aouthdr_out->MinorSubsystemVersion); - bfd_h_put_32 (abfd, extra->Reserved1, - (bfd_byte *) aouthdr_out->Reserved1); - bfd_h_put_32 (abfd, extra->SizeOfImage, - (bfd_byte *) aouthdr_out->SizeOfImage); - bfd_h_put_32 (abfd, extra->SizeOfHeaders, - (bfd_byte *) aouthdr_out->SizeOfHeaders); - bfd_h_put_32 (abfd, extra->CheckSum, - (bfd_byte *) aouthdr_out->CheckSum); - bfd_h_put_16 (abfd, extra->Subsystem, - (bfd_byte *) aouthdr_out->Subsystem); - bfd_h_put_16 (abfd, extra->DllCharacteristics, - (bfd_byte *) aouthdr_out->DllCharacteristics); + PUT_OPTHDR_IMAGE_BASE (abfd, extra->ImageBase, aouthdr_out->ImageBase); + H_PUT_32 (abfd, extra->SectionAlignment, aouthdr_out->SectionAlignment); + H_PUT_32 (abfd, extra->FileAlignment, aouthdr_out->FileAlignment); + H_PUT_16 (abfd, extra->MajorOperatingSystemVersion, + aouthdr_out->MajorOperatingSystemVersion); + H_PUT_16 (abfd, extra->MinorOperatingSystemVersion, + aouthdr_out->MinorOperatingSystemVersion); + H_PUT_16 (abfd, extra->MajorImageVersion, aouthdr_out->MajorImageVersion); + H_PUT_16 (abfd, extra->MinorImageVersion, aouthdr_out->MinorImageVersion); + H_PUT_16 (abfd, extra->MajorSubsystemVersion, + aouthdr_out->MajorSubsystemVersion); + H_PUT_16 (abfd, extra->MinorSubsystemVersion, + aouthdr_out->MinorSubsystemVersion); + H_PUT_32 (abfd, extra->Reserved1, aouthdr_out->Reserved1); + H_PUT_32 (abfd, extra->SizeOfImage, aouthdr_out->SizeOfImage); + H_PUT_32 (abfd, extra->SizeOfHeaders, aouthdr_out->SizeOfHeaders); + H_PUT_32 (abfd, extra->CheckSum, aouthdr_out->CheckSum); + H_PUT_16 (abfd, extra->Subsystem, aouthdr_out->Subsystem); + H_PUT_16 (abfd, extra->DllCharacteristics, aouthdr_out->DllCharacteristics); PUT_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, extra->SizeOfStackReserve, - (bfd_byte *) aouthdr_out->SizeOfStackReserve); + aouthdr_out->SizeOfStackReserve); PUT_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, extra->SizeOfStackCommit, - (bfd_byte *) aouthdr_out->SizeOfStackCommit); + aouthdr_out->SizeOfStackCommit); PUT_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, extra->SizeOfHeapReserve, - (bfd_byte *) aouthdr_out->SizeOfHeapReserve); + aouthdr_out->SizeOfHeapReserve); PUT_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, extra->SizeOfHeapCommit, - (bfd_byte *) aouthdr_out->SizeOfHeapCommit); - bfd_h_put_32 (abfd, extra->LoaderFlags, - (bfd_byte *) aouthdr_out->LoaderFlags); - bfd_h_put_32 (abfd, extra->NumberOfRvaAndSizes, - (bfd_byte *) aouthdr_out->NumberOfRvaAndSizes); + aouthdr_out->SizeOfHeapCommit); + H_PUT_32 (abfd, extra->LoaderFlags, aouthdr_out->LoaderFlags); + H_PUT_32 (abfd, extra->NumberOfRvaAndSizes, + aouthdr_out->NumberOfRvaAndSizes); { int idx; + for (idx = 0; idx < 16; idx++) { - bfd_h_put_32 (abfd, extra->DataDirectory[idx].VirtualAddress, - (bfd_byte *) aouthdr_out->DataDirectory[idx][0]); - bfd_h_put_32 (abfd, extra->DataDirectory[idx].Size, - (bfd_byte *) aouthdr_out->DataDirectory[idx][1]); + H_PUT_32 (abfd, extra->DataDirectory[idx].VirtualAddress, + aouthdr_out->DataDirectory[idx][0]); + H_PUT_32 (abfd, extra->DataDirectory[idx].Size, + aouthdr_out->DataDirectory[idx][1]); } } @@ -832,63 +803,51 @@ _bfd_XXi_only_swap_filehdr_out (abfd, in, out) filehdr_in->pe.dos_message[15] = 0x0; filehdr_in->pe.nt_signature = NT_SIGNATURE; - 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); + H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic); + H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); - bfd_h_put_32 (abfd, time (0), (bfd_byte *) filehdr_out->f_timdat); - PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr, - (bfd_byte *) filehdr_out->f_symptr); - bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); - 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); + H_PUT_32 (abfd, time (0), filehdr_out->f_timdat); + PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, + filehdr_out->f_symptr); + H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms); + H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr); + H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags); - /* put in extra dos header stuff. This data remains essentially + /* Put in extra dos header stuff. This data remains essentially constant, it just has to be tacked on to the beginning of all exes - for NT */ - bfd_h_put_16 (abfd, filehdr_in->pe.e_magic, (bfd_byte *) filehdr_out->e_magic); - bfd_h_put_16 (abfd, filehdr_in->pe.e_cblp, (bfd_byte *) filehdr_out->e_cblp); - bfd_h_put_16 (abfd, filehdr_in->pe.e_cp, (bfd_byte *) filehdr_out->e_cp); - bfd_h_put_16 (abfd, filehdr_in->pe.e_crlc, (bfd_byte *) filehdr_out->e_crlc); - bfd_h_put_16 (abfd, filehdr_in->pe.e_cparhdr, - (bfd_byte *) filehdr_out->e_cparhdr); - bfd_h_put_16 (abfd, filehdr_in->pe.e_minalloc, - (bfd_byte *) filehdr_out->e_minalloc); - bfd_h_put_16 (abfd, filehdr_in->pe.e_maxalloc, - (bfd_byte *) filehdr_out->e_maxalloc); - bfd_h_put_16 (abfd, filehdr_in->pe.e_ss, (bfd_byte *) filehdr_out->e_ss); - bfd_h_put_16 (abfd, filehdr_in->pe.e_sp, (bfd_byte *) filehdr_out->e_sp); - bfd_h_put_16 (abfd, filehdr_in->pe.e_csum, (bfd_byte *) filehdr_out->e_csum); - bfd_h_put_16 (abfd, filehdr_in->pe.e_ip, (bfd_byte *) filehdr_out->e_ip); - bfd_h_put_16 (abfd, filehdr_in->pe.e_cs, (bfd_byte *) filehdr_out->e_cs); - bfd_h_put_16 (abfd, filehdr_in->pe.e_lfarlc, (bfd_byte *) filehdr_out->e_lfarlc); - bfd_h_put_16 (abfd, filehdr_in->pe.e_ovno, (bfd_byte *) filehdr_out->e_ovno); - { - int idx; - for (idx = 0; idx < 4; idx++) - bfd_h_put_16 (abfd, filehdr_in->pe.e_res[idx], - (bfd_byte *) filehdr_out->e_res[idx]); - } - bfd_h_put_16 (abfd, filehdr_in->pe.e_oemid, (bfd_byte *) filehdr_out->e_oemid); - bfd_h_put_16 (abfd, filehdr_in->pe.e_oeminfo, - (bfd_byte *) filehdr_out->e_oeminfo); - { - int idx; - for (idx = 0; idx < 10; idx++) - bfd_h_put_16 (abfd, filehdr_in->pe.e_res2[idx], - (bfd_byte *) filehdr_out->e_res2[idx]); - } - bfd_h_put_32 (abfd, filehdr_in->pe.e_lfanew, (bfd_byte *) filehdr_out->e_lfanew); + for NT. */ + H_PUT_16 (abfd, filehdr_in->pe.e_magic, filehdr_out->e_magic); + H_PUT_16 (abfd, filehdr_in->pe.e_cblp, filehdr_out->e_cblp); + H_PUT_16 (abfd, filehdr_in->pe.e_cp, filehdr_out->e_cp); + H_PUT_16 (abfd, filehdr_in->pe.e_crlc, filehdr_out->e_crlc); + H_PUT_16 (abfd, filehdr_in->pe.e_cparhdr, filehdr_out->e_cparhdr); + H_PUT_16 (abfd, filehdr_in->pe.e_minalloc, filehdr_out->e_minalloc); + H_PUT_16 (abfd, filehdr_in->pe.e_maxalloc, filehdr_out->e_maxalloc); + H_PUT_16 (abfd, filehdr_in->pe.e_ss, filehdr_out->e_ss); + H_PUT_16 (abfd, filehdr_in->pe.e_sp, filehdr_out->e_sp); + H_PUT_16 (abfd, filehdr_in->pe.e_csum, filehdr_out->e_csum); + H_PUT_16 (abfd, filehdr_in->pe.e_ip, filehdr_out->e_ip); + H_PUT_16 (abfd, filehdr_in->pe.e_cs, filehdr_out->e_cs); + H_PUT_16 (abfd, filehdr_in->pe.e_lfarlc, filehdr_out->e_lfarlc); + H_PUT_16 (abfd, filehdr_in->pe.e_ovno, filehdr_out->e_ovno); - { - int idx; - for (idx = 0; idx < 16; idx++) - bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx], - (bfd_byte *) filehdr_out->dos_message[idx]); - } + for (idx = 0; idx < 4; idx++) + H_PUT_16 (abfd, filehdr_in->pe.e_res[idx], filehdr_out->e_res[idx]); + + H_PUT_16 (abfd, filehdr_in->pe.e_oemid, filehdr_out->e_oemid); + H_PUT_16 (abfd, filehdr_in->pe.e_oeminfo, filehdr_out->e_oeminfo); + + for (idx = 0; idx < 10; idx++) + H_PUT_16 (abfd, filehdr_in->pe.e_res2[idx], filehdr_out->e_res2[idx]); + + H_PUT_32 (abfd, filehdr_in->pe.e_lfanew, filehdr_out->e_lfanew); + + for (idx = 0; idx < 16; idx++) + H_PUT_32 (abfd, filehdr_in->pe.dos_message[idx], + filehdr_out->dos_message[idx]); /* Also put in the NT signature. */ - bfd_h_put_32 (abfd, filehdr_in->pe.nt_signature, - (bfd_byte *) filehdr_out->nt_signature); + H_PUT_32 (abfd, filehdr_in->pe.nt_signature, filehdr_out->nt_signature); return FILHSZ; } @@ -902,14 +861,13 @@ _bfd_XX_only_swap_filehdr_out (abfd, in, out) struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; FILHDR *filehdr_out = (FILHDR *) out; - 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); - PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr, - (bfd_byte *) filehdr_out->f_symptr); - bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); - 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); + H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic); + H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); + H_PUT_32 (abfd, filehdr_in->f_timdat, filehdr_out->f_timdat); + PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, filehdr_out->f_symptr); + H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms); + H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr); + H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags); return FILHSZ; } @@ -932,12 +890,11 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) ((scnhdr_int->s_vaddr - pe_data (abfd)->pe_opthdr.ImageBase) & 0xffffffff), - (bfd_byte *) scnhdr_ext->s_vaddr); + scnhdr_ext->s_vaddr); /* NT wants the size data to be rounded up to the next NT_FILE_ALIGNMENT, but zero if it has no content (as in .bss, sometimes). */ - if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0) { ps = scnhdr_int->s_size; @@ -950,17 +907,17 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) } PUT_SCNHDR_SIZE (abfd, ss, - (bfd_byte *) scnhdr_ext->s_size); + scnhdr_ext->s_size); /* s_paddr in PE is really the virtual size. */ - PUT_SCNHDR_PADDR (abfd, ps, (bfd_byte *) scnhdr_ext->s_paddr); + PUT_SCNHDR_PADDR (abfd, ps, scnhdr_ext->s_paddr); PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, - (bfd_byte *) scnhdr_ext->s_scnptr); + scnhdr_ext->s_scnptr); PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, - (bfd_byte *) scnhdr_ext->s_relptr); + scnhdr_ext->s_relptr); PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, - (bfd_byte *) scnhdr_ext->s_lnnoptr); + scnhdr_ext->s_lnnoptr); /* Extra flags must be set when dealing with NT. All sections should also have the IMAGE_SCN_MEM_READ (0x40000000) flag set. In addition, the @@ -978,7 +935,8 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) { int flags = scnhdr_int->s_flags; - bfd_h_put_32 (abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); + + H_PUT_32 (abfd, flags, scnhdr_ext->s_flags); } if (coff_data (abfd)->link_info @@ -994,41 +952,37 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) executables, but the 17-th bit has been observed to be there. Overflow is not an issue: a 4G-line program will overflow a bunch of other fields long before this! */ - bfd_h_put_16 (abfd, scnhdr_int->s_nlnno & 0xffff, - (bfd_byte *) scnhdr_ext->s_nlnno); - bfd_h_put_16 (abfd, scnhdr_int->s_nlnno >> 16, - (bfd_byte *) scnhdr_ext->s_nreloc); + H_PUT_16 (abfd, (scnhdr_int->s_nlnno & 0xffff), scnhdr_ext->s_nlnno); + H_PUT_16 (abfd, (scnhdr_int->s_nlnno >> 16), scnhdr_ext->s_nreloc); } else { if (scnhdr_int->s_nlnno <= 0xffff) - bfd_h_put_16 (abfd, scnhdr_int->s_nlnno, - (bfd_byte *) scnhdr_ext->s_nlnno); + H_PUT_16 (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno); else { (*_bfd_error_handler) (_("%s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), scnhdr_int->s_nlnno); bfd_set_error (bfd_error_file_truncated); - bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + H_PUT_16 (abfd, 0xffff, scnhdr_ext->s_nlnno); ret = 0; } + if (scnhdr_int->s_nreloc <= 0xffff) - bfd_h_put_16 (abfd, scnhdr_int->s_nreloc, - (bfd_byte *) scnhdr_ext->s_nreloc); + H_PUT_16 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); else { - /* PE can deal with large #s of relocs, but not here */ - bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + /* PE can deal with large #s of relocs, but not here. */ + H_PUT_16 (abfd, 0xffff, scnhdr_ext->s_nreloc); scnhdr_int->s_flags |= IMAGE_SCN_LNK_NRELOC_OVFL; - bfd_h_put_32 (abfd, scnhdr_int->s_flags, - (bfd_byte *) scnhdr_ext->s_flags); + H_PUT_32 (abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags); #if 0 (*_bfd_error_handler) (_("%s: reloc overflow 1: 0x%lx > 0xffff"), bfd_get_filename (abfd), scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); - bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + H_PUT_16 (abfd, 0xffff, scnhdr_ext->s_nreloc); ret = 0; #endif } @@ -1036,26 +990,26 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) return ret; } -static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = { - N_("Export Directory [.edata (or where ever we found it)]"), - N_("Import Directory [parts of .idata]"), - N_("Resource Directory [.rsrc]"), - N_("Exception Directory [.pdata]"), - N_("Security Directory"), - N_("Base Relocation Directory [.reloc]"), - N_("Debug Directory"), - N_("Description Directory"), - N_("Special Directory"), - N_("Thread Storage Directory [.tls]"), - N_("Load Configuration Directory"), - N_("Bound Import Directory"), - N_("Import Address Table Directory"), - N_("Delay Import Directory"), - N_("Reserved"), - N_("Reserved") -}; - -/**********************************************************************/ +static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = + { + N_("Export Directory [.edata (or where ever we found it)]"), + N_("Import Directory [parts of .idata]"), + N_("Resource Directory [.rsrc]"), + N_("Exception Directory [.pdata]"), + N_("Security Directory"), + N_("Base Relocation Directory [.reloc]"), + N_("Debug Directory"), + N_("Description Directory"), + N_("Special Directory"), + N_("Thread Storage Directory [.tls]"), + N_("Load Configuration Directory"), + N_("Bound Import Directory"), + N_("Import Address Table Directory"), + N_("Delay Import Directory"), + N_("Reserved"), + N_("Reserved") + }; + #ifdef POWERPC_LE_PE /* The code for the PPC really falls in the "architecture dependent" category. However, it's not clear that anyone will ever care, so @@ -1064,7 +1018,6 @@ static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = { PPC- specific code. */ #endif -/**********************************************************************/ static boolean pe_print_idata (abfd, vfile) bfd *abfd; @@ -1082,6 +1035,7 @@ pe_print_idata (abfd, vfile) bfd_size_type datasize = 0; bfd_size_type dataoff; bfd_size_type i; + bfd_size_type amt; int onaline = 20; pe_data_type *pe = pe_data (abfd); @@ -1143,15 +1097,13 @@ pe_print_idata (abfd, vfile) bfd_byte *data = 0; int offset; - data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, - rel_section)); - if (data == NULL && bfd_section_size (abfd, rel_section) != 0) + amt = bfd_section_size (abfd, rel_section); + data = (bfd_byte *) bfd_malloc (amt); + if (data == NULL && amt != 0) return false; - bfd_get_section_contents (abfd, - rel_section, - (PTR) data, 0, - bfd_section_size (abfd, rel_section)); + bfd_get_section_contents (abfd, rel_section, (PTR) data, (bfd_vma) 0, + amt); offset = abfd->start_address - rel_section->vma; @@ -1181,13 +1133,13 @@ pe_print_idata (abfd, vfile) fprintf (file, _(" Table Stamp Chain Name Thunk\n")); - data = (bfd_byte *) bfd_malloc (dataoff + datasize); + amt = dataoff + datasize; + data = (bfd_byte *) bfd_malloc (amt); if (data == NULL) return false; /* Read the whole section. Some of the fields might be before dataoff. */ - if (! bfd_get_section_contents (abfd, section, (PTR) data, - 0, dataoff + datasize)) + if (! bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, amt)) return false; adj = section->vma - extra->ImageBase; @@ -1205,13 +1157,11 @@ pe_print_idata (abfd, vfile) /* print (i + extra->DataDirectory[1].VirtualAddress) */ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); - +#if 0 if (i + 20 > datasize) - { - /* Check stuff. */ - ; - } - + /* Check stuff. */ + ; +#endif hint_addr = bfd_get_32 (abfd, data + i + dataoff); time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff); forward_chain = bfd_get_32 (abfd, data + i + 8 + dataoff); @@ -1299,11 +1249,10 @@ pe_print_idata (abfd, vfile) fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); differ = 1; } + if (iat_member == 0) - { - fprintf (file, - _("\t>>> Ran out of IAT members!\n")); - } + fprintf (file, + _("\t>>> Ran out of IAT members!\n")); else { ordinal = bfd_get_16 (abfd, data + iat_member - adj); @@ -1318,15 +1267,13 @@ pe_print_idata (abfd, vfile) if (hint_addr != 0 && hint_member == 0) break; } + if (differ == 0) - { - fprintf (file, - _("\tThe Import Address Table is identical\n")); - } + fprintf (file, + _("\tThe Import Address Table is identical\n")); } fprintf (file, "\n"); - } free (data); @@ -1342,24 +1289,23 @@ pe_print_edata (abfd, vfile) FILE *file = (FILE *) vfile; bfd_byte *data; asection *section; - bfd_size_type datasize = 0; bfd_size_type dataoff; bfd_size_type i; - bfd_signed_vma adj; - struct EDT_type { - long export_flags; /* reserved - should be zero */ + struct EDT_type + { + long export_flags; /* reserved - should be zero */ long time_stamp; short major_ver; short minor_ver; - bfd_vma name; /* rva - relative to image base */ - long base; /* ordinal base */ - unsigned long num_functions; /* Number in the export address table */ - unsigned long num_names; /* Number in the name pointer table */ - bfd_vma eat_addr; /* rva to the export address table */ - bfd_vma npt_addr; /* rva to the Export Name Pointer Table */ - bfd_vma ot_addr; /* rva to the Ordinal Table */ + bfd_vma name; /* rva - relative to image base */ + long base; /* ordinal base */ + unsigned long num_functions;/* Number in the export address table */ + unsigned long num_names; /* Number in the name pointer table */ + bfd_vma eat_addr; /* rva to the export address table */ + bfd_vma npt_addr; /* rva to the Export Name Pointer Table */ + bfd_vma ot_addr; /* rva to the Ordinal Table */ } edt; pe_data_type *pe = pe_data (abfd); @@ -1384,9 +1330,11 @@ pe_print_edata (abfd, vfile) else { addr += extra->ImageBase; + for (section = abfd->sections; section != NULL; section = section->next) { datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) break; } @@ -1409,8 +1357,8 @@ pe_print_edata (abfd, vfile) if (data == NULL) return false; - if (! bfd_get_section_contents (abfd, section, (PTR) data, dataoff, - datasize)) + if (! bfd_get_section_contents (abfd, section, (PTR) data, + (file_ptr) dataoff, datasize)) return false; /* Go get Export Directory Table. */ @@ -1428,7 +1376,7 @@ pe_print_edata (abfd, vfile) adj = section->vma - extra->ImageBase + dataoff; - /* Dump the EDT first first */ + /* Dump the EDT first. */ fprintf (file, _("\nThe Export Tables (interpreted %s section contents)\n\n"), section->name); @@ -1482,7 +1430,8 @@ pe_print_edata (abfd, vfile) /* The next table to find is the Export Address Table. It's basically a list of pointers that either locate a function in this dll, or forward the call to another dll. Something like: - typedef union { + typedef union + { long export_rva; long forwarder_rva; } export_address_table_entry; @@ -1596,18 +1545,16 @@ pe_print_pdata (abfd, vfile) _(" \t\tAddress Address Handler Data Address Mask\n")); #endif - if (bfd_section_size (abfd, section) == 0) + datasize = bfd_section_size (abfd, section); + if (datasize == 0) return true; - data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section)); - datasize = bfd_section_size (abfd, section); + data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL && datasize != 0) return false; - bfd_get_section_contents (abfd, - section, - (PTR) data, 0, - bfd_section_size (abfd, section)); + bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, + datasize); start = 0; @@ -1631,10 +1578,8 @@ pe_print_pdata (abfd, vfile) if (begin_addr == 0 && end_addr == 0 && eh_handler == 0 && eh_data == 0 && prolog_end_addr == 0) - { - /* We are probably into the padding of the section now. */ - break; - } + /* We are probably into the padding of the section now. */ + break; em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3); eh_handler &= ~(bfd_vma) 0x3; @@ -1687,21 +1632,22 @@ pe_print_pdata (abfd, vfile) } #define IMAGE_REL_BASED_HIGHADJ 4 -static const char * const tbl[] = { - "ABSOLUTE", - "HIGH", - "LOW", - "HIGHLOW", - "HIGHADJ", - "MIPS_JMPADDR", - "SECTION", - "REL32", - "RESERVED1", - "MIPS_JMPADDR16", - "DIR64", - "HIGH3ADJ" - "UNKNOWN", /* MUST be last */ -}; +static const char * const tbl[] = + { + "ABSOLUTE", + "HIGH", + "LOW", + "HIGHLOW", + "HIGHADJ", + "MIPS_JMPADDR", + "SECTION", + "REL32", + "RESERVED1", + "MIPS_JMPADDR16", + "DIR64", + "HIGH3ADJ" + "UNKNOWN", /* MUST be last */ + }; static boolean pe_print_reloc (abfd, vfile) @@ -1711,7 +1657,7 @@ pe_print_reloc (abfd, vfile) FILE *file = (FILE *) vfile; bfd_byte *data = 0; asection *section = bfd_get_section_by_name (abfd, ".reloc"); - bfd_size_type datasize = 0; + bfd_size_type datasize; bfd_size_type i; bfd_size_type start, stop; @@ -1724,15 +1670,13 @@ pe_print_reloc (abfd, vfile) fprintf (file, _("\n\nPE File Base Relocations (interpreted .reloc section contents)\n")); - data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section)); datasize = bfd_section_size (abfd, section); + data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL && datasize != 0) return false; - bfd_get_section_contents (abfd, - section, - (PTR) data, 0, - bfd_section_size (abfd, section)); + bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, + datasize); start = 0; @@ -1745,16 +1689,13 @@ pe_print_reloc (abfd, vfile) long number, size; /* The .reloc section is a sequence of blocks, with a header consisting - of two 32 bit quantities, followed by a number of 16 bit entries */ - + of two 32 bit quantities, followed by a number of 16 bit entries. */ virtual_address = bfd_get_32 (abfd, data+i); size = bfd_get_32 (abfd, data+i+4); number = (size - 8) / 2; if (size == 0) - { - break; - } + break; fprintf (file, _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), @@ -1785,6 +1726,7 @@ pe_print_reloc (abfd, vfile) fprintf (file, "\n"); } + i += size; } @@ -1845,6 +1787,7 @@ _bfd_XX_print_private_bfd_data_common (abfd, vfile) fprintf (file, "SizeOfImage\t\t%08lx\n", i->SizeOfImage); fprintf (file, "SizeOfHeaders\t\t%08lx\n", i->SizeOfHeaders); fprintf (file, "CheckSum\t\t%08lx\n", i->CheckSum); + switch (i->Subsystem) { case IMAGE_SUBSYSTEM_UNKNOWN: @@ -1875,6 +1818,7 @@ _bfd_XX_print_private_bfd_data_common (abfd, vfile) subsystem_name = "EFI runtime driver"; break; } + fprintf (file, "Subsystem\t\t%08x", i->Subsystem); if (subsystem_name) fprintf (file, "\t(%s)", subsystem_name); @@ -1922,7 +1866,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd) pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr; pe_data (obfd)->dll = pe_data (ibfd)->dll; - /* for strip: if we removed .reloc, we'll make a real mess of things + /* For strip: if we removed .reloc, we'll make a real mess of things if we don't remove this entry as well. */ if (! pe_data (obfd)->has_reloc_section) { @@ -1933,6 +1877,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd) } /* Copy private section data. */ + boolean _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -1949,18 +1894,20 @@ _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) { if (coff_section_data (obfd, osec) == NULL) { - osec->used_by_bfd = - (PTR) bfd_zalloc (obfd, sizeof (struct coff_section_tdata)); + bfd_size_type amt = sizeof (struct coff_section_tdata); + osec->used_by_bfd = (PTR) bfd_zalloc (obfd, amt); if (osec->used_by_bfd == NULL) return false; } + if (pei_section_data (obfd, osec) == NULL) { - coff_section_data (obfd, osec)->tdata = - (PTR) bfd_zalloc (obfd, sizeof (struct pei_section_tdata)); + bfd_size_type amt = sizeof (struct pei_section_tdata); + coff_section_data (obfd, osec)->tdata = (PTR) bfd_zalloc (obfd, amt); if (coff_section_data (obfd, osec)->tdata == NULL) return false; } + pei_section_data (obfd, osec)->virt_size = pei_section_data (ibfd, isec)->virt_size; pei_section_data (obfd, osec)->pe_flags = diff --git a/contrib/binutils/bfd/po/Make-in b/contrib/binutils/bfd/po/Make-in index 2414748..a288585 100644 --- a/contrib/binutils/bfd/po/Make-in +++ b/contrib/binutils/bfd/po/Make-in @@ -205,12 +205,12 @@ clean: mostlyclean distclean: clean rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m - rm -f SRC-POTFILES BLD-POTFILES SRC-POTFILES.in BLD-POTFILES.in + rm -f SRC-POTFILES BLD-POTFILES maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) + rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: update-po $(DISTFILES) diff --git a/contrib/binutils/bfd/po/SRC-POTFILES.in b/contrib/binutils/bfd/po/SRC-POTFILES.in index ab40ed1..0ef9b4a 100644 --- a/contrib/binutils/bfd/po/SRC-POTFILES.in +++ b/contrib/binutils/bfd/po/SRC-POTFILES.in @@ -12,6 +12,7 @@ aout64.c aoutf1.h aoutx.h archive.c +archive64.c archures.c armnetbsd.c bfd.c @@ -36,7 +37,6 @@ coff-i960.c coff-m68k.c coff-m88k.c coff-mips.c -coff-pmac.c coff-rs6000.c coff-sh.c coff-sparc.c @@ -81,10 +81,14 @@ cpu-m68k.c cpu-m88k.c cpu-mcore.c cpu-mips.c +cpu-mmix.c cpu-ns32k.c +cpu-openrisc.c +cpu-pdp11.c cpu-pj.c cpu-powerpc.c cpu-rs6000.c +cpu-s390.c cpu-sh.c cpu-sparc.c cpu-tic30.c @@ -94,6 +98,7 @@ cpu-v850.c cpu-vax.c cpu-w65.c cpu-we32k.c +cpu-xstormy16.c cpu-z8k.c demo64.c dwarf1.c @@ -104,9 +109,11 @@ ecoffswap.h efi-app-ia32.c efi-app-ia64.c elf-bfd.h +elf-eh-frame.c elf-hppa.h elf-m10200.c elf-m10300.c +elf-strtab.c elf.c elf32-arc.c elf32-arm.h @@ -116,6 +123,7 @@ elf32-d10v.c elf32-d30v.c elf32-fr30.c elf32-gen.c +elf32-h8300.c elf32-hppa.c elf32-hppa.h elf32-i370.c @@ -129,18 +137,25 @@ elf32-m68k.c elf32-m88k.c elf32-mcore.c elf32-mips.c +elf32-openrisc.c elf32-pj.c elf32-ppc.c +elf32-s390.c elf32-sh-lin.c +elf32-sh-nbsd.c elf32-sh.c elf32-sparc.c elf32-v850.c +elf32-xstormy16.c elf32.c elf64-alpha.c elf64-gen.c elf64-hppa.c elf64-hppa.h elf64-mips.c +elf64-mmix.c +elf64-ppc.c +elf64-s390.c elf64-sparc.c elf64-x86-64.c elf64.c @@ -184,6 +199,7 @@ libieee.h libnlm.h liboasys.h libpei.h +libxcoff.h linker.c lynx-core.c m68k4knetbsd.c @@ -191,7 +207,9 @@ m68klinux.c m68klynx.c m68knetbsd.c m88kmach3.c +merge.c mipsbsd.c +mmo.c netbsd.h newsos3.c nlm-target.h @@ -210,6 +228,7 @@ oasys.c opncls.c osf-core.c pc532-mach.c +pdp11.c pe-arm.c pe-i386.c pe-mcore.c @@ -244,6 +263,7 @@ tekhex.c trad-core.c vaxnetbsd.c versados.c +version.h vms-gsd.c vms-hdr.c vms-misc.c diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot index e77b05d..bb8a425 100644 --- a/contrib/binutils/bfd/po/bfd.pot +++ b/contrib/binutils/bfd/po/bfd.pot @@ -6,2016 +6,2092 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-01-11 11:54-0800\n" +"POT-Creation-Date: 2002-01-17 12:55+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" -#: aout-adobe.c:189 +#: aout-adobe.c:196 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aout-cris.c:205 +#: aout-cris.c:208 #, c-format msgid "%s: Invalid relocation type exported: %d" msgstr "" -#: aout-cris.c:249 +#: aout-cris.c:252 #, c-format msgid "%s: Invalid relocation type imported: %d" msgstr "" -#: aout-cris.c:260 +#: aout-cris.c:263 #, c-format msgid "%s: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1259 aoutx.h:1673 +#: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1643 +#: aoutx.h:1669 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1645 +#: aoutx.h:1671 msgid "*unknown*" msgstr "" -#: aoutx.h:3684 +#: aoutx.h:3735 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "" -#: archive.c:1820 +#: archive.c:1826 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2086 +#: archive.c:2093 msgid "Reading archive file mod timestamp" msgstr "" #. FIXME: bfd can't call perror. -#: archive.c:2113 +#: archive.c:2120 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:273 +#: bfd.c:281 msgid "No error" msgstr "" -#: bfd.c:274 +#: bfd.c:282 msgid "System call error" msgstr "" -#: bfd.c:275 +#: bfd.c:283 msgid "Invalid bfd target" msgstr "" -#: bfd.c:276 +#: bfd.c:284 msgid "File in wrong format" msgstr "" -#: bfd.c:277 +#: bfd.c:285 +msgid "Archive object file in wrong format" +msgstr "" + +#: bfd.c:286 msgid "Invalid operation" msgstr "" -#: bfd.c:278 +#: bfd.c:287 msgid "Memory exhausted" msgstr "" -#: bfd.c:279 +#: bfd.c:288 msgid "No symbols" msgstr "" -#: bfd.c:280 +#: bfd.c:289 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:281 +#: bfd.c:290 msgid "No more archived files" msgstr "" -#: bfd.c:282 +#: bfd.c:291 msgid "Malformed archive" msgstr "" -#: bfd.c:283 +#: bfd.c:292 msgid "File format not recognized" msgstr "" -#: bfd.c:284 +#: bfd.c:293 msgid "File format is ambiguous" msgstr "" -#: bfd.c:285 +#: bfd.c:294 msgid "Section has no contents" msgstr "" -#: bfd.c:286 +#: bfd.c:295 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:287 +#: bfd.c:296 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:288 +#: bfd.c:297 msgid "Bad value" msgstr "" -#: bfd.c:289 +#: bfd.c:298 msgid "File truncated" msgstr "" -#: bfd.c:290 +#: bfd.c:299 msgid "File too big" msgstr "" -#: bfd.c:291 +#: bfd.c:300 msgid "#" msgstr "" -#: bfd.c:675 +#: bfd.c:707 #, c-format -msgid "bfd assertion fail %s:%d" +msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:693 +#: bfd.c:726 #, c-format -msgid "BFD internal error, aborting at %s line %d in %s\n" +msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:697 +#: bfd.c:730 #, c-format -msgid "BFD internal error, aborting at %s line %d\n" +msgid "BFD %sinternal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:699 +#: bfd.c:732 msgid "Please report this bug.\n" msgstr "" -#: binary.c:303 +#: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" -#: coff-a29k.c:122 +#: coff-a29k.c:119 msgid "Missing IHCONST" msgstr "" -#: coff-a29k.c:181 +#: coff-a29k.c:180 msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:213 +#: coff-a29k.c:212 msgid "Unrecognized reloc" msgstr "" -#: coff-a29k.c:425 +#: coff-a29k.c:408 msgid "missing IHCONST reloc" msgstr "" -#: coff-a29k.c:516 +#: coff-a29k.c:498 msgid "missing IHIHALF reloc" msgstr "" -#: coff-alpha.c:880 coff-alpha.c:917 +#: coff-alpha.c:881 coff-alpha.c:918 msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1486 elf64-alpha.c:4004 +#: coff-alpha.c:1485 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1992 coff-mips.c:1434 +#: coff-alpha.c:1989 coff-mips.c:1433 msgid "GP relative relocation when GP not defined" msgstr "" -#: coff-arm.c:1018 elf32-arm.h:246 +#: coff-arm.c:1051 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1047 elf32-arm.h:281 +#: coff-arm.c:1080 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1335 coff-arm.c:1430 elf32-arm.h:841 elf32-arm.h:946 +#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1339 elf32-arm.h:949 +#: coff-arm.c:1379 elf32-arm.h:993 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1434 elf32-arm.h:844 +#: coff-arm.c:1474 elf32-arm.h:889 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1437 +#: coff-arm.c:1477 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1726 coff-tic80.c:682 cofflink.c:2991 +#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2063 +#: coff-arm.c:2107 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2191 +#: coff-arm.c:2235 #, c-format msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" msgstr "" -#: coff-arm.c:2206 +#: coff-arm.c:2250 #, c-format msgid "" "%s: ERROR: passes floats in float registers whereas target %s uses integer " "registers" msgstr "" -#: coff-arm.c:2209 +#: coff-arm.c:2253 #, c-format msgid "" "%s: ERROR: passes floats in integer registers whereas target %s uses float " "registers" msgstr "" -#: coff-arm.c:2224 +#: coff-arm.c:2268 #, c-format msgid "" "%s: ERROR: compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2227 +#: coff-arm.c:2271 #, c-format msgid "" "%s: ERROR: compiled as absolute position code, whereas target %s is position " "independent" msgstr "" -#: coff-arm.c:2256 +#: coff-arm.c:2300 #, c-format msgid "Warning: input file %s supports interworking, whereas %s does not." msgstr "" -#: coff-arm.c:2259 +#: coff-arm.c:2303 #, c-format msgid "Warning: input file %s does not support interworking, whereas %s does." msgstr "" -#: coff-arm.c:2286 +#: coff-arm.c:2330 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2294 elf32-arm.h:2210 +#: coff-arm.c:2338 elf32-arm.h:2408 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2296 +#: coff-arm.c:2340 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2299 elf32-arm.h:2213 +#: coff-arm.c:2343 elf32-arm.h:2411 msgid " [position independent]" msgstr "" -#: coff-arm.c:2301 +#: coff-arm.c:2345 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2305 +#: coff-arm.c:2349 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2307 +#: coff-arm.c:2351 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2309 +#: coff-arm.c:2353 msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2357 +#: coff-arm.c:2401 #, c-format msgid "" "Warning: Not setting interworking flag of %s, since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2361 +#: coff-arm.c:2405 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" -#: coffcode.h:2136 -#, c-format -msgid "Unrecognized TI COFF target id '0x%x'" +#: coff-i960.c:136 coff-i960.c:485 +msgid "uncertain calling convention for non-COFF symbol" +msgstr "" + +#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 +msgid "unsupported reloc type" +msgstr "" + +#: coff-mips.c:875 elf32-mips.c:1987 elf64-mips.c:1739 +msgid "GP relative relocation when _gp not defined" +msgstr "" + +#. No other sections should appear in -membedded-pic +#. code. +#: coff-mips.c:2468 +msgid "reloc against unsupported section" +msgstr "" + +#: coff-mips.c:2476 +msgid "reloc not properly aligned" msgstr "" -#: coffcode.h:4194 +#: coff-rs6000.c:2710 coff64-rs6000.c:1164 #, c-format -msgid "%s: warning: illegal symbol index %ld in line numbers" +msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coffcode.h:4208 +#: coff-rs6000.c:2756 coff64-rs6000.c:1210 #, c-format -msgid "%s: warning: duplicate line number information for `%s'" +msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: coffcode.h:4568 +#: coff-rs6000.c:3006 coff64-rs6000.c:2060 #, c-format -msgid "%s: Unrecognized storage class %d for %s symbol `%s'" +msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "" -#: coffcode.h:4699 +#: coff-tic54x.c:279 coff-tic80.c:449 #, c-format -msgid "warning: %s: local symbol `%s' has no section" +msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-tic54x.c:376 coffcode.h:4810 +#: coff-tic54x.c:390 coffcode.h:4847 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4848 +#: coff-w65.c:363 #, c-format -msgid "%s: illegal relocation type %d at address 0x%lx" +msgid "ignoring reloc %s\n" msgstr "" -#: coffgen.c:1631 +#: coffcode.h:1081 #, c-format -msgid "%s: bad string table size %lu" +msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coffgen.c:2093 +#: coffcode.h:2125 #, c-format -msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" +msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coff-i960.c:136 coff-i960.c:485 -msgid "uncertain calling convention for non-COFF symbol" +#: coffcode.h:4236 +#, c-format +msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#: cofflink.c:526 elflink.h:1648 +#: coffcode.h:4250 #, c-format -msgid "Warning: type of symbol `%s' changed from %d to %d in %s" +msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: cofflink.c:2289 +#: coffcode.h:4609 #, c-format -msgid "%s: relocs in section `%s', but it has no contents" +msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: cofflink.c:2628 coffswap.h:894 +#: coffcode.h:4740 #, c-format -msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" +msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: cofflink.c:2637 coffswap.h:880 +#: coffcode.h:4885 #, c-format -msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" +msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2265 -msgid "unsupported reloc type" +#: coffgen.c:1661 +#, c-format +msgid "%s: bad string table size %lu" msgstr "" -#: coff-mips.c:875 elf32-mips.c:1417 -msgid "GP relative relocation when _gp not defined" +#: coffgen.c:2138 +#, c-format +msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" msgstr "" -#. No other sections should appear in -membedded-pic -#. code. -#: coff-mips.c:2469 -msgid "reloc against unsupported section" +#: cofflink.c:536 elflink.h:1967 +#, c-format +msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: coff-mips.c:2477 -msgid "reloc not properly aligned" +#: cofflink.c:2317 +#, c-format +msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: coff-tic54x.c:263 coff-tic80.c:445 +#: cofflink.c:2653 coffswap.h:889 #, c-format -msgid "Unrecognized reloc type 0x%x" +msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: coff-w65.c:369 +#: cofflink.c:2662 coffswap.h:876 #, c-format -msgid "ignoring reloc %s\n" +msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" +msgstr "" + +#: dwarf2.c:381 +msgid "Dwarf Error: Can't find .debug_str section." +msgstr "" + +#: dwarf2.c:398 +#, c-format +msgid "" +"Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str " +"size (%u)." msgstr "" -#: dwarf2.c:423 +#: dwarf2.c:542 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:441 +#: dwarf2.c:559 #, c-format -msgid "Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)." +msgid "" +"Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)." msgstr "" -#: dwarf2.c:624 +#: dwarf2.c:756 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %d." msgstr "" -#: dwarf2.c:697 +#: dwarf2.c:843 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:782 +#: dwarf2.c:929 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:806 +#: dwarf2.c:952 #, c-format -msgid "Dwarf Error: Line offset (%u) bigger than line size (%u)." +msgid "Dwarf Error: Line offset (%u) greater than or equal to line size (%u)." msgstr "" -#: dwarf2.c:973 +#: dwarf2.c:1143 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1152 dwarf2.c:1306 +#: dwarf2.c:1318 dwarf2.c:1532 #, c-format msgid "Dwarf Error: Could not find abbrev number %d." msgstr "" -#: dwarf2.c:1267 +#: dwarf2.c:1493 #, c-format msgid "" "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1274 +#: dwarf2.c:1500 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1297 +#: dwarf2.c:1523 #, c-format msgid "Dwarf Error: Bad abbrev number: %d." msgstr "" -#: ecoff.c:1323 +#: ecoff.c:1328 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1592 +#: ecoff.c:1597 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1599 ecoff.c:1602 +#: ecoff.c:1604 ecoff.c:1607 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1614 +#: ecoff.c:1619 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1621 +#: ecoff.c:1626 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1629 +#: ecoff.c:1634 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1634 +#: ecoff.c:1639 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1639 +#: ecoff.c:1644 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1645 +#: ecoff.c:1650 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.h:1179 +#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 +#: elf64-x86-64.c:1275 #, c-format -msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +msgid "" +"%s: warning: unresolvable relocation against symbol `%s' from %s section" +msgstr "" + +#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 +#: elf32-cris.c:1392 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 +#: elf32-i860.c:1048 elf32-m32r.c:1281 elf32-openrisc.c:455 elf32-v850.c:1691 +#: elf64-mmix.c:1164 +msgid "internal error: out of range error" +msgstr "" + +#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 +#: elf32-cris.c:1396 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 +#: elf32-i860.c:1052 elf32-m32r.c:1285 elf32-mips.c:7565 elf32-openrisc.c:459 +#: elf32-v850.c:1695 elf64-mips.c:4464 elf64-mmix.c:1168 +msgid "internal error: unsupported relocation error" +msgstr "" + +#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 +#: elf32-h8300.c:555 elf32-m32r.c:1289 +msgid "internal error: dangerous error" msgstr "" -#: elf32-arm.h:1375 +#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 +#: elf32-cris.c:1404 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 +#: elf32-i860.c:1060 elf32-m32r.c:1293 elf32-openrisc.c:467 elf32-v850.c:1715 +#: elf64-mmix.c:1176 +msgid "internal error: unknown error" +msgstr "" + +#: elf.c:345 #, c-format -msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +msgid "%s: invalid string offset %u >= %lu for section `%s'" +msgstr "" + +#: elf.c:450 +#, c-format +msgid "%s: invalid SHT_GROUP entry" msgstr "" -#: elf-hppa.h:1369 elf-hppa.h:1402 elf32-arm.h:1853 elf32-i386.c:1428 -#: elf32-ppc.c:3096 elf32-sh.c:2997 elf64-x86-64.c:271 +#: elf.c:531 #, c-format +msgid "%s: no group info for section %s" +msgstr "" + +#: elf.c:842 msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" +"\n" +"Program Header:\n" msgstr "" -#: elf-m10200.c:455 elf-m10300.c:669 elf32-arm.h:1927 elf32-avr.c:842 -#: elf32-cris.c:431 elf32-d10v.c:478 elf32-fr30.c:651 elf32-i860.c:1051 -#: elf32-m32r.c:1265 elf32-v850.c:1672 -msgid "internal error: out of range error" +#: elf.c:891 +msgid "" +"\n" +"Dynamic Section:\n" msgstr "" -#: elf-m10200.c:459 elf-m10300.c:673 elf32-arm.h:1931 elf32-avr.c:846 -#: elf32-cris.c:435 elf32-d10v.c:482 elf32-fr30.c:655 elf32-i860.c:1055 -#: elf32-m32r.c:1269 elf32-v850.c:1676 -msgid "internal error: unsupported relocation error" +#: elf.c:1020 +msgid "" +"\n" +"Version definitions:\n" msgstr "" -#: elf-m10200.c:463 elf-m10300.c:677 elf32-arm.h:1935 elf32-d10v.c:486 -#: elf32-m32r.c:1273 -msgid "internal error: dangerous error" +#: elf.c:1043 +msgid "" +"\n" +"Version References:\n" msgstr "" -#: elf-m10200.c:467 elf-m10300.c:681 elf32-arm.h:1939 elf32-avr.c:854 -#: elf32-cris.c:443 elf32-d10v.c:490 elf32-fr30.c:663 elf32-i860.c:1063 -#: elf32-m32r.c:1277 elf32-v850.c:1696 -msgid "internal error: unknown error" +#: elf.c:1048 +#, c-format +msgid " required from %s:\n" +msgstr "" + +#: elf.c:1675 +#, c-format +msgid "%s: invalid link %lu for reloc section %s (index %u)" +msgstr "" + +#: elf.c:3289 +#, c-format +msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "" -#: elf32-arm.h:1967 +#: elf.c:3393 +#, c-format +msgid "%s: Not enough room for program headers, try linking with -N" +msgstr "" + +#: elf.c:3518 #, c-format msgid "" -"Warning: Not setting interwork flag of %s since it has already been " -"specified as non-interworking" +"Error: First section in segment (%s) starts at 0x%x whereas the segment " +"starts at 0x%x" msgstr "" -#: elf32-arm.h:1971 +#: elf.c:3804 #, c-format -msgid "Warning: Clearing the interwork flag of %s due to outside request" +msgid "%s: warning: allocated section `%s' not in segment" +msgstr "" + +#: elf.c:4138 +#, c-format +msgid "%s: symbol `%s' required but not present" +msgstr "" + +#: elf.c:4147 +#, c-format +msgid "" +"elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%" +"s\n" msgstr "" -#: elf32-arm.h:2019 +#: elf.c:4391 +#, c-format +msgid "%s: warning: Empty loadable segment detected\n" +msgstr "" + +#: elf.c:5804 +#, c-format +msgid "%s: unsupported relocation type %s" +msgstr "" + +#: elf32-arm.h:1224 +#, c-format +msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +msgstr "" + +#: elf32-arm.h:1420 +#, c-format +msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +msgstr "" + +#: elf32-arm.h:1904 elf32-i386.c:1776 elf32-sh.c:3133 +#, c-format +msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" +msgstr "" + +#: elf32-arm.h:1998 #, c-format msgid "" -"Warning: Clearing the interwork flag in %s because non-interworking code in " -"%s has been linked with it" +"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" msgstr "" -#: elf32-arm.h:2113 +#: elf32-arm.h:2114 #, c-format msgid "" -"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" +"Warning: Not setting interwork flag of %s since it has already been " +"specified as non-interworking" msgstr "" -#: elf32-arm.h:2127 +#: elf32-arm.h:2118 #, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgid "Warning: Clearing the interwork flag of %s due to outside request" msgstr "" -#: elf32-arm.h:2138 +#: elf32-arm.h:2166 #, c-format msgid "" -"Error: %s passes floats in %s registers, whereas %s passes them in %s " -"registers" +"Warning: Clearing the interwork flag in %s because non-interworking code in %" +"s has been linked with it" msgstr "" -#: elf32-arm.h:2141 elf32-arm.h:2143 -msgid "float" +#: elf32-arm.h:2261 +#, c-format +msgid "" +"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" msgstr "" -#: elf32-arm.h:2141 elf32-arm.h:2143 -msgid "integer" +#: elf32-arm.h:2275 +#, c-format +msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: elf32-arm.h:2150 +#: elf32-arm.h:2287 #, c-format -msgid "Error: %s uses %s floating point, whereas %s uses %s floating point" +msgid "" +"Error: %s passes floats in FP registers, whereas %s passes them in integer " +"registers" msgstr "" -#: elf32-arm.h:2153 elf32-arm.h:2155 -msgid "soft" +#: elf32-arm.h:2292 +#, c-format +msgid "" +"Error: %s passes floats in integer registers, whereas %s passes them in FP " +"registers" msgstr "" -#: elf32-arm.h:2153 elf32-arm.h:2155 -msgid "hard" +#: elf32-arm.h:2303 +#, c-format +msgid "Error: %s uses VFP instructions, whereas %s FPA instructions" msgstr "" -#: elf32-arm.h:2162 +#: elf32-arm.h:2308 #, c-format -msgid "Warning: %s %s interworking, whereas %s %s" +msgid "Error: %s uses FPA instructions, whereas %s VFP instructions" msgstr "" -#: elf32-arm.h:2165 -msgid "supports" +#: elf32-arm.h:2328 +#, c-format +msgid "Error: %s uses software FP, whereas %s uses hardware FP" msgstr "" -#: elf32-arm.h:2165 -msgid "does not support" +#: elf32-arm.h:2333 +#, c-format +msgid "Error: %s uses hardware FP, whereas %s uses software FP" msgstr "" -#: elf32-arm.h:2167 -msgid "does not" +#: elf32-arm.h:2348 +#, c-format +msgid "Warning: %s supports interworking, whereas %s does not" msgstr "" -#: elf32-arm.h:2167 -msgid "does" +#: elf32-arm.h:2355 +#, c-format +msgid "Warning: %s does not support interworking, whereas %s does" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2193 elf32-cris.c:615 elf32-m68k.c:430 elf32-mips.c:2695 +#: elf32-arm.h:2386 elf32-cris.c:2970 elf32-m68k.c:410 elf32-mips.c:3232 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2202 +#: elf32-arm.h:2395 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2205 +#: elf32-arm.h:2398 msgid " [APCS-26]" msgstr "" -#: elf32-arm.h:2207 +#: elf32-arm.h:2400 msgid " [APCS-32]" msgstr "" -#: elf32-arm.h:2216 +#: elf32-arm.h:2403 +msgid " [VFP float format]" +msgstr "" + +#: elf32-arm.h:2405 +msgid " [FPA float format]" +msgstr "" + +#: elf32-arm.h:2414 msgid " [new ABI]" msgstr "" -#: elf32-arm.h:2219 +#: elf32-arm.h:2417 msgid " [old ABI]" msgstr "" -#: elf32-arm.h:2222 +#: elf32-arm.h:2420 msgid " [software FP]" msgstr "" -#: elf32-arm.h:2229 +#: elf32-arm.h:2428 msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.h:2232 +#: elf32-arm.h:2431 elf32-arm.h:2442 msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.h:2234 +#: elf32-arm.h:2433 elf32-arm.h:2444 msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.h:2240 +#: elf32-arm.h:2439 +msgid " [Version2 EABI]" +msgstr "" + +#: elf32-arm.h:2447 +msgid " [dynamic symbols use segment index]" +msgstr "" + +#: elf32-arm.h:2450 +msgid " [mapping symbols precede others]" +msgstr "" + +#: elf32-arm.h:2457 msgid " " msgstr "" -#: elf32-arm.h:2247 +#: elf32-arm.h:2464 msgid " [relocatable executable]" msgstr "" -#: elf32-arm.h:2250 +#: elf32-arm.h:2467 msgid " [has entry point]" msgstr "" -#: elf32-arm.h:2255 +#: elf32-arm.h:2472 msgid "" msgstr "" -#: elf32-avr.c:850 elf32-cris.c:439 elf32-fr30.c:659 elf32-i860.c:1059 -#: elf32-v850.c:1680 +#: elf32-avr.c:843 elf32-cris.c:1400 elf32-fr30.c:661 elf32-i860.c:1056 +#: elf32-openrisc.c:463 elf32-v850.c:1699 elf64-mmix.c:1172 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-cris.c:618 -msgid " [symbols have a _ prefix]" +#: elf32-cris.c:949 +#, c-format +msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:657 +#: elf32-cris.c:1012 #, c-format -msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" +msgid "" +"%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" +msgstr "" + +#: elf32-cris.c:1015 elf32-cris.c:1142 +msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:658 +#: elf32-cris.c:1131 #, c-format -msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" +msgid "" +"%s: relocation %s with non-zero addend %d against local symbol from %s " +"section" msgstr "" -#: elf32-hppa.c:606 +#: elf32-cris.c:1138 #, c-format -msgid "%s(%s+0x%lx): cannot find stub entry %s" +msgid "" +"%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" msgstr "" -#: elf32-hppa.c:667 +#: elf32-cris.c:1156 #, c-format -msgid "%s: cannot create stub entry %s" +msgid "" +"%s: relocation %s is not allowed for global symbol: `%s' from %s section" msgstr "" -#: elf32-hppa.c:859 +#: elf32-cris.c:1275 #, c-format -msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" +msgid "%s: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-hppa.c:872 elf32-hppa.c:1568 +#: elf32-cris.c:2508 #, c-format -msgid "Could not find relocation section for %s" +msgid "" +"%s, section %s:\n" +" relocation %s should not be used in a shared object; recompile with -fPIC" +msgstr "" + +#: elf32-cris.c:2973 +msgid " [symbols have a _ prefix]" +msgstr "" + +#: elf32-cris.c:3012 +#, c-format +msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" +msgstr "" + +#: elf32-cris.c:3013 +#, c-format +msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" +msgstr "" + +#: elf32-gen.c:82 elf64-gen.c:82 +#, c-format +msgid "%s: Relocations in generic ELF (EM: %d)" +msgstr "" + +#: elf32-hppa.c:646 +#, c-format +msgid "%s: cannot create stub entry %s" msgstr "" -#: elf32-hppa.c:1011 elf32-hppa.c:3362 +#: elf32-hppa.c:937 elf32-hppa.c:3540 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1323 +#: elf32-hppa.c:1312 #, c-format msgid "" "%s: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1343 +#: elf32-hppa.c:1332 #, c-format msgid "" "%s: relocation %s should not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:2755 +#: elf32-hppa.c:1525 +#, c-format +msgid "Could not find relocation section for %s" +msgstr "" + +#: elf32-hppa.c:2862 #, c-format msgid "%s: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3253 +#: elf32-hppa.c:3424 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "" -#: elf32-hppa.c:3856 +#: elf32-hppa.c:4064 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4173 +#: elf32-hppa.c:4403 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:273 +#: elf32-i386.c:298 #, c-format msgid "%s: invalid relocation type %d" msgstr "" -#: elf32-m32r.c:916 -msgid "SDA relocation when _SDA_BASE_ not defined" +#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#, c-format +msgid "%s: bad symbol index: %d" msgstr "" -#: elf32-m32r.c:1000 elf32-ppc.c:2963 +#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2085 elf64-s390.c:759 #, c-format -msgid "%s: unknown relocation type %d" +msgid "%s: bad relocation section name `%s'" msgstr "" -#: elf32-m32r.c:1208 +#: elf32-i386.c:2067 elf32-s390.c:1949 elf64-ppc.c:3908 elf64-s390.c:1953 #, c-format -msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" +msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-m32r.c:2010 +#: elf32-i386.c:2105 elf32-s390.c:1987 elf64-s390.c:1991 #, c-format -msgid "%s: Instruction set mismatch with previous modules" +msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-m32r.c:2033 -#, c-format -msgid "private flags = %lx" +#: elf32-m32r.c:924 +msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-m32r.c:2038 -msgid ": m32r instructions" +#: elf32-ia64.c:3538 elf32-m32r.c:1008 elf32-ppc.c:2930 elf64-ia64.c:3538 +#, c-format +msgid "%s: unknown relocation type %d" msgstr "" -#: elf32-m32r.c:2039 +#: elf32-m32r.c:1224 +#, c-format +msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" +msgstr "" + +#: elf32-m32r.c:2001 +#, c-format +msgid "%s: Instruction set mismatch with previous modules" +msgstr "" + +#: elf32-m32r.c:2024 +#, c-format +msgid "private flags = %lx" +msgstr "" + +#: elf32-m32r.c:2029 +msgid ": m32r instructions" +msgstr "" + +#: elf32-m32r.c:2030 msgid ": m32rx instructions" msgstr "" -#: elf32-m68k.c:433 +#: elf32-m68k.c:413 msgid " [cpu32]" msgstr "" -#: elf32-mcore.c:366 elf32-mcore.c:493 +#: elf32-mcore.c:353 elf32-mcore.c:479 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:452 +#: elf32-mcore.c:438 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:1576 +#: elf32-mips.c:2146 elf64-mips.c:1972 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1725 +#: elf32-mips.c:2295 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-mips.c:2582 +#: elf32-mips.c:3119 #, c-format msgid "%s: linking PIC files with non-PIC files" msgstr "" -#: elf32-mips.c:2592 +#: elf32-mips.c:3129 #, c-format msgid "%s: linking abicalls files with non-abicalls files" msgstr "" -#: elf32-mips.c:2621 +#: elf32-mips.c:3158 #, c-format msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" msgstr "" -#: elf32-mips.c:2630 +#: elf32-mips.c:3167 #, c-format msgid "%s: ISA mismatch (%d) with previous modules (%d)" msgstr "" -#: elf32-mips.c:2653 +#: elf32-mips.c:3190 #, c-format msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elf32-mips.c:2667 elf32-ppc.c:1477 elf64-sparc.c:2971 +#: elf32-mips.c:3204 elf32-ppc.c:1470 elf64-ppc.c:1538 elf64-sparc.c:3033 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-mips.c:2698 +#: elf32-mips.c:3235 msgid " [abi=O32]" msgstr "" -#: elf32-mips.c:2700 +#: elf32-mips.c:3237 msgid " [abi=O64]" msgstr "" -#: elf32-mips.c:2702 +#: elf32-mips.c:3239 msgid " [abi=EABI32]" msgstr "" -#: elf32-mips.c:2704 +#: elf32-mips.c:3241 msgid " [abi=EABI64]" msgstr "" -#: elf32-mips.c:2706 +#: elf32-mips.c:3243 msgid " [abi unknown]" msgstr "" -#: elf32-mips.c:2708 +#: elf32-mips.c:3245 msgid " [abi=N32]" msgstr "" -#: elf32-mips.c:2710 +#: elf32-mips.c:3247 msgid " [abi=64]" msgstr "" -#: elf32-mips.c:2712 +#: elf32-mips.c:3249 msgid " [no abi set]" msgstr "" -#: elf32-mips.c:2715 +#: elf32-mips.c:3252 msgid " [mips1]" msgstr "" -#: elf32-mips.c:2717 +#: elf32-mips.c:3254 msgid " [mips2]" msgstr "" -#: elf32-mips.c:2719 +#: elf32-mips.c:3256 msgid " [mips3]" msgstr "" -#: elf32-mips.c:2721 +#: elf32-mips.c:3258 msgid " [mips4]" msgstr "" -#: elf32-mips.c:2723 +#: elf32-mips.c:3260 msgid " [mips5]" msgstr "" -#: elf32-mips.c:2725 +#: elf32-mips.c:3262 msgid " [mips32]" msgstr "" -#: elf32-mips.c:2727 +#: elf32-mips.c:3264 msgid " [mips64]" msgstr "" -#: elf32-mips.c:2729 +#: elf32-mips.c:3266 msgid " [unknown ISA]" msgstr "" -#: elf32-mips.c:2732 +#: elf32-mips.c:3269 msgid " [32bitmode]" msgstr "" -#: elf32-mips.c:2734 +#: elf32-mips.c:3271 msgid " [not 32bitmode]" msgstr "" -#: elf32-mips.c:4388 +#: elf32-mips.c:4947 msgid "static procedure (no name)" msgstr "" -#: elf32-mips.c:5005 elf64-alpha.c:4377 +#: elf32-mips.c:5565 elf64-mips.c:6694 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elf32-mips.c:5570 +#: elf32-mips.c:6132 elf64-mips.c:3150 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf32-mips.c:6686 +#: elf32-mips.c:7238 elf64-mips.c:4203 #, c-format msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elf32-mips.c:7673 +#: elf32-mips.c:8237 elf64-mips.c:5891 #, c-format -msgid "Malformed reloc detected for section %s" +msgid "%s: Malformed reloc detected for section %s" msgstr "" -#: elf32-mips.c:7750 +#: elf32-mips.c:8315 elf64-mips.c:5969 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elf32-ppc.c:1443 +#: elf32-ppc.c:1436 elf64-ppc.c:1503 #, c-format msgid "" "%s: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:1451 +#: elf32-ppc.c:1444 elf64-ppc.c:1511 #, c-format msgid "" "%s: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:1578 +#: elf32-ppc.c:1568 #, c-format msgid "%s: Unknown special linker type %d" msgstr "" -#: elf32-ppc.c:2245 elf32-ppc.c:2279 elf32-ppc.c:2314 +#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:3129 +#: elf32-ppc.c:3097 elf64-ppc.c:3500 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:3493 elf32-ppc.c:3514 elf32-ppc.c:3564 +#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 #, c-format msgid "" "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:3630 +#: elf32-ppc.c:3589 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-sh.c:1084 +#: elf32-sh.c:1101 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:1096 +#: elf32-sh.c:1113 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:1113 +#: elf32-sh.c:1130 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:1128 +#: elf32-sh.c:1145 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:1165 +#: elf32-sh.c:1202 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:1287 +#: elf32-sh.c:1323 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:1296 +#: elf32-sh.c:1332 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:1689 elf32-sh.c:2076 +#: elf32-sh.c:1741 elf32-sh.c:2132 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sparc.c:1512 elf64-sparc.c:2262 +#: elf32-sh.c:3267 +#, c-format +msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgstr "" + +#: elf32-sparc.c:1554 elf64-sparc.c:2286 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "" -#: elf32-sparc.c:1962 +#: elf32-sparc.c:2007 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:1976 +#: elf32-sparc.c:2021 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:677 +#: elf32-v850.c:682 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:680 +#: elf32-v850.c:685 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:683 +#: elf32-v850.c:688 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:686 +#: elf32-v850.c:691 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:689 +#: elf32-v850.c:694 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:1066 +#: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1684 +#: elf32-v850.c:1703 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1688 +#: elf32-v850.c:1707 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1692 +#: elf32-v850.c:1711 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1881 +#: elf32-v850.c:1877 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1900 +#: elf32-v850.c:1897 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1905 +#: elf32-v850.c:1902 msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1906 +#: elf32-v850.c:1903 msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1907 +#: elf32-v850.c:1904 msgid "v850ea architecture" msgstr "" -#: elf64-alpha.c:951 +#: elf64-alpha.c:858 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:3014 +#: elf64-alpha.c:2934 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-sparc.c:1248 +#: elf64-alpha.c:3518 elf64-alpha.c:3530 #, c-format -msgid "%s: check_relocs: unhandled reloc type %d" -msgstr "" - -#: elf64-sparc.c:1285 -msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" +msgid "%s: gp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-sparc.c:1305 -msgid "" -"Register %%g%d used incompatibly: previously declared in %s to %s, in %s " -"redefined to %s" -msgstr "" - -#: elf64-sparc.c:1328 +#: elf64-hppa.c:2070 #, c-format -msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s" +msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" -#: elf64-sparc.c:1374 +#: elf64-mmix.c:1268 #, c-format -msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s" +msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "" -#: elf64-sparc.c:2952 -#, c-format -msgid "%s: linking UltraSPARC specific with HAL specific code" +#: elf64-mmix.c:1270 +msgid "(unknown)" msgstr "" -#: elf.c:325 +#: elf64-mmix.c:1305 #, c-format -msgid "%s: invalid string offset %u >= %lu for section `%s'" +msgid "%s: directive LOCAL valid only with a register or absolute value" msgstr "" -#: elf.c:566 +#: elf64-mmix.c:1333 +#, c-format msgid "" -"\n" -"Program Header:\n" +"%s: LOCAL directive: Register $%ld is not a local register. First global " +"register is $%ld." msgstr "" -#: elf.c:614 +#: elf64-mmix.c:1609 +#, c-format msgid "" -"\n" -"Dynamic Section:\n" +"%s: Error: multiple definition of `%s'; start of %s is set in a earlier " +"linked file\n" msgstr "" -#: elf.c:743 -msgid "" -"\n" -"Version definitions:\n" +#: elf64-mmix.c:1668 +msgid "Register section has contents\n" msgstr "" -#: elf.c:766 -msgid "" -"\n" -"Version References:\n" +#: elf64-ppc.c:1466 libbfd.c:1436 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" msgstr "" -#: elf.c:771 +#: elf64-ppc.c:1468 libbfd.c:1438 #, c-format -msgid " required from %s:\n" +msgid "%s: compiled for a little endian system and target is big endian" msgstr "" -#: elf.c:1359 +#: elf64-ppc.c:3166 #, c-format -msgid "%s: invalid link %lu for reloc section %s (index %u)" +msgid "linkage table overflow against `%s'" msgstr "" -#: elf.c:2113 -#, c-format -msgid "" -"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = " -"0x%.8lx\n" +#: elf64-ppc.c:3244 +msgid "stub section size doesn't match calculated size" msgstr "" -#: elf.c:2716 +#: elf64-ppc.c:3845 #, c-format -msgid "%s: Not enough room for program headers (allocated %u, need %u)" +msgid "%s: Relocation %s is not supported for symbol %s." msgstr "" -#: elf.c:2815 +#: elf64-ppc.c:3889 #, c-format -msgid "%s: Not enough room for program headers, try linking with -N" +msgid "%s: error: relocation %s not a multiple of 4" msgstr "" -#: elf.c:2941 +#: elf64-sparc.c:1277 #, c-format -msgid "Error: First section in segment (%s) starts at 0x%x" +msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf.c:2944 +#: elf64-sparc.c:1314 #, c-format -msgid " whereas segment starts at 0x%x" +msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf.c:3217 +#: elf64-sparc.c:1334 #, c-format -msgid "%s: warning: allocated section `%s' not in segment" +msgid "Register %%g%d used incompatibly: %s in %s" msgstr "" -#: elf.c:3616 +#: elf64-sparc.c:1338 elf64-sparc.c:1362 elf64-sparc.c:1411 #, c-format -msgid "%s: symbol `%s' required but not present" +msgid " previously %s in %s" msgstr "" -#: elf.c:3625 +#: elf64-sparc.c:1359 elf64-sparc.c:1408 #, c-format -msgid "" -"elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = " -"0x%.8lx%s\n" +msgid "Symbol `%s' has differing types: %s in %s" msgstr "" -#: elf.c:3866 +#: elf64-sparc.c:3014 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" +msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf.c:5213 +#: elfcode.h:1218 #, c-format -msgid "%s: unsupported relocation type %s" +msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elfcode.h:1084 +#: elflink.c:434 #, c-format -msgid "%s: version count (%ld) does not match symbol count (%ld)" +msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "" -#: elflink.c:432 +#: elflink.h:1113 #, c-format -msgid "%s: Section %s is already to large to put hole of %ld bytes in" +msgid "%s: warning: unexpected redefinition of `%s'" msgstr "" -#: elflink.h:1465 +#: elflink.h:1784 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elflink.h:1506 +#: elflink.h:1825 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "" -#: elflink.h:1626 +#: elflink.h:1945 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "" -#: elflink.h:1872 -#, c-format -msgid "%s: warning: unexpected redefinition of `%s'" -msgstr "" - -#: elflink.h:3659 +#: elflink.h:4020 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.h:3931 +#: elflink.h:4329 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elflink.h:5180 +#: elflink.h:4559 elflink.h:4567 elflink.h:6218 elflink.h:7295 +msgid "Error: out of memory" +msgstr "" + +#: elflink.h:4729 +msgid "Not enough memory to sort relocations" +msgstr "" + +#: elflink.h:5995 #, c-format msgid "%s: could not find output section %s for input section %s" msgstr "" -#: i386linux.c:450 m68klinux.c:454 sparclinux.c:452 +#: elflink.h:6568 +msgid "warning: relocation against removed section; zeroing" +msgstr "" + +#: elflink.h:6598 +msgid "warning: relocation against removed section" +msgstr "" + +#: elflink.h:6611 +#, c-format +msgid "local symbols in discarded section %s" +msgstr "" + +#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:458 m68klinux.c:462 sparclinux.c:460 +#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:646 i386linux.c:696 m68klinux.c:653 m68klinux.c:701 -#: sparclinux.c:649 sparclinux.c:699 +#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 +#: sparclinux.c:655 sparclinux.c:705 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:720 m68klinux.c:725 sparclinux.c:723 +#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 msgid "Warning: fixup count mismatch\n" msgstr "" -#: ieee.c:167 +#: ieee.c:235 #, c-format msgid "%s: string too long (%d chars, max 65535)" msgstr "" -#: ieee.c:297 +#: ieee.c:365 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "" -#: ieee.c:793 +#: ieee.c:877 #, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "" -#: ieee.c:818 +#: ieee.c:902 #, c-format msgid "%s: unexpected ATN type %d in external part" msgstr "" -#: ieee.c:840 +#: ieee.c:924 #, c-format msgid "%s: unexpected type after ATN" msgstr "" -#: ihex.c:259 +#: ihex.c:258 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "" -#: ihex.c:369 +#: ihex.c:368 #, c-format -msgid "%s:%d: bad checksum in Intel Hex file (expected %u, found %u)" +msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:421 +#: ihex.c:422 #, c-format -msgid "%s:%d: bad extended address record length in Intel Hex file" +msgid "%s:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:438 +#: ihex.c:439 #, c-format -msgid "%s:%d: bad extended start address length in Intel Hex file" +msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:455 +#: ihex.c:456 #, c-format -msgid "%s:%d: bad extended linear address record length in Intel Hex file" +msgid "%s:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:472 +#: ihex.c:473 #, c-format -msgid "%s:%d: bad extended linear start address length in Intel Hex file" +msgid "%s:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:489 +#: ihex.c:490 #, c-format -msgid "%s:%d: unrecognized ihex type %u in Intel Hex file\n" +msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "" -#: ihex.c:609 +#: ihex.c:610 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "" -#: ihex.c:644 +#: ihex.c:645 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "" -#: ihex.c:858 +#: ihex.c:863 #, c-format msgid "%s: address 0x%s out of range for Intex Hex file" msgstr "" -#: libbfd.c:471 +#: libbfd.c:492 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: libbfd.c:474 +#: libbfd.c:495 msgid "not mapping: env var not set\n" msgstr "" -#: libbfd.c:1370 -#, c-format -msgid "%s: compiled for a big endian system and target is little endian" -msgstr "" - -#: libbfd.c:1372 +#: libbfd.c:1463 #, c-format -msgid "%s: compiled for a little endian system and target is big endian" +msgid "Deprecated %s called" msgstr "" -#: linker.c:2678 +#: libbfd.c:1465 #, c-format -msgid "Attempt to do relocateable link with %s input and %s output" +msgid " at %s line %d in %s\n" msgstr "" -#: oasys.c:1016 +#: linker.c:1849 #, c-format -msgid "%s: can not represent section `%s' in oasys" +msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: osf-core.c:146 +#: linker.c:2745 #, c-format -msgid "Unhandled OSF/1 core file section type %d\n" +msgid "Attempt to do relocateable link with %s input and %s output" msgstr "" -#. XXX code yet to be written. -#: peicode.h:807 +#: merge.c:897 #, c-format -msgid "%s: Unhandled import type; %x" +msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "" -#: peicode.h:812 +#: mmo.c:460 #, c-format -msgid "%s: Unrecognised import type; %x" +msgid "%s: No core to allocate section name %s\n" msgstr "" -#: peicode.h:826 +#: mmo.c:537 #, c-format -msgid "%s: Unrecognised import name type; %x" +msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "" -#: peicode.h:1183 +#: mmo.c:1190 #, c-format -msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" +msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "" -#: peicode.h:1195 +#: mmo.c:1336 #, c-format msgid "" -"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " -"archive" +"%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " +"starting with `%s'\n" msgstr "" -#: peicode.h:1212 +#: mmo.c:1571 #, c-format -msgid "%s: size field is zero in Import Library Format header" +msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "" -#: peicode.h:1240 +#: mmo.c:1581 #, c-format -msgid "%s: string not null terminated in ILF object file." +msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "" -#: peigen.c:993 +#: mmo.c:1617 #, c-format -msgid "%s: line number overflow: 0x%lx > 0xffff" +msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -#: peigen.c:1011 +#: mmo.c:1663 #, c-format -msgid "%s: reloc overflow 1: 0x%lx > 0xffff" -msgstr "" - -#: peigen.c:1024 -msgid "Export Directory [.edata (or where ever we found it)]" +msgid "" +"%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "" -#: peigen.c:1025 -msgid "Import Directory [parts of .idata]" +#: mmo.c:1702 +#, c-format +msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "" -#: peigen.c:1026 -msgid "Resource Directory [.rsrc]" +#: mmo.c:1711 +#, c-format +msgid "" +"%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -#: peigen.c:1027 -msgid "Exception Directory [.pdata]" +#: mmo.c:1734 +#, c-format +msgid "" +"%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " +"for lop_fixrx\n" msgstr "" -#: peigen.c:1028 -msgid "Security Directory" +#: mmo.c:1757 +#, c-format +msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "" -#: peigen.c:1029 -msgid "Base Relocation Directory [.reloc]" +#: mmo.c:1777 +#, c-format +msgid "" +"%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "" -#: peigen.c:1030 -msgid "Debug Directory" +#: mmo.c:1790 +#, c-format +msgid "" +"%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -#: peigen.c:1031 -msgid "Description Directory" +#: mmo.c:1896 +#, c-format +msgid "" +"%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -#: peigen.c:1032 -msgid "Special Directory" +#: mmo.c:1932 +#, c-format +msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "" -#: peigen.c:1033 -msgid "Thread Storage Directory [.tls]" +#: mmo.c:1945 +#, c-format +msgid "" +"%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " +"to the preceding lop_stab (%ld)\n" msgstr "" -#: peigen.c:1034 -msgid "Load Configuration Directory" +#: mmo.c:2610 +#, c-format +msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "" -#: peigen.c:1035 -msgid "Bound Import Directory" +#: mmo.c:2898 +#, c-format +msgid "" +"%s: Bad symbol definition: `Main' set to %s rather than the start address %" +"s\n" msgstr "" -#: peigen.c:1036 -msgid "Import Address Table Directory" +#: mmo.c:2932 +#, c-format +msgid "" +"%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: " +"%d. Only `Main' will be emitted.\n" msgstr "" -#: peigen.c:1037 -msgid "Delay Import Directory" +#: mmo.c:2977 +#, c-format +msgid "%s: internal error, symbol table changed size from %d to %d words\n" msgstr "" -#: peigen.c:1038 peigen.c:1039 -msgid "Reserved" +#: mmo.c:3032 +#, c-format +msgid "%s: internal error, internal register section %s had contents\n" msgstr "" -#: peigen.c:1103 -msgid "" -"\n" -"There is an import table, but the section containing it could not be found\n" +#: mmo.c:3084 +#, c-format +msgid "%s: no initialized registers; section length 0\n" msgstr "" -#: peigen.c:1108 +#: mmo.c:3090 #, c-format -msgid "" -"\n" -"There is an import table in %s at 0x%lx\n" +msgid "%s: too many initialized registers; section length %ld\n" msgstr "" -#: peigen.c:1147 +#: mmo.c:3095 #, c-format msgid "" -"\n" -"Function descriptor located at the start address: %04lx\n" +"%s: invalid start address for initialized registers of length %ld: 0x%lx%" +"08lx\n" msgstr "" -#: peigen.c:1150 +#: oasys.c:1036 #, c-format -msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" +msgid "%s: can not represent section `%s' in oasys" msgstr "" -#: peigen.c:1156 -msgid "" -"\n" -"No reldata section! Function descriptor not decoded.\n" +#: osf-core.c:132 +#, c-format +msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" -#: peigen.c:1161 +#: pe-mips.c:658 #, c-format -msgid "" -"\n" -"The Import Tables (interpreted %s section contents)\n" +msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: peigen.c:1164 -msgid " vma: Hint Time Forward DLL First\n" +#. OK, at this point the following variables are set up: +#. src = VMA of the memory we're fixing up +#. mem = pointer to memory we're fixing up +#. val = VMA of what we need to refer to +#. +#: pe-mips.c:794 +#, c-format +msgid "%s: unimplemented %s\n" msgstr "" -#: peigen.c:1166 -msgid " Table Stamp Chain Name Thunk\n" +#: pe-mips.c:820 +#, c-format +msgid "%s: jump too far away\n" msgstr "" -#: peigen.c:1216 +#: pe-mips.c:847 #, c-format -msgid "" -"\n" -"\tDLL Name: %s\n" +msgid "%s: bad pair/reflo after refhi\n" msgstr "" -#: peigen.c:1220 peigen.c:1283 -msgid "\tvma: Hint/Ord Member-Name\n" +#. XXX code yet to be written. +#: peicode.h:785 +#, c-format +msgid "%s: Unhandled import type; %x" msgstr "" -#: peigen.c:1282 -msgid "\tThe Import Address Table (difference found)\n" +#: peicode.h:790 +#, c-format +msgid "%s: Unrecognised import type; %x" msgstr "" -#: peigen.c:1289 -msgid "\t>>> Ran out of IAT members!\n" +#: peicode.h:804 +#, c-format +msgid "%s: Unrecognised import name type; %x" msgstr "" -#: peigen.c:1308 -msgid "\tThe Import Address Table is identical\n" +#: peicode.h:1162 +#, c-format +msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peigen.c:1381 +#: peicode.h:1174 +#, c-format msgid "" -"\n" -"There is an export table, but the section containing it could not be found\n" +"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " +"archive" msgstr "" -#: peigen.c:1386 +#: peicode.h:1191 #, c-format -msgid "" -"\n" -"There is an export table in %s at 0x%lx\n" +msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peigen.c:1417 +#: peicode.h:1219 #, c-format +msgid "%s: string not null terminated in ILF object file." +msgstr "" + +#: ppcboot.c:416 msgid "" "\n" -"The Export Tables (interpreted %s section contents)\n" -"\n" +"ppcboot header:\n" msgstr "" -#: peigen.c:1421 +#: ppcboot.c:417 #, c-format -msgid "Export Flags \t\t\t%lx\n" +msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: peigen.c:1424 +#: ppcboot.c:418 #, c-format -msgid "Time/Date stamp \t\t%lx\n" +msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: peigen.c:1427 +#: ppcboot.c:421 #, c-format -msgid "Major/Minor \t\t\t%d/%d\n" +msgid "Flag field = 0x%.2x\n" msgstr "" -#: peigen.c:1430 -msgid "Name \t\t\t\t" +#: ppcboot.c:427 +#, c-format +msgid "Partition name = \"%s\"\n" msgstr "" -#: peigen.c:1436 +#: ppcboot.c:446 #, c-format -msgid "Ordinal Base \t\t\t%ld\n" +msgid "" +"\n" +"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: peigen.c:1439 -msgid "Number in:\n" +#: ppcboot.c:452 +#, c-format +msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: peigen.c:1442 +#: ppcboot.c:458 #, c-format -msgid "\tExport Address Table \t\t%08lx\n" +msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: peigen.c:1446 +#: ppcboot.c:459 #, c-format -msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" +msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: peigen.c:1449 -msgid "Table Addresses\n" +#: som.c:5402 +msgid "som_sizeof_headers unimplemented" msgstr "" -#: peigen.c:1452 -msgid "\tExport Address Table \t\t" +#: srec.c:301 +#, c-format +msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: peigen.c:1457 -msgid "\tName Pointer Table \t\t" +#: syms.c:996 +msgid "Unsupported .stab relocation" msgstr "" -#: peigen.c:1462 -msgid "\tOrdinal Table \t\t\t" +#: vms-gsd.c:356 +#, c-format +msgid "bfd_make_section (%s) failed" msgstr "" -#: peigen.c:1476 +#: vms-gsd.c:371 #, c-format -msgid "" -"\n" -"Export Address Table -- Ordinal Base %ld\n" +msgid "bfd_set_section_flags (%s, %x) failed" msgstr "" -#: peigen.c:1495 -msgid "Forwarder RVA" +#: vms-gsd.c:407 +#, c-format +msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "" -#: peigen.c:1506 -msgid "Export RVA" +#: vms-gsd.c:704 +#, c-format +msgid "unknown gsd/egsd subtype %d" msgstr "" -#: peigen.c:1513 -msgid "" -"\n" -"[Ordinal/Name Pointer] Table\n" +#: vms-hdr.c:406 +msgid "Object module NOT error-free !\n" msgstr "" -#: peigen.c:1568 +#: vms-misc.c:543 #, c-format -msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" +msgid "Stack overflow (%d) in _bfd_vms_push" msgstr "" -#: peigen.c:1572 -msgid "" -"\n" -"The Function Table (interpreted .pdata section contents)\n" +#: vms-misc.c:561 +msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: peigen.c:1575 -msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" +#: vms-misc.c:919 +msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: peigen.c:1578 -msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" -msgstr "" - -#: peigen.c:1580 -msgid " \t\tAddress Address Handler Data Address Mask\n" -msgstr "" - -#: peigen.c:1652 -msgid " Register save millicode" -msgstr "" - -#: peigen.c:1655 -msgid " Register restore millicode" -msgstr "" - -#: peigen.c:1658 -msgid " Glue code sequence" -msgstr "" - -#: peigen.c:1709 -msgid "" -"\n" -"\n" -"PE File Base Relocations (interpreted .reloc section contents)\n" -msgstr "" - -#: peigen.c:1744 -#, c-format -msgid "" -"\n" -"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" -msgstr "" - -#: peigen.c:1757 -#, c-format -msgid "\treloc %4d offset %4x [%4lx] %s" -msgstr "" - -#. The MS dumpbin program reportedly ands with 0xff0f before -#. printing the characteristics field. Not sure why. No reason to -#. emulate it here. -#: peigen.c:1796 -#, c-format -msgid "" -"\n" -"Characteristics 0x%x\n" -msgstr "" - -#: pe-mips.c:653 -#, c-format -msgid "%s: `ld -r' not supported with PE MIPS objects\n" -msgstr "" - -#. OK, at this point the following variables are set up: -#. src = VMA of the memory we're fixing up -#. mem = pointer to memory we're fixing up -#. val = VMA of what we need to refer to -#. -#: pe-mips.c:789 -#, c-format -msgid "%s: unimplemented %s\n" -msgstr "" - -#: pe-mips.c:815 -#, c-format -msgid "%s: jump too far away\n" -msgstr "" - -#: pe-mips.c:842 -#, c-format -msgid "%s: bad pair/reflo after refhi\n" -msgstr "" - -#: ppcboot.c:422 -msgid "" -"\n" -"ppcboot header:\n" -msgstr "" - -#: ppcboot.c:423 -#, c-format -msgid "Entry offset = 0x%.8lx (%ld)\n" -msgstr "" - -#: ppcboot.c:424 -#, c-format -msgid "Length = 0x%.8lx (%ld)\n" -msgstr "" - -#: ppcboot.c:427 -#, c-format -msgid "Flag field = 0x%.2x\n" -msgstr "" - -#: ppcboot.c:433 -#, c-format -msgid "Partition name = \"%s\"\n" -msgstr "" - -#: ppcboot.c:452 -#, c-format -msgid "" -"\n" -"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "" - -#: ppcboot.c:458 -#, c-format -msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "" - -#: ppcboot.c:464 -#, c-format -msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" -msgstr "" - -#: ppcboot.c:465 -#, c-format -msgid "Partition[%d] length = 0x%.8lx (%ld)\n" -msgstr "" - -#: som.c:5355 -msgid "som_sizeof_headers unimplemented" -msgstr "" - -#: srec.c:300 -#, c-format -msgid "%s:%d: Unexpected character `%s' in S-record file\n" -msgstr "" - -#: syms.c:968 -msgid "Unsupported .stab relocation" -msgstr "" - -#: vms-gsd.c:354 -#, c-format -msgid "bfd_make_section (%s) failed" -msgstr "" - -#: vms-gsd.c:368 -#, c-format -msgid "bfd_set_section_flags (%s, %x) failed" -msgstr "" - -#: vms-gsd.c:404 -#, c-format -msgid "Size mismatch section %s=%lx, %s=%lx" -msgstr "" - -#: vms-gsd.c:699 -#, c-format -msgid "unknown gsd/egsd subtype %d" -msgstr "" - -#: vms-hdr.c:403 -msgid "Object module NOT error-free !\n" -msgstr "" - -#: vms-misc.c:539 -#, c-format -msgid "Stack overflow (%d) in _bfd_vms_push" -msgstr "" - -#: vms-misc.c:557 -msgid "Stack underflow in _bfd_vms_pop" -msgstr "" - -#: vms-misc.c:915 -msgid "_bfd_vms_output_counted called with zero bytes" -msgstr "" - -#: vms-misc.c:920 +#: vms-misc.c:924 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:1051 +#: vms-misc.c:1055 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:1113 +#: vms-misc.c:1117 #, c-format msgid "failed to enter %s" msgstr "" -#: vms-tir.c:68 +#: vms-tir.c:78 msgid "No Mem !" msgstr "" -#: vms-tir.c:302 +#: vms-tir.c:313 msgid "Bad section index in ETIR_S_C_STA_PQ" msgstr "" -#: vms-tir.c:317 +#: vms-tir.c:328 #, c-format msgid "Unsupported STA cmd %d" msgstr "" -#: vms-tir.c:322 vms-tir.c:1274 +#: vms-tir.c:333 vms-tir.c:1301 #, c-format msgid "Reserved STA cmd %d" msgstr "" -#: vms-tir.c:428 +#: vms-tir.c:443 #, c-format msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" msgstr "" -#: vms-tir.c:449 +#: vms-tir.c:465 #, c-format msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" msgstr "" -#: vms-tir.c:462 +#: vms-tir.c:478 msgid "ETIR_S_C_STO_RB/AB: Not supported" msgstr "" -#: vms-tir.c:520 +#: vms-tir.c:538 msgid "ETIR_S_C_STO_LP_PSB: Not supported" msgstr "" -#: vms-tir.c:526 +#: vms-tir.c:544 msgid "ETIR_S_C_STO_HINT_GBL: not implemented" msgstr "" -#: vms-tir.c:532 +#: vms-tir.c:550 msgid "ETIR_S_C_STO_HINT_PS: not implemented" msgstr "" -#: vms-tir.c:536 vms-tir.c:1446 +#: vms-tir.c:554 vms-tir.c:1473 #, c-format msgid "Reserved STO cmd %d" msgstr "" -#: vms-tir.c:649 +#: vms-tir.c:667 msgid "ETIR_S_C_OPR_INSV: Not supported" msgstr "" -#: vms-tir.c:667 +#: vms-tir.c:685 msgid "ETIR_S_C_OPR_USH: Not supported" msgstr "" -#: vms-tir.c:673 +#: vms-tir.c:691 msgid "ETIR_S_C_OPR_ROT: Not supported" msgstr "" -#: vms-tir.c:692 +#: vms-tir.c:710 msgid "ETIR_S_C_OPR_REDEF: Not supported" msgstr "" -#: vms-tir.c:698 +#: vms-tir.c:716 msgid "ETIR_S_C_OPR_DFLIT: Not supported" msgstr "" -#: vms-tir.c:702 vms-tir.c:1641 +#: vms-tir.c:720 vms-tir.c:1668 #, c-format msgid "Reserved OPR cmd %d" msgstr "" -#: vms-tir.c:770 vms-tir.c:1710 +#: vms-tir.c:788 vms-tir.c:1737 #, c-format msgid "Reserved CTL cmd %d" msgstr "" -#: vms-tir.c:798 +#: vms-tir.c:816 msgid "ETIR_S_C_STC_LP: not supported" msgstr "" -#: vms-tir.c:816 +#: vms-tir.c:834 msgid "ETIR_S_C_STC_GBL: not supported" msgstr "" -#: vms-tir.c:824 +#: vms-tir.c:842 msgid "ETIR_S_C_STC_GCA: not supported" msgstr "" -#: vms-tir.c:833 +#: vms-tir.c:851 msgid "ETIR_S_C_STC_PS: not supported" msgstr "" @@ -2024,11 +2100,11 @@ msgstr "" #. * arg: - #. * #. -#: vms-tir.c:1174 +#: vms-tir.c:1199 msgid "Stack-from-image not implemented" msgstr "" -#: vms-tir.c:1194 +#: vms-tir.c:1219 msgid "Stack-entry-mask not fully implemented" msgstr "" @@ -2041,171 +2117,526 @@ msgstr "" #. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. * and stack TRUE (args match) or FALSE (args dont match) value #. -#: vms-tir.c:1210 +#: vms-tir.c:1235 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1230 +#: vms-tir.c:1256 msgid "Stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1245 +#: vms-tir.c:1271 msgid "Stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1267 +#: vms-tir.c:1294 msgid "Stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1442 +#: vms-tir.c:1469 #, c-format msgid "Unimplemented STO cmd %d" msgstr "" -#: vms-tir.c:1581 +#: vms-tir.c:1608 msgid "TIR_S_C_OPR_ASH incomplete" msgstr "" -#: vms-tir.c:1595 +#: vms-tir.c:1622 msgid "TIR_S_C_OPR_USH incomplete" msgstr "" -#: vms-tir.c:1609 +#: vms-tir.c:1636 msgid "TIR_S_C_OPR_ROT incomplete" msgstr "" #. #. * redefine symbol to current location #. -#: vms-tir.c:1630 +#: vms-tir.c:1657 msgid "TIR_S_C_OPR_REDEF not supported" msgstr "" #. #. * define a literal #. -#: vms-tir.c:1637 +#: vms-tir.c:1664 msgid "TIR_S_C_OPR_DFLIT not supported" msgstr "" -#: vms-tir.c:1691 +#: vms-tir.c:1718 msgid "TIR_S_C_CTL_DFLOC not fully implemented" msgstr "" -#: vms-tir.c:1699 +#: vms-tir.c:1726 msgid "TIR_S_C_CTL_STLOC not fully implemented" msgstr "" -#: vms-tir.c:1707 +#: vms-tir.c:1734 msgid "TIR_S_C_CTL_STKDL not fully implemented" msgstr "" -#: vms-tir.c:1761 +#: vms-tir.c:1791 #, c-format msgid "Obj code %d not found" msgstr "" -#: vms-tir.c:2102 +#: vms-tir.c:2137 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2376 +#: vms-tir.c:2424 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1634 +#: xcofflink.c:1241 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1686 +#: xcofflink.c:1294 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1709 +#: xcofflink.c:1317 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1721 +#: xcofflink.c:1329 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1760 +#: xcofflink.c:1365 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1883 -#, c-format -msgid "%s: symbol `%s' has unrecognized smclas %d" -msgstr "" - -#: xcofflink.c:1902 +#: xcofflink.c:1517 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:2006 +#: xcofflink.c:1624 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:2317 +#: xcofflink.c:1948 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2452 +#: xcofflink.c:2083 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2473 +#: xcofflink.c:2104 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:3113 +#: xcofflink.c:2749 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:3704 +#: xcofflink.c:2890 +msgid "error: undefined symbol __rtinit" +msgstr "" + +#: xcofflink.c:3458 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4698 +#: xcofflink.c:4452 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5523 xcofflink.c:5879 xcofflink.c:5916 xcofflink.c:6233 +#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5545 xcofflink.c:6244 +#: xcofflink.c:5314 xcofflink.c:6128 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5560 +#: xcofflink.c:5329 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: xcofflink.c:6440 +#: elf32-ia64.c:2190 elf64-ia64.c:2190 +msgid "@pltoff reloc against local symbol" +msgstr "" + +#: elf32-ia64.c:2248 elf64-ia64.c:2248 +msgid "non-zero addend in @fptr reloc" +msgstr "" + +#: elf32-ia64.c:3414 elf64-ia64.c:3414 #, c-format -msgid "%s: unsupported relocation type 0x%02x" +msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: xcofflink.c:6486 +#: elf32-ia64.c:3425 elf64-ia64.c:3425 #, c-format -msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" +msgid "%s: __gp does not cover short data segment" +msgstr "" + +#: elf32-ia64.c:3729 elf64-ia64.c:3729 +#, c-format +msgid "%s: linking non-pic code in a shared library" +msgstr "" + +#: elf32-ia64.c:3762 elf64-ia64.c:3762 +#, c-format +msgid "%s: @gprel relocation against dynamic symbol %s" +msgstr "" + +#: elf32-ia64.c:3901 elf64-ia64.c:3901 +#, c-format +msgid "%s: dynamic relocation against speculation fixup" +msgstr "" + +#: elf32-ia64.c:3909 elf64-ia64.c:3909 +#, c-format +msgid "%s: speculation fixup against undefined weak symbol" +msgstr "" + +#: elf32-ia64.c:4093 elf64-ia64.c:4093 +msgid "unsupported reloc" +msgstr "" + +#: elf32-ia64.c:4373 elf64-ia64.c:4373 +#, c-format +msgid "%s: linking trap-on-NULL-dereference with non-trapping files" +msgstr "" + +#: elf32-ia64.c:4382 elf64-ia64.c:4382 +#, c-format +msgid "%s: linking big-endian files with little-endian files" +msgstr "" + +#: elf32-ia64.c:4391 elf64-ia64.c:4391 +#, c-format +msgid "%s: linking 64-bit files with 32-bit files" +msgstr "" + +#: elf32-ia64.c:4400 elf64-ia64.c:4400 +#, c-format +msgid "%s: linking constant-gp files with non-constant-gp files" +msgstr "" + +#: elf32-ia64.c:4410 elf64-ia64.c:4410 +#, c-format +msgid "%s: linking auto-pic files with non-auto-pic files" +msgstr "" + +#: peigen.c:964 pepigen.c:964 +#, c-format +msgid "%s: line number overflow: 0x%lx > 0xffff" +msgstr "" + +#: peigen.c:981 pepigen.c:981 +#, c-format +msgid "%s: reloc overflow 1: 0x%lx > 0xffff" +msgstr "" + +#: peigen.c:995 pepigen.c:995 +msgid "Export Directory [.edata (or where ever we found it)]" +msgstr "" + +#: peigen.c:996 pepigen.c:996 +msgid "Import Directory [parts of .idata]" +msgstr "" + +#: peigen.c:997 pepigen.c:997 +msgid "Resource Directory [.rsrc]" +msgstr "" + +#: peigen.c:998 pepigen.c:998 +msgid "Exception Directory [.pdata]" +msgstr "" + +#: peigen.c:999 pepigen.c:999 +msgid "Security Directory" +msgstr "" + +#: peigen.c:1000 pepigen.c:1000 +msgid "Base Relocation Directory [.reloc]" +msgstr "" + +#: peigen.c:1001 pepigen.c:1001 +msgid "Debug Directory" +msgstr "" + +#: peigen.c:1002 pepigen.c:1002 +msgid "Description Directory" +msgstr "" + +#: peigen.c:1003 pepigen.c:1003 +msgid "Special Directory" +msgstr "" + +#: peigen.c:1004 pepigen.c:1004 +msgid "Thread Storage Directory [.tls]" +msgstr "" + +#: peigen.c:1005 pepigen.c:1005 +msgid "Load Configuration Directory" +msgstr "" + +#: peigen.c:1006 pepigen.c:1006 +msgid "Bound Import Directory" +msgstr "" + +#: peigen.c:1007 pepigen.c:1007 +msgid "Import Address Table Directory" +msgstr "" + +#: peigen.c:1008 pepigen.c:1008 +msgid "Delay Import Directory" +msgstr "" + +#: peigen.c:1009 peigen.c:1010 pepigen.c:1009 pepigen.c:1010 +msgid "Reserved" +msgstr "" + +#: peigen.c:1073 pepigen.c:1073 +msgid "" +"\n" +"There is an import table, but the section containing it could not be found\n" +msgstr "" + +#: peigen.c:1078 pepigen.c:1078 +#, c-format +msgid "" +"\n" +"There is an import table in %s at 0x%lx\n" +msgstr "" + +#: peigen.c:1115 pepigen.c:1115 +#, c-format +msgid "" +"\n" +"Function descriptor located at the start address: %04lx\n" +msgstr "" + +#: peigen.c:1118 pepigen.c:1118 +#, c-format +msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" +msgstr "" + +#: peigen.c:1124 pepigen.c:1124 +msgid "" +"\n" +"No reldata section! Function descriptor not decoded.\n" +msgstr "" + +#: peigen.c:1129 pepigen.c:1129 +#, c-format +msgid "" +"\n" +"The Import Tables (interpreted %s section contents)\n" +msgstr "" + +#: peigen.c:1132 pepigen.c:1132 +msgid " vma: Hint Time Forward DLL First\n" +msgstr "" + +#: peigen.c:1134 pepigen.c:1134 +msgid " Table Stamp Chain Name Thunk\n" +msgstr "" + +#: peigen.c:1182 pepigen.c:1182 +#, c-format +msgid "" +"\n" +"\tDLL Name: %s\n" +msgstr "" + +#: peigen.c:1186 peigen.c:1249 pepigen.c:1186 pepigen.c:1249 +msgid "\tvma: Hint/Ord Member-Name\n" +msgstr "" + +#: peigen.c:1248 pepigen.c:1248 +msgid "\tThe Import Address Table (difference found)\n" +msgstr "" + +#: peigen.c:1255 pepigen.c:1255 +msgid "\t>>> Ran out of IAT members!\n" +msgstr "" + +#: peigen.c:1273 pepigen.c:1273 +msgid "\tThe Import Address Table is identical\n" +msgstr "" + +#: peigen.c:1345 pepigen.c:1345 +msgid "" +"\n" +"There is an export table, but the section containing it could not be found\n" +msgstr "" + +#: peigen.c:1350 pepigen.c:1350 +#, c-format +msgid "" +"\n" +"There is an export table in %s at 0x%lx\n" +msgstr "" + +#: peigen.c:1381 pepigen.c:1381 +#, c-format +msgid "" +"\n" +"The Export Tables (interpreted %s section contents)\n" +"\n" +msgstr "" + +#: peigen.c:1385 pepigen.c:1385 +#, c-format +msgid "Export Flags \t\t\t%lx\n" +msgstr "" + +#: peigen.c:1388 pepigen.c:1388 +#, c-format +msgid "Time/Date stamp \t\t%lx\n" +msgstr "" + +#: peigen.c:1391 pepigen.c:1391 +#, c-format +msgid "Major/Minor \t\t\t%d/%d\n" +msgstr "" + +#: peigen.c:1394 pepigen.c:1394 +msgid "Name \t\t\t\t" +msgstr "" + +#: peigen.c:1400 pepigen.c:1400 +#, c-format +msgid "Ordinal Base \t\t\t%ld\n" +msgstr "" + +#: peigen.c:1403 pepigen.c:1403 +msgid "Number in:\n" +msgstr "" + +#: peigen.c:1406 pepigen.c:1406 +#, c-format +msgid "\tExport Address Table \t\t%08lx\n" +msgstr "" + +#: peigen.c:1410 pepigen.c:1410 +#, c-format +msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" +msgstr "" + +#: peigen.c:1413 pepigen.c:1413 +msgid "Table Addresses\n" +msgstr "" + +#: peigen.c:1416 pepigen.c:1416 +msgid "\tExport Address Table \t\t" +msgstr "" + +#: peigen.c:1421 pepigen.c:1421 +msgid "\tName Pointer Table \t\t" +msgstr "" + +#: peigen.c:1426 pepigen.c:1426 +msgid "\tOrdinal Table \t\t\t" +msgstr "" + +#: peigen.c:1441 pepigen.c:1441 +#, c-format +msgid "" +"\n" +"Export Address Table -- Ordinal Base %ld\n" +msgstr "" + +#: peigen.c:1460 pepigen.c:1460 +msgid "Forwarder RVA" +msgstr "" + +#: peigen.c:1471 pepigen.c:1471 +msgid "Export RVA" +msgstr "" + +#: peigen.c:1478 pepigen.c:1478 +msgid "" +"\n" +"[Ordinal/Name Pointer] Table\n" +msgstr "" + +#: peigen.c:1533 pepigen.c:1533 +#, c-format +msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" +msgstr "" + +#: peigen.c:1537 pepigen.c:1537 +msgid "" +"\n" +"The Function Table (interpreted .pdata section contents)\n" +msgstr "" + +#: peigen.c:1540 pepigen.c:1540 +msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" +msgstr "" + +#: peigen.c:1543 pepigen.c:1543 +msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" +msgstr "" + +#: peigen.c:1545 pepigen.c:1545 +msgid " \t\tAddress Address Handler Data Address Mask\n" +msgstr "" + +#: peigen.c:1613 pepigen.c:1613 +msgid " Register save millicode" +msgstr "" + +#: peigen.c:1616 pepigen.c:1616 +msgid " Register restore millicode" +msgstr "" + +#: peigen.c:1619 pepigen.c:1619 +msgid " Glue code sequence" +msgstr "" + +#: peigen.c:1671 pepigen.c:1671 +msgid "" +"\n" +"\n" +"PE File Base Relocations (interpreted .reloc section contents)\n" +msgstr "" + +#: peigen.c:1701 pepigen.c:1701 +#, c-format +msgid "" +"\n" +"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" +msgstr "" + +#: peigen.c:1714 pepigen.c:1714 +#, c-format +msgid "\treloc %4d offset %4x [%4lx] %s" +msgstr "" + +#. The MS dumpbin program reportedly ands with 0xff0f before +#. printing the characteristics field. Not sure why. No reason to +#. emulate it here. +#: peigen.c:1754 pepigen.c:1754 +#, c-format +msgid "" +"\n" +"Characteristics 0x%x\n" msgstr "" diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index b2250a0..9ac3f31 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -1,5 +1,5 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, @@ -32,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ the file. objcopy cooperates by specially setting the start address to zero by default. */ -#include - +#include "safe-ctype.h" #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -97,7 +96,6 @@ static boolean ppcboot_get_section_contents static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *)); static char *mangle_name PARAMS ((bfd *, char *)); static long ppcboot_get_symtab PARAMS ((bfd *, asymbol **)); -static asymbol *ppcboot_make_empty_symbol PARAMS ((bfd *)); static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static boolean ppcboot_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); @@ -114,7 +112,10 @@ ppcboot_mkobject (abfd) bfd *abfd; { if (!ppcboot_get_tdata (abfd)) - ppcboot_set_tdata (abfd, bfd_zalloc (abfd, sizeof (ppcboot_data_t))); + { + bfd_size_type amt = sizeof (ppcboot_data_t); + ppcboot_set_tdata (abfd, bfd_zalloc (abfd, amt)); + } return true; } @@ -172,7 +173,8 @@ ppcboot_object_p (abfd) return NULL; } - if (bfd_read ((PTR) &hdr, sizeof (hdr), 1, abfd) != sizeof (hdr)) + if (bfd_bread ((PTR) &hdr, (bfd_size_type) sizeof (hdr), abfd) + != sizeof (hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -216,7 +218,7 @@ ppcboot_object_p (abfd) tdata->sec = sec; memcpy ((PTR) &tdata->header, (PTR) &hdr, sizeof (ppcboot_hdr_t)); - ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0); + ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0L); return abfd->xvec; } @@ -235,8 +237,8 @@ ppcboot_get_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (bfd_seek (abfd, offset + sizeof (ppcboot_hdr_t), SEEK_SET) != 0 - || bfd_read (location, 1, count, abfd) != count) + if (bfd_seek (abfd, offset + (file_ptr) sizeof (ppcboot_hdr_t), SEEK_SET) != 0 + || bfd_bread (location, count, abfd) != count) return false; return true; } @@ -259,7 +261,7 @@ mangle_name (abfd, suffix) bfd *abfd; char *suffix; { - int size; + bfd_size_type size; char *buf; char *p; @@ -275,7 +277,7 @@ mangle_name (abfd, suffix) /* Change any non-alphanumeric characters to underscores. */ for (p = buf; *p; p++) - if (! isalnum ((unsigned char) *p)) + if (! ISALNUM (*p)) *p = '_'; return buf; @@ -292,8 +294,9 @@ ppcboot_get_symtab (abfd, alocation) asection *sec = ppcboot_get_tdata (abfd)->sec; asymbol *syms; unsigned int i; + bfd_size_type amt = PPCBOOT_SYMS * sizeof (asymbol); - syms = (asymbol *) bfd_alloc (abfd, PPCBOOT_SYMS * sizeof (asymbol)); + syms = (asymbol *) bfd_alloc (abfd, amt); if (syms == NULL) return false; @@ -328,17 +331,7 @@ ppcboot_get_symtab (abfd, alocation) return PPCBOOT_SYMS; } - -/* Make an empty symbol. */ - -static asymbol * -ppcboot_make_empty_symbol (abfd) - bfd *abfd; -{ - return (asymbol *) bfd_alloc (abfd, sizeof (asymbol)); -} - - +#define ppcboot_make_empty_symbol _bfd_generic_make_empty_symbol #define ppcboot_print_symbol _bfd_nosymbols_print_symbol /* Get information about a symbol. */ @@ -475,6 +468,7 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) bfd_generic_get_relocated_section_contents #define ppcboot_bfd_relax_section bfd_generic_relax_section #define ppcboot_bfd_gc_sections bfd_generic_gc_sections +#define ppcboot_bfd_merge_sections bfd_generic_merge_sections #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols #define ppcboot_bfd_final_link _bfd_generic_final_link diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c index 704391a..f8db927 100644 --- a/contrib/binutils/bfd/ptrace-core.c +++ b/contrib/binutils/bfd/ptrace-core.c @@ -1,5 +1,5 @@ /* BFD backend for core files which use the ptrace_user structure - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001 + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. The structure of this file is based on trad-core.c written by John Gilmore of Cygnus Support. @@ -64,8 +64,9 @@ ptrace_unix_core_file_p (abfd) int val; struct ptrace_user u; struct trad_core_struct *rawptr; + bfd_size_type amt; - val = bfd_read ((void *)&u, 1, sizeof u, abfd); + val = bfd_bread ((void *)&u, (bfd_size_type) sizeof u, abfd); if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC || u.pt_rev != _BCS_PTRACE_REV) { @@ -78,8 +79,8 @@ ptrace_unix_core_file_p (abfd) /* Allocate both the upage and the struct core_data at once, so a single free() will free them both. */ - rawptr = (struct trad_core_struct *) - bfd_zalloc (abfd, sizeof (struct trad_core_struct)); + amt = sizeof (struct trad_core_struct); + rawptr = (struct trad_core_struct *) bfd_zalloc (abfd, amt); if (rawptr == NULL) return 0; @@ -88,22 +89,17 @@ ptrace_unix_core_file_p (abfd) rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ - /* Create the sections. This is raunchy, but bfd_close wants to free - them separately. */ + /* Create the sections. */ - core_stacksec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); if (core_stacksec (abfd) == NULL) - return NULL; - core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + goto fail; + core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); if (core_datasec (abfd) == NULL) - return NULL; - core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + goto fail; + core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); if (core_regsec (abfd) == NULL) - return NULL; - - core_stacksec (abfd)->name = ".stack"; - core_datasec (abfd)->name = ".data"; - core_regsec (abfd)->name = ".reg"; + goto fail; /* FIXME: Need to worry about shared memory, library data, and library text. I don't think that any of these things are supported on the @@ -130,12 +126,13 @@ ptrace_unix_core_file_p (abfd) core_datasec (abfd)->alignment_power = 2; core_regsec (abfd)->alignment_power = 2; - abfd->sections = core_stacksec (abfd); - core_stacksec (abfd)->next = core_datasec (abfd); - core_datasec (abfd)->next = core_regsec (abfd); - abfd->section_count = 3; - return abfd->xvec; + + fail: + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = NULL; + bfd_section_list_clear (abfd); + return NULL; } char * diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c index 1c45f6f..d73ad24 100644 --- a/contrib/binutils/bfd/reloc.c +++ b/contrib/binutils/bfd/reloc.c @@ -65,31 +65,31 @@ CODE_FRAGMENT . .typedef enum bfd_reloc_status .{ -. {* No errors detected *} +. {* No errors detected *} . bfd_reloc_ok, . -. {* The relocation was performed, but there was an overflow. *} +. {* The relocation was performed, but there was an overflow. *} . bfd_reloc_overflow, . -. {* The address to relocate was not within the section supplied. *} +. {* The address to relocate was not within the section supplied. *} . bfd_reloc_outofrange, . -. {* Used by special functions *} +. {* Used by special functions *} . bfd_reloc_continue, . -. {* Unsupported relocation size requested. *} +. {* Unsupported relocation size requested. *} . bfd_reloc_notsupported, . -. {* Unused *} +. {* Unused *} . bfd_reloc_other, . -. {* The symbol to relocate against was undefined. *} +. {* The symbol to relocate against was undefined. *} . bfd_reloc_undefined, . -. {* The relocation was performed, but may not be ok - presently -. generated only when linking i960 coff files with i960 b.out -. symbols. If this type is returned, the error_message argument -. to bfd_perform_relocation will be set. *} +. {* The relocation was performed, but may not be ok - presently +. generated only when linking i960 coff files with i960 b.out +. symbols. If this type is returned, the error_message argument +. to bfd_perform_relocation will be set. *} . bfd_reloc_dangerous . } . bfd_reloc_status_type; @@ -97,16 +97,16 @@ CODE_FRAGMENT . .typedef struct reloc_cache_entry .{ -. {* A pointer into the canonical table of pointers *} +. {* A pointer into the canonical table of pointers *} . struct symbol_cache_entry **sym_ptr_ptr; . -. {* offset in section *} +. {* offset in section *} . bfd_size_type address; . -. {* addend for relocation value *} +. {* addend for relocation value *} . bfd_vma addend; . -. {* Pointer to how to perform the required relocation *} +. {* Pointer to how to perform the required relocation *} . reloc_howto_type *howto; . .} arelent; @@ -250,19 +250,19 @@ CODE_FRAGMENT . .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 .}; @@ -280,97 +280,91 @@ CODE_FRAGMENT . .struct reloc_howto_struct .{ -. {* The type field has mainly a documentary use - the back end can -. do what it wants with it, though normally the back end's -. external idea of what a reloc number is stored -. in this field. For example, a PC relative word relocation -. in a coff environment has the type 023 - because that's -. what the outside world calls a R_PCRWORD reloc. *} +. {* The type field has mainly a documentary use - the back end can +. do what it wants with it, though normally the back end's +. external idea of what a reloc number is stored +. in this field. For example, a PC relative word relocation +. in a coff environment has the type 023 - because that's +. what the outside world calls a R_PCRWORD reloc. *} . unsigned int type; . -. {* The value the final relocation is shifted right by. This drops -. unwanted data from the relocation. *} +. {* The value the final relocation is shifted right by. This drops +. 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. *} +. {* The number of bits in the item to be relocated. This is used +. when doing overflow checking. *} . unsigned int bitsize; . -. {* Notes that the relocation is relative to the location in the -. data section of the addend. The relocation function will -. subtract from the relocation value the address of the location -. being relocated. *} +. {* Notes that the relocation is relative to the location in the +. data section of the addend. The relocation function will +. subtract from the relocation value the address of the location +. 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 -. called rather than the normal function. This allows really -. strange relocation methods to be accomodated (e.g., i960 callj -. instructions). *} +. {* If this field is non null, then the supplied function is +. called rather than the normal function. This allows really +. strange relocation methods to be accomodated (e.g., i960 callj +. instructions). *} . bfd_reloc_status_type (*special_function) -. PARAMS ((bfd *abfd, -. arelent *reloc_entry, -. struct symbol_cache_entry *symbol, -. PTR data, -. asection *input_section, -. bfd *output_bfd, -. char **error_message)); +. PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, +. bfd *, char **)); . -. {* The textual name of the relocation type. *} +. {* The textual name of the relocation type. *} . char *name; . -. {* Some formats record a relocation addend in the section contents -. rather than with the relocation. For ELF formats this is the -. distinction between USE_REL and USE_RELA (though the code checks -. for USE_REL == 1/0). The value of this field is TRUE if the -. addend is recorded with the section contents; when performing a -. partial link (ld -r) the section contents (the data) will be -. modified. The value of this field is FALSE if addends are -. recorded with the relocation (in arelent.addend); when performing -. a partial link the relocation will be modified. -. All relocations for all ELF USE_RELA targets should set this field -. to FALSE (values of TRUE should be looked on with suspicion). -. However, the converse is not true: not all relocations of all ELF -. USE_REL targets set this field to TRUE. Why this is so is peculiar -. to each particular target. For relocs that aren't used in partial -. links (e.g. GOT stuff) it doesn't matter what this is set to. *} +. {* Some formats record a relocation addend in the section contents +. rather than with the relocation. For ELF formats this is the +. distinction between USE_REL and USE_RELA (though the code checks +. for USE_REL == 1/0). The value of this field is TRUE if the +. addend is recorded with the section contents; when performing a +. partial link (ld -r) the section contents (the data) will be +. modified. The value of this field is FALSE if addends are +. recorded with the relocation (in arelent.addend); when performing +. a partial link the relocation will be modified. +. All relocations for all ELF USE_RELA targets should set this field +. to FALSE (values of TRUE should be looked on with suspicion). +. However, the converse is not true: not all relocations of all ELF +. USE_REL targets set this field to TRUE. Why this is so is peculiar +. to each particular target. For relocs that aren't used in partial +. links (e.g. GOT stuff) it doesn't matter what this is set to. *} . boolean partial_inplace; . -. {* The src_mask selects which parts of the read in data -. are to be used in the relocation sum. E.g., if this was an 8 bit -. byte of data which we read and relocated, this would be -. 0x000000ff. When we have relocs which have an addend, such as -. sun4 extended relocs, the value in the offset part of a -. relocating field is garbage so we never use it. In this case -. the mask would be 0x00000000. *} +. {* The src_mask selects which parts of the read in data +. are to be used in the relocation sum. E.g., if this was an 8 bit +. byte of data which we read and relocated, this would be +. 0x000000ff. When we have relocs which have an addend, such as +. sun4 extended relocs, the value in the offset part of a +. relocating field is garbage so we never use it. In this case +. the mask would be 0x00000000. *} . bfd_vma src_mask; . -. {* The dst_mask selects which parts of the instruction are replaced -. into the instruction. In most cases src_mask == dst_mask, -. except in the above special case, where dst_mask would be -. 0x000000ff, and src_mask would be 0x00000000. *} +. {* The dst_mask selects which parts of the instruction are replaced +. into the instruction. In most cases src_mask == dst_mask, +. except in the above special case, where dst_mask would be +. 0x000000ff, and src_mask would be 0x00000000. *} . bfd_vma dst_mask; . -. {* When some formats create PC relative instructions, they leave -. the value of the pc of the place being relocated in the offset -. slot of the instruction, so that a PC relative relocation can -. be made just by adding in an ordinary offset (e.g., sun3 a.out). -. Some formats leave the displacement part of an instruction -. empty (e.g., m88k bcs); this flag signals the fact.*} +. {* When some formats create PC relative instructions, they leave +. the value of the pc of the place being relocated in the offset +. slot of the instruction, so that a PC relative relocation can +. be made just by adding in an ordinary offset (e.g., sun3 a.out). +. Some formats leave the displacement part of an instruction +. empty (e.g., m88k bcs); this flag signals the fact. *} . boolean pcrel_offset; -. .}; */ @@ -382,37 +376,43 @@ FUNCTION DESCRIPTION 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} +.#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 } DESCRIPTION And will be replaced with the totally magic way. But for the 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) +.#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ +. HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ +. NAME, false, 0, 0, IN) . DESCRIPTION This is used to fill in an empty howto entry in an array. .#define EMPTY_HOWTO(C) \ -. HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) +. HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \ +. NULL, false, 0, 0, false) . DESCRIPTION Helper routine to turn a symbol into a relocation value. -.#define HOWTO_PREPARE(relocation, symbol) \ -. { \ -. if (symbol != (asymbol *)NULL) { \ -. if (bfd_is_com_section (symbol->section)) { \ -. relocation = 0; \ -. } \ -. else { \ -. relocation = symbol->value; \ -. } \ -. } \ -.} +.#define HOWTO_PREPARE(relocation, symbol) \ +. { \ +. if (symbol != (asymbol *) NULL) \ +. { \ +. if (bfd_is_com_section (symbol->section)) \ +. { \ +. relocation = 0; \ +. } \ +. else \ +. { \ +. relocation = symbol->value; \ +. } \ +. } \ +. } */ @@ -453,9 +453,10 @@ DESCRIPTION How relocs are tied together in an <>: -.typedef struct relent_chain { +.typedef struct relent_chain +.{ . arelent relent; -. struct relent_chain *next; +. struct relent_chain *next; .} arelent_chain; */ @@ -626,8 +627,8 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, } /* Is the address of the relocation really within the section? */ - if (reloc_entry->address > input_section->_cooked_size / - bfd_octets_per_byte (abfd)) + if (reloc_entry->address > (input_section->_cooked_size + / bfd_octets_per_byte (abfd))) return bfd_reloc_outofrange; /* Work out which section the relocation is targetted at and the @@ -903,14 +904,14 @@ space consuming. For each target: { short x = bfd_get_16 (abfd, (bfd_byte *) data + octets); DOIT (x); - bfd_put_16 (abfd, x, (unsigned char *) data + octets); + bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + octets); } break; case 2: { long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); DOIT (x); - bfd_put_32 (abfd, x, (bfd_byte *) data + octets); + bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); } break; case -2: @@ -918,7 +919,7 @@ space consuming. For each target: long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); relocation = -relocation; DOIT (x); - bfd_put_32 (abfd, x, (bfd_byte *) data + octets); + bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); } break; @@ -927,7 +928,7 @@ space consuming. For each target: long x = bfd_get_16 (abfd, (bfd_byte *) data + octets); relocation = -relocation; DOIT (x); - bfd_put_16 (abfd, x, (bfd_byte *) data + octets); + bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); } break; @@ -1022,7 +1023,8 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, } /* Is the address of the relocation really within the section? */ - if (reloc_entry->address > input_section->_cooked_size) + if (reloc_entry->address > (input_section->_cooked_size + / bfd_octets_per_byte (abfd))) return bfd_reloc_outofrange; /* Work out which section the relocation is targetted at and the @@ -1292,14 +1294,14 @@ space consuming. For each target: { short x = bfd_get_16 (abfd, (bfd_byte *) data); DOIT (x); - bfd_put_16 (abfd, x, (unsigned char *) data); + bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data); } break; case 2: { long x = bfd_get_32 (abfd, (bfd_byte *) data); DOIT (x); - bfd_put_32 (abfd, x, (bfd_byte *) data); + bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data); } break; case -2: @@ -1307,7 +1309,7 @@ space consuming. For each target: long x = bfd_get_32 (abfd, (bfd_byte *) data); relocation = -relocation; DOIT (x); - bfd_put_32 (abfd, x, (bfd_byte *) data); + bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data); } break; @@ -1681,6 +1683,8 @@ ENUMX ENUMX BFD_RELOC_8_GOTOFF ENUMX + BFD_RELOC_64_PLT_PCREL +ENUMX BFD_RELOC_32_PLT_PCREL ENUMX BFD_RELOC_24_PLT_PCREL @@ -1689,6 +1693,8 @@ ENUMX ENUMX BFD_RELOC_8_PLT_PCREL ENUMX + BFD_RELOC_64_PLTOFF +ENUMX BFD_RELOC_32_PLTOFF ENUMX BFD_RELOC_16_PLTOFF @@ -1851,6 +1857,8 @@ ENUMEQX BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL ENUMX + BFD_RELOC_SPARC_PLT32 +ENUMX BFD_RELOC_SPARC_PLT64 ENUMX BFD_RELOC_SPARC_HIX22 @@ -1927,27 +1935,6 @@ ENUMDOC 2 - byte-manipulation (byte offset reg) 3 - jsr (target of branch) - The GNU linker currently doesn't do any of this optimizing. - -ENUM - BFD_RELOC_ALPHA_USER_LITERAL -ENUMX - BFD_RELOC_ALPHA_USER_LITUSE_BASE -ENUMX - BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF -ENUMX - BFD_RELOC_ALPHA_USER_LITUSE_JSR -ENUMX - BFD_RELOC_ALPHA_USER_GPDISP -ENUMX - BFD_RELOC_ALPHA_USER_GPRELHIGH -ENUMX - BFD_RELOC_ALPHA_USER_GPRELLOW -ENUMDOC - The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to - process the explicit !!sequence relocations, and are mapped - into the normal relocations at the end of processing. - ENUM BFD_RELOC_ALPHA_HINT ENUMDOC @@ -1968,6 +1955,14 @@ ENUMDOC which is filled by the linker. ENUM + BFD_RELOC_ALPHA_GPREL_HI16 +ENUMX + BFD_RELOC_ALPHA_GPREL_LO16 +ENUMDOC + The GPREL_HI/LO relocations together form a 32-bit offset from the + GP register. + +ENUM BFD_RELOC_MIPS_JMP ENUMDOC Bits 27..2 of the relocation address shifted right 2 bits; @@ -2007,12 +2002,6 @@ ENUM ENUMDOC Like BFD_RELOC_LO16, but PC relative. -ENUMEQ - BFD_RELOC_MIPS_GPREL - BFD_RELOC_GPREL16 -ENUMDOC - Relocation relative to the global pointer. - ENUM BFD_RELOC_MIPS_LITERAL ENUMDOC @@ -2022,9 +2011,6 @@ ENUM BFD_RELOC_MIPS_GOT16 ENUMX BFD_RELOC_MIPS_CALL16 -ENUMEQX - BFD_RELOC_MIPS_GPREL32 - BFD_RELOC_GPREL32 ENUMX BFD_RELOC_MIPS_GOT_HI16 ENUMX @@ -2135,6 +2121,13 @@ ENUMDOC ns32k relocations ENUM + BFD_RELOC_PDP11_DISP_8_PCREL +ENUMX + BFD_RELOC_PDP11_DISP_6_PCREL +ENUMDOC + PDP11 relocations + +ENUM BFD_RELOC_PJ_CODE_HI16 ENUMX BFD_RELOC_PJ_CODE_LO16 @@ -2209,6 +2202,52 @@ ENUMX BFD_RELOC_PPC_EMB_BIT_FLD ENUMX BFD_RELOC_PPC_EMB_RELSDA +ENUMX + BFD_RELOC_PPC64_HIGHER +ENUMX + BFD_RELOC_PPC64_HIGHER_S +ENUMX + BFD_RELOC_PPC64_HIGHEST +ENUMX + BFD_RELOC_PPC64_HIGHEST_S +ENUMX + BFD_RELOC_PPC64_TOC16_LO +ENUMX + BFD_RELOC_PPC64_TOC16_HI +ENUMX + BFD_RELOC_PPC64_TOC16_HA +ENUMX + BFD_RELOC_PPC64_TOC +ENUMX + BFD_RELOC_PPC64_PLTGOT16 +ENUMX + BFD_RELOC_PPC64_PLTGOT16_LO +ENUMX + BFD_RELOC_PPC64_PLTGOT16_HI +ENUMX + BFD_RELOC_PPC64_PLTGOT16_HA +ENUMX + BFD_RELOC_PPC64_ADDR16_DS +ENUMX + BFD_RELOC_PPC64_ADDR16_LO_DS +ENUMX + BFD_RELOC_PPC64_GOT16_DS +ENUMX + BFD_RELOC_PPC64_GOT16_LO_DS +ENUMX + BFD_RELOC_PPC64_PLT16_LO_DS +ENUMX + BFD_RELOC_PPC64_SECTOFF_DS +ENUMX + BFD_RELOC_PPC64_SECTOFF_LO_DS +ENUMX + BFD_RELOC_PPC64_TOC16_DS +ENUMX + BFD_RELOC_PPC64_TOC16_LO_DS +ENUMX + BFD_RELOC_PPC64_PLTGOT16_DS +ENUMX + BFD_RELOC_PPC64_PLTGOT16_LO_DS ENUMDOC Power(rs6000) and PowerPC relocations. @@ -2678,6 +2717,78 @@ ENUMDOC Motorola Mcore relocations. ENUM + BFD_RELOC_MMIX_GETA +ENUMX + BFD_RELOC_MMIX_GETA_1 +ENUMX + BFD_RELOC_MMIX_GETA_2 +ENUMX + BFD_RELOC_MMIX_GETA_3 +ENUMDOC + These are relocations for the GETA instruction. +ENUM + BFD_RELOC_MMIX_CBRANCH +ENUMX + BFD_RELOC_MMIX_CBRANCH_J +ENUMX + BFD_RELOC_MMIX_CBRANCH_1 +ENUMX + BFD_RELOC_MMIX_CBRANCH_2 +ENUMX + BFD_RELOC_MMIX_CBRANCH_3 +ENUMDOC + These are relocations for a conditional branch instruction. +ENUM + BFD_RELOC_MMIX_PUSHJ +ENUMX + BFD_RELOC_MMIX_PUSHJ_1 +ENUMX + BFD_RELOC_MMIX_PUSHJ_2 +ENUMX + BFD_RELOC_MMIX_PUSHJ_3 +ENUMDOC + These are relocations for the PUSHJ instruction. +ENUM + BFD_RELOC_MMIX_JMP +ENUMX + BFD_RELOC_MMIX_JMP_1 +ENUMX + BFD_RELOC_MMIX_JMP_2 +ENUMX + BFD_RELOC_MMIX_JMP_3 +ENUMDOC + These are relocations for the JMP instruction. +ENUM + BFD_RELOC_MMIX_ADDR19 +ENUMDOC + This is a relocation for a relative address as in a GETA instruction or + a branch. +ENUM + BFD_RELOC_MMIX_ADDR27 +ENUMDOC + This is a relocation for a relative address as in a JMP instruction. +ENUM + BFD_RELOC_MMIX_REG_OR_BYTE +ENUMDOC + This is a relocation for an instruction field that may be a general + register or a value 0..255. +ENUM + BFD_RELOC_MMIX_REG +ENUMDOC + This is a relocation for an instruction field that may be a general + register. +ENUM + BFD_RELOC_MMIX_BASE_PLUS_OFFSET +ENUMDOC + This is a relocation for two instruction fields holding a register and + an offset, the equivalent of the relocation. +ENUM + BFD_RELOC_MMIX_LOCAL +ENUMDOC + This relocation is an assertion that the expression is not allocated as + a global register. It does not modify contents. + +ENUM BFD_RELOC_AVR_7_PCREL ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit pc relative @@ -2763,6 +2874,75 @@ ENUMDOC into 22 bits. ENUM + BFD_RELOC_390_12 +ENUMDOC + Direct 12 bit. +ENUM + BFD_RELOC_390_GOT12 +ENUMDOC + 12 bit GOT offset. +ENUM + BFD_RELOC_390_PLT32 +ENUMDOC + 32 bit PC relative PLT address. +ENUM + BFD_RELOC_390_COPY +ENUMDOC + Copy symbol at runtime. +ENUM + BFD_RELOC_390_GLOB_DAT +ENUMDOC + Create GOT entry. +ENUM + BFD_RELOC_390_JMP_SLOT +ENUMDOC + Create PLT entry. +ENUM + BFD_RELOC_390_RELATIVE +ENUMDOC + Adjust by program base. +ENUM + BFD_RELOC_390_GOTPC +ENUMDOC + 32 bit PC relative offset to GOT. +ENUM + BFD_RELOC_390_GOT16 +ENUMDOC + 16 bit GOT offset. +ENUM + BFD_RELOC_390_PC16DBL +ENUMDOC + PC relative 16 bit shifted by 1. +ENUM + BFD_RELOC_390_PLT16DBL +ENUMDOC + 16 bit PC rel. PLT shifted by 1. +ENUM + BFD_RELOC_390_PC32DBL +ENUMDOC + PC relative 32 bit shifted by 1. +ENUM + BFD_RELOC_390_PLT32DBL +ENUMDOC + 32 bit PC rel. PLT shifted by 1. +ENUM + BFD_RELOC_390_GOTPCDBL +ENUMDOC + 32 bit PC rel. GOT shifted by 1. +ENUM + BFD_RELOC_390_GOT64 +ENUMDOC + 64 bit GOT offset. +ENUM + BFD_RELOC_390_PLT64 +ENUMDOC + 64 bit PC relative PLT address. +ENUM + BFD_RELOC_390_GOTENT +ENUMDOC + 32 bit rel. offset to GOT entry. + +ENUM BFD_RELOC_VTABLE_INHERIT ENUMX BFD_RELOC_VTABLE_ENTRY @@ -2860,6 +3040,10 @@ ENUMX ENUMX BFD_RELOC_IA64_LTOFF_FPTR64I ENUMX + BFD_RELOC_IA64_LTOFF_FPTR32MSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR32LSB +ENUMX BFD_RELOC_IA64_LTOFF_FPTR64MSB ENUMX BFD_RELOC_IA64_LTOFF_FPTR64LSB @@ -2945,6 +3129,44 @@ ENUMX ENUMDOC These relocs are only used within the CRIS assembler. They are not (at present) written to any object files. +ENUM + BFD_RELOC_CRIS_COPY +ENUMX + BFD_RELOC_CRIS_GLOB_DAT +ENUMX + BFD_RELOC_CRIS_JUMP_SLOT +ENUMX + BFD_RELOC_CRIS_RELATIVE +ENUMDOC + Relocs used in ELF shared libraries for CRIS. +ENUM + BFD_RELOC_CRIS_32_GOT +ENUMDOC + 32-bit offset to symbol-entry within GOT. +ENUM + BFD_RELOC_CRIS_16_GOT +ENUMDOC + 16-bit offset to symbol-entry within GOT. +ENUM + BFD_RELOC_CRIS_32_GOTPLT +ENUMDOC + 32-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_CRIS_16_GOTPLT +ENUMDOC + 16-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_CRIS_32_GOTREL +ENUMDOC + 32-bit offset to symbol, relative to GOT. +ENUM + BFD_RELOC_CRIS_32_PLT_GOTREL +ENUMDOC + 32-bit offset to symbol with PLT entry, relative to GOT. +ENUM + BFD_RELOC_CRIS_32_PLT_PCREL +ENUMDOC + 32-bit offset to symbol with PLT entry, relative to this relocation. ENUM BFD_RELOC_860_COPY @@ -3013,6 +3235,35 @@ ENUMX ENUMDOC Intel i860 Relocations. +ENUM + BFD_RELOC_OPENRISC_ABS_26 +ENUMX + BFD_RELOC_OPENRISC_REL_26 +ENUMDOC + OpenRISC Relocations. + +ENUM + BFD_RELOC_H8_DIR16A8 +ENUMX + BFD_RELOC_H8_DIR16R8 +ENUMX + BFD_RELOC_H8_DIR24A8 +ENUMX + BFD_RELOC_H8_DIR24R8 +ENUMX + BFD_RELOC_H8_DIR32A16 +ENUMDOC + H8 elf Relocations. + +ENUM + BFD_RELOC_XSTORMY16_REL_12 +ENUMX + BFD_RELOC_XSTORMY16_24 +ENUMX + BFD_RELOC_XSTORMY16_FPTR16 +ENUMDOC + Sony Xstormy16 Relocations. + ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT @@ -3159,6 +3410,28 @@ bfd_generic_gc_sections (abfd, link_info) /* INTERNAL_FUNCTION + bfd_generic_merge_sections + +SYNOPSIS + boolean bfd_generic_merge_sections + (bfd *, struct bfd_link_info *); + +DESCRIPTION + Provides default handling for SEC_MERGE section merging for back ends + which don't have SEC_MERGE support -- i.e., does nothing. +*/ + +/*ARGSUSED*/ +boolean +bfd_generic_merge_sections (abfd, link_info) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +{ + return true; +} + +/* +INTERNAL_FUNCTION bfd_generic_get_relocated_section_contents SYNOPSIS @@ -3197,7 +3470,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, if (reloc_size < 0) goto error_return; - reloc_vector = (arelent **) bfd_malloc ((size_t) reloc_size); + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (reloc_vector == NULL && reloc_size != 0) goto error_return; @@ -3205,7 +3478,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, if (!bfd_get_section_contents (input_bfd, input_section, (PTR) data, - 0, + (bfd_vma) 0, input_section->_raw_size)) goto error_return; diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c index 7de8d95..1d69a7f 100644 --- a/contrib/binutils/bfd/reloc16.c +++ b/contrib/binutils/bfd/reloc16.c @@ -1,5 +1,5 @@ /* 8 and 16 bit COFF relocation functions, for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -137,17 +137,16 @@ bfd_perform_slip (abfd, slip, input_section, value) } boolean -bfd_coff_reloc16_relax_section (abfd, i, link_info, again) +bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) bfd *abfd; - asection *i; + asection *input_section; struct bfd_link_info *link_info; boolean *again; { /* Get enough memory to hold the stuff. */ - bfd *input_bfd = i->owner; - asection *input_section = i; - int *shrinks; - int shrink = 0; + bfd *input_bfd = input_section->owner; + unsigned *shrinks; + unsigned shrink = 0; long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); arelent **reloc_vector = NULL; long reloc_count; @@ -159,7 +158,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) if (reloc_size < 0) return false; - reloc_vector = (arelent **) bfd_malloc (reloc_size); + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (!reloc_vector && reloc_size > 0) return false; @@ -191,11 +190,14 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) if (reloc_count > 0) { int another_pass = 0; + bfd_size_type amt; /* Allocate and initialize the shrinks array for this section. The last element is used as an accumlator of shrinks. */ - shrinks = (int *) bfd_malloc ((reloc_count + 1) * sizeof (int)); - memset (shrinks, 0, (reloc_count + 1) * sizeof (int)); + amt = reloc_count + 1; + amt *= sizeof (unsigned); + shrinks = (unsigned *) bfd_malloc (amt); + memset (shrinks, 0, (size_t) amt); /* Loop until nothing changes in this section. */ do { @@ -268,11 +270,11 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, if (!bfd_get_section_contents(input_bfd, input_section, data, - 0, + (bfd_vma) 0, input_section->_raw_size)) return NULL; - reloc_vector = (arelent **) bfd_malloc ((size_t) reloc_size); + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (!reloc_vector && reloc_size != 0) return NULL; diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c index 62f9c98..9f5b793 100644 --- a/contrib/binutils/bfd/sco5-core.c +++ b/contrib/binutils/bfd/sco5-core.c @@ -1,5 +1,5 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Jouke Numan This file is part of BFD, the Binary File Descriptor library. @@ -43,7 +43,6 @@ struct sco5_core_struct static asection * make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr)); -static asymbol *sco5_core_make_empty_symbol PARAMS ((bfd *)); static struct user *read_uarea PARAMS ((bfd *, int)); const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd)); char *sco5_core_file_failing_command PARAMS ((bfd *abfd)); @@ -75,16 +74,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) return asect; } -static asymbol * -sco5_core_make_empty_symbol (abfd) - bfd *abfd; -{ - asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); - if (new) - new->the_bfd = abfd; - return new; -} - static struct user * read_uarea(abfd, filepos) bfd *abfd; @@ -92,17 +81,17 @@ read_uarea(abfd, filepos) { struct sco5_core_struct *rawptr; + bfd_size_type amt = sizeof (struct sco5_core_struct); - rawptr = ((struct sco5_core_struct *) - bfd_zmalloc (sizeof (struct sco5_core_struct))); + rawptr = (struct sco5_core_struct *) bfd_zmalloc (amt); if (rawptr == NULL) return NULL; abfd->tdata.sco5_core_data = rawptr; - if ((bfd_seek (abfd, filepos, SEEK_SET) != 0) - || (bfd_read ((void *)&rawptr->u, 1, sizeof rawptr->u, abfd) - != sizeof rawptr->u)) + if (bfd_seek (abfd, (file_ptr) filepos, SEEK_SET) != 0 + || bfd_bread ((void *) &rawptr->u, (bfd_size_type) sizeof rawptr->u, + abfd) != sizeof rawptr->u) { bfd_set_error (bfd_error_wrong_format); return NULL; @@ -150,9 +139,10 @@ sco5_core_file_p (abfd) coresize = statbuf.st_size; } /* Last long in core is sizeof struct coreoffsets, read it */ - if ((bfd_seek (abfd, coresize-sizeof coffset_siz, SEEK_SET) != 0) - || (bfd_read ((void *)&coffset_siz, 1, sizeof coffset_siz, abfd) - != sizeof coffset_siz) ) + if ((bfd_seek (abfd, (file_ptr) (coresize - sizeof coffset_siz), + SEEK_SET) != 0) + || bfd_bread ((void *) &coffset_siz, (bfd_size_type) sizeof coffset_siz, + abfd) != sizeof coffset_siz) { bfd_set_error (bfd_error_wrong_format); return NULL; @@ -160,8 +150,8 @@ sco5_core_file_p (abfd) /* Use it to seek start of coreoffsets region, read it and determine validity */ - if ((bfd_seek (abfd, coresize-coffset_siz, SEEK_SET) != 0) - || (bfd_read ((void *)&coffsets, 1, sizeof coffsets, abfd) + if ((bfd_seek (abfd, (file_ptr) (coresize - coffset_siz), SEEK_SET) != 0) + || (bfd_bread ((void *) &coffsets, (bfd_size_type) sizeof coffsets, abfd) != sizeof coffsets) || ((coffsets.u_info != 1) && (coffsets.u_info != C_VERSION))) { @@ -173,15 +163,15 @@ sco5_core_file_p (abfd) { /* Old version, no section heads, read info from user struct */ - u = read_uarea(abfd, coffsets.u_user); + u = read_uarea (abfd, coffsets.u_user); if (! u) - return NULL; + goto fail; if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS, (bfd_size_type) coffsets.u_usize, 0 - (bfd_vma) u->u_ar0, (file_ptr) coffsets.u_user)) - return NULL; + goto fail; if (!make_bfd_asection (abfd, ".data", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, @@ -189,14 +179,14 @@ sco5_core_file_p (abfd) + u->u_exdata.ux_bsize), (bfd_vma) u->u_exdata.ux_datorg, (file_ptr) coffsets.u_data)) - return NULL; + goto fail; if (!make_bfd_asection (abfd, ".stack", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, (bfd_size_type) u->u_ssize * NBPC, (bfd_vma) u->u_sub, (file_ptr) coffsets.u_stack)) - return NULL; + goto fail; return abfd->xvec; /* Done for version 1 */ } @@ -207,18 +197,20 @@ sco5_core_file_p (abfd) coresecthead and check its validity */ if ((bfd_seek (abfd, - coresize - coffset_siz - 2 * sizeof coffset_siz, + (file_ptr) (coresize - coffset_siz - 2 * sizeof coffset_siz), SEEK_SET) != 0) - || (bfd_read ((void *)&nsecs, 1, sizeof nsecs, abfd) != sizeof nsecs) - || (bfd_read ((void *)&cheadoffs, 1, sizeof cheadoffs, abfd) - != sizeof cheadoffs) - || (bfd_seek (abfd, cheadoffs, SEEK_SET) != 0) - || (bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead) + || (bfd_bread ((void *) &nsecs, (bfd_size_type) sizeof nsecs, abfd) + != sizeof nsecs) + || (bfd_bread ((void *) &cheadoffs, (bfd_size_type) sizeof cheadoffs, + abfd) != sizeof cheadoffs) + || (bfd_seek (abfd, (file_ptr) cheadoffs, SEEK_SET) != 0) + || (bfd_bread ((void *) &chead, (bfd_size_type) sizeof chead, abfd) + != sizeof chead) || (chead.cs_stype != CORES_OFFSETS) || (chead.cs_x.csx_magic != COREMAGIC_NUMBER)) { bfd_set_error (bfd_error_wrong_format); - return NULL; + goto fail; } /* OK, we believe you. You're a core file (sure, sure). */ @@ -227,11 +219,12 @@ sco5_core_file_p (abfd) nsecs--; /* We've seen CORES_OFFSETS already */ for (; nsecs; nsecs--) { - if ((bfd_seek (abfd, chead.cs_hseek, SEEK_SET) != 0) - || bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead) + if ((bfd_seek (abfd, (file_ptr) chead.cs_hseek, SEEK_SET) != 0) + || (bfd_bread ((void *) &chead, (bfd_size_type) sizeof chead, abfd) + != sizeof chead)) { bfd_set_error (bfd_error_wrong_format); - return NULL; + goto fail; } switch (chead.cs_stype) @@ -240,15 +233,15 @@ sco5_core_file_p (abfd) if (chead.cs_x.csx_magic != COREMAGIC_NUMBER) { bfd_set_error (bfd_error_wrong_format); - return NULL; + goto fail; } secname = NULL; nsecs++; /* MAGIC not in section cnt!*/ break; case CORES_UAREA: /* U-area, read in tdata */ - u = read_uarea(abfd, chead.cs_sseek); + u = read_uarea (abfd, chead.cs_sseek); if (! u) - return NULL; + goto fail; /* This is tricky. As the "register section", we give them the entire upage and stack. u.u_ar0 points to where @@ -319,12 +312,20 @@ sco5_core_file_p (abfd) (bfd_size_type) chead.cs_vsize, (bfd_vma) chead.cs_vaddr, (file_ptr) chead.cs_sseek)) - return NULL; + goto fail; } return abfd->xvec; + fail: + if (abfd->tdata.any) + { + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = NULL; + } + bfd_section_list_clear (abfd); + return NULL; } char * @@ -351,22 +352,12 @@ sco5_core_file_failing_signal (ignore_abfd) /* ARGSUSED */ boolean sco5_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; + bfd *core_bfd ATTRIBUTE_UNUSED; + bfd *exec_bfd ATTRIBUTE_UNUSED; { return true; /* FIXME, We have no way of telling at this point */ } -#define sco5_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound -#define sco5_core_get_symtab _bfd_nosymbols_get_symtab -#define sco5_core_print_symbol _bfd_nosymbols_print_symbol -#define sco5_core_get_symbol_info _bfd_nosymbols_get_symbol_info -#define sco5_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name -#define sco5_core_get_lineno _bfd_nosymbols_get_lineno -#define sco5_core_find_nearest_line _bfd_nosymbols_find_nearest_line -#define sco5_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol -#define sco5_core_read_minisymbols _bfd_nosymbols_read_minisymbols -#define sco5_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol - /* If somebody calls any byte-swapping routines, shoot them. */ static void swap_abort () @@ -413,15 +404,15 @@ const bfd_target sco5_core_vec = bfd_false, bfd_false }, - BFD_JUMP_TABLE_GENERIC (_bfd_generic), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (sco5), - BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), - BFD_JUMP_TABLE_SYMBOLS (sco5_core), - BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), - BFD_JUMP_TABLE_WRITE (_bfd_generic), - BFD_JUMP_TABLE_LINK (_bfd_nolink), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (sco5), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c index fc03ce9..c1dc0b1 100644 --- a/contrib/binutils/bfd/section.c +++ b/contrib/binutils/bfd/section.c @@ -1,6 +1,6 @@ /* Object file "section" support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -177,7 +177,7 @@ CODE_FRAGMENT . . int id; . -. {* Which section is it; 0..nth. *} +. {* Which section in the bfd; 0..n-1 as sections are created in a bfd. *} . . int index; . @@ -205,9 +205,11 @@ CODE_FRAGMENT . some relocation information too. *} .#define SEC_RELOC 0x004 . -.#if 0 {* Obsolete ? *} -.#define SEC_BALIGN 0x008 -.#endif +. {* ELF reserves 4 processor specific bits and 8 operating system +. specific bits in sh_flags; at present we can get away with just +. one in communicating between the assembler and BFD, but this +. isn't a good long-term solution. *} +.#define SEC_ARCH_BIT_0 0x008 . . {* A signal to the OS that the section contains read only data. *} .#define SEC_READONLY 0x010 @@ -290,9 +292,10 @@ CODE_FRAGMENT . 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 based on the sum of +. the symbol and addend values specified by the associated relocation +. entries. Entries without associated relocation entries will be +. appended to the end of the section in an unspecified order. *} .#define SEC_SORT_ENTRIES 0x80000 . . {* When linking, duplicate sections of the same name should be @@ -350,6 +353,18 @@ CODE_FRAGMENT . references found to any symbol in the section. *} .#define SEC_CLINK 0x10000000 . +. {* Attempt to merge identical entities in the section. +. Entity size is given in the entsize field. *} +.#define SEC_MERGE 0x20000000 +. +. {* If given with SEC_MERGE, entities to merge are zero terminated +. strings where entsize specifies character size instead of fixed +. size entries. *} +.#define SEC_STRINGS 0x40000000 +. +. {* This section contains data about section groups. *} +.#define SEC_GROUP 0x80000000 +. . {* End of section flags. *} . . {* Some internal packed boolean fields. *} @@ -364,13 +379,14 @@ CODE_FRAGMENT . unsigned int linker_mark : 1; . . {* Another mark flag used by some of the linker backends. Set for -. output sections that have a input section. *} +. output sections that have an input section. *} . unsigned int linker_has_input : 1; . . {* A mark flag used by some linker backends for garbage collection. *} . unsigned int gc_mark : 1; . -. {* Used by the ELF code to mark sections which have been allocated to segments. *} +. {* Used by the ELF code to mark sections which have been allocated +. to segments. *} . unsigned int segment_mark : 1; . . {* End of internal packed boolean fields. *} @@ -466,14 +482,14 @@ CODE_FRAGMENT . . unsigned int lineno_count; . +. {* Entity size for merging purposes. *} +. +. unsigned int entsize; +. . {* Optional information about a COMDAT entry; NULL if not COMDAT. *} . . struct bfd_comdat_info *comdat; . -. {* Points to the kept section if this section is a link-once section, -. and is discarded. *} -. struct sec *kept_section; -. . {* When a section is being output, this value changes as more . linenumbers are written out. *} . @@ -528,6 +544,12 @@ CODE_FRAGMENT .#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) .#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) . +.#define bfd_is_const_section(SEC) \ +. ( ((SEC) == bfd_abs_section_ptr) \ +. || ((SEC) == bfd_und_section_ptr) \ +. || ((SEC) == bfd_com_section_ptr) \ +. || ((SEC) == bfd_ind_section_ptr)) +. .extern const struct symbol_cache_entry * const bfd_abs_symbol; .extern const struct symbol_cache_entry * const bfd_com_symbol; .extern const struct symbol_cache_entry * const bfd_und_symbol; @@ -538,6 +560,32 @@ CODE_FRAGMENT .#define bfd_get_section_size_after_reloc(section) \ . ((section)->reloc_done ? (section)->_cooked_size \ . : (abort (), (bfd_size_type) 1)) +. +.{* Macros to handle insertion and deletion of a bfd's sections. These +. only handle the list pointers, ie. do not adjust section_count, +. target_index etc. *} +.#define bfd_section_list_remove(ABFD, PS) \ +. do \ +. { \ +. asection **_ps = PS; \ +. asection *_s = *_ps; \ +. *_ps = _s->next; \ +. if (_s->next == NULL) \ +. (ABFD)->section_tail = _ps; \ +. } \ +. while (0) +.#define bfd_section_list_insert(ABFD, PS, S) \ +. do \ +. { \ +. asection **_ps = PS; \ +. asection *_s = S; \ +. _s->next = *_ps; \ +. *_ps = _s; \ +. if (_s->next == NULL) \ +. (ABFD)->section_tail = &_s->next; \ +. } \ +. while (0) +. */ /* We use a macro to initialize the static asymbol structures because @@ -584,11 +632,11 @@ static const asymbol global_syms[] = /* line_filepos, userdata, contents, lineno, lineno_count, */ \ 0, NULL, NULL, NULL, 0, \ \ - /* comdat, kept_section, moving_line_filepos, target_index, */ \ - NULL, NULL, 0, 0, \ + /* entsize, comdat, moving_line_filepos, */ \ + 0, NULL, 0, \ \ - /* used_by_bfd, constructor_chain, owner, */ \ - NULL, NULL, NULL, \ + /* target_index, used_by_bfd, constructor_chain, owner, */ \ + 0, NULL, NULL, NULL, \ \ /* symbol, */ \ (struct symbol_cache_entry *) &global_syms[IDX], \ @@ -607,6 +655,83 @@ STD_SECTION (bfd_abs_section, 0, bfd_abs_symbol, BFD_ABS_SECTION_NAME, 2); STD_SECTION (bfd_ind_section, 0, bfd_ind_symbol, BFD_IND_SECTION_NAME, 3); #undef STD_SECTION +struct section_hash_entry +{ + struct bfd_hash_entry root; + asection section; +}; + +/* Initialize an entry in the section hash table. */ + +struct bfd_hash_entry * +bfd_section_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct section_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry != NULL) + { + memset ((PTR) &((struct section_hash_entry *) entry)->section, + 0, sizeof (asection)); + } + + return entry; +} + +#define section_hash_lookup(table, string, create, copy) \ + ((struct section_hash_entry *) \ + bfd_hash_lookup ((table), (string), (create), (copy))) + +/* Initializes a new section. NEWSECT->NAME is already set. */ + +static asection *bfd_section_init PARAMS ((bfd *, asection *)); + +static asection * +bfd_section_init (abfd, newsect) + bfd *abfd; + asection *newsect; +{ + static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ + + newsect->id = section_id; + newsect->index = abfd->section_count; + newsect->owner = abfd; + + /* Create a symbol whose only job is to point to this section. This + is useful for things like relocs which are relative to the base + of a section. */ + newsect->symbol = bfd_make_empty_symbol (abfd); + if (newsect->symbol == NULL) + return NULL; + + newsect->symbol->name = newsect->name; + newsect->symbol->value = 0; + newsect->symbol->section = newsect; + newsect->symbol->flags = BSF_SECTION_SYM; + + newsect->symbol_ptr_ptr = &newsect->symbol; + + if (! BFD_SEND (abfd, _new_section_hook, (abfd, newsect))) + return NULL; + + section_id++; + abfd->section_count++; + *abfd->section_tail = newsect; + abfd->section_tail = &newsect->next; + return newsect; +} + /* DOCDD INODE @@ -619,6 +744,29 @@ These are the functions exported by the section handling part of BFD. /* FUNCTION + bfd_section_list_clear + +SYNOPSIS + void bfd_section_list_clear (bfd *); + +DESCRIPTION + Clears the section list, and also resets the section count and + hash table entries. +*/ + +void +bfd_section_list_clear (abfd) + bfd *abfd; +{ + abfd->sections = NULL; + abfd->section_tail = &abfd->sections; + abfd->section_count = 0; + memset ((PTR) abfd->section_htab.table, 0, + abfd->section_htab.size * sizeof (struct bfd_hash_entry *)); +} + +/* +FUNCTION bfd_get_section_by_name SYNOPSIS @@ -640,11 +788,12 @@ bfd_get_section_by_name (abfd, name) bfd *abfd; const char *name; { - asection *sect; + struct section_hash_entry *sh; + + sh = section_hash_lookup (&abfd->section_htab, name, false, false); + if (sh != NULL) + return &sh->section; - for (sect = abfd->sections; sect != NULL; sect = sect->next) - if (!strcmp (sect->name, name)) - return sect; return NULL; } @@ -676,7 +825,7 @@ bfd_get_unique_section_name (abfd, templat, count) char *sname; len = strlen (templat); - sname = bfd_malloc (len + 8); + sname = bfd_malloc ((bfd_size_type) len + 8); if (sname == NULL) return NULL; strcpy (sname, templat); @@ -691,7 +840,7 @@ bfd_get_unique_section_name (abfd, templat, count) abort (); sprintf (sname + len, ".%d", num++); } - while (bfd_get_section_by_name (abfd, sname) != NULL); + while (section_hash_lookup (&abfd->section_htab, sname, false, false)); if (count != NULL) *count = num; @@ -728,12 +877,40 @@ bfd_make_section_old_way (abfd, name) bfd *abfd; const char *name; { - asection *sec = bfd_get_section_by_name (abfd, name); - if (sec == (asection *) NULL) + struct section_hash_entry *sh; + asection *newsect; + + if (abfd->output_has_begun) { - sec = bfd_make_section (abfd, name); + bfd_set_error (bfd_error_invalid_operation); + return NULL; } - return sec; + + if (strcmp (name, BFD_ABS_SECTION_NAME) == 0) + return bfd_abs_section_ptr; + + if (strcmp (name, BFD_COM_SECTION_NAME) == 0) + return bfd_com_section_ptr; + + if (strcmp (name, BFD_UND_SECTION_NAME) == 0) + return bfd_und_section_ptr; + + if (strcmp (name, BFD_IND_SECTION_NAME) == 0) + return bfd_ind_section_ptr; + + sh = section_hash_lookup (&abfd->section_htab, name, true, false); + if (sh == NULL) + return NULL; + + newsect = &sh->section; + if (newsect->name != NULL) + { + /* Section already exists. */ + return newsect; + } + + newsect->name = name; + return bfd_section_init (abfd, newsect); } /* @@ -758,10 +935,8 @@ bfd_make_section_anyway (abfd, name) bfd *abfd; const char *name; { - static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ + struct section_hash_entry *sh; asection *newsect; - asection **prev = &abfd->sections; - asection *sect = abfd->sections; if (abfd->output_has_begun) { @@ -769,55 +944,24 @@ bfd_make_section_anyway (abfd, name) return NULL; } - while (sect) - { - prev = §->next; - sect = sect->next; - } - - newsect = (asection *) bfd_zalloc (abfd, sizeof (asection)); - if (newsect == NULL) + sh = section_hash_lookup (&abfd->section_htab, name, true, false); + if (sh == NULL) return NULL; - newsect->name = name; - newsect->id = section_id++; - newsect->index = abfd->section_count++; - newsect->flags = SEC_NO_FLAGS; - - newsect->userdata = NULL; - newsect->contents = NULL; - newsect->next = (asection *) NULL; - newsect->relocation = (arelent *) NULL; - newsect->reloc_count = 0; - newsect->line_filepos = 0; - newsect->owner = abfd; - newsect->comdat = NULL; - newsect->kept_section = NULL; - - /* Create a symbol whos only job is to point to this section. This is - useful for things like relocs which are relative to the base of a - section. */ - newsect->symbol = bfd_make_empty_symbol (abfd); - if (newsect->symbol == NULL) + newsect = &sh->section; + if (newsect->name != NULL) { - bfd_release (abfd, newsect); - return NULL; - } - newsect->symbol->name = name; - newsect->symbol->value = 0; - newsect->symbol->section = newsect; - newsect->symbol->flags = BSF_SECTION_SYM; - - newsect->symbol_ptr_ptr = &newsect->symbol; - - if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true) - { - bfd_release (abfd, newsect); - return NULL; + /* We are making a section of the same name. It can't go in + section_htab without generating a unique section name and + that would be pointless; We don't need to traverse the + hash table. */ + newsect = (asection *) bfd_zalloc (abfd, sizeof (asection)); + if (newsect == NULL) + return NULL; } - *prev = newsect; - return newsect; + newsect->name = name; + return bfd_section_init (abfd, newsect); } /* @@ -839,35 +983,34 @@ bfd_make_section (abfd, name) bfd *abfd; const char *name; { - asection *sect = abfd->sections; + struct section_hash_entry *sh; + asection *newsect; - if (strcmp (name, BFD_ABS_SECTION_NAME) == 0) - { - return bfd_abs_section_ptr; - } - if (strcmp (name, BFD_COM_SECTION_NAME) == 0) - { - return bfd_com_section_ptr; - } - if (strcmp (name, BFD_UND_SECTION_NAME) == 0) + if (abfd->output_has_begun) { - return bfd_und_section_ptr; + bfd_set_error (bfd_error_invalid_operation); + return NULL; } - if (strcmp (name, BFD_IND_SECTION_NAME) == 0) - { - return bfd_ind_section_ptr; - } + if (strcmp (name, BFD_ABS_SECTION_NAME) == 0 + || strcmp (name, BFD_COM_SECTION_NAME) == 0 + || strcmp (name, BFD_UND_SECTION_NAME) == 0 + || strcmp (name, BFD_IND_SECTION_NAME) == 0) + return NULL; + + sh = section_hash_lookup (&abfd->section_htab, name, true, false); + if (sh == NULL) + return NULL; - while (sect) + newsect = &sh->section; + if (newsect->name != NULL) { - if (!strcmp (sect->name, name)) - return NULL; - sect = sect->next; + /* Section already exists. */ + return newsect; } - /* The name is not already used; go ahead and make a new section. */ - return bfd_make_section_anyway (abfd, name); + newsect->name = name; + return bfd_section_init (abfd, newsect); } /* @@ -1000,12 +1143,9 @@ FUNCTION bfd_set_section_contents SYNOPSIS - boolean bfd_set_section_contents - (bfd *abfd, - asection *section, - PTR data, - file_ptr offset, - bfd_size_type count); + boolean bfd_set_section_contents (bfd *abfd, asection *section, + PTR data, file_ptr offset, + bfd_size_type count); DESCRIPTION Sets the contents of the section @var{section} in BFD @@ -1046,17 +1186,15 @@ bfd_set_section_contents (abfd, section, location, offset, count) return (false); } - if (offset < 0) + sz = bfd_get_section_size_now (abfd, section); + if ((bfd_size_type) offset > sz + || count > sz + || offset + count > sz + || count != (size_t) count) { - bad_val: bfd_set_error (bfd_error_bad_value); return false; } - sz = bfd_get_section_size_now (abfd, section); - if ((bfd_size_type) offset > sz - || count > sz - || offset + count > sz) - goto bad_val; switch (abfd->direction) { @@ -1079,7 +1217,7 @@ bfd_set_section_contents (abfd, section, location, offset, count) /* Record a copy of the data in memory if desired. */ if (section->contents && location != section->contents + offset) - memcpy (section->contents + offset, location, count); + memcpy (section->contents + offset, location, (size_t) count); if (BFD_SEND (abfd, _bfd_set_section_contents, (abfd, section, location, offset, count))) @@ -1096,9 +1234,9 @@ FUNCTION bfd_get_section_contents SYNOPSIS - boolean bfd_get_section_contents - (bfd *abfd, asection *section, PTR location, - file_ptr offset, bfd_size_type count); + boolean bfd_get_section_contents (bfd *abfd, asection *section, + PTR location, file_ptr offset, + bfd_size_type count); DESCRIPTION Read data from @var{section} in BFD @var{abfd} @@ -1125,21 +1263,21 @@ bfd_get_section_contents (abfd, section, location, offset, count) if (section->flags & SEC_CONSTRUCTOR) { - memset (location, 0, (unsigned) count); + memset (location, 0, (size_t) count); return true; } - if (offset < 0) + /* Even if reloc_done is true, this function reads unrelocated + contents, so we want the raw size. */ + sz = section->_raw_size; + if ((bfd_size_type) offset > sz + || count > sz + || offset + count > sz + || count != (size_t) count) { - bad_val: bfd_set_error (bfd_error_bad_value); return false; } - /* Even if reloc_done is true, this function reads unrelocated - contents, so we want the raw size. */ - sz = section->_raw_size; - if ((bfd_size_type) offset > sz || count > sz || offset + count > sz) - goto bad_val; if (count == 0) /* Don't bother. */ @@ -1147,7 +1285,7 @@ bfd_get_section_contents (abfd, section, location, offset, count) if ((section->flags & SEC_HAS_CONTENTS) == 0) { - memset (location, 0, (unsigned) count); + memset (location, 0, (size_t) count); return true; } @@ -1166,7 +1304,8 @@ FUNCTION bfd_copy_private_section_data SYNOPSIS - boolean bfd_copy_private_section_data(bfd *ibfd, asection *isec, bfd *obfd, asection *osec); + boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, + bfd *obfd, asection *osec); DESCRIPTION Copy private section information from @var{isec} in the BFD @@ -1239,7 +1378,8 @@ _bfd_strip_section_from_output (info, s) asection *is; for (is = abfd->sections; is != NULL; is = is->next) { - if (is != s && is->output_section == os) + if (is != s && is->output_section == os + && (is->flags & SEC_EXCLUDE) == 0) break; } if (is != NULL) @@ -1257,9 +1397,11 @@ _bfd_strip_section_from_output (info, s) for (spp = &os->owner->sections; *spp; spp = &(*spp)->next) if (*spp == os) { - *spp = os->next; + bfd_section_list_remove (os->owner, spp); os->owner->section_count--; break; } } + + s->flags |= SEC_EXCLUDE; } diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c index b877018..28ff8c8 100644 --- a/contrib/binutils/bfd/sparclinux.c +++ b/contrib/binutils/bfd/sparclinux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored sparc a.out binaries. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -37,7 +37,10 @@ USA. */ #include "libaout.h" /* BFD a.out internal data structures */ #define DEFAULT_ARCH bfd_arch_sparc -#define MY(OP) CAT(sparclinux_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (sparclinux_,OP) #define TARGETNAME "a.out-sparc-linux" extern const bfd_target MY(vec); @@ -225,9 +228,9 @@ linux_link_hash_table_create (abfd) bfd *abfd; { struct linux_link_hash_table *ret; + bfd_size_type amt = sizeof (struct linux_link_hash_table); - ret = ((struct linux_link_hash_table *) - bfd_alloc (abfd, sizeof (struct linux_link_hash_table))); + ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct linux_link_hash_table *) NULL) return (struct bfd_link_hash_table *) NULL; if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, @@ -407,7 +410,8 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, if (! (_bfd_generic_link_add_one_symbol (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS, - BSF_GLOBAL | BSF_CONSTRUCTOR, s, 0, NULL, false, false, NULL))) + BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL, + false, false, NULL))) return false; } @@ -446,7 +450,7 @@ linux_tally_symbols (h, data) name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1; p = strrchr (name, '_'); if (p != NULL) - alloc = (char *) bfd_malloc (strlen (name) + 1); + alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"), @@ -590,7 +594,8 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) ".linux-dynamic"); if (s != NULL) { - s->_raw_size = 8 + linux_hash_table (info)->fixup_count * 8; + s->_raw_size = linux_hash_table (info)->fixup_count + 1; + s->_raw_size *= 8; s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; @@ -633,7 +638,8 @@ linux_finish_dynamic_link (output_bfd, info) #endif fixup_table = s->contents; - bfd_put_32 (output_bfd, linux_hash_table (info)->fixup_count, fixup_table); + bfd_put_32 (output_bfd, + (bfd_vma) linux_hash_table (info)->fixup_count, fixup_table); fixup_table += 4; /* Fill in fixup table. */ @@ -664,14 +670,14 @@ linux_finish_dynamic_link (output_bfd, info) { /* Relative address */ new_addr = new_addr - (f->value + 5); - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value + 1, fixup_table); fixup_table += 4; } else { - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value, fixup_table); fixup_table += 4; @@ -682,9 +688,9 @@ linux_finish_dynamic_link (output_bfd, info) if (linux_hash_table (info)->local_builtins != 0) { /* Special marker so we know to switch to the other type of fixup */ - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; ++fixups_written; for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next) @@ -710,7 +716,7 @@ linux_finish_dynamic_link (output_bfd, info) new_addr, f->value); #endif - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); fixup_table += 4; bfd_put_32 (output_bfd, f->value, fixup_table); fixup_table += 4; @@ -723,9 +729,9 @@ linux_finish_dynamic_link (output_bfd, info) (*_bfd_error_handler) (_("Warning: fixup count mismatch\n")); while (linux_hash_table (info)->fixup_count > fixups_written) { - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); fixup_table += 4; ++fixups_written; } @@ -747,15 +753,16 @@ linux_finish_dynamic_link (output_bfd, info) printf ("Builtin fixup table at %x\n", new_addr); #endif - bfd_put_32 (output_bfd, new_addr, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); } else - bfd_put_32 (output_bfd, 0, fixup_table); + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); - if (bfd_seek (output_bfd, os->filepos + s->output_offset, SEEK_SET) != 0) + if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset), + SEEK_SET) != 0) return false; - if (bfd_write ((PTR) s->contents, 1, s->_raw_size, output_bfd) + if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size) return false; diff --git a/contrib/binutils/bfd/sparcnetbsd.c b/contrib/binutils/bfd/sparcnetbsd.c index 9cb9637..64d0eb1 100644 --- a/contrib/binutils/bfd/sparcnetbsd.c +++ b/contrib/binutils/bfd/sparcnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/sparc a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000 + Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -28,7 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DEFAULT_ARCH bfd_arch_sparc #define DEFAULT_MID M_SPARC_NETBSD -#define MY(OP) CAT(sparcnetbsd_,OP) +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (sparcnetbsd_,OP) + /* This needs to start with a.out so GDB knows it is an a.out variant. */ #define TARGETNAME "a.out-sparc-netbsd" diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c index 33dfaa7..5dfad88 100644 --- a/contrib/binutils/bfd/srec.c +++ b/contrib/binutils/bfd/srec.c @@ -1,6 +1,6 @@ /* BFD back-end for s-record objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -108,7 +108,7 @@ DESCRIPTION #include "sysdep.h" #include "libbfd.h" #include "libiberty.h" -#include +#include "safe-ctype.h" static void srec_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static void srec_print_symbol @@ -122,7 +122,7 @@ static const bfd_target *srec_object_p PARAMS ((bfd *)); static const bfd_target *symbolsrec_object_p PARAMS ((bfd *)); static boolean srec_read_section PARAMS ((bfd *, asection *, bfd_byte *)); -static boolean srec_write_record PARAMS ((bfd *, int, bfd_vma, +static boolean srec_write_record PARAMS ((bfd *, unsigned int, bfd_vma, const bfd_byte *, const bfd_byte *)); static boolean srec_write_header PARAMS ((bfd *)); @@ -138,13 +138,12 @@ static boolean internal_srec_write_object_contents PARAMS ((bfd *, int)); static boolean srec_write_object_contents PARAMS ((bfd *)); static boolean symbolsrec_write_object_contents PARAMS ((bfd *)); static int srec_sizeof_headers PARAMS ((bfd *, boolean)); -static asymbol *srec_make_empty_symbol PARAMS ((bfd *)); static long srec_get_symtab_upper_bound PARAMS ((bfd *)); static long srec_get_symtab PARAMS ((bfd *, asymbol **)); /* Macros for converting between hex and binary. */ -static CONST char digs[] = "0123456789ABCDEF"; +static const char digs[] = "0123456789ABCDEF"; #define NIBBLE(x) hex_value(x) #define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1])) @@ -235,7 +234,8 @@ srec_mkobject (abfd) if (abfd->tdata.srec_data == NULL) { - tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type)); + bfd_size_type amt = sizeof (tdata_type); + tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, amt); if (tdata == NULL) return false; abfd->tdata.srec_data = tdata; @@ -260,7 +260,7 @@ srec_get_byte (abfd, errorptr) { bfd_byte c; - if (bfd_read (&c, 1, 1, abfd) != 1) + if (bfd_bread (&c, (bfd_size_type) 1, abfd) != 1) { if (bfd_get_error () != bfd_error_file_truncated) *errorptr = true; @@ -290,7 +290,7 @@ srec_bad_byte (abfd, lineno, c, error) { char buf[10]; - if (! isprint (c)) + if (! ISPRINT (c)) sprintf (buf, "\\%03o", (unsigned int) c); else { @@ -299,7 +299,7 @@ srec_bad_byte (abfd, lineno, c, error) } (*_bfd_error_handler) (_("%s:%d: Unexpected character `%s' in S-record file\n"), - bfd_get_filename (abfd), lineno, buf); + bfd_archive_filename (abfd), lineno, buf); bfd_set_error (bfd_error_bad_value); } } @@ -313,8 +313,9 @@ srec_new_symbol (abfd, name, val) bfd_vma val; { struct srec_symbol *n; + bfd_size_type amt = sizeof (struct srec_symbol); - n = (struct srec_symbol *) bfd_alloc (abfd, sizeof (struct srec_symbol)); + n = (struct srec_symbol *) bfd_alloc (abfd, amt); if (n == NULL) return false; @@ -389,7 +390,7 @@ srec_scan (abfd) case ' ': do { - unsigned int alc; + bfd_size_type alc; char *p, *symname; bfd_vma symval; @@ -416,9 +417,9 @@ srec_scan (abfd) *p++ = c; while ((c = srec_get_byte (abfd, &error)) != EOF - && ! isspace (c)) + && ! ISSPACE (c)) { - if ((unsigned int) (p - symbuf) >= alc) + if ((bfd_size_type) (p - symbuf) >= alc) { char *n; @@ -440,7 +441,7 @@ srec_scan (abfd) } *p++ = '\0'; - symname = bfd_alloc (abfd, p - symbuf); + symname = bfd_alloc (abfd, (bfd_size_type) (p - symbuf)); if (symname == NULL) goto error_return; strcpy (symname, symbuf); @@ -503,7 +504,7 @@ srec_scan (abfd) pos = bfd_tell (abfd) - 1; - if (bfd_read (hdr, 1, 3, abfd) != 3) + if (bfd_bread (hdr, (bfd_size_type) 3, abfd) != 3) goto error_return; if (! ISHEX (hdr[1]) || ! ISHEX (hdr[2])) @@ -521,13 +522,13 @@ srec_scan (abfd) { if (buf != NULL) free (buf); - buf = (bfd_byte *) bfd_malloc (bytes * 2); + buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2); if (buf == NULL) goto error_return; bufsize = bytes * 2; } - if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2) + if (bfd_bread (buf, (bfd_size_type) bytes * 2, abfd) != bytes * 2) goto error_return; /* Ignore the checksum byte. */ @@ -572,9 +573,11 @@ srec_scan (abfd) { char secbuf[20]; char *secname; + bfd_size_type amt; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); - secname = (char *) bfd_alloc (abfd, strlen (secbuf) + 1); + amt = strlen (secbuf) + 1; + secname = (char *) bfd_alloc (abfd, amt); strcpy (secname, secbuf); sec = bfd_make_section (abfd, secname); if (sec == NULL) @@ -642,7 +645,7 @@ srec_object_p (abfd) srec_init (); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_read (b, 1, 4, abfd) != 4) + || bfd_bread (b, (bfd_size_type) 4, abfd) != 4) return NULL; if (b[0] != 'S' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3])) @@ -672,7 +675,7 @@ symbolsrec_object_p (abfd) srec_init (); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_read (b, 1, 2, abfd) != 2) + || bfd_bread (b, (bfd_size_type) 2, abfd) != 2) return NULL; if (b[0] != '$' || b[1] != '$') @@ -722,7 +725,7 @@ srec_read_section (abfd, section, contents) ought to know the exact format. */ BFD_ASSERT (c == 'S'); - if (bfd_read (hdr, 1, 3, abfd) != 3) + if (bfd_bread (hdr, (bfd_size_type) 3, abfd) != 3) goto error_return; BFD_ASSERT (ISHEX (hdr[1]) && ISHEX (hdr[2])); @@ -733,13 +736,13 @@ srec_read_section (abfd, section, contents) { if (buf != NULL) free (buf); - buf = (bfd_byte *) bfd_malloc (bytes * 2); + buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2); if (buf == NULL) goto error_return; bufsize = bytes * 2; } - if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2) + if (bfd_bread (buf, (bfd_size_type) bytes * 2, abfd) != bytes * 2) goto error_return; address = 0; @@ -821,8 +824,7 @@ srec_get_section_contents (abfd, section, location, offset, count) if (section->used_by_bfd == NULL) { section->used_by_bfd = bfd_alloc (abfd, section->_raw_size); - if (section->used_by_bfd == NULL - && section->_raw_size != 0) + if (section->used_by_bfd == NULL && section->_raw_size != 0) return false; if (! srec_read_section (abfd, section, section->used_by_bfd)) @@ -865,7 +867,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) register srec_data_list_type *entry; entry = ((srec_data_list_type *) - bfd_alloc (abfd, sizeof (srec_data_list_type))); + bfd_alloc (abfd, (bfd_size_type) sizeof (srec_data_list_type))); if (entry == NULL) return false; @@ -873,7 +875,9 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) && (section->flags & SEC_ALLOC) && (section->flags & SEC_LOAD)) { - bfd_byte *data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do); + bfd_byte *data; + + data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do); if (data == NULL) return false; memcpy ((PTR) data, location, (size_t) bytes_to_do); @@ -927,14 +931,14 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) static boolean srec_write_record (abfd, type, address, data, end) bfd *abfd; - int type; + unsigned int type; bfd_vma address; const bfd_byte *data; const bfd_byte *end; { char buffer[MAXCHUNK]; unsigned int check_sum = 0; - CONST bfd_byte *src = data; + const bfd_byte *src = data; char *dst = buffer; char *length; bfd_size_type wrlen; @@ -981,7 +985,7 @@ srec_write_record (abfd, type, address, data, end) *dst++ = '\r'; *dst++ = '\n'; wrlen = dst - buffer; - if (bfd_write ((PTR) buffer, 1, wrlen, abfd) != wrlen) + if (bfd_bwrite ((PTR) buffer, wrlen, abfd) != wrlen) return false; return true; } @@ -998,7 +1002,7 @@ srec_write_header (abfd) for (i = 0; i < 40 && abfd->filename[i]; i++) *dst++ = abfd->filename[i]; - return srec_write_record (abfd, 0, 0, buffer, dst); + return srec_write_record (abfd, 0, (bfd_vma) 0, buffer, dst); } static boolean @@ -1056,12 +1060,12 @@ srec_write_symbols (abfd) if (count) { - size_t len; + bfd_size_type len; asymbol **table = bfd_get_outsymbols (abfd); sprintf (buffer, "$$ %s\r\n", abfd->filename); len = strlen (buffer); - if (bfd_write (buffer, len, 1, abfd) != len) + if (bfd_bwrite (buffer, len, abfd) != len) return false; for (i = 0; i < count; i++) @@ -1071,7 +1075,6 @@ srec_write_symbols (abfd) && (s->flags & BSF_DEBUGGING) == 0) { /* Just dump out non debug symbols. */ - bfd_size_type l; char buf2[40], *p; sprintf_vma (buf2, @@ -1081,14 +1084,14 @@ srec_write_symbols (abfd) while (p[0] == '0' && p[1] != 0) p++; sprintf (buffer, " %s $%s\r\n", s->name, p); - l = strlen (buffer); - if (bfd_write (buffer, l, 1, abfd) != l) + len = strlen (buffer); + if (bfd_bwrite (buffer, len, abfd) != len) return false; } } sprintf (buffer, "$$ \r\n"); len = strlen (buffer); - if (bfd_write (buffer, len, 1, abfd) != len) + if (bfd_bwrite (buffer, len, abfd) != len) return false; } @@ -1146,16 +1149,6 @@ srec_sizeof_headers (abfd, exec) return 0; } -static asymbol * -srec_make_empty_symbol (abfd) - bfd *abfd; -{ - asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); - if (new) - new->the_bfd = abfd; - return new; -} - /* Return the amount of memory needed to read the symbol table. */ static long @@ -1172,7 +1165,7 @@ srec_get_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { - unsigned int symcount = bfd_get_symcount (abfd); + bfd_size_type symcount = bfd_get_symcount (abfd); asymbol *csymbols; unsigned int i; @@ -1217,8 +1210,8 @@ srec_get_symbol_info (ignore_abfd, symbol, ret) } static void -srec_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +srec_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -1230,7 +1223,7 @@ srec_print_symbol (ignore_abfd, afile, symbol, how) fprintf (file, "%s", symbol->name); break; default: - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", symbol->section->name, symbol->name); @@ -1245,6 +1238,7 @@ srec_print_symbol (ignore_abfd, afile, symbol, how) #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name #define srec_get_lineno _bfd_nosymbols_get_lineno #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line +#define srec_make_empty_symbol _bfd_generic_make_empty_symbol #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define srec_read_minisymbols _bfd_generic_read_minisymbols #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol @@ -1262,6 +1256,7 @@ srec_print_symbol (ignore_abfd, afile, symbol, how) bfd_generic_get_relocated_section_contents #define srec_bfd_relax_section bfd_generic_relax_section #define srec_bfd_gc_sections bfd_generic_gc_sections +#define srec_bfd_merge_sections bfd_generic_merge_sections #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols #define srec_bfd_final_link _bfd_generic_final_link diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c index 15b1af5..bba4a6d 100644 --- a/contrib/binutils/bfd/stabs.c +++ b/contrib/binutils/bfd/stabs.c @@ -1,5 +1,6 @@ /* Stabs in sections linking support. - Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -25,8 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "aout/stab_gnu.h" - -#include +#include "safe-ctype.h" /* Stabs entries use a 12 byte format: 4 byte string table index @@ -178,7 +178,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) { boolean first; struct stab_info *sinfo; - bfd_size_type count; + bfd_size_type count, amt; struct stab_section_info *secinfo; bfd_byte *stabbuf = NULL; bfd_byte *stabstrbuf = NULL; @@ -223,7 +223,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) { /* Initialize the stabs information we need to keep track of. */ first = true; - *psinfo = (PTR) bfd_alloc (abfd, sizeof (struct stab_info)); + amt = sizeof (struct stab_info); + *psinfo = (PTR) bfd_alloc (abfd, amt); if (*psinfo == NULL) goto error_return; sinfo = (struct stab_info *) *psinfo; @@ -247,16 +248,16 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) count = stabsec->_raw_size / STABSIZE; - *psecinfo = bfd_alloc (abfd, - (sizeof (struct stab_section_info) - + (count - 1) * sizeof (bfd_size_type))); + amt = sizeof (struct stab_section_info); + amt += (count - 1) * sizeof (bfd_size_type); + *psecinfo = bfd_alloc (abfd, amt); if (*psecinfo == NULL) goto error_return; secinfo = (struct stab_section_info *) *psecinfo; secinfo->excls = NULL; secinfo->cumulative_skips = NULL; - memset (secinfo->stridxs, 0, count * sizeof (bfd_size_type)); + memset (secinfo->stridxs, 0, (size_t) count * sizeof (bfd_size_type)); /* Read the stabs information from abfd. */ @@ -265,9 +266,9 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) if (stabbuf == NULL || stabstrbuf == NULL) goto error_return; - if (! bfd_get_section_contents (abfd, stabsec, stabbuf, 0, + if (! bfd_get_section_contents (abfd, stabsec, stabbuf, (bfd_vma) 0, stabsec->_raw_size) - || ! bfd_get_section_contents (abfd, stabstrsec, stabstrbuf, 0, + || ! bfd_get_section_contents (abfd, stabstrsec, stabstrbuf, (bfd_vma) 0, stabstrsec->_raw_size)) goto error_return; @@ -362,7 +363,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) { /* Skip the file number. */ ++str; - while (isdigit ((unsigned char) *str)) + while (ISDIGIT (*str)) ++str; --str; } @@ -383,7 +384,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) /* Record this symbol, so that we can set the value correctly. */ - ne = (struct stab_excl_list *) bfd_alloc (abfd, sizeof *ne); + amt = sizeof *ne; + ne = (struct stab_excl_list *) bfd_alloc (abfd, amt); if (ne == NULL) goto error_return; ne->offset = sym - stabbuf; @@ -471,8 +473,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) bfd_size_type i, offset; bfd_size_type *pskips; - secinfo->cumulative_skips = - (bfd_size_type *) bfd_alloc (abfd, count * sizeof (bfd_size_type)); + amt = count * sizeof (bfd_size_type); + secinfo->cumulative_skips = (bfd_size_type *) bfd_alloc (abfd, amt); if (secinfo->cumulative_skips == NULL) goto error_return; @@ -500,6 +502,176 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) return false; } + +/* This function is called for each input file before the stab + section is relocated. It discards stab entries for discarded + functions and variables. The function returns true iff + any entries have been deleted. +*/ + +boolean +_bfd_discard_section_stabs (abfd, stabsec, psecinfo, + reloc_symbol_deleted_p, cookie) + bfd *abfd; + asection *stabsec; + PTR psecinfo; + boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); + PTR cookie; +{ + bfd_size_type count, amt; + struct stab_section_info *secinfo; + bfd_byte *stabbuf = NULL; + bfd_byte *sym, *symend; + bfd_size_type skip; + bfd_size_type *pstridx; + int deleting; + + if (stabsec->_raw_size == 0) + { + /* This file does not contain stabs debugging information. */ + return false; + } + + if (stabsec->_raw_size % STABSIZE != 0) + { + /* Something is wrong with the format of these stab symbols. + Don't try to optimize them. */ + return false; + } + + if ((stabsec->output_section != NULL + && bfd_is_abs_section (stabsec->output_section))) + { + /* At least one of the sections is being discarded from the + link, so we should just ignore them. */ + return false; + } + + /* We should have initialized our data in _bfd_link_stab_sections. + If there was some bizarre error reading the string sections, though, + we might not have. Bail rather than asserting. */ + if (psecinfo == NULL) + return false; + + count = stabsec->_raw_size / STABSIZE; + secinfo = (struct stab_section_info *) psecinfo; + + /* Read the stabs information from abfd. */ + + stabbuf = (bfd_byte *) bfd_malloc (stabsec->_raw_size); + if (stabbuf == NULL) + goto error_return; + + if (! bfd_get_section_contents (abfd, stabsec, stabbuf, (bfd_vma) 0, + stabsec->_raw_size)) + goto error_return; + + /* Look through the stabs symbols and discard any information for + discarded functions. */ + + skip = 0; + deleting = -1; + + symend = stabbuf + stabsec->_raw_size; + for (sym = stabbuf, pstridx = secinfo->stridxs; + sym < symend; + sym += STABSIZE, ++pstridx) + { + int type; + + if (*pstridx == (bfd_size_type) -1) + { + /* This stab was deleted in a previous pass. */ + continue; + } + + type = sym[TYPEOFF]; + + if (type == N_FUN) + { + int strx = bfd_get_32 (abfd, sym + STRDXOFF); + + if (strx == 0) + { + if (deleting) + { + skip++; + *pstridx = -1; + } + deleting = -1; + continue; + } + deleting = 0; + if ((*reloc_symbol_deleted_p) (sym + VALOFF - stabbuf, cookie)) + deleting = 1; + } + + if (deleting == 1) + { + *pstridx = -1; + skip++; + } + else if (deleting == -1) + { + /* Outside of a function. Check for deleted variables. */ + if (type == N_STSYM || type == N_LCSYM) + if ((*reloc_symbol_deleted_p) (sym + VALOFF - stabbuf, cookie)) + { + *pstridx = -1; + skip ++; + } + /* We should also check for N_GSYM entries which reference a + deleted global, but those are less harmful to debuggers + and would require parsing the stab strings. */ + } + } + + free (stabbuf); + stabbuf = NULL; + + /* Shrink the stabsec as needed. */ + stabsec->_cooked_size -= skip * STABSIZE; + if (stabsec->_cooked_size == 0) + stabsec->flags |= SEC_EXCLUDE; + + /* Recalculate the `cumulative_skips' array now that stabs have been + deleted for this section. */ + + if (skip != 0) + { + bfd_size_type i, offset; + bfd_size_type *pskips; + + if (secinfo->cumulative_skips == NULL) + { + amt = count * sizeof (bfd_size_type); + secinfo->cumulative_skips = (bfd_size_type *) bfd_alloc (abfd, amt); + if (secinfo->cumulative_skips == NULL) + goto error_return; + } + + pskips = secinfo->cumulative_skips; + pstridx = secinfo->stridxs; + offset = 0; + + for (i = 0; i < count; i++, pskips++, pstridx++) + { + *pskips = offset; + if (*pstridx == (bfd_size_type) -1) + offset += STABSIZE; + } + + BFD_ASSERT (offset != 0); + } + + return (skip > 0); + + error_return: + if (stabbuf != NULL) + free (stabbuf); + return false; +} + /* Write out the stab section. This is called with the relocated contents. */ @@ -522,7 +694,8 @@ _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents) if (secinfo == NULL) return bfd_set_section_contents (output_bfd, stabsec->output_section, - contents, stabsec->output_offset, + contents, + (file_ptr) stabsec->output_offset, stabsec->_raw_size); /* Handle each N_BINCL entry. */ @@ -571,7 +744,7 @@ _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents) BFD_ASSERT ((bfd_size_type) (tosym - contents) == stabsec->_cooked_size); return bfd_set_section_contents (output_bfd, stabsec->output_section, - contents, stabsec->output_offset, + contents, (file_ptr) stabsec->output_offset, stabsec->_cooked_size); } @@ -600,8 +773,8 @@ _bfd_write_stab_strings (output_bfd, psinfo) <= sinfo->stabstr->output_section->_raw_size); if (bfd_seek (output_bfd, - (sinfo->stabstr->output_section->filepos - + sinfo->stabstr->output_offset), + (file_ptr) (sinfo->stabstr->output_section->filepos + + sinfo->stabstr->output_offset), SEEK_SET) != 0) return false; diff --git a/contrib/binutils/bfd/sunos.c b/contrib/binutils/bfd/sunos.c index f4ada70..30fd019 100644 --- a/contrib/binutils/bfd/sunos.c +++ b/contrib/binutils/bfd/sunos.c @@ -1,5 +1,6 @@ /* BFD backend for SunOS binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, + 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,7 +21,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGETNAME "a.out-sunos-big" -#define MY(OP) CAT(sunos_big_,OP) + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not + remove whitespace added here, and thus will fail to concatenate + the tokens. */ +#define MY(OP) CONCAT2 (sunos_big_,OP) #include "bfd.h" #include "bfdlink.h" @@ -142,6 +147,7 @@ sunos_read_dynamic_info (abfd) struct external_sun4_dynamic dyninfo; unsigned long dynver; struct external_sun4_dynamic_link linkinfo; + bfd_size_type amt; if (obj_aout_dynamic_info (abfd) != (PTR) NULL) return true; @@ -152,8 +158,8 @@ sunos_read_dynamic_info (abfd) return false; } - info = ((struct sunos_dynamic_info *) - bfd_zalloc (abfd, sizeof (struct sunos_dynamic_info))); + amt = sizeof (struct sunos_dynamic_info); + info = (struct sunos_dynamic_info *) bfd_zalloc (abfd, amt); if (!info) return false; info->valid = false; @@ -174,7 +180,8 @@ sunos_read_dynamic_info (abfd) if ((abfd->flags & DYNAMIC) == 0) return true; if (! bfd_get_section_contents (abfd, obj_datasec (abfd), (PTR) &dyninfo, - (file_ptr) 0, sizeof dyninfo)) + (file_ptr) 0, + (bfd_size_type) sizeof dyninfo)) return true; dynver = GET_WORD (abfd, dyninfo.ld_version); @@ -195,7 +202,8 @@ sunos_read_dynamic_info (abfd) /* This executable appears to be dynamically linked in a way that we can understand. */ - if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, dynoff, + if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, + (file_ptr) dynoff, (bfd_size_type) sizeof linkinfo)) return true; @@ -277,6 +285,7 @@ sunos_slurp_dynamic_symtab (abfd) bfd *abfd; { struct sunos_dynamic_info *info; + bfd_size_type amt; /* Get the general dynamic information. */ if (obj_aout_dynamic_info (abfd) == NULL) @@ -295,16 +304,12 @@ sunos_slurp_dynamic_symtab (abfd) /* Get the dynamic nlist structures. */ if (info->dynsym == (struct external_nlist *) NULL) { - info->dynsym = ((struct external_nlist *) - bfd_alloc (abfd, - (info->dynsym_count - * EXTERNAL_NLIST_SIZE))); + amt = (bfd_size_type) info->dynsym_count * EXTERNAL_NLIST_SIZE; + info->dynsym = (struct external_nlist *) bfd_alloc (abfd, amt); if (info->dynsym == NULL && info->dynsym_count != 0) return false; - if (bfd_seek (abfd, info->dyninfo.ld_stab, SEEK_SET) != 0 - || (bfd_read ((PTR) info->dynsym, info->dynsym_count, - EXTERNAL_NLIST_SIZE, abfd) - != info->dynsym_count * EXTERNAL_NLIST_SIZE)) + if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_stab, SEEK_SET) != 0 + || bfd_bread ((PTR) info->dynsym, amt, abfd) != amt) { if (info->dynsym != NULL) { @@ -318,13 +323,12 @@ sunos_slurp_dynamic_symtab (abfd) /* Get the dynamic strings. */ if (info->dynstr == (char *) NULL) { - info->dynstr = (char *) bfd_alloc (abfd, info->dyninfo.ld_symb_size); + amt = info->dyninfo.ld_symb_size; + info->dynstr = (char *) bfd_alloc (abfd, amt); if (info->dynstr == NULL && info->dyninfo.ld_symb_size != 0) return false; - if (bfd_seek (abfd, info->dyninfo.ld_symbols, SEEK_SET) != 0 - || (bfd_read ((PTR) info->dynstr, 1, info->dyninfo.ld_symb_size, - abfd) - != info->dyninfo.ld_symb_size)) + if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_symbols, SEEK_SET) != 0 + || bfd_bread ((PTR) info->dynstr, amt, abfd) != amt) { if (info->dynstr != NULL) { @@ -367,8 +371,8 @@ sunos_canonicalize_dynamic_symtab (abfd, storage) table = (bfd_byte *) bfd_malloc (table_size); if (table == NULL && table_size != 0) abort (); - if (bfd_seek (abfd, info->dyninfo.ld_hash, SEEK_SET) != 0 - || bfd_read ((PTR) table, 1, table_size, abfd) != table_size) + if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_hash, SEEK_SET) != 0 + || bfd_bread ((PTR) table, table_size, abfd) != table_size) abort (); for (i = 0; i < info->dynsym_count; i++) { @@ -398,18 +402,18 @@ sunos_canonicalize_dynamic_symtab (abfd, storage) structures. */ if (info->canonical_dynsym == (aout_symbol_type *) NULL) { - info->canonical_dynsym = ((aout_symbol_type *) - bfd_alloc (abfd, - (info->dynsym_count - * sizeof (aout_symbol_type)))); + bfd_size_type size; + bfd_size_type strsize = info->dyninfo.ld_symb_size; + + size = (bfd_size_type) info->dynsym_count * sizeof (aout_symbol_type); + info->canonical_dynsym = (aout_symbol_type *) bfd_alloc (abfd, size); if (info->canonical_dynsym == NULL && info->dynsym_count != 0) return -1; if (! aout_32_translate_symbol_table (abfd, info->canonical_dynsym, - info->dynsym, info->dynsym_count, - info->dynstr, - info->dyninfo.ld_symb_size, - true)) + info->dynsym, + (bfd_size_type) info->dynsym_count, + info->dynstr, strsize, true)) { if (info->canonical_dynsym != NULL) { @@ -459,6 +463,7 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) { struct sunos_dynamic_info *info; unsigned long i; + bfd_size_type size; /* Get the general dynamic information. */ if (obj_aout_dynamic_info (abfd) == (PTR) NULL) @@ -477,15 +482,12 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) /* Get the dynamic reloc information. */ if (info->dynrel == NULL) { - info->dynrel = (PTR) bfd_alloc (abfd, - (info->dynrel_count - * obj_reloc_entry_size (abfd))); - if (info->dynrel == NULL && info->dynrel_count != 0) + size = (bfd_size_type) info->dynrel_count * obj_reloc_entry_size (abfd); + info->dynrel = (PTR) bfd_alloc (abfd, size); + if (info->dynrel == NULL && size != 0) return -1; - if (bfd_seek (abfd, info->dyninfo.ld_rel, SEEK_SET) != 0 - || (bfd_read ((PTR) info->dynrel, info->dynrel_count, - obj_reloc_entry_size (abfd), abfd) - != info->dynrel_count * obj_reloc_entry_size (abfd))) + if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_rel, SEEK_SET) != 0 + || bfd_bread ((PTR) info->dynrel, size, abfd) != size) { if (info->dynrel != NULL) { @@ -502,10 +504,8 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) { arelent *to; - info->canonical_dynrel = ((arelent *) - bfd_alloc (abfd, - (info->dynrel_count - * sizeof (arelent)))); + size = (bfd_size_type) info->dynrel_count * sizeof (arelent); + info->canonical_dynrel = (arelent *) bfd_alloc (abfd, size); if (info->canonical_dynrel == NULL && info->dynrel_count != 0) return -1; @@ -520,7 +520,7 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) pend = p + info->dynrel_count; for (; p < pend; p++, to++) NAME(aout,swap_ext_reloc_in) (abfd, p, to, syms, - info->dynsym_count); + (bfd_size_type) info->dynsym_count); } else { @@ -531,7 +531,7 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) pend = p + info->dynrel_count; for (; p < pend; p++, to++) NAME(aout,swap_std_reloc_in) (abfd, p, to, syms, - info->dynsym_count); + (bfd_size_type) info->dynsym_count); } } @@ -564,21 +564,21 @@ static const bfd_byte sparc_plt_first_entry[SPARC_PLT_ENTRY_SIZE] = }; /* save %sp, -96, %sp */ -#define SPARC_PLT_ENTRY_WORD0 0x9de3bfa0 +#define SPARC_PLT_ENTRY_WORD0 ((bfd_vma) 0x9de3bfa0) /* call; address filled in later. */ -#define SPARC_PLT_ENTRY_WORD1 0x40000000 +#define SPARC_PLT_ENTRY_WORD1 ((bfd_vma) 0x40000000) /* sethi; reloc index filled in later. */ -#define SPARC_PLT_ENTRY_WORD2 0x01000000 +#define SPARC_PLT_ENTRY_WORD2 ((bfd_vma) 0x01000000) /* This sequence is used when for the jump table entry to a defined symbol in a complete executable. It is used when linking PIC compiled code which is not being put into a shared library. */ /* sethi
, %g1 */ -#define SPARC_PLT_PIC_WORD0 0x03000000 +#define SPARC_PLT_PIC_WORD0 ((bfd_vma) 0x03000000) /* jmp %g1 +
*/ -#define SPARC_PLT_PIC_WORD1 0x81c06000 +#define SPARC_PLT_PIC_WORD1 ((bfd_vma) 0x81c06000) /* nop */ -#define SPARC_PLT_PIC_WORD2 0x01000000 +#define SPARC_PLT_PIC_WORD2 ((bfd_vma) 0x01000000) /* An m68k procedure linkage table entry is 8 bytes. The first entry in the table is a jump which is filled in the by the runtime @@ -598,7 +598,7 @@ static const bfd_byte m68k_plt_first_entry[M68K_PLT_ENTRY_SIZE] = }; /* bsrl */ -#define M68K_PLT_ENTRY_WORD0 (0x61ff) +#define M68K_PLT_ENTRY_WORD0 ((bfd_vma) 0x61ff) /* Remaining words filled in later. */ /* An entry in the SunOS linker hash table. */ @@ -715,9 +715,9 @@ sunos_link_hash_table_create (abfd) bfd *abfd; { struct sunos_link_hash_table *ret; + bfd_size_type amt = sizeof (struct sunos_link_hash_table); - ret = ((struct sunos_link_hash_table *) - bfd_alloc (abfd, sizeof (struct sunos_link_hash_table))); + ret = (struct sunos_link_hash_table *) bfd_alloc (abfd, amt); if (ret == (struct sunos_link_hash_table *) NULL) return (struct bfd_link_hash_table *) NULL; if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, @@ -875,10 +875,10 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) bfd_size_type *sym_countp; char **stringsp; { - asection *s; bfd *dynobj; struct sunos_dynamic_info *dinfo; unsigned long need; + asection **ps; /* Make sure we have all the required sections. */ if (info->hash->creator == abfd->xvec) @@ -904,17 +904,12 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) want, because that one still implies that the section takes up space in the output file. If this is the first object we have seen, we must preserve the dynamic sections we just created. */ - if (abfd != dynobj) - abfd->sections = NULL; - else + for (ps = &abfd->sections; *ps != NULL; ) { - asection *s; - - for (s = abfd->sections; - (s->flags & SEC_LINKER_CREATED) == 0; - s = s->next) - ; - abfd->sections = s; + if (abfd != dynobj || ((*ps)->flags & SEC_LINKER_CREATED) == 0) + bfd_section_list_remove (abfd, ps); + else + ps = &(*ps)->next; } /* The native linker seems to just ignore dynamic objects when -r is @@ -938,7 +933,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) /* The .need section holds the list of names of shared objets which must be included at runtime. The address of this section is put in the ld_need field. */ - s = bfd_make_section (dynobj, ".need"); + asection *s = bfd_make_section (dynobj, ".need"); if (s == NULL || ! bfd_set_section_flags (dynobj, s, (SEC_ALLOC @@ -955,7 +950,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) /* The .rules section holds the path to search for shared objects. The address of this section is put in the ld_rules field. */ - s = bfd_make_section (dynobj, ".rules"); + asection *s = bfd_make_section (dynobj, ".rules"); if (s == NULL || ! bfd_set_section_flags (dynobj, s, (SEC_ALLOC @@ -985,12 +980,12 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) unsigned short major_vno, minor_vno; struct bfd_link_needed_list *needed, **pp; char *namebuf, *p; - size_t alc; + bfd_size_type alc; bfd_byte b; char *namecopy; - if (bfd_seek (abfd, need, SEEK_SET) != 0 - || bfd_read (buf, 1, 16, abfd) != 16) + if (bfd_seek (abfd, (file_ptr) need, SEEK_SET) != 0 + || bfd_bread (buf, (bfd_size_type) 16, abfd) != 16) return false; /* For the format of an ld_need entry, see aout/sun4.h. We @@ -998,12 +993,12 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) name = bfd_get_32 (abfd, buf); flags = bfd_get_32 (abfd, buf + 4); - major_vno = (unsigned short)bfd_get_16 (abfd, buf + 8); - minor_vno = (unsigned short)bfd_get_16 (abfd, buf + 10); + major_vno = (unsigned short) bfd_get_16 (abfd, buf + 8); + minor_vno = (unsigned short) bfd_get_16 (abfd, buf + 10); need = bfd_get_32 (abfd, buf + 12); - needed = ((struct bfd_link_needed_list *) - bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); + alc = sizeof (struct bfd_link_needed_list); + needed = (struct bfd_link_needed_list *) bfd_alloc (abfd, alc); if (needed == NULL) return false; needed->by = abfd; @@ -1020,7 +1015,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) *p++ = '-'; *p++ = 'l'; } - if (bfd_seek (abfd, name, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) name, SEEK_SET) != 0) { free (namebuf); return false; @@ -1028,13 +1023,13 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) do { - if (bfd_read (&b, 1, 1, abfd) != 1) + if (bfd_bread (&b, (bfd_size_type) 1, abfd) != 1) { free (namebuf); return false; } - if ((size_t) (p - namebuf) >= alc) + if ((bfd_size_type) (p - namebuf) >= alc) { char *n; @@ -1085,7 +1080,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) strcat (p, minbuf); } - namecopy = bfd_alloc (abfd, strlen (namebuf) + 1); + namecopy = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); if (namecopy == NULL) { free (namebuf); @@ -1322,11 +1317,11 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, asection **srulesptr; { bfd *dynobj; - size_t dynsymcount; + bfd_size_type dynsymcount; struct sunos_link_hash_entry *h; asection *s; size_t bucketcount; - size_t hashalloc; + bfd_size_type hashalloc; size_t i; bfd *sub; @@ -1442,7 +1437,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, s->contents = (bfd_byte *) bfd_alloc (dynobj, hashalloc); if (s->contents == NULL && dynsymcount > 0) return false; - memset (s->contents, 0, hashalloc); + memset (s->contents, 0, (size_t) hashalloc); for (i = 0; i < bucketcount; i++) PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); s->_raw_size = bucketcount * HASH_ENTRY_SIZE; @@ -1470,7 +1465,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, add = 8 - (s->_raw_size & 7); contents = (bfd_byte *) bfd_realloc (s->contents, - (size_t) (s->_raw_size + add)); + s->_raw_size + add); if (contents == NULL) return false; memset (contents + s->_raw_size, 0, (size_t) add); @@ -1544,19 +1539,19 @@ sunos_scan_relocs (info, abfd, sec, rel_size) return true; if (! info->keep_memory) - relocs = free_relocs = bfd_malloc ((size_t) rel_size); + relocs = free_relocs = bfd_malloc (rel_size); else { struct aout_section_data_struct *n; + bfd_size_type amt = sizeof (struct aout_section_data_struct); - n = ((struct aout_section_data_struct *) - bfd_alloc (abfd, sizeof (struct aout_section_data_struct))); + n = (struct aout_section_data_struct *) bfd_alloc (abfd, amt); if (n == NULL) relocs = NULL; else { set_aout_section_data (sec, n); - relocs = bfd_malloc ((size_t) rel_size); + relocs = bfd_malloc (rel_size); aout_section_data (sec)->relocs = relocs; } } @@ -1564,7 +1559,7 @@ sunos_scan_relocs (info, abfd, sec, rel_size) return false; if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 - || bfd_read (relocs, 1, rel_size, abfd) != rel_size) + || bfd_bread (relocs, rel_size, abfd) != rel_size) goto error_return; if (obj_reloc_entry_size (abfd) == RELOC_STD_SIZE) @@ -1777,6 +1772,7 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) asection *splt = NULL; asection *sgot = NULL; asection *srel = NULL; + bfd_size_type amt; /* We only know how to handle SPARC plt entries. */ if (bfd_get_arch (abfd) != bfd_arch_sparc) @@ -1868,10 +1864,10 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) if (adata (abfd).local_got_offsets == NULL) { + amt = bfd_get_symcount (abfd); + amt *= sizeof (bfd_vma); adata (abfd).local_got_offsets = - (bfd_vma *) bfd_zalloc (abfd, - (bfd_get_symcount (abfd) - * sizeof (bfd_vma))); + (bfd_vma *) bfd_zalloc (abfd, amt); if (adata (abfd).local_got_offsets == NULL) return false; } @@ -2201,7 +2197,6 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) bfd *dynobj; asection *splt; bfd_byte *p; - asection *s; bfd_vma r_address; dynobj = sunos_hash_table (info)->dynobj; @@ -2230,8 +2225,6 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) } else { - bfd_vma val; - val = (h->root.root.u.def.section->output_section->vma + h->root.root.u.def.section->output_offset + h->root.root.u.def.value); @@ -2250,7 +2243,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) abort (); bfd_put_16 (output_bfd, M68K_PLT_ENTRY_WORD0, p); bfd_put_32 (output_bfd, (- (h->plt_offset + 2)), p + 2); - bfd_put_16 (output_bfd, s->reloc_count, p + 6); + bfd_put_16 (output_bfd, (bfd_vma) s->reloc_count, p + 6); r_address += 2; break; @@ -2399,13 +2392,13 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) outsym = ((struct external_nlist *) (s->contents + h->dynindx * EXTERNAL_NLIST_SIZE)); - bfd_h_put_8 (output_bfd, type, outsym->e_type); - bfd_h_put_8 (output_bfd, 0, outsym->e_other); + H_PUT_8 (output_bfd, type, outsym->e_type); + H_PUT_8 (output_bfd, 0, outsym->e_other); /* FIXME: The native linker doesn't use 0 for desc. It seems to use one less than the desc value in the shared library, although that seems unlikely. */ - bfd_h_put_16 (output_bfd, 0, outsym->e_desc); + H_PUT_16 (output_bfd, 0, outsym->e_desc); PUT_WORD (output_bfd, h->dynstr_index, outsym->e_strx); PUT_WORD (output_bfd, val, outsym->e_value); @@ -2668,7 +2661,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, } *relocationp = (sgot->vma - + (*got_offsetp &~ 1) + + (*got_offsetp &~ (bfd_vma) 1) - sunos_hash_table (info)->got_base); /* There is nothing else to do for a base relative reloc. */ @@ -2845,7 +2838,8 @@ sunos_finish_dynamic_link (abfd, info) BFD_ASSERT (o->output_section != NULL && o->output_section->owner == abfd); if (! bfd_set_section_contents (abfd, o->output_section, - o->contents, o->output_offset, + o->contents, + (file_ptr) o->output_offset, o->_raw_size)) return false; } @@ -2855,6 +2849,7 @@ sunos_finish_dynamic_link (abfd, info) { struct external_sun4_dynamic esd; struct external_sun4_dynamic_link esdl; + file_ptr pos; /* Finish up the dynamic link information. */ PUT_WORD (dynobj, (bfd_vma) 3, esd.ld_version); @@ -2869,7 +2864,8 @@ sunos_finish_dynamic_link (abfd, info) esd.ld); if (! bfd_set_section_contents (abfd, sdyn->output_section, &esd, - sdyn->output_offset, sizeof esd)) + (file_ptr) sdyn->output_offset, + (bfd_size_type) sizeof esd)) return false; PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_loaded); @@ -2934,11 +2930,10 @@ sunos_finish_dynamic_link (abfd, info) BFD_ALIGN (obj_textsec (abfd)->_raw_size, 0x2000), esdl.ld_text); + pos = sdyn->output_offset; + pos += sizeof esd + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE; if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl, - (sdyn->output_offset - + sizeof esd - + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE), - sizeof esdl)) + pos, (bfd_size_type) sizeof esdl)) return false; abfd->flags |= DYNAMIC; diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index 34169ec..9ec9dd8 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -1,6 +1,6 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -197,7 +197,7 @@ CODE_FRAGMENT . . {* The text of the symbol. The name is left alone, and not copied; the . application may not alter it. *} -. CONST char *name; +. const char *name; . . {* The value of the symbol. This really should be a union of a . numeric value with a pointer, since some flags indicate that @@ -308,10 +308,12 @@ CODE_FRAGMENT #include "bfd.h" #include "sysdep.h" #include "libbfd.h" +#include "safe-ctype.h" #include "bfdlink.h" #include "aout/stab_gnu.h" static char coff_section_type PARAMS ((const char *)); +static int cmpindexentry PARAMS ((const PTR, const PTR)); /* DOCDD @@ -353,7 +355,10 @@ bfd_is_local_label (abfd, sym) bfd *abfd; asymbol *sym; { - if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0) + /* The BSF_SECTION_SYM check is needed for IA-64, where every label that + starts with '.' is local. This would accidentally catch section names + if we didn't reject them here. */ + if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0) return false; if (sym->name == NULL) return false; @@ -429,14 +434,15 @@ FUNCTION bfd_print_symbol_vandf SYNOPSIS - void bfd_print_symbol_vandf(PTR file, asymbol *symbol); + void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol); DESCRIPTION Print the value and flags of the @var{symbol} supplied to the stream @var{file}. */ void -bfd_print_symbol_vandf (arg, symbol) +bfd_print_symbol_vandf (abfd, arg, symbol) + bfd *abfd; PTR arg; asymbol *symbol; { @@ -444,11 +450,12 @@ bfd_print_symbol_vandf (arg, symbol) flagword type = symbol->flags; if (symbol->section != (asection *) NULL) { - fprintf_vma (file, symbol->value + symbol->section->vma); + bfd_fprintf_vma (abfd, file, + symbol->value + symbol->section->vma); } else { - fprintf_vma (file, symbol->value); + bfd_fprintf_vma (abfd, file, symbol->value); } /* This presumes that a symbol can not be both BSF_DEBUGGING and @@ -489,6 +496,31 @@ DESCRIPTION /* FUNCTION + _bfd_generic_make_empty_symbol + +SYNOPSIS + asymbol *_bfd_generic_make_empty_symbol (bfd *); + +DESCRIPTION + Create a new <> structure for the BFD @var{abfd} + and return a pointer to it. Used by core file routines, + binary back-end and anywhere else where no private info + is needed. +*/ + +asymbol * +_bfd_generic_make_empty_symbol (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (asymbol); + asymbol *new = (asymbol *) bfd_zalloc (abfd, amt); + if (new) + new->the_bfd = abfd; + return new; +} + +/* +FUNCTION bfd_make_debug_symbol DESCRIPTION @@ -502,14 +534,14 @@ DESCRIPTION struct section_to_type { - CONST char *section; + const char *section; char type; }; /* Map section names to POSIX/BSD single-character symbol types. This table is probably incomplete. It is sorted for convenience of adding entries. Since it is so short, a linear search is used. */ -static CONST struct section_to_type stt[] = +static const struct section_to_type stt[] = { {"*DEBUG*", 'N'}, {".bss", 'b'}, @@ -541,7 +573,7 @@ static char coff_section_type (s) const char *s; { - CONST struct section_to_type *t; + const struct section_to_type *t; for (t = &stt[0]; t->section; t++) if (!strncmp (s, t->section, strlen (t->section))) @@ -550,13 +582,6 @@ coff_section_type (s) return '?'; } -#ifndef islower -#define islower(c) ((c) >= 'a' && (c) <= 'z') -#endif -#ifndef toupper -#define toupper(c) (islower(c) ? ((c) & ~0x20) : (c)) -#endif - /* FUNCTION bfd_decode_symclass @@ -611,7 +636,7 @@ bfd_decode_symclass (symbol) else return '?'; if (symbol->flags & BSF_GLOBAL) - c = toupper (c); + c = TOUPPER (c); return c; /* We don't have to handle these cases just yet, but we will soon: @@ -718,7 +743,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) if (storage == 0) return 0; - syms = (asymbol **) bfd_malloc ((size_t) storage); + syms = (asymbol **) bfd_malloc ((bfd_size_type) storage); if (syms == NULL) goto error_return; @@ -848,7 +873,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, bfd_byte *last_stab = NULL; bfd_size_type stroff; struct indexentry *indexentry; - char *directory_name, *file_name; + char *file_name; + char *directory_name; int saw_fun; *pfound = false; @@ -894,11 +920,10 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, arelent **reloc_vector; int i; char *name; - char *file_name; - char *directory_name; char *function_name; + bfd_size_type amt = sizeof *info; - info = (struct stab_find_info *) bfd_zalloc (abfd, sizeof *info); + info = (struct stab_find_info *) bfd_zalloc (abfd, amt); if (info == NULL) return false; @@ -925,10 +950,10 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (info->stabs == NULL || info->strs == NULL) return false; - if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, 0, - stabsize) - || ! bfd_get_section_contents (abfd, info->strsec, info->strs, 0, - strsize)) + if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, + (bfd_vma) 0, stabsize) + || ! bfd_get_section_contents (abfd, info->strsec, info->strs, + (bfd_vma) 0, strsize)) return false; /* If this is a relocateable object file, we have to relocate @@ -938,7 +963,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec); if (reloc_size < 0) return false; - reloc_vector = (arelent **) bfd_malloc (reloc_size); + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (reloc_vector == NULL && reloc_size != 0) return false; reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector, @@ -979,7 +1004,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, val &= r->howto->src_mask; sym = *r->sym_ptr_ptr; val += sym->value + sym->section->vma + r->addend; - bfd_put_32 (abfd, val, info->stabs + r->address); + bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address); } } @@ -1029,10 +1054,9 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, return true; ++info->indextablesize; - info->indextable = ((struct indexentry *) - bfd_alloc (abfd, - (sizeof (struct indexentry) - * info->indextablesize))); + amt = info->indextablesize; + amt *= sizeof (struct indexentry); + info->indextable = (struct indexentry *) bfd_alloc (abfd, amt); if (info->indextable == NULL) return false; @@ -1150,7 +1174,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, ++i; info->indextablesize = i; - qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry); + qsort (info->indextable, (size_t) i, sizeof (struct indexentry), + cmpindexentry); *pinfo = (PTR) info; } @@ -1272,9 +1297,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, { if (info->filename != NULL) free (info->filename); - info->filename = (char *) bfd_malloc (dirlen + - strlen (file_name) - + 1); + info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + + strlen (file_name) + 1); if (info->filename == NULL) return false; strcpy (info->filename, directory_name); diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h index bab1c51..1338d6b 100644 --- a/contrib/binutils/bfd/sysdep.h +++ b/contrib/binutils/bfd/sysdep.h @@ -125,6 +125,12 @@ extern void free (); extern char *getenv (); #endif +/* Define offsetof for those systems which lack it */ + +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + #ifdef ENABLE_NLS #include /* Note the use of dgetext() and PACKAGE here, rather than gettext(). diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c index cfbe6ad..352571a 100644 --- a/contrib/binutils/bfd/targets.c +++ b/contrib/binutils/bfd/targets.c @@ -1,6 +1,6 @@ /* Generic target-file-type support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -153,7 +153,8 @@ DESCRIPTION . bfd_target_versados_flavour, . bfd_target_msdos_flavour, . bfd_target_ovax_flavour, -. bfd_target_evax_flavour +. bfd_target_evax_flavour, +. bfd_target_mmo_flavour .}; . .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -208,27 +209,27 @@ Entries for byte swapping for data. These are different from the other entry points, since they don't take a BFD asthe first argument. Certain other handlers could do the same. -. bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); +. bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); -. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); +. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); -. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); +. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); -. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); +. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); Byte swapping for the headers -. bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); +. bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); +. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); +. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); . bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); +. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); Format dependent routines: these are vectors of entry points within the target vector structure, one for each format to check. @@ -239,225 +240,223 @@ Check the format of a file being read. Return a <> or zero. Set the format of a file being written. -. boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); +. boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); Write cached information into a file being written, at <>. -. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); +. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); The general target vector. These vectors are initialized using the BFD_JUMP_TABLE macros. . . {* Generic entry points. *} -.#define BFD_JUMP_TABLE_GENERIC(NAME)\ -.CAT(NAME,_close_and_cleanup),\ -.CAT(NAME,_bfd_free_cached_info),\ -.CAT(NAME,_new_section_hook),\ -.CAT(NAME,_get_section_contents),\ -.CAT(NAME,_get_section_contents_in_window) +Do not "beautify" the CONCAT* macro args. Traditional C will not +remove whitespace added here, and thus will fail to concatenate +the tokens. +.#define BFD_JUMP_TABLE_GENERIC(NAME) \ +.CONCAT2 (NAME,_close_and_cleanup), \ +.CONCAT2 (NAME,_bfd_free_cached_info), \ +.CONCAT2 (NAME,_new_section_hook), \ +.CONCAT2 (NAME,_get_section_contents), \ +.CONCAT2 (NAME,_get_section_contents_in_window) . . {* Called when the BFD is being closed to do any necessary cleanup. *} -. boolean (*_close_and_cleanup) PARAMS ((bfd *)); +. boolean (*_close_and_cleanup) PARAMS ((bfd *)); . {* Ask the BFD to free all cached information. *} -. boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); +. boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); . {* Called when a new section is created. *} -. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); +. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); . {* Read the contents of a section. *} -. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); -. boolean (*_bfd_get_section_contents_in_window) -. PARAMS ((bfd *, sec_ptr, bfd_window *, -. file_ptr, bfd_size_type)); +. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, +. file_ptr, bfd_size_type)); +. boolean (*_bfd_get_section_contents_in_window) +. PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); . . {* Entry points to copy private data. *} -.#define BFD_JUMP_TABLE_COPY(NAME)\ -.CAT(NAME,_bfd_copy_private_bfd_data),\ -.CAT(NAME,_bfd_merge_private_bfd_data),\ -.CAT(NAME,_bfd_copy_private_section_data),\ -.CAT(NAME,_bfd_copy_private_symbol_data),\ -.CAT(NAME,_bfd_set_private_flags),\ -.CAT(NAME,_bfd_print_private_bfd_data)\ +.#define BFD_JUMP_TABLE_COPY(NAME) \ +.CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ +.CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ +.CONCAT2 (NAME,_bfd_copy_private_section_data), \ +.CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ +.CONCAT2 (NAME,_bfd_set_private_flags), \ +.CONCAT2 (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, -. bfd *, sec_ptr)); +. boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, +. bfd *, sec_ptr)); . {* Called to copy BFD private symbol data from one symbol . to another. *} -. boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, -. bfd *, asymbol *)); +. boolean (*_bfd_copy_private_symbol_data) PARAMS ((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)); +. boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); . . {* Core file entry points. *} -.#define BFD_JUMP_TABLE_CORE(NAME)\ -.CAT(NAME,_core_file_failing_command),\ -.CAT(NAME,_core_file_failing_signal),\ -.CAT(NAME,_core_file_matches_executable_p) +.#define BFD_JUMP_TABLE_CORE(NAME) \ +.CONCAT2 (NAME,_core_file_failing_command), \ +.CONCAT2 (NAME,_core_file_failing_signal), \ +.CONCAT2 (NAME,_core_file_matches_executable_p) . char * (*_core_file_failing_command) PARAMS ((bfd *)); . int (*_core_file_failing_signal) PARAMS ((bfd *)); . boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); . . {* Archive entry points. *} -.#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ -.CAT(NAME,_slurp_armap),\ -.CAT(NAME,_slurp_extended_name_table),\ -.CAT(NAME,_construct_extended_name_table),\ -.CAT(NAME,_truncate_arname),\ -.CAT(NAME,_write_armap),\ -.CAT(NAME,_read_ar_hdr),\ -.CAT(NAME,_openr_next_archived_file),\ -.CAT(NAME,_get_elt_at_index),\ -.CAT(NAME,_generic_stat_arch_elt),\ -.CAT(NAME,_update_armap_timestamp) +.#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ +.CONCAT2 (NAME,_slurp_armap), \ +.CONCAT2 (NAME,_slurp_extended_name_table), \ +.CONCAT2 (NAME,_construct_extended_name_table), \ +.CONCAT2 (NAME,_truncate_arname), \ +.CONCAT2 (NAME,_write_armap), \ +.CONCAT2 (NAME,_read_ar_hdr), \ +.CONCAT2 (NAME,_openr_next_archived_file), \ +.CONCAT2 (NAME,_get_elt_at_index), \ +.CONCAT2 (NAME,_generic_stat_arch_elt), \ +.CONCAT2 (NAME,_update_armap_timestamp) . boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); . boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); . boolean (*_bfd_construct_extended_name_table) -. PARAMS ((bfd *, char **, bfd_size_type *, const char **)); -. void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); -. boolean (*write_armap) PARAMS ((bfd *arch, -. unsigned int elength, -. struct orl *map, -. unsigned int orl_count, -. int stridx)); -. PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); -. bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); +. PARAMS ((bfd *, char **, bfd_size_type *, const char **)); +. void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); +. boolean (*write_armap) +. PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +. PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); +. bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); .#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) . bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); . int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); . boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); . . {* Entry points used for symbols. *} -.#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ -.CAT(NAME,_get_symtab_upper_bound),\ -.CAT(NAME,_get_symtab),\ -.CAT(NAME,_make_empty_symbol),\ -.CAT(NAME,_print_symbol),\ -.CAT(NAME,_get_symbol_info),\ -.CAT(NAME,_bfd_is_local_label_name),\ -.CAT(NAME,_get_lineno),\ -.CAT(NAME,_find_nearest_line),\ -.CAT(NAME,_bfd_make_debug_symbol),\ -.CAT(NAME,_read_minisymbols),\ -.CAT(NAME,_minisymbol_to_symbol) -. long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); -. long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, -. struct symbol_cache_entry **)); -. struct symbol_cache_entry * -. (*_bfd_make_empty_symbol) PARAMS ((bfd *)); -. void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, -. struct symbol_cache_entry *, -. bfd_print_symbol_type)); +.#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ +.CONCAT2 (NAME,_get_symtab_upper_bound), \ +.CONCAT2 (NAME,_get_symtab), \ +.CONCAT2 (NAME,_make_empty_symbol), \ +.CONCAT2 (NAME,_print_symbol), \ +.CONCAT2 (NAME,_get_symbol_info), \ +.CONCAT2 (NAME,_bfd_is_local_label_name), \ +.CONCAT2 (NAME,_get_lineno), \ +.CONCAT2 (NAME,_find_nearest_line), \ +.CONCAT2 (NAME,_bfd_make_debug_symbol), \ +.CONCAT2 (NAME,_read_minisymbols), \ +.CONCAT2 (NAME,_minisymbol_to_symbol) +. long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); +. long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, +. struct symbol_cache_entry **)); +. struct symbol_cache_entry * +. (*_bfd_make_empty_symbol) PARAMS ((bfd *)); +. void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, +. struct symbol_cache_entry *, +. bfd_print_symbol_type)); .#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) -. void (*_bfd_get_symbol_info) PARAMS ((bfd *, -. struct symbol_cache_entry *, -. symbol_info *)); +. void (*_bfd_get_symbol_info) PARAMS ((bfd *, +. 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, -. struct sec *section, struct symbol_cache_entry **symbols, -. bfd_vma offset, CONST char **file, CONST char **func, -. unsigned int *line)); +. alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); +. boolean (*_bfd_find_nearest_line) +. PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, +. const char **, const char **, unsigned int *)); . {* Back-door to allow format-aware applications to create debug symbols . while using BFD for everything else. Currently used by the assembler . when creating COFF files. *} -. asymbol * (*_bfd_make_debug_symbol) PARAMS (( -. bfd *abfd, -. void *ptr, -. unsigned long size)); +. asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *, +. unsigned long size)); .#define bfd_read_minisymbols(b, d, m, s) \ . BFD_SEND (b, _read_minisymbols, (b, d, m, s)) -. long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, -. unsigned int *)); +. long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, +. unsigned int *)); .#define bfd_minisymbol_to_symbol(b, d, m, f) \ . BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) . asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, . asymbol *)); . . {* Routines for relocs. *} -.#define BFD_JUMP_TABLE_RELOCS(NAME)\ -.CAT(NAME,_get_reloc_upper_bound),\ -.CAT(NAME,_canonicalize_reloc),\ -.CAT(NAME,_bfd_reloc_type_lookup) -. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); -. long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, -. struct symbol_cache_entry **)); +.#define BFD_JUMP_TABLE_RELOCS(NAME) \ +.CONCAT2 (NAME,_get_reloc_upper_bound), \ +.CONCAT2 (NAME,_canonicalize_reloc), \ +.CONCAT2 (NAME,_bfd_reloc_type_lookup) +. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); +. long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, +. struct symbol_cache_entry **)); . {* See documentation on reloc types. *} . reloc_howto_type * -. (*reloc_type_lookup) PARAMS ((bfd *abfd, -. bfd_reloc_code_real_type code)); +. (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); . . {* Routines used when writing an object file. *} -.#define BFD_JUMP_TABLE_WRITE(NAME)\ -.CAT(NAME,_set_arch_mach),\ -.CAT(NAME,_set_section_contents) -. boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, -. unsigned long)); -. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); +.#define BFD_JUMP_TABLE_WRITE(NAME) \ +.CONCAT2 (NAME,_set_arch_mach), \ +.CONCAT2 (NAME,_set_section_contents) +. boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, +. unsigned long)); +. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, +. file_ptr, bfd_size_type)); . . {* Routines used by the linker. *} -.#define BFD_JUMP_TABLE_LINK(NAME)\ -.CAT(NAME,_sizeof_headers),\ -.CAT(NAME,_bfd_get_relocated_section_contents),\ -.CAT(NAME,_bfd_relax_section),\ -.CAT(NAME,_bfd_link_hash_table_create),\ -.CAT(NAME,_bfd_link_add_symbols),\ -.CAT(NAME,_bfd_final_link),\ -.CAT(NAME,_bfd_link_split_section),\ -.CAT(NAME,_bfd_gc_sections) -. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); -. bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, -. struct bfd_link_info *, struct bfd_link_order *, -. bfd_byte *data, boolean relocateable, -. struct symbol_cache_entry **)); +.#define BFD_JUMP_TABLE_LINK(NAME) \ +.CONCAT2 (NAME,_sizeof_headers), \ +.CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ +.CONCAT2 (NAME,_bfd_relax_section), \ +.CONCAT2 (NAME,_bfd_link_hash_table_create), \ +.CONCAT2 (NAME,_bfd_link_add_symbols), \ +.CONCAT2 (NAME,_bfd_final_link), \ +.CONCAT2 (NAME,_bfd_link_split_section), \ +.CONCAT2 (NAME,_bfd_gc_sections), \ +.CONCAT2 (NAME,_bfd_merge_sections) +. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); +. bfd_byte *(*_bfd_get_relocated_section_contents) +. PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, +. bfd_byte *, boolean, struct symbol_cache_entry **)); . -. boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, -. struct bfd_link_info *, boolean *again)); +. boolean (*_bfd_relax_section) +. PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *)); . . {* Create a hash table for the linker. Different backends store . different information in this table. *} . struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); . . {* Add symbols from this object file into the hash table. *} -. boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); +. boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); . . {* Do a link based on the link_order structures attached to each . section of the BFD. *} -. boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); +. boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); . . {* Should this section be split up into smaller pieces during linking. *} -. boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); +. boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); . . {* Remove sections that are not referenced from the output. *} -. boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); +. boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); +. +. {* Attempt to merge SEC_MERGE sections. *} +. boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); . . {* Routines to handle dynamic symbols and relocs. *} -.#define BFD_JUMP_TABLE_DYNAMIC(NAME)\ -.CAT(NAME,_get_dynamic_symtab_upper_bound),\ -.CAT(NAME,_canonicalize_dynamic_symtab),\ -.CAT(NAME,_get_dynamic_reloc_upper_bound),\ -.CAT(NAME,_canonicalize_dynamic_reloc) +.#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ +.CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ +.CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ +.CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ +.CONCAT2 (NAME,_canonicalize_dynamic_reloc) . {* Get the amount of memory required to hold the dynamic symbols. *} -. long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); +. long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); . {* Read in the dynamic symbols. *} -. long (*_bfd_canonicalize_dynamic_symtab) +. long (*_bfd_canonicalize_dynamic_symtab) . PARAMS ((bfd *, struct symbol_cache_entry **)); . {* Get the amount of memory required to hold the dynamic relocs. *} -. long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); +. long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); . {* Read in the dynamic relocs. *} -. long (*_bfd_canonicalize_dynamic_reloc) +. long (*_bfd_canonicalize_dynamic_reloc) . PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); . @@ -517,6 +516,7 @@ extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_d10v_vec; extern const bfd_target bfd_elf32_d30v_vec; extern const bfd_target bfd_elf32_fr30_vec; +extern const bfd_target bfd_elf32_h8300_vec; extern const bfd_target bfd_elf32_hppa_linux_vec; extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i370_vec; @@ -525,6 +525,7 @@ extern const bfd_target bfd_elf32_i860_little_vec; extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i960_vec; extern const bfd_target bfd_elf32_ia64_big_vec; +extern const bfd_target bfd_elf32_ia64_hpux_big_vec; extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlearc_vec; extern const bfd_target bfd_elf32_littlearm_oabi_vec; @@ -539,32 +540,45 @@ extern const bfd_target bfd_elf32_mcore_big_vec; extern const bfd_target bfd_elf32_mcore_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; +extern const bfd_target bfd_elf32_openrisc_vec; extern const bfd_target bfd_elf32_pj_vec; extern const bfd_target bfd_elf32_pjl_vec; extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; +extern const bfd_target bfd_elf32_s390_vec; extern const bfd_target bfd_elf32_sh_vec; extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shlin_vec; +extern const bfd_target bfd_elf32_shlnbsd_vec; +extern const bfd_target bfd_elf32_shnbsd_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; extern const bfd_target bfd_elf32_us_cris_vec; extern const bfd_target bfd_elf32_v850_vec; +extern const bfd_target bfd_elf32_xstormy16_vec; extern const bfd_target bfd_elf64_alpha_vec; extern const bfd_target bfd_elf64_big_generic_vec; extern const bfd_target bfd_elf64_bigmips_vec; extern const bfd_target bfd_elf64_hppa_linux_vec; extern const bfd_target bfd_elf64_hppa_vec; +extern const bfd_target bfd_elf64_ia64_aix_big_vec; +extern const bfd_target bfd_elf64_ia64_aix_little_vec; extern const bfd_target bfd_elf64_ia64_big_vec; +extern const bfd_target bfd_elf64_ia64_hpux_big_vec; extern const bfd_target bfd_elf64_ia64_little_vec; extern const bfd_target bfd_elf64_little_generic_vec; extern const bfd_target bfd_elf64_littlemips_vec; +extern const bfd_target bfd_elf64_mmix_vec; +extern const bfd_target bfd_elf64_powerpc_vec; +extern const bfd_target bfd_elf64_powerpcle_vec; +extern const bfd_target bfd_elf64_s390_vec; +extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; -extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_x86_64_vec; +extern const bfd_target bfd_mmo_vec; extern const bfd_target bfd_powerpc_pe_vec; extern const bfd_target bfd_powerpc_pei_vec; extern const bfd_target bfd_powerpcle_pe_vec; @@ -625,6 +639,7 @@ extern const bfd_target nlm32_sparc_vec; extern const bfd_target oasys_vec; extern const bfd_target pc532machaout_vec; extern const bfd_target pc532netbsd_vec; +extern const bfd_target pdp11_aout_vec; extern const bfd_target pmac_xcoff_vec; extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; @@ -644,7 +659,6 @@ extern const bfd_target sparclynx_aout_vec; extern const bfd_target sparclynx_coff_vec; extern const bfd_target sparcnetbsd_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 tic54x_coff0_beh_vec; @@ -662,28 +676,25 @@ extern const bfd_target w65_vec; extern const bfd_target we32kcoff_vec; extern const bfd_target z8kcoff_vec; -/* srec is always included. */ +/* These are always included. */ extern const bfd_target srec_vec; extern const bfd_target symbolsrec_vec; - -/* binary is always included. */ +extern const bfd_target tekhex_vec; extern const bfd_target binary_vec; - -/* ihex is always included. */ extern const bfd_target ihex_vec; /* All of the xvecs for core files. */ extern const bfd_target aix386_core_vec; extern const bfd_target cisco_core_big_vec; extern const bfd_target cisco_core_little_vec; -extern const bfd_target hpux_core_vec; extern const bfd_target hppabsd_core_vec; +extern const bfd_target hpux_core_vec; extern const bfd_target irix_core_vec; extern const bfd_target netbsd_core_vec; extern const bfd_target osf_core_vec; +extern const bfd_target ptrace_core_vec; extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; -extern const bfd_target ptrace_core_vec; static const bfd_target * const _bfd_target_vector[] = { @@ -704,127 +715,152 @@ static const bfd_target * const _bfd_target_vector[] = { it wasn't omitted by mistake. */ &a29kcoff_big_vec, &a_out_adobe_vec, -#if 0 /* No one seems to use this. */ + &aout0_big_vec, +#if 0 + /* We have no way of distinguishing these from other a.out variants */ + &aout_arm_big_vec, + &aout_arm_little_vec, + /* No one seems to use this. */ &aout_mips_big_vec, #endif &aout_mips_little_vec, +#if 0 + &apollocoff_vec, +#endif + &arm_epoc_pe_big_vec, + &arm_epoc_pe_little_vec, + &arm_epoc_pei_big_vec, + &arm_epoc_pei_little_vec, + &armcoff_big_vec, + &armcoff_little_vec, + &armnetbsd_vec, + &armpe_big_vec, + &armpe_little_vec, + &armpei_big_vec, + &armpei_little_vec, &b_out_vec_big_host, &b_out_vec_little_host, - &bfd_efi_app_ia32_vec, #ifdef BFD64 &bfd_efi_app_ia64_vec, #endif + &bfd_elf32_avr_vec, /* This, and other vectors, may not be used in any *.mt configuration. But that does not mean they are unnecessary. If configured with --enable-targets=all, objdump or gdb should be able to examine the file even if we don't recognize the machine type. */ &bfd_elf32_big_generic_vec, -#ifdef BFD64 - &bfd_elf64_alpha_vec, - &bfd_elf64_hppa_vec, - &bfd_elf64_hppa_linux_vec, - &bfd_elf64_ia64_little_vec, - &bfd_elf64_ia64_big_vec, -#endif - &bfd_elf32_avr_vec, &bfd_elf32_bigarc_vec, - &bfd_elf32_bigarm_vec, - &bfd_elf32_bigarm_oabi_vec, + &bfd_elf32_bigarm_oabi_vec, + &bfd_elf32_bigarm_vec, &bfd_elf32_bigmips_vec, -#ifdef BFD64 - &bfd_elf64_bigmips_vec, -#endif &bfd_elf32_cris_vec, - &bfd_elf32_us_cris_vec, &bfd_elf32_d10v_vec, &bfd_elf32_d30v_vec, - &bfd_elf32_hppa_vec, + &bfd_elf32_fr30_vec, + &bfd_elf32_h8300_vec, &bfd_elf32_hppa_linux_vec, + &bfd_elf32_hppa_vec, &bfd_elf32_i370_vec, &bfd_elf32_i386_vec, -#ifdef BFD64 - &bfd_elf64_x86_64_vec, -#endif - &bfd_elf32_i860_vec, &bfd_elf32_i860_little_vec, + &bfd_elf32_i860_vec, &bfd_elf32_i960_vec, +#if 0 + &bfd_elf32_ia64_big_vec, +#endif + &bfd_elf32_ia64_hpux_big_vec, &bfd_elf32_little_generic_vec, &bfd_elf32_littlearc_vec, - &bfd_elf32_littlearm_vec, - &bfd_elf32_littlearm_oabi_vec, + &bfd_elf32_littlearm_oabi_vec, + &bfd_elf32_littlearm_vec, &bfd_elf32_littlemips_vec, -#ifdef BFD64 - &bfd_elf64_littlemips_vec, -#endif &bfd_elf32_m32r_vec, - &bfd_elf32_mn10200_vec, - &bfd_elf32_mn10300_vec, &bfd_elf32_m68hc11_vec, &bfd_elf32_m68hc12_vec, &bfd_elf32_m68k_vec, &bfd_elf32_m88k_vec, + &bfd_elf32_mcore_big_vec, + &bfd_elf32_mcore_little_vec, + &bfd_elf32_mn10200_vec, + &bfd_elf32_mn10300_vec, + &bfd_elf32_openrisc_vec, &bfd_elf32_pj_vec, &bfd_elf32_pjl_vec, &bfd_elf32_powerpc_vec, &bfd_elf32_powerpcle_vec, + &bfd_elf32_s390_vec, + &bfd_elf32_sh_vec, + &bfd_elf32_shblin_vec, + &bfd_elf32_shl_vec, + &bfd_elf32_shlin_vec, + &bfd_elf32_shlnbsd_vec, + &bfd_elf32_shnbsd_vec, &bfd_elf32_sparc_vec, - &bfd_elf32_v850_vec, - &bfd_elf32_fr30_vec, - &bfd_elf32_mcore_big_vec, - &bfd_elf32_mcore_little_vec, &bfd_elf32_tradbigmips_vec, &bfd_elf32_tradlittlemips_vec, + &bfd_elf32_us_cris_vec, + &bfd_elf32_v850_vec, + &bfd_elf32_xstormy16_vec, #ifdef BFD64 - &bfd_elf64_tradbigmips_vec, - &bfd_elf64_tradlittlemips_vec, - /* No one seems to use this. */ + &bfd_elf64_alpha_vec, &bfd_elf64_big_generic_vec, + &bfd_elf64_bigmips_vec, + &bfd_elf64_hppa_linux_vec, + &bfd_elf64_hppa_vec, + &bfd_elf64_ia64_aix_big_vec, + &bfd_elf64_ia64_aix_little_vec, + &bfd_elf64_ia64_big_vec, + &bfd_elf64_ia64_hpux_big_vec, + &bfd_elf64_ia64_little_vec, &bfd_elf64_little_generic_vec, -#endif + &bfd_elf64_littlemips_vec, + &bfd_elf64_mmix_vec, + &bfd_elf64_powerpc_vec, + &bfd_elf64_powerpcle_vec, + &bfd_elf64_s390_vec, #if 0 &bfd_elf64_sparc_vec, #endif - /* We don't include cisco_core_*_vec. Although it has a magic number, - the magic number isn't at the beginning of the file, and thus - might spuriously match other kinds of files. */ - - &cris_aout_vec, + &bfd_elf64_tradbigmips_vec, + &bfd_elf64_tradlittlemips_vec, + &bfd_elf64_x86_64_vec, + &bfd_mmo_vec, +#endif + &bfd_powerpc_pe_vec, + &bfd_powerpc_pei_vec, + &bfd_powerpcle_pe_vec, + &bfd_powerpcle_pei_vec, + &cris_aout_vec, #ifdef BFD64 &demo_64_vec, /* Only compiled if host has long-long support */ #endif &ecoff_big_vec, - &ecoff_little_vec, &ecoff_biglittle_vec, + &ecoff_little_vec, #ifdef BFD64 &ecoffalpha_little_vec, #endif + &go32coff_vec, + &go32stubbedcoff_vec, &h8300coff_vec, &h8500coff_vec, #if 0 /* Since a.out files lack decent magic numbers, no way to recognize which kind of a.out file it is. */ &host_aout_vec, -#endif -#if 0 /* Clashes with sunos_big_vec magic no. */ + /* Clashes with sunos_big_vec magic no. */ &hp300bsd_vec, #endif &hp300hpux_vec, -#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) - &som_vec, -#endif &i386aout_vec, &i386bsd_vec, &i386coff_vec, +#if 0 + &i386dynix_vec, +#endif &i386freebsd_vec, - &i860coff_vec, - &bfd_powerpc_pe_vec, - &bfd_powerpcle_pe_vec, - &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. */ @@ -841,20 +877,14 @@ static const bfd_target * const _bfd_target_vector[] = { &i386os9k_vec, &i386pe_vec, &i386pei_vec, - &armcoff_little_vec, - &armcoff_big_vec, - &armnetbsd_vec, - &armpe_little_vec, - &armpe_big_vec, - &armpei_little_vec, - &armpei_big_vec, - &arm_epoc_pe_little_vec, - &arm_epoc_pe_big_vec, - &arm_epoc_pei_little_vec, - &arm_epoc_pei_big_vec, + &i860coff_vec, &icoff_big_vec, &icoff_little_vec, &ieee_vec, +#if 0 + &m68k4knetbsd_vec, + &m68kaux_coff_vec, +#endif &m68kcoff_vec, &m68kcoffun_vec, #if 0 @@ -872,13 +902,15 @@ static const bfd_target * const _bfd_target_vector[] = { &mcore_pe_little_vec, &mcore_pei_big_vec, &mcore_pei_little_vec, + &mipslpe_vec, + &mipslpei_vec, &newsos3_vec, - &nlm32_i386_vec, - &nlm32_sparc_vec, #ifdef BFD64 &nlm32_alpha_vec, #endif - &pc532netbsd_vec, + &nlm32_i386_vec, + &nlm32_powerpc_vec, + &nlm32_sparc_vec, #if 0 /* We have no oasys tools anymore, so we can't test any of this anymore. If you want to test the stuff yourself, go ahead... @@ -888,40 +920,45 @@ static const bfd_target * const _bfd_target_vector[] = { &oasys_vec, #endif &pc532machaout_vec, -#if 0 - /* We have no way of distinguishing these from other a.out variants */ - &aout_arm_big_vec, - &aout_arm_little_vec, - &riscix_vec, -#endif + &pc532netbsd_vec, + &pdp11_aout_vec, #if 0 /* This has the same magic number as RS/6000. */ &pmac_xcoff_vec, #endif - &rs6000coff_vec, + &ppcboot_vec, +#if 0 + /* We have no way of distinguishing these from other a.out variants */ + &riscix_vec, +#endif #ifdef BFD64 &rs6000coff64_vec, #endif - &ppcboot_vec, - &shcoff_vec, - &shlcoff_vec, + &rs6000coff_vec, &shcoff_small_vec, + &shcoff_vec, &shlcoff_small_vec, + &shlcoff_vec, + &shlpe_vec, + &shlpei_vec, +#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) + &som_vec, +#endif + &sparccoff_vec, &sparcle_aout_vec, &sparclinux_vec, &sparclynx_aout_vec, &sparclynx_coff_vec, &sparcnetbsd_vec, &sunos_big_vec, - &aout0_big_vec, &tic30_aout_vec, &tic30_coff_vec, - &tic54x_coff0_vec, &tic54x_coff0_beh_vec, - &tic54x_coff1_vec, + &tic54x_coff0_vec, &tic54x_coff1_beh_vec, - &tic54x_coff2_vec, + &tic54x_coff1_vec, &tic54x_coff2_beh_vec, + &tic54x_coff2_vec, &tic80coff_vec, &vaxnetbsd_vec, &versados_vec, @@ -929,9 +966,9 @@ static const bfd_target * const _bfd_target_vector[] = { &vms_alpha_vec, #endif &vms_vax_vec, + &w65_vec, &we32kcoff_vec, &z8kcoff_vec, - #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */ @@ -949,12 +986,19 @@ static const bfd_target * const _bfd_target_vector[] = { #ifdef AIX386_CORE &aix386_core_vec, #endif -#ifdef HPUX_CORE - &hpux_core_vec, +#if 0 + /* We don't include cisco_core_*_vec. Although it has a magic number, + the magic number isn't at the beginning of the file, and thus + might spuriously match other kinds of files. */ + &cisco_core_big_vec, + &cisco_core_little_vec, #endif #ifdef HPPABSD_CORE &hppabsd_core_vec, #endif +#ifdef HPUX_CORE + &hpux_core_vec, +#endif #ifdef IRIX_CORE &irix_core_vec, #endif @@ -964,17 +1008,16 @@ static const bfd_target * const _bfd_target_vector[] = { #ifdef OSF_CORE &osf_core_vec, #endif +#ifdef PTRACE_CORE + &ptrace_core_vec, +#endif #ifdef SCO5_CORE &sco5_core_vec, #endif -#ifdef TRAD_CORE +#ifdef TRAD_CORE &trad_core_vec, #endif -#ifdef PTRACE_CORE - &ptrace_core_vec, -#endif - NULL /* end of list marker */ }; const bfd_target * const *bfd_target_vector = _bfd_target_vector; @@ -1081,7 +1124,7 @@ FUNCTION bfd_find_target SYNOPSIS - const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd); + const bfd_target *bfd_find_target(const char *target_name, bfd *abfd); DESCRIPTION Return a pointer to the transfer vector for the object target @@ -1147,19 +1190,20 @@ const char ** bfd_target_list () { int vec_length= 0; + bfd_size_type amt; #if defined (HOST_HPPAHPUX) && ! defined (__STDC__) /* The native compiler on the HP9000/700 has a bug which causes it to loop endlessly when compiling this file. This avoids it. */ volatile #endif - const bfd_target * const *target; - CONST char **name_list, **name_ptr; + const bfd_target * const *target; + const char **name_list, **name_ptr; for (target = &bfd_target_vector[0]; *target != NULL; target++) vec_length++; - name_ptr = name_list = (CONST char **) - bfd_zmalloc ((vec_length + 1) * sizeof (char **)); + amt = (vec_length + 1) * sizeof (char **); + name_ptr = name_list = (const char **) bfd_zmalloc (amt); if (name_list == NULL) return NULL; diff --git a/contrib/binutils/bfd/targmatch.sed b/contrib/binutils/bfd/targmatch.sed index 2f40e72..2716876 100644 --- a/contrib/binutils/bfd/targmatch.sed +++ b/contrib/binutils/bfd/targmatch.sed @@ -1,5 +1,6 @@ 1,/START OF targmatch.h/ d /END OF targmatch.h/,$ d +/^[ ]*case/,/^[ ]*esac/ d s/^#if/KEEP #if/ s/^#endif/KEEP #endif/ s/^[ ]*#.*$// diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c index ccfe7d8..f5d5160 100644 --- a/contrib/binutils/bfd/tekhex.c +++ b/contrib/binutils/bfd/tekhex.c @@ -1,5 +1,5 @@ /* BFD backend for Extended Tektronix Hex Format objects. - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -107,7 +107,7 @@ static asymbol *tekhex_make_empty_symbol PARAMS ((bfd *)); static int tekhex_sizeof_headers PARAMS ((bfd *, boolean)); static boolean tekhex_write_object_contents PARAMS ((bfd *)); static void out PARAMS ((bfd *, int, char *, char *)); -static void writesym PARAMS ((char **, CONST char *)); +static void writesym PARAMS ((char **, const char *)); static void writevalue PARAMS ((char **, bfd_vma)); static boolean tekhex_set_section_contents PARAMS ((bfd*, sec_ptr, PTR, file_ptr, bfd_size_type)); @@ -354,11 +354,11 @@ find_chunk (abfd, vma) } if (!d) { - char *sname = bfd_alloc (abfd, 12); + char *sname = bfd_alloc (abfd, (bfd_size_type) 12); /* No chunk for this address, so make one up */ - d = (struct data_struct *) - bfd_alloc (abfd, sizeof (struct data_struct)); + d = ((struct data_struct *) + bfd_alloc (abfd, (bfd_size_type) sizeof (struct data_struct))); if (!sname || !d) return NULL; @@ -394,7 +394,7 @@ first_phase (abfd, type, src) char *src; { asection *section = bfd_abs_section_ptr; - int len; + unsigned int len; char sym[17]; /* A symbol can only be 16chars long */ switch (type) @@ -419,7 +419,7 @@ first_phase (abfd, type, src) section = bfd_get_section_by_name (abfd, sym); if (section == (asection *) NULL) { - char *n = bfd_alloc (abfd, len + 1); + char *n = bfd_alloc (abfd, (bfd_size_type) len + 1); if (!n) abort (); /* FIXME */ @@ -445,10 +445,10 @@ first_phase (abfd, type, src) case '8': /* Symbols, add to section */ { + bfd_size_type amt = sizeof (tekhex_symbol_type); tekhex_symbol_type *new = - (tekhex_symbol_type *) bfd_alloc (abfd, - sizeof (tekhex_symbol_type)); - char type = (*src); + (tekhex_symbol_type *) bfd_alloc (abfd, amt); + char stype = (*src); if (!new) abort (); /* FIXME */ @@ -459,12 +459,12 @@ first_phase (abfd, type, src) new->prev = abfd->tdata.tekhex_data->symbols; abfd->tdata.tekhex_data->symbols = new; len = getsym (sym, &src); - new->symbol.name = bfd_alloc (abfd, len + 1); + new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1); if (!new->symbol.name) abort (); /* FIXME */ memcpy ((char *) (new->symbol.name), sym, len + 1); new->symbol.section = section; - if (type <= '4') + if (stype <= '4') new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT); else new->symbol.flags = BSF_LOCAL; @@ -496,17 +496,17 @@ pass_over (abfd, func) char type; /* Find first '%' */ - eof = (boolean) (bfd_read (src, 1, 1, abfd) != 1); + eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); while (*src != '%' && !eof) { - eof = (boolean) (bfd_read (src, 1, 1, abfd) != 1); + eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); } if (eof) break; src++; /* Fetch the type and the length and the checksum */ - if (bfd_read (src, 1, 5, abfd) != 5) + if (bfd_bread (src, (bfd_size_type) 5, abfd) != 5) abort (); /* FIXME */ type = src[2]; @@ -516,7 +516,7 @@ pass_over (abfd, func) chars_on_line = HEX (src) - 5; /* Already read five char */ - if (bfd_read (src, 1, chars_on_line, abfd) != chars_on_line) + if (bfd_bread (src, (bfd_size_type) chars_on_line, abfd) != chars_on_line) abort (); /* FIXME */ src[chars_on_line] = 0; /* put a null at the end */ @@ -555,8 +555,9 @@ static boolean tekhex_mkobject (abfd) bfd *abfd; { - tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type)); + tdata_type *tdata; + tdata = (tdata_type *) bfd_alloc (abfd, (bfd_size_type) sizeof (tdata_type)); if (!tdata) return false; abfd->tdata.tekhex_data = tdata; @@ -580,7 +581,7 @@ tekhex_object_p (abfd) tekhex_init (); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_read (b, 1, 4, abfd) != 4) + || bfd_bread (b, (bfd_size_type) 4, abfd) != 4) return NULL; if (b[0] != '%' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3])) @@ -597,7 +598,7 @@ move_section_contents (abfd, section, locationp, offset, count, get) bfd *abfd; asection *section; PTR locationp; - file_ptr offset ATTRIBUTE_UNUSED; + file_ptr offset; bfd_size_type count; boolean get; { @@ -606,10 +607,11 @@ move_section_contents (abfd, section, locationp, offset, count, get) bfd_vma prev_number = 1; /* Nothing can have this as a high bit*/ struct data_struct *d = (struct data_struct *) NULL; + BFD_ASSERT (offset == 0); for (addr = section->vma; count != 0; count--, addr++) { - - bfd_vma chunk_number = addr & ~CHUNK_MASK; /* Get high bits of address */ + /* Get high bits of address. */ + bfd_vma chunk_number = addr & ~(bfd_vma) CHUNK_MASK; bfd_vma low_bits = addr & CHUNK_MASK; if (chunk_number != prev_number) @@ -689,7 +691,7 @@ tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do) { if (s->flags & SEC_LOAD) { - for (vma = s->vma & ~CHUNK_MASK; + for (vma = s->vma & ~(bfd_vma) CHUNK_MASK; vma < s->vma + s->_raw_size; vma += CHUNK_MASK) find_chunk (abfd, vma); @@ -699,7 +701,8 @@ tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do) } if (section->flags & (SEC_LOAD | SEC_ALLOC)) { - move_section_contents (abfd, section, locationp, offset, bytes_to_do, false); + move_section_contents (abfd, section, locationp, offset, bytes_to_do, + false); return true; } else @@ -740,7 +743,7 @@ writevalue (dst, value) static void writesym (dst, sym) char **dst; - CONST char *sym; + const char *sym; { char *p = *dst; int len = (sym ? strlen (sym) : 0); @@ -797,11 +800,11 @@ out (abfd, type, start, end) sum += sum_block[(unsigned char) front[2]]; sum += sum_block[(unsigned char) front[3]]; /* type */ TOHEX (front + 4, sum); - if (bfd_write (front, 1, 6, abfd) != 6) + if (bfd_bwrite (front, (bfd_size_type) 6, abfd) != 6) abort (); end[0] = '\n'; wrlen = end - start + 1; - if (bfd_write (start, 1, wrlen, abfd) != wrlen) + if (bfd_bwrite (start, wrlen, abfd) != wrlen) abort (); } @@ -826,7 +829,7 @@ tekhex_write_object_contents (abfd) { int low; - CONST int span = 32; + const int span = 32; int addr; /* Write it in blocks of 32 bytes */ @@ -876,10 +879,10 @@ tekhex_write_object_contents (abfd) if (section_code != '?') { /* do not include debug symbols */ - asymbol *s = *p; + asymbol *sym = *p; char *dst = buffer; - writesym (&dst, s->section->name); + writesym (&dst, sym->section->name); switch (section_code) { @@ -911,15 +914,15 @@ tekhex_write_object_contents (abfd) return false; } - writesym (&dst, s->name); - writevalue (&dst, s->value + s->section->vma); + writesym (&dst, sym->name); + writevalue (&dst, sym->value + sym->section->vma); out (abfd, '3', buffer, dst); } } } /* And the terminator */ - if (bfd_write ("%0781010\n", 1, 9, abfd) != 9) + if (bfd_bwrite ("%0781010\n", (bfd_size_type) 9, abfd) != 9) abort (); return true; } @@ -937,8 +940,8 @@ static asymbol * tekhex_make_empty_symbol (abfd) bfd *abfd; { - tekhex_symbol_type *new = - (tekhex_symbol_type *) bfd_zalloc (abfd, sizeof (struct tekhex_symbol_struct)); + bfd_size_type amt = sizeof (struct tekhex_symbol_struct); + tekhex_symbol_type *new = (tekhex_symbol_type *) bfd_zalloc (abfd, amt); if (!new) return NULL; @@ -957,8 +960,8 @@ tekhex_get_symbol_info (ignore_abfd, symbol, ret) } static void -tekhex_print_symbol (ignore_abfd, filep, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +tekhex_print_symbol (abfd, filep, symbol, how) + bfd *abfd; PTR filep; asymbol *symbol; bfd_print_symbol_type how; @@ -975,9 +978,9 @@ tekhex_print_symbol (ignore_abfd, filep, symbol, how) case bfd_print_symbol_all: { - CONST char *section_name = symbol->section->name; + const char *section_name = symbol->section->name; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", section_name, @@ -1001,6 +1004,7 @@ tekhex_print_symbol (ignore_abfd, filep, symbol, how) bfd_generic_get_relocated_section_contents #define tekhex_bfd_relax_section bfd_generic_relax_section #define tekhex_bfd_gc_sections bfd_generic_gc_sections +#define tekhex_bfd_merge_sections bfd_generic_merge_sections #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols #define tekhex_bfd_final_link _bfd_generic_final_link diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c index 872ad54..aed0b50 100644 --- a/contrib/binutils/bfd/trad-core.c +++ b/contrib/binutils/bfd/trad-core.c @@ -1,6 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -80,14 +80,15 @@ trad_unix_core_file_p (abfd) int val; struct user u; struct trad_core_struct *rawptr; + bfd_size_type amt; #ifdef TRAD_CORE_USER_OFFSET /* If defined, this macro is the file position of the user struct. */ - if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) return 0; #endif - val = bfd_read ((void *)&u, 1, sizeof u, abfd); + val = bfd_bread ((void *) &u, (bfd_size_type) sizeof u, abfd); if (val != sizeof u) { /* Too small to be a core file */ @@ -149,8 +150,8 @@ trad_unix_core_file_p (abfd) /* Allocate both the upage and the struct core_data at once, so a single free() will free them both. */ - rawptr = (struct trad_core_struct *) - bfd_zmalloc (sizeof (struct trad_core_struct)); + amt = sizeof (struct trad_core_struct); + rawptr = (struct trad_core_struct *) bfd_zmalloc (amt); if (rawptr == NULL) return 0; @@ -158,22 +159,17 @@ trad_unix_core_file_p (abfd) rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ - /* Create the sections. This is raunchy, but bfd_close wants to free - them separately. */ + /* Create the sections. */ - core_stacksec(abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + core_stacksec(abfd) = bfd_make_section_anyway (abfd, ".stack"); if (core_stacksec (abfd) == NULL) - return NULL; - core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + goto fail; + core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); if (core_datasec (abfd) == NULL) - return NULL; - core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); + goto fail; + core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); if (core_regsec (abfd) == NULL) - return NULL; - - core_stacksec (abfd)->name = ".stack"; - core_datasec (abfd)->name = ".data"; - core_regsec (abfd)->name = ".reg"; + goto fail; core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; @@ -230,12 +226,13 @@ trad_unix_core_file_p (abfd) core_datasec (abfd)->alignment_power = 2; core_regsec (abfd)->alignment_power = 2; - abfd->sections = core_stacksec (abfd); - core_stacksec (abfd)->next = core_datasec (abfd); - core_datasec (abfd)->next = core_regsec (abfd); - abfd->section_count = 3; - return abfd->xvec; + + fail: + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = NULL; + bfd_section_list_clear (abfd); + return NULL; } char * diff --git a/contrib/binutils/bfd/version.h b/contrib/binutils/bfd/version.h new file mode 100644 index 0000000..55d8900 --- /dev/null +++ b/contrib/binutils/bfd/version.h @@ -0,0 +1 @@ +#define BFD_VERSION_DATE 20020127 diff --git a/contrib/binutils/binutils/ChangeLog b/contrib/binutils/binutils/ChangeLog index 5470118..f091a47 100644 --- a/contrib/binutils/binutils/ChangeLog +++ b/contrib/binutils/binutils/ChangeLog @@ -1,13 +1,412 @@ -2001-10-17 Nick Clifton +2002-01-25 Jason R. Thorpe + + * objcopy.c (strip_usage): Document -d as an alias + --strip-debug. + + * size.c (usage): Document [-t | --totals] options. + (long_options): Add --totals option. + (main): If the [-t | --totals] option is specified and + the output format is Berkeley-style, print the total + text, data, and bss sizes of all objects listed. + (print_berkeley_format): If the [-t | --totals] option + is specified, track the total text, data, and bss + sizes. + * doc/binutils.texi (size): Document [-t | --totals] options. + (strip): Document -d as an alias for --strip-debug. + * NEWS: Mention new feature of size. + +2002-01-25 Nick Clifton + + * po/fr.po: Updated version. + * po/es.po: Updated version. + +2002-01-23 Nick Clifton + + * addr2line.c (usage): Update text to provide verbose + description of the command line options. + * ar.c (usage): Update text to provide verbose + description of the command line options. + (main): Accept -h and -H when running as ranlib. + * coffdump.c (show_usage): Update text to provide verbose + description of the command line options. + * dlltool.c (main): Accept -H as an alias for --help. + * nlmconv.c (show_usage): Update text to provide verbose + description of the command line options. + * nm.c (usage): Replace OPTIONS with option(s). + (main): Accept -H as an alias for --help. + * objcopy.c (strip_main): Accept -H as an alias for --help. + * objdump.c (main): Accept -v as an alias for --verbose. + * readelf.c (usage): Adjust format to match style used in + other binutils. + * size.c (usage): Update text to provide verbose description + of the command line options. + (main): Accept -v, -h and -H as command line options. + * srconv.c (show_usage): Update text to provide verbose + description of the command line options. + * strings.c (main): Accept -H and -v as command line options. + (usage): Update text to provide verbose description of the + command line options. + * sysdump.c (show_usage): Update text to provide verbose + description of the command line options. + * windres.c (usage): Adjust format to match style used in + other binutils. + + * coffdump.c: Fix formatting. + * nlmconv.c: Fix formatting. + * srconv.c: Fix formatting. + * sysdump.c: Fix formatting. + +2002-01-22 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2002-01-18 Andreas Jaeger + + * version.c (print_version): Update year. + +2002-01-17 Alan Modra + + * readelf.c (get_machine_name): Handle EM_PPC64. + (guess_is_rela): Here too. + +2002-01-17 Nick Clifton + + * po/binutils.pot: Regenerate. + * po/fr.po: Regenerate. + * po/tr.po: Regenerate. + +2002-01-16 Nick Clifton + + * po/tr.po: Import new version. + +2002-01-16 Alan Modra + + * readelf.c (get_ppc64_dynamic_type): New. + (get_dynamic_type): Call it. + +2002-01-15 Nick Clifton + + * objcopy.c (copy_usage): Use "options" instead of "switches". + (strip_usage): Use "options" instead of "switches". + * doc/binutils.texi (dlltool): Refer to "options" instead of + "switches". + +2002-01-14 Richard Earnshaw + + * MAINTAINERS: Add self as co-maintainer for the ARM code. + +2001-12-18 Nick Clifton + + * po/es.po: Import from translation project. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-09 Jason Thorpe + + * readelf.c (get_netbsd_elfcore_note_type): Use + NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH. + +2002-01-09 Jason Thorpe + + * readelf.c: Update copyright years. + (get_note_type): Return a const char *. + (get_netbsd_elfcore_note_type): New function. + (process_note): Use get_netbsd_elfcore_note_type to get + the note type string for NetBSD ELF core files. + +2002-01-06 Steve Ellcey + + * readelf.c (get_ia64_segment_type): Add support for macros. + (get_segment_type): Add support for IA64 specific macros. + +2001-12-20 Julian v. Bock + + * readelf.c (print_symbol): New function: Print a formatted symbol + name. If --wide is specified do not truncate it. + (dump_relocations): Use print_symbol() to print symbol names. + (process_symbol_table): Likewise. + (process_syminfo): Likewise. + (process_mips_specific): Likewise. + (usage): Document new feature of --wide switch. + * doc/binutils.texi (objdump): Document additional behaviour of + --wide. + +2001-12-18 Michael Snyder + + * objcopy.c (copy_file): Accept corefiles (format bfd_core). + (copy_object): Don't set the start address or flags of a core file. + (copy_section): Don't relocate a core file. Don't copy contents + if the input section has the contents flag set, but the output + section does not (which happens with the fake 'note' pseudo- + sections that BFD creates for corefiles). + +2001-12-18 Thiemo Seufer + + * readelf.c (get_machine_flags): Recognize header flags for ABI and + ASE extensions. More robust code for ISA checking. Ignore empty fields + in header flags for GNU extensions. + +2001-12-18 Alan Modra + + * objcopy.c (copy_archive): Set output bfd format outside the loop. + +2001-12-18 Nick Clifton + + * po/ja.po: Import from translation project. + * configure.in (ALL_LINGUAS): Add ja. + * configure: Regenerate. + +2001-12-18 Thiemo Seufer + + * addr2line.c (main): Protoype. + * ar.c (main): Protoype. + * nm.c (main): Protoype. + * objcopy.c (main): Protoype. + * objdump.c (main): Protoype. + * size.c (main): Protoype. + * strings.c (main): Protoype. + +2001-12-17 Alan Modra + + * readelf.c (symtab_shndx_hdr): New global. + (SECTION_HEADER_INDEX): Define. + (SECTION_HEADER_NUM): Define. + (SECTION_HEADER): Define. + (GET_ELF_SYMBOLS): Pass two params rather than three. + (get_32bit_elf_symbols): Take file and section args. Read and + use SHT_SYMTAB_SHNDX. + (get_64bit_elf_symbols): Likewise. + (dump_relocations): Use SECTION_HEADER to index "section_headers". + (process_section_headers): Likewise. Use SECTION_HEADER_NUM too. + Remember symtab_shdx_hdr. + (process_program_headers): Scan from index 1 for segment map. + (slurp_ia64_unwind_table): Use SECTION_HEADER to index + "section_headers". + (process_relocs): Likewise. Also adjust call to GET_ELF_SYMBOLS. + (process_unwind): Likewise. + (process_version_sections): Likewise. + (process_symbol_table): Likewise. + (display_debug_info): Likewise. + (process_dynamic_segment): Fake up a symtab section for changed + GET_ELF_SYMBOLS. + (get_symbol_index_type): Check SHN_LOOS before SHN_LORESERVE. + (process_program_headers): Kill signed/unsigned warning. + (load_debug_str): Likewise. + (display_debug_info): Likewise. + +2001-12-13 Jakub Jelinek + + * readelf.c (get_segment_type): Support PT_GNU_EH_FRAME. + +2001-12-11 Alan Modra + + * readelf.c (process_file_header): Print extended e_shnum and + e_shdtrndx values. Set elf_header values for same. + (get_32bit_section_headers): Add "num" arg to read "num" headers. + (get_64bit_section_headers): Likewise. + (process_section_headers): Update calls. + (get_file_header): Call get_32bit_section_headers or 64bit variant. + +2001-12-10 Jakub Jelinek + + * objcopy.c (setup_section): Copy entsize. + +2001-12-07 Geoffrey Keating + + * readelf.c (guess_is_rela): Add support for stormy16. + (dump_relocations): Likewise. + (get_machine_name): Likewise. + +2001-12-05 Nick Clifton + + * dllwrap.c (main) Replace multiple strings describing a + single error with a single, newline escaped sentence to permit + better translation into foreign languages. + + * readelf.c (get_elf_class): Remove internalionalisation of ELF + class names. + +2001-12-04 Thiemo Seufer + + * strings.c (get_char): Initialize value. + +2001-12-04 Thiemo Seufer + + * arlex.l: Silence compile warnings. + * arsup.h: Likewise. Fix formatting. + +2001-12-04 Jakub Jelinek + + * strings.c: Include config.h before bfd.h. + (file_off): New type. + (file_open): Define. + (print_strings): Use file_off instead of file_ptr. Print addresses + which don't fit into long correctly. + (get_char): Use file_off instead of file_ptr. Use getc_unlocked if + available. + (strings_file): Use file_off instead of file_ptr. Use file_open. + * configure.in: Check for getc_unlocked. + Check for fopen64 and whether _LARGEFILE64_SOURCE needs to + be defined for it. + * configure: Rebuilt. + * config.h.in: Rebuilt. + +2001-11-29 H.J. Lu + + * bucomm.c (make_tempname): Revert the changes made on + 2001-11-14 and 2001-11-12. They won't work with directories. + +2001-11-23 John David Anglin + + * binutils/Makefile.am (check-DEJAGNU): Pass CC_FOR_TARGET and + CFLAGS_FOR_TARGET to runtest in environment. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + +2001-11-28 Mike Stump + + * objcopy.c (setup_section): Preserve SEC_RELOC when + --set-section-flags is used. + +2001-11-19 Nick Clifton + + * readelf.c (do_debug_str): New variable. + (display_debug_str): New function: Display the contents of a + .debug_str section. + (load_debug_str): New function: Load in the contents of a + .debug_str section. + (free_debug_str): New function: Free the memory used by + load_debug_str(). + (fetch_indirect_string): Retrieve a string from the .debug_str + section. + (usage): Add -ws. + (parse_args): Accept -ws. + (process_section_headers): Allow the display of the .debug_str + section. + (read_and_display_attr_value): Use fetch_indirect_string. Show + offset into .debug_str section. + (display_debug_info): Use load_debug_str and free_debug_str. + (debug_displays): Add .debug_str. + * doc/binutils.texi: Document -ws. + +2001-11-19 Andreas Jaeger + + * testsuite/binutils-all/objdump.exp: Add x86-64. + +2001-11-15 Andreas Schwab + + * readelf.c: Fix warnings without terminating newline. + +2001-11-15 Alan Modra + + * doc/binutils.texi (objdump): Document ppc -M options. + +2001-11-14 Andreas Jaeger + + * doc/binutils.texi (objdump): Fix description to use x86-64. + +2001-11-14 Nick Clifton + + * bucomm.c (make_tempname): Use mkstemps instead of mkstemp, since + not all systems provide mkstemp. + +2001-11-14 Alan Modra + + * doc/binutils.texi (objdump): Document x86 -M options. + +2001-11-13 Keith Walker + + * readelf.c (read_and_display_attr_value): New function to + handle DW_FORM_indirect. + (read_and_display_attr): Use it. + +2001-11-13 Geoffrey Keating + + * readelf.c (display_debug_lines): Deal with unknown standard + opcodes. Handle DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin, + DW_LNS_set_isa. + +2001-11-13 Timothy Wall + + * MAINTAINERS: Add self as tic54x maintainer. This target + includes the IBM C54XDSP clone. + +2001-11-12 * Steven J. Hill + + * bucomm.c (make_tempname): Use mkstemp in place of mktemp. + +2001-11-09 Jeffrey A Law (law@cygnus.com) + + * unwind-ia64.c (unw_print_brmask): Fix ISO C portability glitch. + (unw_print_grmask, unw_print_frmask, unw_print_abreg): Likewise. + (unw_print_xyreg, unw_decode_x1, unw_decode_x2): Likewise. + (unw_decode_x3, unw_decode_r1, unw_decode_r2): Likewise. + (unw_decode_r3, unw_decode_p1, unw_decode_p2_p5): Likewise. + (unw_decode_p6, unw_decode_p7_p10, unw_decode_b1): Likewise. + (unw_decode_b2, unw_decode_b3_b4): Likewise. + + * readelf.c (get_elf_class): Fix ISO portability glitch. + (get_data_encoding, get_osabi_name, request_dump): Likewise. + +2001-11-07 Jakub Jelinek + + * readelf.c (debug_str, debug_str_size): New. + (display_debug_abbrev): If no abbrevs were read, skip the CU. + Call free_abbrevs. + (read_and_display_addr): Handle DW_FORM_strp. + (display_debug_info): Read .debug_str section if present, + so that DW_FORM_strp can be handled. + Fix test for non-existant .debug_abbrev section. + +2001-11-05 Jakub Jelinek + + * arlex.l: Accept `\' in filenames. Patch by . - * addr2line.1: Remove .TP macro from SYNOPSIS section - it - prevents successful translation to DocBook format. - * nlmconv.1: As above. - * nm.1: As above. - * objdump.1: As above. - * size.1: As above. - * strings.1: As above. - * strip.1: As above. + * arsup.c (ar_open): Prepend tmp- to basename, not whole path. + +2001-11-05 Martin Schwidefsky + + * MAINTAINERS: Add self as s390/s390x maintainer. + +2001-11-02 Tom Rix + + * MAINTAINERS: Add self as PPC XCOFF maintainer. + +2001-11-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add "fr" and "tr". + * configure: Regernate. + * po/fr.po: New file. + * po/tr.po: New file. + +2001-10-30 Hans-Peter Nilsson + + * MAINTAINERS: Add self as MMIX port maintainer. + * readelf.c: Include elf/mmix.h. + (guess_is_rela): MMIX is RELA. + (dump_relocations): Handle MMIX relocations. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + +2001-10-13 Nick Clifton + + * readelf.c (parse_args): Handle multiple options to the -w + switch. + +2001-10-12 Jakub Jelinek + + * readelf.c (get_section_type_name): Don't print SHT_ prefix for + LOPROC, LOOS and LOUSER. + +2001-10-11 J"orn Rennecke + + * MAINTAINERS: Update my email address. + +2001-10-03 Alan Modra + + * doc/Makefile.in: Regenerate. + * configure: Regenerate. 2001-10-02 Nick Clifton @@ -18,61 +417,503 @@ (debug_displays): Add .debug_pubtypes as a known, but not yet supported, debug section. +2001-10-02 Alan Modra + + * coffdump.c (PROGRAM_VERSION): Delete. + (main <'V'>): Call print_version. + * srconv.c: Likewise. + * sysdump.c: Likewise. + * version.c (program_version): Remove. + (print_version): Use BFD_VERSION_STRING. Just print the current + year in copyright message. + * addr2line.c (program_version): Remove unused declaration. + * objdump.c (display_target_tables): Use BFD_VERSION_STRING in + place of BFD_VERSION. + * Makefile.am (Makefile): Depend on bfd/configure.in. + (cplus-dem.o): Depend on Makefile. + Run "make dep-am". + * Makefile.in: Regenerate. + 2001-10-01 Nick Clifton - * readelf.c (display_debug_aranges): Warn about DWARF64 format - .debug_arange sections. + * readelf.c (display_debug_aranges): Detect and warn about DWARF64 + format .debug_arange sections. + (main): Add missing prototype. + +2001-09-30 Hans-Peter Nilsson + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate. + +2001-09-28 Richard Henderson + + * objdump.c (dump_section_header): Dump SEC_ARCH_BIT_0. + +2001-09-26 Alan Modra + + * bucomm.c (fatal): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, + VA_CLOSE. + (non_fatal): Likewise. + * objdump.c (objdump_sprintf): Likewise. + * readelf.c (error): Likewise. + (warn): Likewise. + +2001-09-25 Jakub Jelinek + + * readelf.c (do_wide): New. + (options): Add --wide. + (usage, parse_args): Likewise. + (process_program_headers): Put each segment on a single line if + --wide is given. + (process_section_headers): Put each section on a single line if + --wide is given. + * doc/binutils.texi: Document it. + * NEWS: Likewise. + +2001-09-25 Alan Modra + + * readelf.c (print_vma): Print 8 digits of low hex value. + +2001-09-24 Andreas Jaeger + + * nlmconv.c: Fix warnings about unused attributes and function + prototypes. + + * strings.c: Add prototype for get_char. + +2000-09-19 H.J. Lu + + * doc/Makefile.am ($(DEMANGLER_NAME).1): Try cxxfilt.man and + $(srcdir)/cxxfilt.man. + * doc/Makefile.in: Rebuild. + +2001-09-19 Alan Modra + + * objcopy.c (copy_main): Correct rename-section string parsing. + Consolidate new_name parsing, and error messages. + +2001-09-18 Bruno Haible + + * addr2line.c: Don't include . + (main): For gettext, also set the LC_CTYPE locate facet. + * ar.c (main): Likewise. + * coffdump.c (main): Likewise. + * dlltool.c: Include "safe-ctype.h" instead of . + (main): For gettext, also set the LC_CTYPE locate facet. + Use ISALNUM instead of isalpha/isdigit. + * dllwrap.c: Don't include . + (main): For gettext, also set the LC_CTYPE locate facet. + * nlmconv.c: Include "safe-ctype.h" instead of . + (main): For gettext, also set the LC_CTYPE locate facet. + Use TOUPPER instead of islower/toupper. + * nlmheader.y: Include "safe-ctype.h" instead of . + (yylex): Use ISSPACE/ISALNUM instead of isspace/isalnum. + Use TOUPPER instead of islower/toupper. + * nm.c (main): For gettext, also set the LC_CTYPE locate facet. + * objcopy.c (main): Likewise. + * objdump.c: Include "safe-ctype.h" instead of . + (disassemble_bytes): Use ISPRINT instead of isprint. + (dump_section_stabs): Use ISDIGIT instead of isdigit. + (dump_data): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * rclex.l: Include "safe-ctype.h" instead of . + (cpp_line, handle_quotes): Use ISSPACE instead of isspace. + * rcparse.y: Include "safe-ctype.h" instead of . + Use TOUPPER instead of islower/toupper. + * readelf.c (main): For gettext, also set the LC_CTYPE locate facet. + * resrc.c: Include "safe-ctype.h" instead of . + (write_rc_accelerators): Use ISPRINT instead of isprint. + (write_rc_rcdata): Likewise. + * size.c (main): For gettext, also set the LC_CTYPE locate facet. + * srconv.c (main): Likewise. + * stabs.c: Include "safe-ctype.h" instead of . + (parse_number): Use ISDIGIT/ISUPPER/ISLOWER instead of + isdigit/isupper/islower. + (parse_stab_string, parse_stab_type, parse_stab_argtypes, + parse_stab_array_type, stab_demangle_count, stab_demangle_get_count, + stab_demangle_prefix, stab_demangle_qualified, + stab_demangle_template, stab_demangle_type, + stab_demangle_fund_type): Use ISDIGIT instead of isdigit. + * strings.c: Include "safe-ctype.h" instead of . + (isgraphic): Use ISPRINT instead of isascii/isprint. + (main): Remove HAVE_LC_MESSAGES dependency. + * sysdump.c: Include "safe-ctype.h" instead of . + (pbarray): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * windres.c: Include "safe-ctype.h" instead of . + (format_from_filename): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * winduni.c: Include "safe-ctype.h" instead of . + (unicode_print): Use ISPRINT instead of isprint. + * wrstabs.c: Include "safe-ctype.h" instead of . + (stab_variable): Use ISDIGIT instead of isdigit. + +2001-09-18 Alan Modra + + * ar.c (print_contents): Cast args of bfd_seek to the right types. + Replace bfd_read call with call to bfd_bread. + (extract_file): Likewise. + + * objdump.c (dump_section_header): Cast section->filepos to + unsigned long to suit printf format string. + * readelf.c (process_section_headers): Similarly for sh_offset. + (process_unwind): Likewise. + +2001-09-14 Nick Clifton + + * strings.c (encoding, encoding_bytes): New variables. + (long_options): Add --encoding. + (main): Accept -e and --encoding. + (get_char): New function. Read a, possibly wide, character from + the input stream. + (print_strings): Use get_char(). + (usage): Document new command line option. + * doc/binutils.texi: Document new command line option. + * NEWS: Announce new command line option. + +2001-09-12 Alexandre Oliva + + * readelf.c (guess_is_rela, dump_relocations, get_machine_name, + get_machine_flags): Added EM_M32R, EM_D10V, EM_V850, EM_D30V, + EM_MN10200, EM_MN10300, EM_FR30, EM_AVR_OLD and EM_PJ_OLD. + Removed EM_CYGNUS_ARC. + +2001-09-04 Jeffrey A Law (law@cygnus.com) + + * readelf.c: Include elf/h8 for H8 series definitions. + (guess_is_rela): H8 series if RELA. + (dump_relocations): Handle H8 series relocations. + +2001-08-31 Eric Christopher + + * readelf.c (get_machine_flags): Remove E_MIPS_MACH_MIPS32_4K. + +2001-08-29 Peter Targett + + * MAINTAINERS: Include ARC Maintainer. + +2001-08-29 Ben Elliston + + * stabs.c (stab_demangle_template): Initialise s4. + +2001-08-27 Alan Modra + + * readelf.c (dump_relocations): Recognise EM_PPC64. + +2001-08-26 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_32BITMODE. + +2001-08-25 H.J. Lu + + * nm.c (print_width): New. + (display_rel_file): Set `print_width' according to + bfd_sprintf_vma. + (print_symbol_info_bsd): Check `print_width' instead of BFD64. + +2001-08-24 Alexandre Oliva + + * objcopy.c (use_alt_mach_code): New variable. + (OPTION_ALT_MACH_CODE): Define. + (copy_options): Added --alt-machine-code. + (copy_main): Handle it. + (copy_object): Switch to alternate machine code if requested. + * doc/binutils.texi: Document new option. + * NEWS: Likewise. + +2001-08-22 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_UCODE. + +2001-08-21 H.J. Lu + + * readelf.c (dump_relocations): Support ELF64 on 32bit hosts. + (display_debug_info): Cast for 64bit hosts. + (display_debug_frames): Likewise. + (process_mips_specific): Likewise. + +2001-08-21 Andreas Jaeger + + * coffgrok.h: Add missing parameter for prototype of coff_grok. + + * sysdump.c: Add missing prototypes. + * srconv.c: Likewise. + * unwind-ia64.c: Likewise. + * coffdump.c: Likewise. + + * sysinfo.y: Print prototypes, include . + + * coffgrok.c: Add missing prototypes, include libiberty.h instead + of declaring xcalloc. + +2001-08-10 H.J. Lu + + * nm.c (print_value): Add one arg, bfd *. + (print_value): Replace fprintf_vma with bfd_fprintf_vma. + (print_symbol_info_bsd): Also pass `abfd' to print_value (). + (print_symbol_info_sysv): Likewise. + (print_symbol_info_posix): Likewise. + + * objdump.c (dump_section_header): Replace printf_vma with + bfd_printf_vma. + (print_section_stabs): Likewise. + (dump_bfd_header): Likewise. + (objdump_print_value): Replace sprintf_vma with + bfd_sprintf_vma. + (disassemble_bytes): Likewise. + (dump_reloc_set): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-09 Alan Modra + + * readelf.c: Add missing prototypes. + * objdump.c: Likewise. Format existing prototypes. + +2001-08-08 Alexandre Oliva + + * readelf.c (display_debug_info): Add to abbrev_offset the addend + of any RELA relocation for the abbrev_offset memory location that + refers to the .debug_abbrev section symbol. + +2001-08-07 H.J. Lu + + * readelf.c (process_file): Return 0 if OK, otherwise return 1. + (main): Return process_file (). 2001-08-05 Philip Blundell - * binutils.texi (objdump): Fix typos. Use "Thumb" not "THUMB". + * doc/binutils.texi: Use "Thumb" not "THUMB". + +2001-08-03 John Healy + + Patch suggested by Frank Eigler . + * objdump.c (disassemble_data): Fill in section member of the + disasm_info structure. + +2001-08-03 Tom Walsh -2001-07-31 David O'Brien + * configure.in: Added --with-windres option. + * configure: Regenerated. - * readelf.1: New file. +2001-07-11 Stephane Carrez + + * doc/binutils.texi: Use @command{name} for commands; + use @option{-opt} for options; use @table @env for list of options; + remove spaces arround [ | ] in synopsis. + + * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for the + center title. + +2001-07-31 Nick Clifton + + * objcopy.c: Fix formatting. + (section_rename): New structure. + (OPTION_RENAME_SECTION): New switch. + (copy_usage): Document new switch. + (add_section_rename): New function: Add a node to the section + rename list. + (find_section_rename): New function: Find the new name and + flags for a section. + (setup_section): Call find_section_name to determine the name + of the output section. + (copy_main): Handle OPTION_RENAME_SECTION. + * binutils.texi: Document new switch. + * NEWS: Mention new switch. + +2001-07-30 Nick Clifton + + * README: Rename bug-gnu-utils@gcc.org to bug-binutils@gcc.org. + * MAINTAINERS: Rename bug-gnu-utils@gcc.org to + bug-binutils@gcc.org. + +2001-07-28 Matthias Kramm + + * bucomm.c (list_supported_architectures): New function. + * bucomm.h (list_supported_architectures): Declare. + * objdump.c (usage): Call the above. + +2001-07-25 Dave Brolley + + * objdump.c (SKIP_ZEROES): Only define it if it is not already defined. + (SKIP_ZEROES_AT_END): Only define it if it is not already defined. + +2001-07-19 Nick Clifton + + * README: Update for 2.11. Change bug reporting email address. + * MAINTAINERS: Tidy up. Change bug reporting email address. + +2001-07-16 DJ Delorie + + * resres.c (write_res_header): Align header size. + (res_align_file): Calculate alignment correctly. + + * rcparse.y (styles): use SUBLANG_SHIFT instead of 8 (or the more + correct 10). + * resrc.c (write_rc_resource): Likewise. + * windres.h (SUBLANG_SHIFT): Define - as 10. + +2001-07-15 Nick Clifton + + * MAINTAINERS: Add Christian Groessler as maintainer for z8k port. + +2001-07-11 Nick Clifton + + * MAINTAINERS: Add notes about branch checkins. + +2001-07-05 Daniel Berlin + + * readelf.c (display_debug_macinfo): New function, display + .debug_macinfo section. + (do_debug_macinfo): New variable. + (parse_args): Handle "-w[mM]" to mean display macro info. + (process_section_headers): Handle debug_macinfo. + (debug_displays): Replace unsupported function with macinfo + function for .debug_macinfo display. + * doc/binutils.texi: Document new command line switch. + * NEWS: Document new feature of readelf. + +2001-07-05 H.J. Lu + + * objcopy.c (filter_symbols): Don't turn undefined symbols + into local. + +2001-07-03 H.J. Lu + + * doc/Makefile.am (addr2line.1): Use addr2line.pod instead of + $@.pod. + (ar.1): Likewise. + (dlltool.1): Likewise. + (nlmconv.1): Likewise. + (nm.1): Likewise. + (objcopy.1): Likewise. + (objdump.1): Likewise. + (ranlib.1): Likewise. + (readelf.1): Likewise. + (size.1): Likewise. + (strings.1): Likewise. + (strip.1): Likewise. + (windres.1): Likewise. + (cxxfilt.man): Use $(DEMANGLER_NAME).pod instead of $@.pod. + ($(DEMANGLER_NAME).1): Also substitute cxxfilt with + $(DEMANGLER_NAME). + (as.1): Removed. + * doc/Makefile.in: Regenerated. + +2001-07-03 Nick Clifton + + * MAINTAINERS: Change MIPS maintainer to Eric Christopher. + +2001-07-01 Daniel Berlin + + * readelf.c: Support DWARF 2.1 tags, encodings, languages. 2001-06-29 James Cownie * readelf.c: Support DWARF 2.1 attributes. -2001-06-27 Nick Clifton +2001-06-28 Alan Modra + + * readelf.c (GET_DATA_ALLOC): Remove. + (GET_DATA): Remove. + (get_data): New function combining above macros, with an extra + test for zero size. + (slurp_rela_relocs): Use get_data, and catch error return. + (slurp_rel_relocs): Likewise. + (get_32bit_program_headers): Likewise. + (get_64bit_program_headers): Likewise. + (get_32bit_section_headers): Likewise. + (get_64bit_section_headers): Likewise. + (get_32bit_elf_symbols): Likewise. + (get_64bit_elf_symbols): Likewise. + (process_section_headers): Likewise. + (process_relocs): Likewise. + (slurp_ia64_unwind_table): Likewise. + (process_unwind): Likewise. + (get_32bit_dynamic_segment): Likewise. + (get_64bit_dynamic_segment): Likewise. + (process_dynamic_segment): Likewise. + (process_version_sections): Likewise. + (process_symbol_table): Likewise. + (dump_section): Likewise. + (display_debug_info): Likewise. + (display_debug_section): Likewise. + (process_section_contents): Likewise. + (process_corefile_note_segment): Likewise. + (process_mips_specific): Likewise. Also free econf32, econf64. - * objcopy.c (strip_main): Accept -o command line switch. +2001-06-25 Alan Modra -2001-06-11 Alan Modra + * readelf.c (dump_relocations): Print "bad symbol index" if + symtab == NULL with non-zero symtab_index. + (process_relocs): Don't bomb if reloc section has no symsec. - Merge from mainline. - 2001-02-27 Alan Modra - * configure.in (BFD_VERSION): New. - (AM_INIT_AUTOMAKE): Use $BFD_VERSION. - * configure: Regenerate. +2001-06-24 H.J. Lu - 2001-04-27 Michal Svec - * strings.c (isgraphic): Do not use isascii() unless it is needed - for isprint() to work. - (main): Set the locale domain to LC_ALL not just LC_MESSAGES. + * objcopy.c (strip_main): Revert the change made on 2001-05-30 + by accident. + (copy_main): Apply the the change made to strip_main on + 2001-05-30 by accident. - 2001-04-10 Alan Modra - * nm.c (print_symbol_info_bsd): Use a simple printf string. +2001-06-23 Andreas Jaeger - 2001-02-07 Todd Vierling - * bucomm.c (bfd_target_vector): Change extern array to pointer. - * objdump.c (bfd_target_vector): Likewise. + * unwind-ia64.c (unw_decode_x1): Add unused attribute for + parameter 'code'. + (unw_decode_x2): Likewise. + (unw_decode_x3): Likewise. + (unw_decode_x4): Likewise. -2001-06-10 Philip Blundell +2001-06-23 Ben Elliston - * configure.in: Set version to 2.11.1. - * configure: Regenerate. + * MAINTAINERS: Add myself as M88k maintainer. -2001-06-09 Alan Modra +2001-06-22 Jocelyn Mayer + + * objcopy.c (strip_main): Support -o or --output-file command lien + switch. - * NEWS: Mention hppa64-elf. Add binutils-2.11 marker. +2001-06-19 H.J. Lu + + * doc/Makefile.in: Regenerated. + +2001-06-19 Nick Clifton + + * readelf.c: Restore formatting. + +2001-06-18 H.J. Lu & Nick Clifton + + * Makefile.am: Move documentation into doc subdirectory. + * Makefile.in: Regenerated. + * binutils.texi: Move into doc subdirectory. + * addr2line.1: Removed. + * ar.1: Likewise. + * dlltool.1: Likewise. + * nlmconv.1: Likewise. + * nm.1: Likewise. + * objcopy.1: Likewise. + * objdump.1: Likewise. + * ranlib.1: Likewise. + * readelf.1: Likewise. + * size.1: Likewise. + * strings.1: Likewise. + * strip.1: Likewise. + * windres.1: Likewise. + * cxxfilt.man: Likewise. + * doc: New Directory. + * doc/Makefile.am: New file. + * doc/Makefile.in: Generate. - * MAINTAINERS: Replace with mainline version. +2001-06-09 Alan Modra + + * NEWS: Fix a typo. Mention hppa64-elf. Add binutils-2.11 marker. -2001-06-07 Alan Modra +2001-06-01 Alan Modra - * Most files: Update copyright notices. + * MAINTAINERS: Update my email address. 2001-05-30 Honda Hiroki @@ -83,13 +924,18 @@ * objcopy.1: Regenerate. * NEWS: Announce new feature. -2001-05-28 Philip Blundell +2001-05-28 Andreas Jaeger - From 2001-05-28 Andreas Jaeger * readelf.c (display_debug_frames): Fix warnings: Remove unused variables, fix format strings. - From 2001-05-16 Richard Henderson +2001-05-28 Nick Clifton + + * objdump.c (disassemble_bytes): Remove section VMA adjustment + when computing the address of the line to show. + +2001-05-16 Richard Henderson + * readelf.c (do_debug_frames_interp): New. (byte_get_little_endian): If BFD64, always read entire 8-byte fields. (byte_get_big_endian): Likewise. @@ -101,77 +947,182 @@ unless do_debug_frames_interp. (debug_displays): Remove duplicate .debug_frame. - From 2001-05-15 Ralf Baechle +2001-05-15 Ralf Baechle + * readelf.c: Replace uses of EM_MIPS_RS4_BE with EM_MIPS_RS3_LE. The former constant was never in active use and is used otherwise by the ABI. - From 2001-05-11 Jakub Jelinek +2001-05-11 Jakub Jelinek + * readelf.c (process_unwind): Print all unwind sections, not just one. - From 2001-05-07 Thiemo Seufer +2001-05-07 Thiemo Seufer + * readelf.c (process_unwind): Remove const specifier. - From 2001-03-30 H.J. Lu +2001-04-27 Michal Svec + + * strings.c (isgraphic): Do not use isascii() unless it is needed + for isprint() to work. + (main): Set the locale domain to LC_ALL not just LC_MESSAGES. + +2001-04-27 Johan Rydberg + + * NEWS: Announce support for OpenRISC. + +2001-04-17 Danny Smith + + * dlltool.c (do_default_excludes): Initialise to true. + +2001-04-10 Alan Modra + + * MAINTAINERS: Update my email address + * nm.c (print_symbol_info_bsd): Use a simple printf string. + +2001-04-05 Hans-Peter Nilsson + + * readelf.c (display_debug_lines): Fix typo for "Prologue". + +2001-03-30 H.J. Lu + * readelf.c (process_unwind): Just return if do_unwind is 0. - From 2001-03-29 H.J. Lu +2001-03-28 Roger Sayle + + * dlltool.c (make_one_lib_file): Fix section flags for + .text, .data and .bss in stub ds*.o files to match those + generated by gas. + +2001-03-29 H.J. Lu + * readelf.c (process_unwind): Only do unwind sections for IA64. - From 2001-02-28 Nick Clifton +2001-03-28 H.J. Lu + + * Makefile.am ($(srcdir)/dlltool.1): Remove the extra target. + * Makefile.in: Regenerate. + +2001-03-26 Andreas Jaeger + + * binutils.texi (nm): Fix texi syntax. + +2001-03-25 Stephane Carrez + + * binutils.texi: Put @c man begin and @c man end indications + to generate man pages using texi2pod and pod2man. Put @c man title + to identify each man. Add SEEALSO entries. + * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variable. + (man_MANS): Add dlltool.1, nlmconv.1, readelf.1, windres.1, + sort the list. + (*.1): Build the man pages from binutils.texi. + * Makefile.in: Regenerate. + +2001-03-13 Eric Kohl + + * defparse.y (opt_equal_name): allow "." in name. + * dlltool.c (def_exports): Added ability to generate forwarded exports. + (gen_exp_file): Likewise. + +2001-03-12 Stefan Geuken + + * NEWS: Document addition of -B switch to objcopy. + * binutils.texi: Document addition of -B switch to objcopy. + * objcopy.c: (copy_options): Add --binary-architecture. + (copy_usage): Document -B/--binary-architecture. + (copy_main): Support -B/--binary-architecture. Set + bfd_external_binary_architecture. + +2001-03-11 Andreas Jaeger + + * readelf.c (guess_is_rela): Handle EM_S390_OLD. + (dump_relocations): Likewise. + (get_machine_name): Likewise. + +2001-02-28 Nick Clifton + * readelf.c: (struct unw_aux_info): Remove const modifier for 'strtab' field. (process_unwind): Remove non-K&R compliant LHS type cast in call to GET_DATA_ALLOC macro. - From 2001-02-11 Michael Sokolov +2001-02-28 Philip Blundell + + * readelf.c (decode_ARM_machine_flags): Explicitly mention which + ABI is in use; remove ambiguity between the "unknown" EABI and + unrecognised ABIs. Handle version 2 ARM EABI. Update uses of + renamed EF_xx constants. + +2001-02-27 Alan Modra + + * configure.in (BFD_VERSION): New. + (AM_INIT_AUTOMAKE): Use $BFD_VERSION. + * configure: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2001-02-14 Nick Clifton + + * MAINTAINERS: Add "Obvious Fix" rule. + +2001-02-11 Michael Sokolov + + * unwind-ia64.c: Don't use ANSI C preprocessor stringisation and string + literal concatenation. + +2001-02-11 Michael Sokolov + * readelf.c (struct unw_aux_info): Remove const from the info member. (process_unwind): Don't type-cast the third argument to the GET_DATA_ALLOC macro. - From 2001-02-11 Nick Clifton +2001-02-11 Nick Clifton + * readelf.c (dump_relocations): Free corrected allocated array. (process_unwind): Fix compile time warning. - From 2001-02-07 David Mosberger - * readelf.c (process_unwind): New function. - (slurp_ia64_unwind_table): Ditto. - (dump_ia64_unwind): Ditto. - (find_symbol_for_address): Ditto. - (slurp_rela_relocs): New function (split off from dump_relocations()). - (slurp_rel_relocs): Ditto. - (parse_args): Handle '-u' option. - * unwind-ia64.c: New file. - * unwind-ia64.h: New file. - * Makefile.am: Include unwind-ia64.c in readelf build. - * Makefile.in: Regenerate. - * po/binutils.pot: Regenerate. +2001-02-10 Nick Clifton -2001-04-06 Hans-Peter Nilsson + * binutils.texi: Document new --unwind option to readelf. - * readelf.c (display_debug_lines): Fix typo for "Prologue". +2001-02-09 Martin Schwidefsky -2001-03-16 Philip Blundell + * readelf.c: Add linux target for S/390. - * configure: Regenerate. - -2001-03-11 Philip Blundell +2001-02-10 Alan Modra - * configure.in: Set version to 2.11. + * nm.c (print_symbol_info_bsd): Don't #ifdef inside printf in case + printf is a macro. -2001-02-13 Hans-Peter Nilsson +2001-02-08 Hans-Peter Nilsson * acinclude.m4 (AM_PROG_LEX): Override installed definition. * aclocal.m4: Regenerate. * configure: Regenerate. -2001-02-10 Alan Modra +2001-02-07 Todd Vierling - * nm.c (print_symbol_info_bsd): Don't #ifdef inside printf in case - printf is a macro. + * bucomm.c (bfd_target_vector): Change extern array to pointer. + * objdump.c (bfd_target_vector): Likewise. + +2001-02-07 David Mosberger + + * readelf.c (process_unwind): New function. + (slurp_ia64_unwind_table): Ditto. + (dump_ia64_unwind): Ditto. + (find_symbol_for_address): Ditto. + (slurp_rela_relocs): New function (split off from dump_relocations()). + (slurp_rel_relocs): Ditto. + (parse_args): Handle '-u' option. + + * unwind-ia64.c: New file. + * unwind-ia64.h: New file. + * Makefile.am: Include unwind-ia64.c in readelf build. + * Makefile.in: Regenerate. + * po/binutils.pot: Regenerate. 2001-02-04 Philip Blundell @@ -269,7 +1220,7 @@ * readelf.c: Fix formatting. -Mon Dec 11 14:30:21 MET 2000 Jan Hubicka +2000-12-11 Jan Hubicka * MAINTAINERS: Add myself and Andreas Jaeger as x86_64 maintainer. @@ -306,7 +1257,7 @@ Mon Dec 11 14:30:21 MET 2000 Jan Hubicka 2000-11-28 Hans-Peter Nilsson - * MAINTAINERS: Add Jörn Rennecke and self as SH maintainers. + * MAINTAINERS: Add Jörn Rennecke and self as SH maintainers. Change sourceware.cygnus.com to sources.redhat.com. Fix typo for "amongst". @@ -802,13 +1753,13 @@ Mon Dec 11 14:30:21 MET 2000 Jan Hubicka * srconv.c: Likewise. * sysdump.c: Likewise. -Sun Apr 23 14:23:26 2000 Denis Chertykov +2000-04-23 Denis Chertykov * readelf.c (guess_is_rela): AVR uses RELA relocations. (get_machine_name): machine name for EM_AVR added. -Fri Apr 21 13:20:53 2000 Richard Henderson - David Mosberger +2000-04-21 Richard Henderson + David Mosberger * Makefile.am (readelf.o): Add elf/ia64.h. * Makefile.in: Rebuild. @@ -833,7 +1784,7 @@ Fri Apr 21 13:20:53 2000 Richard Henderson `strftime' since strftime is not available on all systems. (process_mips_specific): Ditto. -Fri Apr 7 15:56:57 2000 Andrew Cagney +2000-04-07 Andrew Cagney * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add --enable-build-warnings option. diff --git a/contrib/binutils/binutils/ChangeLog-9197 b/contrib/binutils/binutils/ChangeLog-9197 index d989ae4..1ed5416 100644 --- a/contrib/binutils/binutils/ChangeLog-9197 +++ b/contrib/binutils/binutils/ChangeLog-9197 @@ -3342,7 +3342,7 @@ Fri Apr 29 09:50:38 1994 Steve Chamberlain (sac@cygnus.com) Wed Apr 27 11:25:18 1994 Steve Chamberlain (sac@cygnus.com) * Makefile.in (syslex, sysinfo): Use CC_FOR_BUILD. - * coffdump.c, coffgroc.c, coffgrog.h, srconv.c, sysdump.c, + * coffdump.c, coffgrok.c, coffgrok.h, srconv.c, sysdump.c, sysroff.info: Major changes. Tue Apr 26 18:18:24 1994 Stan Shebs (shebs@andros.cygnus.com) @@ -4347,7 +4347,7 @@ Fri May 28 15:01:24 1993 Per Bothner (bothner@rtl.cygnus.com) Thu May 27 16:58:31 1993 Jeffrey Osier (jeffrey@cygnus.com) - * biutils.texi: revised c++filt chapter + * binutils.texi: revised c++filt chapter Wed May 26 17:24:17 1993 Ian Lance Taylor (ian@cygnus.com) @@ -4528,7 +4528,7 @@ Mon Feb 22 22:52:10 1993 Per Bothner (bothner@rtl.cygnus.com) Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com) - * binutils/testsuite: made modifications to testcases, etc., to allow + * testsuite: made modifications to testcases, etc., to allow them to work properly given the reorganization of deja-gnu and the relocation of the testcases from deja-gnu to a "tool" subdirectory. @@ -4539,7 +4539,7 @@ Mon Feb 22 10:27:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) - * binutils/testsuite: Initial creation of binutils/testsuite. + * testsuite: Initial creation of binutils/testsuite. Migrated dejagnu testcases and support files for testing nm to binutils/testsuite from deja-gnu. These files were moved "as is" with no modifications. This migration is part of a major overhaul @@ -4642,7 +4642,7 @@ Mon Nov 2 12:42:11 1992 Ian Lance Taylor (ian@cygnus.com) Thu Oct 15 13:57:35 1992 Per Bothner (bothner@cygnus.com) - * binutils.tex: Document yesterday's changes to strip and copy. + * binutils.texi: Document yesterday's changes to strip and copy. Wed Oct 14 13:22:14 1992 Per Bothner (bothner@cygnus.com) @@ -5130,7 +5130,6 @@ Fri Oct 11 04:12:28 1991 John Gilmore (gnu at cygnus.com) Restructure configuration scheme for bfd, binutils, ld. - * include/sys/h-*.h: Move to bfd/hosts/h-*.h. * configure.in: Revise to symlink sysdep.h to ../bfd/hosts/h-xxx.h. Change some config names to match other dirs. * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO() diff --git a/contrib/binutils/binutils/MAINTAINERS b/contrib/binutils/binutils/MAINTAINERS index 9c44f77..b930f9c 100644 --- a/contrib/binutils/binutils/MAINTAINERS +++ b/contrib/binutils/binutils/MAINTAINERS @@ -1,86 +1,111 @@ ========= Binutils Maintainers ========= This is the list of individuals responsible for maintenance and update -of the "binutils" module, which includes the bfd, binutils, include, -gas, gprof, ld, and opcodes subdirectories. The home page for binutils -is http://sources.redhat.com/binutils/ and patches should be sent to -binutils@sources.redhat.com with "[patch]" as part of the subject. +of the GNU Binary Utilities project. This includes the linker (ld), +the assembler (gas), the profiler (gprof), a whole suite of other +programs (binutils) and the libraries that they use (bfd and +opcodes). This project shares a common set of header files with the +GCC and GDB projects (include), so maintainership of those files is +shared amoungst the projects. -Note - patches to the top level configure.in and config.sub scripts -should be sent to config-patches@gnu.org and not to the binutils list. +The home page for binutils is: - --------- Blanket Write Privs --------- + http://www.gnu.org/software/binutils/binutils.html + +and patches should be sent to: + + bug-binutils@gnu.org + +with "[Patch]" as part of the subject line. Note - patches to the +top level configure.in and config.sub scripts should be sent to: + + config-patches@gnu.org -Nick Clifton (head maintainer) -Richard Henderson -Ian Taylor -Jeff Law -Jim Wilson -DJ Delorie -Alan Modra -Michael Meissner +and not to the binutils list. - --------- Maintainers --------- + --------- Blanket Write Privs --------- -Maintainers are individuals who are responsible for, and have permission -to check in changes in, certain subsets of the code. Note that -maintainers still need approval to check in changes outside of the -immediate domain that they maintain. +The following people have permission to check patches into the +repository without obtaining approval first: + + Nick Clifton (head maintainer) + Richard Henderson + Ian Taylor + Jeff Law + Jim Wilson + DJ Delorie + Alan Modra + Michael Meissner + + --------- Maintainers --------- + +Maintainers are individuals who are responsible for, and have +permission to check in changes in, certain subsets of the code. Note +that maintainers still need approval to check in changes outside of +the immediate domain that they maintain. If there is no maintainer for a given domain then the responsibility -falls to the head maintainer (above). If there are several maintainers -for a given domain then responsibility falls to the first maintainer. -The first maintainer is free to devolve that responsibility among the -other maintainers. - -ARM Nick Clifton -AVR Denis Chertykov -CRIS Hans-Peter Nilsson -HPPA elf32 Alan Modra -IA64 Jim Wilson -i860 Jason Eckhardt -ix86 Alan Modra -ix86 COFF,PE DJ Delorie -ix86 H.J.Lu -ix86 INTEL MODE Diego Novillo -MN10300 Eric Christopher -MIPS Ulf Carlsson -PPC Geoff Keating -SH Jörn Rennecke -SH Hans-Peter Nilsson -SPARC Jakub Jelinek -68HC11 68HC12 Stephane Carrez -DWARF2 Jason Merrill -x86_64 Jan Hubicka -x86_64 Andreas Jaeger - - --------- CGEN Maintainers ------------- +falls to the head maintainer (above). If there are several +maintainers for a given domain then responsibility falls to the first +maintainer. The first maintainer is free to devolve that +responsibility among the other maintainers. + + ARC Peter Targett + ARM Nick Clifton + ARM Richard Earnshaw + AVR Denis Chertykov + CRIS Hans-Peter Nilsson + DWARF2 Jason Merrill + HPPA elf32 Alan Modra + IA64 Jim Wilson + x86_64 Jan Hubicka + x86_64 Andreas Jaeger + i860 Jason Eckhardt + ix86 Alan Modra + ix86 COFF,PE DJ Delorie + ix86 H.J.Lu + ix86 INTEL MODE Diego Novillo + M68HC11 M68HC12 Stephane Carrez + MN10300 Eric Christopher + MIPS Eric Christopher + M88k Ben Elliston + MMIX Hans-Peter Nilsson + PPC Geoff Keating + PPC XCOFF Tom Rix + s390, s390x Martin Schwidefsky + SH Jörn Rennecke + SH Hans-Peter Nilsson + SPARC Jakub Jelinek + TIC54X Timothy Wall + z8k Christian Groessler + + --------- CGEN Maintainers ------------- CGEN is a tool for building, amongst other things, assemblers, -disassemblers and simulators from a single description of a CPU. It -creates files in several of the binutils directories, but it is -mentioned here since there is a single group that maintains CGEN and -the files that it creates. +disassemblers and simulators from a single description of a CPU. +It creates files in several of the binutils directories, but it +is mentioned here since there is a single group that maintains +CGEN and the files that it creates. If you have CGEN related problems you can send email to; - cgen@sources.redhat.com + cgen@sources.redhat.com The current CGEN maintainers are: Doug Evans, Ben Elliston, Frank Eigler - --------- Write After Approval --------- + --------- Write After Approval --------- Individuals with "write after approval" have the ability to check in changes, but they must get approval for each change from someone in one of the above lists (blanket write or maintainers). [It's a huge list, folks. You know who you are. If you have the - *ability* to do binutils checkins, you're in this group. Just remember - to get approval before checking anything in.] + *ability* to do binutils checkins, you're in this group. Just + remember to get approval before checking anything in.] - ------------- Obvious Fixes ------------- + ------------- Obvious Fixes ------------- Fixes for obvious mistakes do not need approval, and can be checked in right away, but the patch should still be sent to the binutils list. @@ -90,3 +115,15 @@ spelling mistakes, blatantly incorrect code (where the correct code is also blatantly obvious), and so on. Obvious fixes should always be small, the larger they are, the more likely it is that they contain some un-obvious side effect or consequence. + + --------- Branch Checkins --------- + +If a patch is approved for check in to the mainline sources, it can +also be checked into the current release branch. Normally however +only bug fixes should be applied to the branch. New features, new +ports, etc, should be restricted to the mainline. (Otherwise the +burden of maintaining the branch in sync with the mainline becomes too +great). If you are uncertain as to whether a patch is appropriate for +the branch, ask the branch maintainer. This is: + + Philip Blundell diff --git a/contrib/binutils/binutils/Makefile.am b/contrib/binutils/binutils/Makefile.am index 823c68b..366f544 100644 --- a/contrib/binutils/binutils/Makefile.am +++ b/contrib/binutils/binutils/Makefile.am @@ -5,7 +5,7 @@ INTLLIBS = @INTLLIBS@ AUTOMAKE_OPTIONS = cygnus dejagnu -SUBDIRS = po +SUBDIRS = doc po tooldir = $(exec_prefix)/$(target_alias) @@ -52,9 +52,6 @@ DLLWRAP_PROG=dllwrap SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -man_MANS = ar.1 nm.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 \ - objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_NAME).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) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ @@ -142,17 +139,15 @@ check-DEJAGNU: site.exp 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); \ + CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \ + $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ + $(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) $(INTLLIBS) size_SOURCES = size.c $(BULIBS) @@ -182,7 +177,7 @@ stamp-under: Makefile $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c touch stamp-under -cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h +cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h Makefile $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c cxxfilt_SOURCES = @@ -277,14 +272,16 @@ dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) -DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ +EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c -diststuff: $(DISTSTUFF) info +diststuff: $(EXTRA_DIST) info DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ site.exp site.bak +Makefile: $(BFDDIR)/configure.in + # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h @@ -330,23 +327,8 @@ dep-am: DEP .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 - -MAINTAINERCLEANFILES = config.texi -$(DEMANGLER_NAME).1: cxxfilt.man Makefile - sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' < $(srcdir)/cxxfilt.man \ - > $(DEMANGLER_NAME).1 - -MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum \ - abcdefgh* +MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* mostlyclean-local: -rm -rf tmpdir @@ -380,148 +362,171 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # 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)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ - arsup.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h +ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h arsup.h $(INCDIR)/filenames.h arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - arsup.h $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ + $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h +ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/filenames.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)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/getopt.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.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)/symcat.h \ + $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ budbg.h $(INCDIR)/filenames.h objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/getopt.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.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 \ + $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/progress.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h + $(INCDIR)/safe-ctype.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 \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.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)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + budbg.h +size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h srconv.o: srconv.c bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.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 + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - sysroff.h sysroff.c + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h sysroff.h \ + sysroff.c version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.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 + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/obstack.h \ - windres.h winduni.h + $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windres.h \ + winduni.h resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + windres.h winduni.h rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ winduni.h +winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/m68k.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/d10v.h \ - $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/i960.h \ + $(INCDIR)/symcat.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/i386.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/arm.h \ + $(INCDIR)/elf/m68k.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/fr30.h \ + $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/i960.h \ $(INCDIR)/elf/pj.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/cris.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h + $(INCDIR)/elf/cris.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/x86-64.h \ + $(INCDIR)/elf/s390.h $(INCDIR)/elf/xstormy16.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + unwind-ia64.h resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/dyn-string.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h underscore.o: underscore.c arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - arsup.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dlltool.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h nlmconv.h +nlmheader.o: nlmheader.c $(INCDIR)/safe-ctype.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.h $(INCDIR)/safe-ctype.h rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h rcparse.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + windres.h winduni.h rcparse.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/contrib/binutils/binutils/Makefile.in b/contrib/binutils/binutils/Makefile.in index a1c4175..0521329 100644 --- a/contrib/binutils/binutils/Makefile.in +++ b/contrib/binutils/binutils/Makefile.in @@ -117,7 +117,7 @@ INTLLIBS = @INTLLIBS@ AUTOMAKE_OPTIONS = cygnus dejagnu -SUBDIRS = po +SUBDIRS = doc po tooldir = $(exec_prefix)/$(target_alias) @@ -161,10 +161,6 @@ DLLWRAP_PROG = dllwrap SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -man_MANS = ar.1 nm.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 \ - objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_NAME).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) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ @@ -243,8 +239,6 @@ CC_FOR_TARGET = ` \ fi` -info_TEXINFOS = binutils.texi - LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) size_SOURCES = size.c $(BULIBS) @@ -293,7 +287,7 @@ windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) -DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ +EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c @@ -301,11 +295,9 @@ DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ site.exp site.bak -MAINTAINERCLEANFILES = config.texi - -MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum \ - abcdefgh* +### +MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -422,15 +414,6 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CF LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` -TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex -INFO_DEPS = binutils.info -DVIS = binutils.dvi -TEXINFOS = binutils.texi -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ NEWS acinclude.m4 aclocal.m4 arlex.c arparse.c config.in configure \ configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c @@ -445,7 +428,7 @@ OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJ all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .dvi .info .l .lo .o .obj .ps .s .texi .texinfo .txi .y +.SUFFIXES: .S .c .l .lo .o .obj .s .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile @@ -648,158 +631,6 @@ nlmheader.h: nlmheader.c rcparse.h: rcparse.c -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/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.txi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< -.dvi.ps: - $(DVIPS) $< -o $@ - -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ - done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done - @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ - done - -dist-info: $(INFO_DEPS) - list='$(INFO_DEPS)'; \ - for base in $$list; 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 binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \ - binutils.fns binutils.ky binutils.kys binutils.ps \ - binutils.log binutils.pg binutils.toc binutils.tp \ - binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \ - binutils.cv binutils.cn - -clean-aminfo: - -distclean-aminfo: - -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-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 - # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, @@ -947,7 +778,6 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info RUNTESTFLAGS = @@ -973,9 +803,9 @@ site.exp: Makefile @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t @test ! -f site.exp || mv site.exp site.bak @mv $@-t site.exp -info-am: $(INFO_DEPS) +info-am: info: info-recursive -dvi-am: $(DVIS) +dvi-am: dvi: dvi-recursive check-am: $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU @@ -990,21 +820,21 @@ all-recursive-am: config.h install-exec-am: install-binPROGRAMS install-exec-local install-exec: install-exec-recursive -install-data-am: install-man +install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall-am: uninstall-binPROGRAMS uninstall-man +uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) $(MANS) config.h +all-am: Makefile $(PROGRAMS) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 + $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: @@ -1019,24 +849,24 @@ distclean-generic: -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "arlexldeflexlrclexlarparseharparsecdefparsehdefparsecnlmheaderhnlmheadercrcparsehrcparsec$(MAINTAINERCLEANFILES)" || rm -f arlexl deflexl rclexl arparseh arparsec defparseh defparsec nlmheaderh nlmheaderc rcparseh rcparsec $(MAINTAINERCLEANFILES) + -test -z "arlexldeflexlrclexlarparseharparsecdefparsehdefparsecnlmheaderhnlmheadercrcparsehrcparsec" || rm -f arlexl deflexl rclexl arparseh arparsec defparseh defparsec nlmheaderh nlmheaderc rcparseh rcparsec mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-libtool mostlyclean-aminfo mostlyclean-tags \ + mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean-local mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS \ - clean-compile clean-libtool clean-aminfo clean-tags \ - clean-generic mostlyclean-am + clean-compile clean-libtool clean-tags clean-generic \ + mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-binPROGRAMS \ distclean-noinstPROGRAMS distclean-compile \ - distclean-libtool distclean-aminfo distclean-tags \ - distclean-generic clean-am + distclean-libtool distclean-tags distclean-generic \ + clean-am -rm -f libtool distclean: distclean-recursive @@ -1045,8 +875,8 @@ distclean: distclean-recursive maintainer-clean-am: 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-am + maintainer-clean-tags maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -1060,14 +890,11 @@ mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool install-info-am uninstall-info \ -mostlyclean-aminfo distclean-aminfo clean-aminfo \ -maintainer-clean-aminfo install-man1 uninstall-man1 install-man \ -uninstall-man install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ +clean-libtool maintainer-clean-libtool install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \ info-am info dvi-am dvi check check-am installcheck-am installcheck \ @@ -1091,9 +918,9 @@ check-DEJAGNU: site.exp 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); \ + CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \ + $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ + $(RUNTESTFLAGS); \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi @@ -1111,7 +938,7 @@ stamp-under: Makefile $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c touch stamp-under -cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h +cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h Makefile $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c # The following is commented out for the conversion to automake. @@ -1176,7 +1003,9 @@ 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 -diststuff: $(DISTSTUFF) info +diststuff: $(EXTRA_DIST) info + +Makefile: $(BFDDIR)/configure.in # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). @@ -1221,20 +1050,6 @@ dep-am: DEP $(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_NAME).1: cxxfilt.man Makefile - sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' < $(srcdir)/cxxfilt.man \ - > $(DEMANGLER_NAME).1 mostlyclean-local: -rm -rf tmpdir @@ -1266,150 +1081,173 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # 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)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ - arsup.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h +ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h arsup.h $(INCDIR)/filenames.h arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - arsup.h $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ + $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/filenames.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h +ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/filenames.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)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/getopt.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.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)/symcat.h \ + $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ budbg.h $(INCDIR)/filenames.h objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/getopt.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.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 \ + $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/progress.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h + $(INCDIR)/safe-ctype.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 \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.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)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + budbg.h +size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h srconv.o: srconv.c bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.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 + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - sysroff.h sysroff.c + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h sysroff.h \ + sysroff.c version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.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 + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.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)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/obstack.h \ - windres.h winduni.h + $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windres.h \ + winduni.h resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + windres.h winduni.h rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ winduni.h +winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/m68k.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/d10v.h \ - $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/i960.h \ + $(INCDIR)/symcat.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/i386.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/arm.h \ + $(INCDIR)/elf/m68k.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/fr30.h \ + $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/i960.h \ $(INCDIR)/elf/pj.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/cris.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h + $(INCDIR)/elf/cris.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/x86-64.h \ + $(INCDIR)/elf/s390.h $(INCDIR)/elf/xstormy16.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + unwind-ia64.h resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/dyn-string.h + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h underscore.o: underscore.c arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - arsup.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dlltool.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h nlmconv.h +nlmheader.o: nlmheader.c $(INCDIR)/safe-ctype.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.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)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ + winduni.h $(INCDIR)/safe-ctype.h rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h windres.h winduni.h rcparse.h + $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + windres.h winduni.h rcparse.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/contrib/binutils/binutils/NEWS b/contrib/binutils/binutils/NEWS index fd07a6d..a2f7abb 100644 --- a/contrib/binutils/binutils/NEWS +++ b/contrib/binutils/binutils/NEWS @@ -1,9 +1,34 @@ -*- text -*- +* size: Add --totals to display summary of sizes (Berkeley format only). + +* readelf: Add --wide option to not break section header or segment listing + lines to fit into 80 columns. + +* strings: Add --encoding to display wide character strings. By Markus Kuhn. + +* objcopy: Add --rename-section to change section names. + +* readelf: Support added for DWARF 2.1 extensions. Support added for + displaying the contents of .debug.macinfo sections. + * New command line switches added to objcopy to allow symbols to be kept as global symbols, and also to specify files containing lists of such symbols. by Honda Hiroki. +* Support for OpenRISC by Johan Rydberg. + +* New command line switch to objcopy --alt-machine-code which creates a binary + with an alternate machine code if one is defined in the architecture + description. Only supported for ELF targets. By Alexandre Oliva. + +* New command line switch to objcopy -B (or --binary-architecture) which sets + the architecture of the output file to the given argument. This option only + makes sense, if the input target is binary. Otherwise it is ignored. + By Stefan Geuken. + +* Support for PDP-11 by Lars Brinkhoff. + Changes in binutils 2.11: * Add support for ARM v5t and v5te architectures and Intel's XScale ARM diff --git a/contrib/binutils/binutils/README b/contrib/binutils/binutils/README index 9157a14..ab3d21f 100644 --- a/contrib/binutils/binutils/README +++ b/contrib/binutils/binutils/README @@ -1,26 +1,31 @@ -These are the GNU binutils. These are utilities of use when dealing -with object files. + README for BINUTILS -The linker (ld) is in a separate directory, which should be ../ld. -Linker-specific notes are in ../ld/README. +These are the GNU binutils. These are utilities of use when dealing +with binary files, either object files or executables. These tools +consist of the linker (ld), the assembler (gas), and the profiler +(gprof) each of which have their own sub-directory named after them. +There is also a collection of other binary tools, including the +disassembler (objdump) in this directory. These tools make use of a +pair of libraries (bfd and opcodes) and a common set of header files +(include). -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. +There are README and NEWS files in most of the program sub-directories +which give more information about those specific programs. -Recent changes are in ./NEWS, ../ld/NEWS, and ../gas/NEWS. Unpacking and Installation -- quick overview ============================================ -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. +When you unpack the binutils archive file, you will get a directory +called something like `binutils-XXX', where XXX is the number of the +release. (Probably 2.11.2 or higher). This directory contains +various files and sub-directories. Most of the files in the top +directory are for information and for configuration. The actual +source code is in sub-directories. To build binutils, you can just do: - cd binutils-2.9 + cd binutils-XXX ./configure [options] make make install # copies the programs files into /usr/local/bin @@ -33,7 +38,7 @@ If you have GNU make, we recommend building in a different directory: mkdir objdir cd objdir - ../binutils-2.9/configure [options] + ../binutils-XXX/configure [options] make make install @@ -41,7 +46,9 @@ 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. +configure option to specify a different target, eg: + + ./configure --target=foo-elf The --enable-targets option adds support for more binary file formats besides the default. List them as the argument to --enable-targets, @@ -49,11 +56,15 @@ separated by commas. For example: ./configure --enable-targets=sun3,rs6000-aix,decstation -The name 'all' compiles in support for all valid BFD targets (this was -the default in releases before 2.3): +The name 'all' compiles in support for all valid BFD targets: ./configure --enable-targets=all +On 32-bit hosts though, this support will be restricted to 32-bit +target unless the --enable-64-bit-bfd option is also used: + + ./configure --enable-64-bit-bfd --enable-targets=all + You can also specify the --enable-shared option when you run configure. This will build the BFD and opcodes libraries as shared libraries. You can use arguments with the --enable-shared option to @@ -62,7 +73,7 @@ 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 +step will attempt to place the correct library in the run-time search path for the binaries. However, in some cases, after you install the binaries, you may have to set an environment variable, normally LD_LIBRARY_PATH, so that the system can find the installed libbfd @@ -71,10 +82,11 @@ shared library. To build under openVMS/AXP, see the file makefile.vms in the top level directory. + If you don't have ar ==================== -If your system does not already have an ar program, the normal +If your system does not already have an 'ar' program, the normal binutils build process will not work. In this case, run configure as usual. Before running make, run this script: @@ -98,10 +110,10 @@ the ranlib program in order to build the distribution. Porting ======= -Binutils-2.9 supports many different architectures, but there +Binutils-2.11 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. +by earlier versions. We are hoping for volunteers to improve this +situation. The major effort in porting binutils to a new host and/or target architecture involves the BFD library. There is some documentation @@ -111,10 +123,13 @@ with gdb-4.x) may also be of help. Reporting bugs ============== -Send bug reports and patches to bug-binutils@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. +Send bug reports and patches to: + + bug-binutils@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. VMS === @@ -156,7 +171,7 @@ makefile.vms. Either select CC=cc (for DEC C) or CC=gcc (for GNU C) Installing the release Provided that your directory setup conforms to the GNU on openVMS -standard, you already have a concealed deviced named 'GNU_ROOT'. +standard, you already have a concealed device named 'GNU_ROOT'. In this case, a simple $ gmake install @@ -179,7 +194,7 @@ and [.binutils]strings.exe) and the gnu assembler and preprocessor and define all programs as foreign commands. -If you're satiesfied with the compilation, you may want to remove +If you're satisfied with the compilation, you may want to remove unneeded objects and libraries: $ gmake clean diff --git a/contrib/binutils/binutils/aclocal.m4 b/contrib/binutils/binutils/aclocal.m4 index 32e6c1f..a4a2b46 100644 --- a/contrib/binutils/binutils/aclocal.m4 +++ b/contrib/binutils/binutils/aclocal.m4 @@ -37,6 +37,24 @@ AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) AC_PROG_LEX AC_DECL_YYTEXT]) +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN(AC_ISC_POSIX, + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff --git a/contrib/binutils/binutils/addr2line.c b/contrib/binutils/binutils/addr2line.c index daae503..a9ceb91 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, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Ulrich Lauther This file is part of GNU Binutils. @@ -28,7 +28,6 @@ both forms write results to stdout, the second form reads addresses to be converted from stdin. */ -#include #include #include "bfd.h" @@ -37,8 +36,6 @@ #include "demangle.h" #include "bucomm.h" -extern char *program_version; - static boolean with_functions; /* -f, show function names. */ static boolean do_demangle; /* -C, demangle names. */ static boolean base_names; /* -s, strip directory names. */ @@ -73,11 +70,19 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("\ -Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n\ - [-e executable] [--exe=executable] [--demangle[=style]]\n\ - [--basenames] [--functions] [addr addr ...]\n"), - program_name); + fprintf (stream, _("Usage: %s [option(s)] [addr(s)]\n"), program_name); + fprintf (stream, _(" Convert addresses into line number/file name pairs.\n")); + fprintf (stream, _(" If no addresses are specified on the command line, they will be read from stdin\n")); + fprintf (stream, _(" The options are:\n\ + -b --target= Set the binary file format\n\ + -e --exe= Set the input file name (default is a.out)\n\ + -s --basenames Strip directory names\n\ + -f --functions Show function names\n\ + -C --demangle[=style] Demangle function names\n\ + -h --help Display this information\n\ + -v --version Display the program's version\n\ +\n")); + list_supported_targets (program_name, stream); if (status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); @@ -266,6 +271,8 @@ process_file (filename, target) bfd_close (abfd); } +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -278,6 +285,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -289,13 +299,13 @@ main (argc, argv) filename = NULL; target = NULL; - while ((c = getopt_long (argc, argv, "b:Ce:sfHV", long_options, (int *) 0)) + while ((c = getopt_long (argc, argv, "b:Ce:sfHhVv", long_options, (int *) 0)) != EOF) { switch (c) { case 0: - break; /* we've been given a long option */ + break; /* We've been given a long option. */ case 'b': target = optarg; break; @@ -322,9 +332,11 @@ main (argc, argv) case 'f': with_functions = true; break; + case 'v': case 'V': print_version ("addr2line"); break; + case 'h': case 'H': usage (stdout, 0); break; diff --git a/contrib/binutils/binutils/ar.c b/contrib/binutils/binutils/ar.c index 996476c..92d9b35 100644 --- a/contrib/binutils/binutils/ar.c +++ b/contrib/binutils/binutils/ar.c @@ -1,5 +1,6 @@ /* ar.c - Archive modify and extract. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -279,8 +280,14 @@ usage (help) fprintf (s, _(" [-X32_64] - (ignored)\n")); } else + { /* xgettext:c-format */ - fprintf (s, _("Usage: %s [-vV] archive\n"), program_name); + fprintf (s, _("Usage: %s [options] archive\n"), program_name); + fprintf (s, _(" Generate an index to speed access to archives\n")); + fprintf (s, _(" The options are:\n\ + -h --help Print this help message\n\ + -V --version Print version information\n")); + } list_supported_targets (program_name, stderr); @@ -357,6 +364,8 @@ remove_output () /* The option parsing should be in its own function. It will be when I have getopt working. */ +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -378,6 +387,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -447,7 +459,10 @@ main (argc, argv) { boolean touch = false; - if (argc < 2 || strcmp (argv[1], "--help") == 0) + if (argc < 2 + || strcmp (argv[1], "--help") == 0 + || strcmp (argv[1], "-h") == 0 + || strcmp (argv[1], "-H") == 0) usage (0); if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "-v") == 0 @@ -827,7 +842,7 @@ print_contents (abfd) /* xgettext:c-format */ printf (_("\n\n\n"), bfd_get_filename (abfd)); - bfd_seek (abfd, 0, SEEK_SET); + bfd_seek (abfd, (file_ptr) 0, SEEK_SET); size = buf.st_size; while (ncopied < size) @@ -838,8 +853,7 @@ print_contents (abfd) if (tocopy > BUFSIZE) tocopy = BUFSIZE; - nread = bfd_read (cbuf, 1, tocopy, abfd); /* oops -- broke - abstraction! */ + nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd); if (nread != tocopy) /* xgettext:c-format */ fatal (_("%s is not a valid archive"), @@ -883,7 +897,7 @@ extract_file (abfd) if (verbose) printf ("x - %s\n", bfd_get_filename (abfd)); - bfd_seek (abfd, 0, SEEK_SET); + bfd_seek (abfd, (file_ptr) 0, SEEK_SET); ostream = NULL; if (size == 0) @@ -907,7 +921,7 @@ extract_file (abfd) if (tocopy > BUFSIZE) tocopy = BUFSIZE; - nread = bfd_read (cbuf, 1, tocopy, abfd); + nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd); if (nread != tocopy) /* xgettext:c-format */ fatal (_("%s is not a valid archive"), diff --git a/contrib/binutils/binutils/arlex.l b/contrib/binutils/binutils/arlex.l index 71ef56e..381b177 100644 --- a/contrib/binutils/binutils/arlex.l +++ b/contrib/binutils/binutils/arlex.l @@ -29,6 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libiberty.h" #include "arparse.h" +#define YY_NO_UNPUT + +extern int yylex PARAMS ((void)); + int linenumber; %} @@ -71,7 +75,7 @@ int linenumber; "(" { return '('; } ")" { return ')'; } "," { return ','; } -[A-Za-z0-9/$:.\-\_]+ { +[A-Za-z0-9/\\$:.\-\_]+ { yylval.name = xstrdup (yytext); return FILENAME; } diff --git a/contrib/binutils/binutils/arsup.c b/contrib/binutils/binutils/arsup.c index 0058c0d..1e86479 100644 --- a/contrib/binutils/binutils/arsup.c +++ b/contrib/binutils/binutils/arsup.c @@ -160,10 +160,11 @@ DEFUN(ar_open,(name, t), { char *tname = (char *) xmalloc (strlen (name) + 10); + const char *bname = lbasename (name); real_name = name; /* Prepend tmp- to the beginning, to avoid file-name clashes after truncation on filesystems with limited namespaces (DOS). */ - sprintf(tname, "tmp-%s", name); + sprintf(tname, "%.*stmp-%s", (int) (bname - name), name, bname); obfd = bfd_openw(tname, NULL); if (!obfd) { diff --git a/contrib/binutils/binutils/arsup.h b/contrib/binutils/binutils/arsup.h index 26538be..e875cbf 100644 --- a/contrib/binutils/binutils/arsup.h +++ b/contrib/binutils/binutils/arsup.h @@ -22,54 +22,40 @@ struct list { struct list *next; }; -void -maybequit PARAMS ((void)); +void maybequit PARAMS ((void)); -void -prompt PARAMS ((void)); +void prompt PARAMS ((void)); -void -ar_clear PARAMS ((void)); +void ar_clear PARAMS ((void)); -void -ar_replace PARAMS ((struct list *)); +void ar_replace PARAMS ((struct list *)); -void -ar_delete PARAMS ((struct list *)); +void ar_delete PARAMS ((struct list *)); -void -ar_save PARAMS ((void)); +void ar_save PARAMS ((void)); -void -ar_list PARAMS ((void)); +void ar_list PARAMS ((void)); -void -ar_open PARAMS ((char *, int)); +void ar_open PARAMS ((char *, int)); -void -ar_directory PARAMS ((char *, struct list *, char *)); +void ar_directory PARAMS ((char *, struct list *, char *)); -void -ar_addmod PARAMS ((struct list *)); +void ar_addmod PARAMS ((struct list *)); -void -ar_addlib PARAMS ((char *, struct list *)); +void ar_addlib PARAMS ((char *, struct list *)); -void -ar_end PARAMS ((void)); +void ar_end PARAMS ((void)); -void -ar_extract PARAMS ((struct list *)); +void ar_extract PARAMS ((struct list *)); -bfd * -open_inarch PARAMS ((const char *archive_filename, const char *)); +bfd *open_inarch PARAMS ((const char *archive_filename, const char *)); -int -yyparse PARAMS ((void)); +extern int yylex PARAMS ((void)); + +int yyparse PARAMS ((void)); /* Functions from ar.c */ -void -extract_file PARAMS ((bfd * abfd)); +void extract_file PARAMS ((bfd * abfd)); extern int interactive; diff --git a/contrib/binutils/binutils/bucomm.c b/contrib/binutils/binutils/bucomm.c index 401a3e4..aa3080f 100644 --- a/contrib/binutils/binutils/bucomm.c +++ b/contrib/binutils/binutils/bucomm.c @@ -70,55 +70,26 @@ report (format, args) putc ('\n', stderr); } -#ifdef ANSI_PROTOTYPES void -fatal (const char *format, ...) +fatal VPARAMS ((const char *format, ...)) { - va_list args; + VA_OPEN (args, format); + VA_FIXEDARG (args, const char *, format); - va_start (args, format); report (format, args); - va_end (args); + VA_CLOSE (args); xexit (1); } void -non_fatal (const char *format, ...) +non_fatal VPARAMS ((const char *format, ...)) { - va_list args; + VA_OPEN (args, format); + VA_FIXEDARG (args, const char *, format); - va_start (args, format); report (format, args); - va_end (args); + VA_CLOSE (args); } -#else -void -fatal (va_alist) - va_dcl -{ - char *Format; - va_list args; - - va_start (args); - Format = va_arg (args, char *); - report (Format, args); - va_end (args); - xexit (1); -} - -void -non_fatal (va_alist) - va_dcl -{ - char *Format; - va_list args; - - va_start (args); - Format = va_arg (args, char *); - report (Format, args); - va_end (args); -} -#endif /* Set the default BFD target based on the configured target. Doing this permits the binutils to be configured for a particular target, @@ -168,6 +139,25 @@ list_supported_targets (name, f) fprintf (f, " %s", bfd_target_vector[t]->name); fprintf (f, "\n"); } + +/* List the supported architectures. */ + +void +list_supported_architectures (name, f) + const char *name; + FILE *f; +{ + const char** arch; + + if (name == NULL) + fprintf (f, _("Supported architectures:")); + else + fprintf (f, _("%s: supported architectures:"), name); + + for (arch = bfd_arch_list (); *arch; arch++) + fprintf (f, " %s", *arch); + fprintf (f, "\n"); +} /* Display the archive header for an element as if it were an ls -l listing: diff --git a/contrib/binutils/binutils/bucomm.h b/contrib/binutils/binutils/bucomm.h index f8c8608..0c98a7f 100644 --- a/contrib/binutils/binutils/bucomm.h +++ b/contrib/binutils/binutils/bucomm.h @@ -164,6 +164,8 @@ void list_matching_formats PARAMS ((char **p)); void list_supported_targets PARAMS ((const char *, FILE *)); +void list_supported_architectures PARAMS ((const char *, FILE *)); + void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose)); char *make_tempname PARAMS ((char *)); diff --git a/contrib/binutils/binutils/coffdump.c b/contrib/binutils/binutils/coffdump.c index 80b0817..db5034e 100644 --- a/contrib/binutils/binutils/coffdump.c +++ b/contrib/binutils/binutils/coffdump.c @@ -1,27 +1,27 @@ /* Coff file dumper. - Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002 + 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 This module reads a type tree generated by coffgrok and prints - it out so we can test the grokker. -*/ + it out so we can test the grokker. */ #include #include @@ -30,14 +30,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coffgrok.h" #include "bucomm.h" -#define PROGRAM_VERSION "1.0" - static int atnl; -static void dump_coff_scope (); + +static void tab PARAMS ((int)); +static void nl PARAMS ((void)); +static void dump_coff_lines PARAMS ((struct coff_line *)); +static void dump_coff_type PARAMS ((struct coff_type *)); +static void dump_coff_where PARAMS ((struct coff_where *)); +static void dump_coff_visible PARAMS ((struct coff_visible *)); +extern void dump_coff_symbol PARAMS ((struct coff_symbol *)); +static void dump_coff_scope PARAMS ((struct coff_scope *)); +static void dump_coff_sfile PARAMS ((struct coff_sfile *)); +static void dump_coff_section PARAMS ((struct coff_section *)); +extern void coff_dump PARAMS ((struct coff_ofile *)); +static void show_usage PARAMS ((FILE *, int)); +extern int main PARAMS ((int, char **)); static void tab (x) -int x; + int x; { static int indent; int i; @@ -79,7 +90,8 @@ int x; } } -static void nl () +static void +nl () { atnl = 1; } @@ -90,21 +102,25 @@ dump_coff_lines (p) { int i; int online = 0; - tab(1); - printf(_("#lines %d "),p->nlines); + + tab (1); + printf (_("#lines %d "),p->nlines); + for (i = 0; i < p->nlines; i++) { - printf("(%d 0x%x)", p->lines[i], p->addresses[i]); + printf ("(%d 0x%x)", p->lines[i], p->addresses[i]); + online++; + if (online > 6) { - nl(); - tab(0); + nl (); + tab (0); online = 0; } } - nl(); - tab(-1); + nl (); + tab (-1); } static void @@ -113,13 +129,14 @@ dump_coff_type (p) { tab (1); printf ("size %d ", p->size); + switch (p->type) { case coff_secdef_type: printf ("section definition at %x size %x\n", p->u.asecdef.address, p->u.asecdef.size); - nl(); + nl (); break; case coff_pointer_type: printf ("pointer to"); @@ -313,7 +330,6 @@ dump_coff_visible (p) tab (-1); } - void dump_coff_symbol (p) struct coff_symbol *p; @@ -321,6 +337,7 @@ dump_coff_symbol (p) tab (1); printf ("List of symbols"); nl (); + while (p) { tab (1); @@ -351,35 +368,37 @@ static void dump_coff_scope (p) struct coff_scope *p; { -if (p) { - tab (1); - printf ("List of blocks %lx ",(unsigned long) p); - - if (p->sec) { - printf( " %s %x..%x", p->sec->name,p->offset, p->offset + p->size -1); - } - nl (); - tab (0); - printf ("*****************"); - nl (); - while (p) + if (p) { - tab (0); - printf ("vars %d", p->nvars); + tab (1); + printf ("List of blocks %lx ",(unsigned long) p); + + if (p->sec) + printf( " %s %x..%x", p->sec->name,p->offset, p->offset + p->size -1); + nl (); - dump_coff_symbol (p->vars_head); - printf ("blocks"); + tab (0); + printf ("*****************"); nl (); - dump_coff_scope (p->list_head); + + while (p) + { + tab (0); + printf ("vars %d", p->nvars); + nl (); + dump_coff_symbol (p->vars_head); + printf ("blocks"); + nl (); + dump_coff_scope (p->list_head); + nl (); + p = p->next; + } + + tab (0); + printf ("*****************"); nl (); - p = p->next; + tab (-1); } - - tab (0); - printf ("*****************"); - nl (); - tab (-1); -} } static void @@ -389,6 +408,7 @@ dump_coff_sfile (p) tab (1); printf ("List of source files"); nl (); + while (p) { tab (0); @@ -402,25 +422,27 @@ dump_coff_sfile (p) static void dump_coff_section(ptr) -struct coff_section *ptr; + struct coff_section *ptr; { int i; - tab(1); - printf("section %s %d %d address %x size %x number %d nrelocs %d", - ptr->name, ptr->code, ptr->data, ptr->address,ptr->size, ptr->number, ptr->nrelocs); - nl(); + + tab (1); + printf ("section %s %d %d address %x size %x number %d nrelocs %d", + ptr->name, ptr->code, ptr->data, ptr->address,ptr->size, + ptr->number, ptr->nrelocs); + nl (); for (i = 0; i < ptr->nrelocs; i++) { - tab(0); - printf("(%x %s %x)", - ptr->relocs[i].offset, - ptr->relocs[i].symbol->name, - ptr->relocs[i].addend); - nl(); + tab (0); + printf ("(%x %s %x)", + ptr->relocs[i].offset, + ptr->relocs[i].symbol->name, + ptr->relocs[i].addend); + nl (); } - tab(-1); + tab (-1); } void @@ -428,17 +450,17 @@ coff_dump (ptr) struct coff_ofile *ptr; { int i; + printf ("Coff dump"); nl (); printf ("#souces %d", ptr->nsources); nl (); dump_coff_sfile (ptr->source_head); + for (i = 0; i < ptr->nsections; i++) - dump_coff_section(ptr->sections + i); + dump_coff_section (ptr->sections + i); } - - char * program_name; static void @@ -446,18 +468,18 @@ show_usage (file, status) FILE *file; int status; { - fprintf (file, "Usage: %s [-hV] in-file\n", program_name); - exit (status); -} + fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name); + fprintf (file, _(" Print a human readable interpretation of a SYSROFF object file\n")); + fprintf (file, _(" The options are:\n\ + -h --help Display this information\n\ + -v --version Display the program's version\n\ +\n")); -static void -show_help () -{ - printf (_("%s: Print a human readable interpretation of a SYSROFF object file\n"), - program_name); - show_usage (stdout, 0); -} + if (status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); + exit (status); +} int main (ac, av) @@ -479,30 +501,34 @@ main (ac, av) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); program_name = av[0]; xmalloc_set_program_name (program_name); - while ((opt = getopt_long (ac, av, "hV", long_options, + while ((opt = getopt_long (ac, av, "HhVv", long_options, (int *) NULL)) != EOF) { switch (opt) { + case 'H': case 'h': - show_help (); - /*NOTREACHED*/ + show_usage (stdout, 0); + break; + case 'v': case 'V': - printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION); + print_version ("coffdump"); exit (0); - /*NOTREACHED*/ case 0: break; default: show_usage (stderr, 1); - /*NOTREACHED*/ + break; } } @@ -512,9 +538,8 @@ main (ac, av) } if (!input_file) - { - fatal (_("no input file specified")); - } + fatal (_("no input file specified")); + abfd = bfd_openr (input_file, 0); if (!abfd) @@ -523,6 +548,7 @@ main (ac, av) if (! bfd_check_format_matches (abfd, bfd_object, &matching)) { bfd_nonfatal (input_file); + if (bfd_get_error () == bfd_error_file_ambiguously_recognized) { list_matching_formats (matching); @@ -533,7 +559,8 @@ main (ac, av) tree = coff_grok (abfd); - coff_dump(tree); - printf("\n"); + coff_dump (tree); + printf ("\n"); + return 0; } diff --git a/contrib/binutils/binutils/coffgrok.c b/contrib/binutils/binutils/coffgrok.c index 1118fac..0194b3f 100644 --- a/contrib/binutils/binutils/coffgrok.c +++ b/contrib/binutils/binutils/coffgrok.c @@ -1,5 +1,5 @@ /* coffgrok.c - Copyright 1994, 1995, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ */ #include +#include #include "bucomm.h" #include "coff/internal.h" @@ -53,7 +54,7 @@ static long symcount; static struct coff_ptr_struct *rawsyms; static int rawcount; static bfd *abfd; -extern char *xcalloc (); + #define PTR_SIZE 4 #define SHORT_SIZE 2 #define INT_SIZE 4 @@ -63,6 +64,19 @@ extern char *xcalloc (); #define INDEXOF(p) ((struct coff_ptr_struct *)(p)-(rawsyms)) +static struct coff_scope *empty_scope PARAMS ((void)); +static struct coff_symbol *empty_symbol PARAMS ((void)); +static void push_scope PARAMS ((int)); +static void pop_scope PARAMS ((void)); +static void do_sections_p1 PARAMS ((struct coff_ofile *)); +static void do_sections_p2 PARAMS ((struct coff_ofile *)); +static struct coff_where *do_where PARAMS ((int)); +static struct coff_line *do_lines PARAMS ((int, char *)); +static struct coff_type *do_type PARAMS ((int)); +static struct coff_visible *do_visible PARAMS ((int)); +static int do_define PARAMS ((int, struct coff_scope *)); +static struct coff_ofile *doit PARAMS ((void)); + static struct coff_scope * empty_scope () { diff --git a/contrib/binutils/binutils/coffgrok.h b/contrib/binutils/binutils/coffgrok.h index e442bae..be0bdef 100644 --- a/contrib/binutils/binutils/coffgrok.h +++ b/contrib/binutils/binutils/coffgrok.h @@ -222,4 +222,4 @@ struct coff_sfile struct coff_sfile *sfile; }; -struct coff_ofile *coff_grok(); +struct coff_ofile *coff_grok PARAMS ((bfd *)); diff --git a/contrib/binutils/binutils/config.in b/contrib/binutils/binutils/config.in index 7b70d16..1e0aa93 100644 --- a/contrib/binutils/binutils/config.in +++ b/contrib/binutils/binutils/config.in @@ -28,9 +28,6 @@ /* Define to `long' if doesn't define. */ #undef off_t -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - /* Define to `unsigned' if doesn't define. */ #undef size_t @@ -61,6 +58,9 @@ /* Define if you have the dcgettext function. */ #undef HAVE_DCGETTEXT +/* Define if you have the getc_unlocked function. */ +#undef HAVE_GETC_UNLOCKED + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD @@ -130,6 +130,12 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + /* Define if you have the header file. */ #undef HAVE_UNISTD_H @@ -160,6 +166,12 @@ /* Suffix used for executables, if any. */ #undef EXECUTABLE_SUFFIX +/* Is fopen64 available? */ +#undef HAVE_FOPEN64 + +/* Enable LFS */ +#undef _LARGEFILE64_SOURCE + /* Is the type time_t defined in ? */ #undef HAVE_TIME_T_IN_TIME_H diff --git a/contrib/binutils/binutils/configure b/contrib/binutils/binutils/configure index a123770..1ba4285 100755 --- a/contrib/binutils/binutils/configure +++ b/contrib/binutils/binutils/configure @@ -53,7 +53,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -168,7 +167,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -339,11 +337,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -509,16 +502,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -557,12 +546,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:561: checking for Cygwin environment" >&5 +echo "configure:550: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -590,19 +579,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:594: checking for mingw32 environment" >&5 +echo "configure:583: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -667,7 +656,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:671: checking host system type" >&5 +echo "configure:660: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -688,7 +677,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:692: checking target system type" >&5 +echo "configure:681: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -706,7 +695,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:710: checking build system type" >&5 +echo "configure:699: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -728,249 +717,49 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:735: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:765: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:816: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 +echo "configure:723: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:848: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 859 "configure" + ac_save_LIBS="$LIBS" +LIBS="-lcposix $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi +if { (eval echo configure:742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:890: 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:895: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:923: 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 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:955: 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 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi + LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 - ISC= fi + + BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` # Find a good install program. We prefer a C program (faster), @@ -985,7 +774,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # 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:989: checking for a BSD compatible install" >&5 +echo "configure:778: 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 @@ -1038,7 +827,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1042: checking whether build environment is sane" >&5 +echo "configure:831: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1095,7 +884,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:888: 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 @@ -1139,141 +928,363 @@ EOF -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1145: 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 +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:934: 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:947: 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:960: 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:973: 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:986: 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 + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case $enableval in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure: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 + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1102: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1153: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1185: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1196 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1158: 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 +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:1227: 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 for working automake""... $ac_c" 1>&6 -echo "configure:1171: 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 +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1232: 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 - 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:1184: 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 + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 + ac_cv_prog_gcc=no fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1197: 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 +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -# 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 +if test $ac_cv_prog_gcc = yes; then + GCC=yes else - enable_shared=yes + GCC= 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 +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:1260: 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 - enable_static=yes + 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* -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi else - enable_fast_install=yes + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi # Check whether --with-gnu-ld or --without-gnu-ld was given. @@ -1285,10 +1296,10 @@ else fi ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1292: checking for ld used by GCC" >&5 +echo "configure:1303: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1296,7 +1307,7 @@ echo "configure:1292: checking for ld used by GCC" >&5 *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' @@ -1318,12 +1329,12 @@ echo "configure:1292: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1322: checking for GNU ld" >&5 +echo "configure:1333: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1325: checking for non-GNU ld" >&5 +echo "configure:1336: checking for non-GNU ld" >&5 fi -if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1331,11 +1342,11 @@ else for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_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 + if "$lt_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 @@ -1344,11 +1355,11 @@ else done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else @@ -1356,24 +1367,24 @@ else 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:1360: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then +echo "configure:1371: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi fi -echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$ac_cv_prog_gnu_ld +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1377: checking for $LD option to reload object files" >&5 +echo "configure:1388: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1385,13 +1396,13 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1389: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then +echo "configure:1400: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -1403,27 +1414,27 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1427: checking whether ln -s works" >&5 +echo "configure:1438: 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 @@ -1444,7 +1455,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1448: checking how to recognise dependant libraries" >&5 +echo "configure:1459: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1462,8 +1473,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -1472,8 +1483,8 @@ beos*) ;; bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -1482,14 +1493,27 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -1502,29 +1526,28 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) - case "$LD" in + case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all @@ -1532,25 +1555,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in - alpha* | i*86 | powerpc* | sparc* | ia64* ) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; +newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' @@ -1567,14 +1595,18 @@ solaris*) lt_cv_file_magic_test_file=/lib/libc.so ;; +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; @@ -1587,13 +1619,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1591: checking for object suffix" >&5 +echo "configure:1623: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1613,7 +1645,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1617: checking for executable suffix" >&5 +echo "configure:1649: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1623,10 +1655,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1652,15 +1684,15 @@ fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # Only perform the check for file, if the check method requires it -case "$deplibs_check_method" in +case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1660: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1692: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1676,7 +1708,7 @@ else if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1718,11 +1750,11 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1722: checking for file" >&5 +echo "configure:1754: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1738,7 +1770,7 @@ else if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1789,7 +1821,7 @@ 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 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1793: checking for $ac_word" >&5 +echo "configure:1825: 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 @@ -1821,7 +1853,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:1825: checking for $ac_word" >&5 +echo "configure:1857: 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 @@ -1856,7 +1888,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1860: checking for $ac_word" >&5 +echo "configure:1892: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1888,7 +1920,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1892: checking for $ac_word" >&5 +echo "configure:1924: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1926,8 +1958,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$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" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. @@ -1952,12 +1984,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1959 "configure"' > conftest.$ac_ext - if { (eval echo configure:1960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case "`/usr/bin/file conftest.o`" in + echo '#line 1991 "configure"' > conftest.$ac_ext + if { (eval echo configure:1992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1977,7 +2009,7 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1981: checking whether the C compiler needs -belf" >&5 +echo "configure:2013: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1990,14 +2022,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2107,7 +2139,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - @@ -2134,7 +2165,7 @@ if test "${enable_commonbfdlib+set}" = set; then esac fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2171,7 +2202,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2175: checking for $ac_word" >&5 +echo "configure:2206: 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 @@ -2201,7 +2232,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:2205: checking for $ac_word" >&5 +echo "configure:2236: 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 @@ -2252,7 +2283,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2256: checking for $ac_word" >&5 +echo "configure:2287: 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 @@ -2284,7 +2315,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2288: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2319: 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. @@ -2295,12 +2326,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2299 "configure" +#line 2330 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2326,12 +2357,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:2330: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2361: 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:2335: checking whether we are using GNU C" >&5 +echo "configure:2366: 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 @@ -2340,7 +2371,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2344: \"$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:2375: \"$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 @@ -2359,7 +2390,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2363: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2394: 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 @@ -2396,7 +2427,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2400: checking for $ac_word" >&5 +echo "configure:2431: 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 @@ -2427,7 +2458,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2431: checking how to run the C preprocessor" >&5 +echo "configure:2462: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2442,13 +2473,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2459,13 +2490,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2476,13 +2507,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2512,7 +2543,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2516: checking for $ac_word" >&5 +echo "configure:2547: 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 @@ -2545,7 +2576,7 @@ test -n "$LEX" || LEX="$missing_dir/missing flex" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2549: checking for $ac_word" >&5 +echo "configure:2580: 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 @@ -2579,7 +2610,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2583: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2614: 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 @@ -2587,7 +2618,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2621,7 +2652,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2625: checking lex output file root" >&5 +echo "configure:2656: 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 @@ -2642,7 +2673,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:2646: checking whether yytext is a pointer" >&5 +echo "configure:2677: 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 @@ -2654,14 +2685,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -2683,11 +2714,11 @@ EOF fi -ALL_LINGUAS= +ALL_LINGUAS="fr tr ja es" # 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:2691: checking for $ac_word" >&5 +echo "configure:2722: 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 @@ -2715,12 +2746,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2719: checking for ANSI C header files" >&5 +echo "configure:2750: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2728,7 +2759,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2745,7 +2776,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2763,7 +2794,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2784,7 +2815,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2795,7 +2826,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2819,12 +2850,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2823: checking for working const" >&5 +echo "configure:2854: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2894,21 +2925,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2898: checking for inline" >&5 +echo "configure:2929: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2934,12 +2965,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2938: checking for off_t" >&5 +echo "configure:2969: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2967,12 +2998,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2971: checking for size_t" >&5 +echo "configure:3002: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3002,19 +3033,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:3006: checking for working alloca.h" >&5 +echo "configure:3037: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3035,12 +3066,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3039: checking for alloca" >&5 +echo "configure:3070: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3100,12 +3131,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3104: checking whether alloca needs Cray hooks" >&5 +echo "configure:3135: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3134: checking for $ac_func" >&5 +echo "configure:3165: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3185,7 +3216,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3189: checking stack direction for C alloca" >&5 +echo "configure:3220: 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 @@ -3193,7 +3224,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3233,21 +3264,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3241: checking for $ac_hdr" >&5 +echo "configure:3272: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3276,12 +3307,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3280: checking for $ac_func" >&5 +echo "configure:3311: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3329,7 +3360,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3333: checking for working mmap" >&5 +echo "configure:3364: 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 @@ -3337,7 +3368,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3477,7 +3521,7 @@ main() } EOF -if { (eval echo configure:3481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3505,17 +3549,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3509: checking for $ac_hdr" >&5 +echo "configure:3553: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3545,12 +3589,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3549: checking for $ac_func" >&5 +echo "configure:3593: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3602,12 +3646,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3606: checking for $ac_func" >&5 +echo "configure:3650: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3664,19 +3708,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3668: checking for LC_MESSAGES" >&5 +echo "configure:3712: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3697,7 +3741,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3701: checking whether NLS is requested" >&5 +echo "configure:3745: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3717,7 +3761,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3721: checking whether included gettext is requested" >&5 +echo "configure:3765: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3736,17 +3780,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3740: checking for libintl.h" >&5 +echo "configure:3784: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3763,19 +3807,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3767: checking for gettext in libc" >&5 +echo "configure:3811: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3791,7 +3835,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3795: checking for bindtextdomain in -lintl" >&5 +echo "configure:3839: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3799,7 +3843,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3826,19 +3870,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3830: checking for gettext in libintl" >&5 +echo "configure:3874: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3866,7 +3910,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3870: checking for $ac_word" >&5 +echo "configure:3914: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3900,12 +3944,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3904: checking for $ac_func" >&5 +echo "configure:3948: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3955,7 +3999,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3959: checking for $ac_word" >&5 +echo "configure:4003: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3991,7 +4035,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3995: checking for $ac_word" >&5 +echo "configure:4039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4023,7 +4067,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4063,7 +4107,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4067: checking for $ac_word" >&5 +echo "configure:4111: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4097,7 +4141,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4101: checking for $ac_word" >&5 +echo "configure:4145: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4133,7 +4177,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4137: checking for $ac_word" >&5 +echo "configure:4181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4223,7 +4267,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4227: checking for catalogs to be installed" >&5 +echo "configure:4271: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4251,17 +4295,17 @@ echo "configure:4227: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4255: checking for linux/version.h" >&5 +echo "configure:4299: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4306,7 +4350,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -4324,7 +4368,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4328: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4372: 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" @@ -4349,7 +4393,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4353: checking for executable suffix" >&5 +echo "configure:4397: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4359,10 +4403,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -4402,7 +4446,7 @@ 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:4406: checking for $ac_word" >&5 +echo "configure:4450: 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 @@ -4441,7 +4485,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4445: checking for a BSD compatible install" >&5 +echo "configure:4489: 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 @@ -4508,7 +4552,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4512: checking for build system executable suffix" >&5 +echo "configure:4556: 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 @@ -4543,17 +4587,17 @@ 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:4547: checking for $ac_hdr" >&5 +echo "configure:4591: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4580,12 +4624,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4584: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4628: 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 < #include @@ -4601,7 +4645,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4624,19 +4668,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:4628: checking for working alloca.h" >&5 +echo "configure:4672: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4657,12 +4701,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4661: checking for alloca" >&5 +echo "configure:4705: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4722,12 +4766,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4726: checking whether alloca needs Cray hooks" >&5 +echo "configure:4770: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4756: checking for $ac_func" >&5 +echo "configure:4800: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4807,7 +4851,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4811: checking stack direction for C alloca" >&5 +echo "configure:4855: 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 @@ -4815,7 +4859,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4855,15 +4899,15 @@ EOF fi -for ac_func in sbrk utimes setmode +for ac_func in sbrk utimes setmode getc_unlocked do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4862: checking for $ac_func" >&5 +echo "configure:4906: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4911,17 +4955,78 @@ fi done +# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE +# needs to be defined for it +echo $ac_n "checking for fopen64""... $ac_c" 1>&6 +echo "configure:4962: checking for fopen64" >&5 +if eval "test \"`echo '$''{'bu_cv_have_fopen64'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +FILE *f = fopen64 ("/tmp/foo","r"); +; return 0; } +EOF +if { (eval echo configure:4974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + bu_cv_have_fopen64=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + saved_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" + cat > conftest.$ac_ext < +int main() { +FILE *f = fopen64 ("/tmp/foo","r"); +; return 0; } +EOF +if { (eval echo configure:4991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bu_cv_have_fopen64=no +fi +rm -f conftest* + CPPFLAGS=$saved_CPPFLAGS +fi +rm -f conftest* +fi + +echo "$ac_t""$bu_cv_have_fopen64" 1>&6 +if test $bu_cv_have_fopen64 != no; then + cat >> confdefs.h <<\EOF +#define HAVE_FOPEN64 1 +EOF + + if test $bu_cv_have_fopen64 = "need -D_LARGEFILE64_SOURCE"; then + cat >> confdefs.h <<\EOF +#define _LARGEFILE64_SOURCE 1 +EOF + + fi +fi + # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:4918: checking for library containing frexp" >&5 +echo "configure:5023: checking for library containing frexp" >&5 if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_frexp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="none required" else @@ -4943,7 +5048,7 @@ rm -f conftest* test "$ac_cv_search_frexp" = "no" && for i in m; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="-l$i" break @@ -4976,19 +5081,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:4980: checking for time_t in time.h" >&5 +echo "configure:5085: 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 < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -5009,19 +5114,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5013: checking for time_t in sys/types.h" >&5 +echo "configure:5118: 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 < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:5025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -5044,12 +5149,12 @@ fi # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:5048: checking for utime.h" >&5 +echo "configure:5153: 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 < #ifdef HAVE_TIME_H @@ -5060,7 +5165,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:5064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -5081,12 +5186,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:5085: checking whether fprintf must be declared" >&5 +echo "configure:5190: 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 < @@ -5107,7 +5212,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:5111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -5128,12 +5233,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:5132: checking whether strstr must be declared" >&5 +echo "configure:5237: 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 < @@ -5154,7 +5259,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:5158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -5175,12 +5280,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:5179: checking whether sbrk must be declared" >&5 +echo "configure:5284: 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 < @@ -5201,7 +5306,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:5205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -5222,12 +5327,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5226: checking whether getenv must be declared" >&5 +echo "configure:5331: 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 < @@ -5248,7 +5353,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:5252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5269,12 +5374,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:5273: checking whether environ must be declared" >&5 +echo "configure:5378: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5295,7 +5400,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:5299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -5438,6 +5543,10 @@ do fi done +if test "${with_windres+set}" = set; then + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' +fi + @@ -5563,7 +5672,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile doc/Makefile po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/contrib/binutils/binutils/configure.in b/contrib/binutils/binutils/configure.in index e2fed82..42381bb 100644 --- a/contrib/binutils/binutils/configure.in +++ b/contrib/binutils/binutils/configure.in @@ -29,7 +29,7 @@ AC_ARG_ENABLE(commonbfdlib, *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; esac])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -64,7 +64,7 @@ AC_PROG_CC AC_PROG_YACC AM_PROG_LEX -ALL_LINGUAS= +ALL_LINGUAS="fr tr ja es" CY_GNU_GETTEXT AM_MAINTAINER_MODE @@ -100,7 +100,29 @@ AC_SUBST(DEMANGLER_NAME) 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 setmode) +AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked) + +# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE +# needs to be defined for it +AC_MSG_CHECKING([for fopen64]) +AC_CACHE_VAL(bu_cv_have_fopen64, +[AC_TRY_LINK([#include ], [FILE *f = fopen64 ("/tmp/foo","r");], +bu_cv_have_fopen64=yes, +[saved_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" + AC_TRY_LINK([#include ], [FILE *f = fopen64 ("/tmp/foo","r");], +bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE", +bu_cv_have_fopen64=no) + CPPFLAGS=$saved_CPPFLAGS])]) +AC_MSG_RESULT($bu_cv_have_fopen64) +if test $bu_cv_have_fopen64 != no; then + AC_DEFINE([HAVE_FOPEN64], 1, + [Is fopen64 available?]) + if test $bu_cv_have_fopen64 = "need -D_LARGEFILE64_SOURCE"; then + AC_DEFINE([_LARGEFILE64_SOURCE], 1, + [Enable LFS]) + fi +fi # Some systems have frexp only in -lm, not in -lc. AC_SEARCH_LIBS(frexp, m) @@ -266,6 +288,10 @@ changequote([,])dnl fi done +if test "${with_windres+set}" = set; then + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' +fi + AC_SUBST(NLMCONV_DEFS) AC_SUBST(BUILD_NLMCONV) AC_SUBST(BUILD_SRCONV) @@ -287,7 +313,7 @@ else fi AC_SUBST(UNDERSCORE) -AC_OUTPUT(Makefile po/Makefile.in:po/Make-in, +AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in, [ case "x$CONFIG_FILES" in *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; diff --git a/contrib/binutils/binutils/defparse.y b/contrib/binutils/binutils/defparse.y index 7e13965..d0bccd9 100644 --- a/contrib/binutils/binutils/defparse.y +++ b/contrib/binutils/binutils/defparse.y @@ -149,6 +149,12 @@ opt_ordinal: opt_equal_name: '=' ID { $$ = $2; } + | '=' ID '.' ID + { + char *name = xmalloc (strlen ($2) + 1 + strlen ($4) + 1); + sprintf (name, "%s.%s", $2, $4); + $$ = name; + } | { $$ = 0; } ; diff --git a/contrib/binutils/binutils/dlltool.c b/contrib/binutils/binutils/dlltool.c index 9475b98..a3c52c5 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 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -48,9 +48,13 @@ LIBRARY [ , ] The result is going to be .DLL - EXPORTS ( [ = ] [ @ ] [ NONAME ] [CONSTANT] [DATA] ) * + EXPORTS ( ( ( [ = ] ) + | ( = . )) + [ @ ] [ NONAME ] [CONSTANT] [DATA] ) * Declares name1 as an exported symbol from the - DLL, with optional ordinal number + DLL, with optional ordinal number . + Or declares name1 as an alias (forward) of the function + in the DLL . IMPORTS ( ( = . ) | ( [ = ] . )) * @@ -249,8 +253,8 @@ #include "demangle.h" #include "dyn-string.h" #include "dlltool.h" +#include "safe-ctype.h" -#include #include #include @@ -363,7 +367,7 @@ static boolean export_all_symbols; /* True if we should exclude the symbols in DEFAULT_EXCLUDES when exporting all symbols. */ -static boolean do_default_excludes; +static boolean do_default_excludes=true; /* Default symbols to exclude when exporting all the symbols. */ static const char *default_excludes = "DllMain@12,DllEntryPoint@0,impure_ptr"; @@ -636,6 +640,7 @@ typedef struct export int noname; int data; int hint; + int forward; /* number of forward label, 0 means no forward */ struct export *next; } export_type; @@ -848,6 +853,7 @@ static export_type *d_exports; /*list of exported functions */ static export_type **d_exports_lexically; /* vector of exported functions in alpha order */ static dlist_type *d_list; /* Descriptions */ static dlist_type *a_list; /* Stuff to go in directives */ +static int d_nforwards = 0; /* Number of forwarded exports */ static int d_is_dll; static int d_is_exe; @@ -882,6 +888,12 @@ def_exports (name, internal_name, ordinal, noname, constant, data) p->next = d_exports; d_exports = p; d_nfuncs++; + + if ((internal_name != NULL) + && (strchr (internal_name, '.') != NULL)) + p->forward = ++d_nforwards; + else + p->forward = 0; /* no forward */ } void @@ -1819,9 +1831,14 @@ gen_exp_file () i++; } } - fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE, - ASM_PREFIX, - exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal); + + if (exp->forward == 0) + fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE, + ASM_PREFIX, + exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal); + else + fprintf (f, "\t%sf%d%s\t%s %d\n", ASM_RVA_BEFORE, + exp->forward, ASM_RVA_AFTER, ASM_C, exp->ordinal); i++; } @@ -1846,8 +1863,13 @@ gen_exp_file () fprintf(f,"%s Export Name Table\n", ASM_C); for (i = 0; (exp = d_exports_lexically[i]); i++) if (!exp->noname || show_allnames) - fprintf (f, "n%d: %s \"%s\"\n", - exp->ordinal, ASM_TEXT, exp->name); + { + fprintf (f, "n%d: %s \"%s\"\n", + exp->ordinal, ASM_TEXT, exp->name); + if (exp->forward != 0) + fprintf (f, "f%d: %s \"%s\"\n", + exp->forward, ASM_TEXT, exp->internal_name); + } if (a_list) { @@ -2054,16 +2076,22 @@ typedef struct #define NSECS 7 -#define INIT_SEC_DATA(id, name, flags, align) { id, name, flags, align, NULL, NULL, NULL, 0, NULL } +#define TEXT_SEC_FLAGS \ + (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY | SEC_HAS_CONTENTS) +#define DATA_SEC_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_DATA) +#define BSS_SEC_FLAGS SEC_ALLOC + +#define INIT_SEC_DATA(id, name, flags, align) \ + { id, name, flags, align, NULL, NULL, NULL, 0, NULL } static sinfo secdata[NSECS] = { - INIT_SEC_DATA (TEXT, ".text", SEC_CODE | SEC_HAS_CONTENTS, 2), - INIT_SEC_DATA (DATA, ".data", SEC_DATA, 2), - INIT_SEC_DATA (BSS, ".bss", 0, 2), - INIT_SEC_DATA (IDATA7, ".idata$7", SEC_HAS_CONTENTS, 2), - INIT_SEC_DATA (IDATA5, ".idata$5", SEC_HAS_CONTENTS, 2), - INIT_SEC_DATA (IDATA4, ".idata$4", SEC_HAS_CONTENTS, 2), - INIT_SEC_DATA (IDATA6, ".idata$6", SEC_HAS_CONTENTS, 1) + INIT_SEC_DATA (TEXT, ".text", TEXT_SEC_FLAGS, 2), + INIT_SEC_DATA (DATA, ".data", DATA_SEC_FLAGS, 2), + INIT_SEC_DATA (BSS, ".bss", BSS_SEC_FLAGS, 2), + INIT_SEC_DATA (IDATA7, ".idata$7", SEC_HAS_CONTENTS, 2), + INIT_SEC_DATA (IDATA5, ".idata$5", SEC_HAS_CONTENTS, 2), + INIT_SEC_DATA (IDATA4, ".idata$4", SEC_HAS_CONTENTS, 2), + INIT_SEC_DATA (IDATA6, ".idata$6", SEC_HAS_CONTENTS, 1) }; #else @@ -2209,7 +2237,7 @@ make_one_lib_file (exp, i) { bfd * abfd; asymbol * exp_label; - asymbol * iname; + asymbol * iname = 0; asymbol * iname2; asymbol * iname_lab; asymbol ** iname_lab_pp; @@ -2223,6 +2251,7 @@ make_one_lib_file (exp, i) #define EXTRA 0 #endif asymbol * ptrs[NSECS + 4 + EXTRA + 1]; + flagword applicable; char * outname = xmalloc (10); int oidx = 0; @@ -2247,6 +2276,8 @@ make_one_lib_file (exp, i) bfd_set_private_flags (abfd, F_INTERWORK); #endif + applicable = bfd_applicable_section_flags (abfd); + /* First make symbols for the sections */ for (i = 0; i < NSECS; i++) { @@ -2256,7 +2287,7 @@ make_one_lib_file (exp, i) si->sec = bfd_make_section_old_way (abfd, si->name); bfd_set_section_flags (abfd, si->sec, - si->flags); + si->flags & applicable); bfd_set_section_alignment(abfd, si->sec, si->align); si->sec->output_section = si->sec; @@ -3104,7 +3135,7 @@ usage (file, status) int status; { /* xgetext:c-format */ - fprintf (file, _("Usage %s \n"), program_name); + fprintf (file, _("Usage %s \n"), program_name); /* xgetext:c-format */ fprintf (file, _(" -m --machine Create as DLL for . [default: %s]\n"), mname); fprintf (file, _(" possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, ppc, thumb\n")); @@ -3189,14 +3220,17 @@ main (ac, av) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); while ((c = getopt_long (ac, av, #ifdef DLLTOOL_MCORE_ELF - "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVhM:L:F:", + "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVHhM:L:F:", #else - "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVh", + "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVHh", #endif long_options, 0)) != EOF) @@ -3246,6 +3280,7 @@ main (ac, av) case 'e': exp_name = optarg; break; + case 'H': case 'h': usage (stdout, 0); break; @@ -3355,7 +3390,7 @@ main (ac, av) imp_name_lab = xstrdup (imp_name); for (p = imp_name_lab; *p; p++) { - if (!isalpha ((unsigned char) *p) && !isdigit ((unsigned char) *p)) + if (!ISALNUM (*p)) *p = '_'; } head_label = make_label("_head_", imp_name_lab); diff --git a/contrib/binutils/binutils/dllwrap.c b/contrib/binutils/binutils/dllwrap.c index 8f83dda..f8449a8 100644 --- a/contrib/binutils/binutils/dllwrap.c +++ b/contrib/binutils/binutils/dllwrap.c @@ -1,5 +1,5 @@ /* dllwrap.c -- wrapper for DLLTOOL and GCC to generate PE style DLLs - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Mumit Khan (khan@xraylith.wisc.edu). This file is part of GNU Binutils. @@ -36,7 +36,6 @@ #include "getopt.h" #include "dyn-string.h" -#include #include #include @@ -517,7 +516,7 @@ usage (file, status) FILE *file; int status; { - fprintf (file, _("Usage %s \n"), program_name); + fprintf (file, _("Usage %s \n"), program_name); fprintf (file, _(" Generic options:\n")); fprintf (file, _(" --quiet, -q Work quietly\n")); fprintf (file, _(" --verbose, -v Verbose\n")); @@ -664,6 +663,15 @@ main (argc, argv) program_name = argv[0]; +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + setlocale (LC_MESSAGES, ""); +#endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + saved_argv = (char **) xmalloc (argc * sizeof (char*)); dlltool_arg_indices = (int *) xmalloc (argc * sizeof (int)); driver_arg_indices = (int *) xmalloc (argc * sizeof (int)); @@ -841,8 +849,8 @@ main (argc, argv) delete_def_file = 1; free (fileprefix); delete_def_file = 1; - warn (_("no export definition file provided")); - warn (_("creating one, but that may not be what you want")); + warn (_("no export definition file provided.\n\ +Creating one, but that may not be what you want")); } /* set the target platform. */ diff --git a/contrib/binutils/binutils/doc/Makefile.am b/contrib/binutils/binutils/doc/Makefile.am new file mode 100644 index 0000000..8fc8c08 --- /dev/null +++ b/contrib/binutils/binutils/doc/Makefile.am @@ -0,0 +1,161 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +# What version of the manual you want; "all" includes everything +CONFIG=all + +# Options to extract the man page from as.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 + +# List of man pages generated from binutils.texi +man_MANS = \ + addr2line.1 \ + ar.1 \ + dlltool.1 \ + nlmconv.1 \ + nm.1 \ + objcopy.1 \ + objdump.1 \ + ranlib.1 \ + readelf.1 \ + size.1 \ + strings.1 \ + strip.1 \ + windres.1 \ + $(DEMANGLER_NAME).1 + +info_TEXINFOS = binutils.texi + +config.texi: Makefile + rm -f config.texi + echo '@set VERSION $(VERSION)' > config.texi + +binutils_TEXI = $(srcdir)/binutils.texi + +binutils.dvi: $(binutils_TEXI) config.texi + +binutils.info: $(binutils_TEXI) config.texi + +# Man page generation from texinfo +addr2line.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod + -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f addr2line.pod + +ar.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod + -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f ar.pod + +dlltool.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod + -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f dlltool.pod + +nlmconv.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod + -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f nlmconv.pod + +nm.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod + -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f nm.pod + +objcopy.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod + -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f objcopy.pod + +objdump.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod + -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f objdump.pod + +ranlib.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod + -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f ranlib.pod + +readelf.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod + -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f readelf.pod + +size.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod + -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f size.pod + +strings.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod + -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f strings.pod + +strip.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod + -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f strip.pod + +windres.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod + -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windres.pod + +cxxfilt.man: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod + -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f $(DEMANGLER_NAME).pod + +MAINTAINERCLEANFILES = config.texi +DISTCLEANFILES = config.texi +MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 + +$(DEMANGLER_NAME).1: cxxfilt.man Makefile + if test -f cxxfilt.man; then \ + man=cxxfilt.man; \ + else \ + man=$(srcdir)/cxxfilt.man; \ + fi; \ + sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \ + -e 's/cxxfilt/$(DEMANGLER_NAME)/' < $$man \ + > $(DEMANGLER_NAME).1 + +# Maintenance + +# We need it for the taz target in ../../Makefile.in. +info: $(MANS) diff --git a/contrib/binutils/binutils/doc/Makefile.in b/contrib/binutils/binutils/doc/Makefile.in new file mode 100644 index 0000000..ec18241 --- /dev/null +++ b/contrib/binutils/binutils/doc/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +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@ +AS = @AS@ +BUILD_DLLTOOL = @BUILD_DLLTOOL@ +BUILD_DLLWRAP = @BUILD_DLLWRAP@ +BUILD_MISC = @BUILD_MISC@ +BUILD_NLMCONV = @BUILD_NLMCONV@ +BUILD_SRCONV = @BUILD_SRCONV@ +BUILD_WINDRES = @BUILD_WINDRES@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +DATADIRNAME = @DATADIRNAME@ +DEMANGLER_NAME = @DEMANGLER_NAME@ +DLLTOOL = @DLLTOOL@ +DLLTOOL_DEFS = @DLLTOOL_DEFS@ +EXEEXT = @EXEEXT@ +EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +HDEFINES = @HDEFINES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +NLMCONV_DEFS = @NLMCONV_DEFS@ +OBJDUMP = @OBJDUMP@ +OBJDUMP_DEFS = @OBJDUMP_DEFS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +UNDERSCORE = @UNDERSCORE@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +YACC = @YACC@ +l = @l@ + +AUTOMAKE_OPTIONS = cygnus + +# What version of the manual you want; "all" includes everything +CONFIG = all + +# Options to extract the man page from as.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 + + +# List of man pages generated from binutils.texi +man_MANS = \ + addr2line.1 \ + ar.1 \ + dlltool.1 \ + nlmconv.1 \ + nm.1 \ + objcopy.1 \ + objdump.1 \ + ranlib.1 \ + readelf.1 \ + size.1 \ + strings.1 \ + strip.1 \ + windres.1 \ + $(DEMANGLER_NAME).1 + + +info_TEXINFOS = binutils.texi + +binutils_TEXI = $(srcdir)/binutils.texi + +MAINTAINERCLEANFILES = config.texi +DISTCLEANFILES = config.texi +MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex +INFO_DEPS = binutils.info +DVIS = binutils.dvi +TEXINFOS = binutils.texi +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +.SUFFIXES: .dvi .info .ps .texi .texinfo .txi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +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/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.texi: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo.dvi: + TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.txi.dvi: + TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< +.dvi.ps: + $(DVIPS) $< -o $@ + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi + +uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; 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 binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \ + binutils.fns binutils.ky binutils.kys binutils.ps \ + binutils.log binutils.pg binutils.toc binutils.tp \ + binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \ + binutils.cv binutils.cn + +clean-aminfo: + +distclean-aminfo: + +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-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = doc + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info +info-am: $(INFO_DEPS) +info: info-am +dvi-am: $(DVIS) +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-man +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-man +uninstall: uninstall-am +all-am: Makefile $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-aminfo clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-aminfo distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: install-info-am uninstall-info mostlyclean-aminfo \ +distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ +uninstall-man1 install-man uninstall-man tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +config.texi: Makefile + rm -f config.texi + echo '@set VERSION $(VERSION)' > config.texi + +binutils.dvi: $(binutils_TEXI) config.texi + +binutils.info: $(binutils_TEXI) config.texi + +# Man page generation from texinfo +addr2line.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod + -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f addr2line.pod + +ar.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod + -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f ar.pod + +dlltool.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod + -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f dlltool.pod + +nlmconv.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod + -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f nlmconv.pod + +nm.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod + -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f nm.pod + +objcopy.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod + -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f objcopy.pod + +objdump.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod + -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f objdump.pod + +ranlib.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod + -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f ranlib.pod + +readelf.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod + -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f readelf.pod + +size.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod + -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f size.pod + +strings.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod + -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f strings.pod + +strip.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod + -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f strip.pod + +windres.1: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod + -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windres.pod + +cxxfilt.man: $(binutils_TEXI) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod + -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f $(DEMANGLER_NAME).pod + +$(DEMANGLER_NAME).1: cxxfilt.man Makefile + if test -f cxxfilt.man; then \ + man=cxxfilt.man; \ + else \ + man=$(srcdir)/cxxfilt.man; \ + fi; \ + sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \ + -e 's/cxxfilt/$(DEMANGLER_NAME)/' < $$man \ + > $(DEMANGLER_NAME).1 + +# Maintenance + +# We need it for the taz target in ../../Makefile.in. +info: $(MANS) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/binutils/binutils/doc/binutils.texi b/contrib/binutils/binutils/doc/binutils.texi new file mode 100644 index 0000000..6fb185b --- /dev/null +++ b/contrib/binutils/binutils/doc/binutils.texi @@ -0,0 +1,3832 @@ +\input texinfo @c -*- Texinfo -*- +@setfilename binutils.info +@c Copyright 2001, 2002 Free Software Foundation, Inc. + +@include config.texi + +@ifinfo +@format +START-INFO-DIR-ENTRY +* Binutils: (binutils). The GNU binary utilities. +* ar: (binutils)ar. Create, modify, and extract from archives +* nm: (binutils)nm. List symbols from object files +* objcopy: (binutils)objcopy. Copy and translate object files +* objdump: (binutils)objdump. Display information from object files +* ranlib: (binutils)ranlib. Generate index to archive contents +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size +* strings: (binutils)strings. List printable strings from files +* strip: (binutils)strip. Discard symbols +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt +* addr2line: (binutils)addr2line. Convert addresses to file and line +* nlmconv: (binutils)nlmconv. Converts object code into an NLM +* windres: (binutils)windres. Manipulate Windows resources +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs +END-INFO-DIR-ENTRY +@end format +@end ifinfo + +@ifinfo +@c man begin COPYRIGHT +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections, with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + +@c man end +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries a copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). + +@end ignore +@end ifinfo + +@synindex ky cp +@c +@c This file documents the GNU binary utilities "ar", "ld", "objcopy", +@c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". +@c +@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +@c +@c This text may be freely distributed under the terms of the GNU +@c Free Documentation License. +@c + +@setchapternewpage odd +@settitle @sc{gnu} Binary Utilities +@titlepage +@finalout +@title The @sc{gnu} Binary Utilities +@subtitle Version @value{VERSION} +@sp 1 +@subtitle May 1993 +@author Roland H. Pesch +@author Jeffrey M. Osier +@author Cygnus Support +@page + +@tex +{\parskip=0pt \hfill Cygnus Support\par \hfill +\TeX{}info \texinfoversion\par } +@end tex + +@vskip 0pt plus 1filll +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +@end titlepage + +@node Top +@top Introduction + +@cindex version +This brief manual contains preliminary documentation for the @sc{gnu} binary +utilities (collectively version @value{VERSION}): + +@iftex +@table @code +@item ar +Create, modify, and extract from archives + +@item nm +List symbols from object files + +@item objcopy +Copy and translate object files + +@item objdump +Display information from object files + +@item ranlib +Generate index to archive contents + +@item readelf +Display the contents of ELF format files. + +@item size +List file section sizes and total size + +@item strings +List printable strings from files + +@item strip +Discard symbols + +@item c++filt +Demangle encoded C++ symbols (on MS-DOS, this program is named +@code{cxxfilt}) + +@item addr2line +Convert addresses into file names and line numbers + +@item nlmconv +Convert object code into a Netware Loadable Module + +@item windres +Manipulate Windows resources + +@item dlltool +Create the files needed to build and use Dynamic Link Libraries +@end table +@end iftex + +This document is distributed under the terms of the GNU Free +Documentation License. A copy of the license is included in the +section entitled "GNU Free Documentation License". + +@menu +* ar:: Create, modify, and extract from archives +* nm:: List symbols from object files +* objcopy:: Copy and translate object files +* objdump:: Display information from object files +* ranlib:: Generate index to archive contents +* readelf:: Display the contents of ELF format files. +* size:: List section sizes and total size +* strings:: List printable strings from files +* strip:: Discard symbols +* c++filt:: Filter to demangle encoded C++ symbols +* cxxfilt: c++filt. MS-DOS name for c++filt +* addr2line:: Convert addresses to file and line +* nlmconv:: Converts object code into an NLM +* windres:: Manipulate Windows resources +* dlltool:: Create files needed to build and use DLLs +* Selecting The Target System:: How these utilities determine the target. +* Reporting Bugs:: Reporting Bugs +* GNU Free Documentation License:: GNU Free Documentation License +* Index:: Index +@end menu + +@node ar +@chapter ar + +@kindex ar +@cindex archives +@cindex collections of files + +@c man title ar create, modify, and extract from archives + +@smallexample +ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] +ar -M [ }), and continues executing even after +errors. If you redirect standard input to a script file, no prompts are +issued, and @command{ar} abandons execution (with a nonzero exit code) +on any error. + +The @command{ar} command language is @emph{not} designed to be equivalent +to the command-line options; in fact, it provides somewhat less control +over archives. The only purpose of the command language is to ease the +transition to @sc{gnu} @command{ar} for developers who already have scripts +written for the MRI ``librarian'' program. + +The syntax for the @command{ar} command language is straightforward: +@itemize @bullet +@item +commands are recognized in upper or lower case; for example, @code{LIST} +is the same as @code{list}. In the following descriptions, commands are +shown in upper case for clarity. + +@item +a single command may appear on each line; it is the first word on the +line. + +@item +empty lines are allowed, and have no effect. + +@item +comments are allowed; text after either of the characters @samp{*} +or @samp{;} is ignored. + +@item +Whenever you use a list of names as part of the argument to an @command{ar} +command, you can separate the individual names with either commas or +blanks. Commas are shown in the explanations below, for clarity. + +@item +@samp{+} is used as a line continuation character; if @samp{+} appears +at the end of a line, the text on the following line is considered part +of the current command. +@end itemize + +Here are the commands you can use in @command{ar} scripts, or when using +@command{ar} interactively. Three of them have special significance: + +@code{OPEN} or @code{CREATE} specify a @dfn{current archive}, which is +a temporary file required for most of the other commands. + +@code{SAVE} commits the changes so far specified by the script. Prior +to @code{SAVE}, commands affect only the temporary copy of the current +archive. + +@table @code +@item ADDLIB @var{archive} +@itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module}) +Add all the contents of @var{archive} (or, if specified, each named +@var{module} from @var{archive}) to the current archive. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@item ADDMOD @var{member}, @var{member}, @dots{} @var{member} +@c FIXME! w/Replacement?? If so, like "ar r @var{archive} @var{names}" +@c else like "ar q..." +Add each named @var{member} as a module in the current archive. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@item CLEAR +Discard the contents of the current archive, canceling the effect of +any operations since the last @code{SAVE}. May be executed (with no +effect) even if no current archive is specified. + +@item CREATE @var{archive} +Creates an archive, and makes it the current archive (required for many +other commands). The new archive is created with a temporary name; it +is not actually saved as @var{archive} until you use @code{SAVE}. +You can overwrite existing archives; similarly, the contents of any +existing file named @var{archive} will not be destroyed until @code{SAVE}. + +@item DELETE @var{module}, @var{module}, @dots{} @var{module} +Delete each listed @var{module} from the current archive; equivalent to +@samp{ar -d @var{archive} @var{module} @dots{} @var{module}}. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@item DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) +@itemx DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) @var{outputfile} +List each named @var{module} present in @var{archive}. The separate +command @code{VERBOSE} specifies the form of the output: when verbose +output is off, output is like that of @samp{ar -t @var{archive} +@var{module}@dots{}}. When verbose output is on, the listing is like +@samp{ar -tv @var{archive} @var{module}@dots{}}. + +Output normally goes to the standard output stream; however, if you +specify @var{outputfile} as a final argument, @command{ar} directs the +output to that file. + +@item END +Exit from @command{ar}, with a @code{0} exit code to indicate successful +completion. This command does not save the output file; if you have +changed the current archive since the last @code{SAVE} command, those +changes are lost. + +@item EXTRACT @var{module}, @var{module}, @dots{} @var{module} +Extract each named @var{module} from the current archive, writing them +into the current directory as separate files. Equivalent to @samp{ar -x +@var{archive} @var{module}@dots{}}. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@ignore +@c FIXME Tokens but no commands??? +@item FULLDIR + +@item HELP +@end ignore + +@item LIST +Display full contents of the current archive, in ``verbose'' style +regardless of the state of @code{VERBOSE}. The effect is like @samp{ar +tv @var{archive}}. (This single command is a @sc{gnu} @command{ar} +enhancement, rather than present for MRI compatibility.) + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@item OPEN @var{archive} +Opens an existing archive for use as the current archive (required for +many other commands). Any changes as the result of subsequent commands +will not actually affect @var{archive} until you next use @code{SAVE}. + +@item REPLACE @var{module}, @var{module}, @dots{} @var{module} +In the current archive, replace each existing @var{module} (named in +the @code{REPLACE} arguments) from files in the current working directory. +To execute this command without errors, both the file, and the module in +the current archive, must exist. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@item VERBOSE +Toggle an internal flag governing the output from @code{DIRECTORY}. +When the flag is on, @code{DIRECTORY} output matches output from +@samp{ar -tv }@dots{}. + +@item SAVE +Commit your changes to the current archive, and actually save it as a +file with the name specified in the last @code{CREATE} or @code{OPEN} +command. + +Requires prior use of @code{OPEN} or @code{CREATE}. + +@end table + +@iftex +@node ld +@chapter ld +@cindex linker +@kindex ld +The @sc{gnu} linker @command{ld} is now described in a separate manual. +@xref{Top,, Overview,, Using LD: the @sc{gnu} linker}. +@end iftex + +@node nm +@chapter nm +@cindex symbols +@kindex nm + +@c man title nm list symbols from object files + +@smallexample +@c man begin SYNOPSIS nm +nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}] + [@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}] + [@option{-s}|@option{--print-armap}] [@option{-A}|@option{-o}|@option{--print-file-name}] + [@option{-n}|@option{-v}|@option{--numeric-sort}] [@option{-p}|@option{--no-sort}] + [@option{-r}|@option{--reverse-sort}] [@option{--size-sort}] [@option{-u}|@option{--undefined-only}] + [@option{-t} @var{radix}|@option{--radix=}@var{radix}] [@option{-P}|@option{--portability}] + [@option{--target=}@var{bfdname}] [@option{-f}@var{format}|@option{--format=}@var{format}] + [@option{--defined-only}] [@option{-l}|@option{--line-numbers}] [@option{--no-demangle}] + [@option{-V}|@option{--version}] [@option{-X 32_64}] [@option{--help}] [@var{objfile}@dots{}] +@c man end +@end smallexample + +@c man begin DESCRIPTION nm +@sc{gnu} @command{nm} lists the symbols from object files @var{objfile}@dots{}. +If no object files are listed as arguments, @command{nm} assumes the file +@file{a.out}. + +For each symbol, @command{nm} shows: + +@itemize @bullet +@item +The symbol value, in the radix selected by options (see below), or +hexadecimal by default. + +@item +The symbol type. At least the following types are used; others are, as +well, depending on the object file format. If lowercase, the symbol is +local; if uppercase, the symbol is global (external). + +@c Some more detail on exactly what these symbol types are used for +@c would be nice. +@table @code +@item A +The symbol's value is absolute, and will not be changed by further +linking. + +@item B +The symbol is in the uninitialized data section (known as BSS). + +@item C +The symbol is common. Common symbols are uninitialized data. When +linking, multiple common symbols may appear with the same name. If the +symbol is defined anywhere, the common symbols are treated as undefined +references. +@ifclear man +For more details on common symbols, see the discussion of +--warn-common in @ref{Options,,Linker options,ld.info,The GNU linker}. +@end ifclear + +@item D +The symbol is in the initialized data section. + +@item G +The symbol is in an initialized data section for small objects. Some +object file formats permit more efficient access to small data objects, +such as a global int variable as opposed to a large global array. + +@item I +The symbol is an indirect reference to another symbol. This is a GNU +extension to the a.out object file format which is rarely used. + +@item N +The symbol is a debugging symbol. + +@item R +The symbol is in a read only data section. + +@item S +The symbol is in an uninitialized data section for small objects. + +@item T +The symbol is in the text (code) section. + +@item U +The symbol is undefined. + +@item V +The symbol is a weak object. When a weak defined symbol is linked with +a normal defined symbol, the normal defined symbol is used with no error. +When a weak undefined symbol is linked and the symbol is not defined, +the value of the weak symbol becomes zero with no error. + +@item W +The symbol is a weak symbol that has not been specifically tagged as a +weak object symbol. When a weak defined symbol is linked with a normal +defined symbol, the normal defined symbol is used with no error. +When a weak undefined symbol is linked and the symbol is not defined, +the value of the weak symbol becomes zero with no error. + +@item - +The symbol is a stabs symbol in an a.out object file. In this case, the +next values printed are the stabs other field, the stabs desc field, and +the stab type. Stabs symbols are used to hold debugging information. +@ifclear man +For more information, see @ref{Top,Stabs,Stabs Overview,stabs.info, The +``stabs'' debug format}. +@end ifclear + +@item ? +The symbol type is unknown, or object file format specific. +@end table + +@item +The symbol name. +@end itemize + +@c man end + +@c man begin OPTIONS nm +The long and short forms of options, shown here as alternatives, are +equivalent. + +@table @env +@item -A +@itemx -o +@itemx --print-file-name +@cindex input file name +@cindex file name +@cindex source file name +Precede each symbol by the name of the input file (or archive member) +in which it was found, rather than identifying the input file once only, +before all of its symbols. + +@item -a +@itemx --debug-syms +@cindex debugging symbols +Display all symbols, even debugger-only symbols; normally these are not +listed. + +@item -B +@cindex @command{nm} format +@cindex @command{nm} compatibility +The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}). + +@item -C +@itemx --demangle[=@var{style}] +@cindex demangling in nm +Decode (@dfn{demangle}) low-level symbol names into user-level names. +Besides removing any initial underscore prepended by the system, this +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. + +@item --no-demangle +Do not demangle low-level symbol names. This is the default. + +@item -D +@itemx --dynamic +@cindex dynamic symbols +Display the dynamic symbols rather than the normal symbols. This is +only meaningful for dynamic objects, such as certain types of shared +libraries. + +@item -f @var{format} +@itemx --format=@var{format} +@cindex @command{nm} format +@cindex @command{nm} compatibility +Use the output format @var{format}, which can be @code{bsd}, +@code{sysv}, or @code{posix}. The default is @code{bsd}. +Only the first character of @var{format} is significant; it can be +either upper or lower case. + +@item -g +@itemx --extern-only +@cindex external symbols +Display only external symbols. + +@item -l +@itemx --line-numbers +@cindex symbol line numbers +For each symbol, use debugging information to try to find a filename and +line number. For a defined symbol, look for the line number of the +address of the symbol. For an undefined symbol, look for the line +number of a relocation entry which refers to the symbol. If line number +information can be found, print it after the other symbol information. + +@item -n +@itemx -v +@itemx --numeric-sort +Sort symbols numerically by their addresses, rather than alphabetically +by their names. + +@item -p +@itemx --no-sort +@cindex sorting symbols +Do not bother to sort the symbols in any order; print them in the order +encountered. + +@item -P +@itemx --portability +Use the POSIX.2 standard output format instead of the default format. +Equivalent to @samp{-f posix}. + +@item -s +@itemx --print-armap +@cindex symbol index, listing +When listing symbols from archive members, include the index: a mapping +(stored in the archive by @command{ar} or @command{ranlib}) of which modules +contain definitions for which names. + +@item -r +@itemx --reverse-sort +Reverse the order of the sort (whether numeric or alphabetic); let the +last come first. + +@item --size-sort +Sort symbols by size. The size is computed as the difference between +the value of the symbol and the value of the symbol with the next higher +value. The size of the symbol is printed, rather than the value. + +@item -t @var{radix} +@itemx --radix=@var{radix} +Use @var{radix} as the radix for printing the symbol values. It must be +@samp{d} for decimal, @samp{o} for octal, or @samp{x} for hexadecimal. + +@item --target=@var{bfdname} +@cindex object code format +Specify an object code format other than your system's default format. +@xref{Target Selection}, for more information. + +@item -u +@itemx --undefined-only +@cindex external symbols +@cindex undefined symbols +Display only undefined symbols (those external to each object file). + +@item --defined-only +@cindex external symbols +@cindex undefined symbols +Display only defined symbols for each object file. + +@item -V +@itemx --version +Show the version number of @command{nm} and exit. + +@item -X +This option is ignored for compatibility with the AIX version of +@command{nm}. It takes one parameter which must be the string +@option{32_64}. The default mode of AIX @command{nm} corresponds +to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}. + +@item --help +Show a summary of the options to @command{nm} and exit. +@end table + +@c man end + +@ignore +@c man begin SEEALSO nm +ar(1), objdump(1), ranlib(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node objcopy +@chapter objcopy + +@c man title objcopy copy and translate object files + +@smallexample +@c man begin SYNOPSIS objcopy +objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] + [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] + [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] + [@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}] + [@option{-S}|@option{--strip-all}] [@option{-g}|@option{--strip-debug}] + [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}] + [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] + [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] + [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] + [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] + [@option{-x}|@option{--discard-all}] [@option{-X}|@option{--discard-locals}] + [@option{-b} @var{byte}|@option{--byte=}@var{byte}] + [@option{-i} @var{interleave}|@option{--interleave=}@var{interleave}] + [@option{-j} @var{sectionname}|@option{--only-section=}@var{sectionname}] + [@option{-R} @var{sectionname}|@option{--remove-section=}@var{sectionname}] + [@option{-p}|@option{--preserve-dates}] + [@option{--debugging}] + [@option{--gap-fill=}@var{val}] [@option{--pad-to=}@var{address}] + [@option{--set-start=}@var{val}] [@option{--adjust-start=}@var{incr}] + [@option{--change-addresses=}@var{incr}] + [@option{--change-section-address} @var{section}@{=,+,-@}@var{val}] + [@option{--change-section-lma} @var{section}@{=,+,-@}@var{val}] + [@option{--change-section-vma} @var{section}@{=,+,-@}@var{val}] + [@option{--change-warnings}] [@option{--no-change-warnings}] + [@option{--set-section-flags} @var{section}=@var{flags}] + [@option{--add-section} @var{sectionname}=@var{filename}] + [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] + [@option{--change-leading-char} ] [@option{--remove-leading-char}] + [@option{--srec-len=}@var{ival} ] [@option{--srec-forceS3}] + [@option{--redefine-sym} @var{old}=@var{new} ] + [@option{--weaken}] + [@option{--keep-symbols=}@var{filename}] + [@option{--strip-symbols=}@var{filename}] + [@option{--keep-global-symbols=}@var{filename}] + [@option{--localize-symbols=}@var{filename}] + [@option{--weaken-symbols=}@var{filename}] + [@option{--alt-machine-code=@var{index}}] + [@option{-v}|@option{--verbose}] + [@option{-V}|@option{--version}] + [@option{--help}] + @var{infile} [@var{outfile}] +@c man end +@end smallexample + +@c man begin DESCRIPTION objcopy +The @sc{gnu} @command{objcopy} utility copies the contents of an object +file to another. @command{objcopy} uses the @sc{gnu} @sc{bfd} Library to +read and write the object files. It can write the destination object +file in a format different from that of the source object file. The +exact behavior of @command{objcopy} is controlled by command-line options. +Note that @command{objcopy} should be able to copy a fully linked file +between any two formats. However, copying a relocatable object file +between any two formats may not work as expected. + +@command{objcopy} creates temporary files to do its translations and +deletes them afterward. @command{objcopy} uses @sc{bfd} to do all its +translation work; it has access to all the formats described in @sc{bfd} +and thus is able to recognize most formats without being told +explicitly. @xref{BFD,,BFD,ld.info,Using LD}. + +@command{objcopy} can be used to generate S-records by using an output +target of @samp{srec} (e.g., use @samp{-O srec}). + +@command{objcopy} can be used to generate a raw binary file by using an +output target of @samp{binary} (e.g., use @option{-O binary}). When +@command{objcopy} generates a raw binary file, it will essentially produce +a memory dump of the contents of the input object file. All symbols and +relocation information will be discarded. The memory dump will start at +the load address of the lowest section copied into the output file. + +When generating an S-record or a raw binary file, it may be helpful to +use @option{-S} to remove sections containing debugging information. In +some cases @option{-R} will be useful to remove sections which contain +information that is not needed by the binary file. + +Note - @command{objcopy} is not able to change the endianness of its input +files. If the input format has an endianness, (some formats do not), +@command{objcopy} can only copy the inputs into file formats that have the +same endianness or which have no endianness (eg @samp{srec}). + +@c man end + +@c man begin OPTIONS objcopy + +@table @env +@item @var{infile} +@itemx @var{outfile} +The input and output files, respectively. +If you do not specify @var{outfile}, @command{objcopy} creates a +temporary file and destructively renames the result with +the name of @var{infile}. + +@item -I @var{bfdname} +@itemx --input-target=@var{bfdname} +Consider the source file's object format to be @var{bfdname}, rather than +attempting to deduce it. @xref{Target Selection}, for more information. + +@item -O @var{bfdname} +@itemx --output-target=@var{bfdname} +Write the output file using the object format @var{bfdname}. +@xref{Target Selection}, for more information. + +@item -F @var{bfdname} +@itemx --target=@var{bfdname} +Use @var{bfdname} as the object format for both the input and the output +file; i.e., simply transfer data from source to destination with no +translation. @xref{Target Selection}, for more information. + +@item -B @var{bfdarch} +@itemx --binary-architecture=@var{bfdarch} +Useful when transforming a raw binary input file into an object file. +In this case the output architecture can be set to @var{bfdarch}. This +option will be ignored if the input file has a known @var{bfdarch}. You +can access this binary data inside a program by referencing the special +symbols that are created by the conversion process. These symbols are +called _binary_@var{objfile}_start, _binary_@var{objfile}_end and +_binary_@var{objfile}_size. e.g. you can transform a picture file into +an object file and then access it in your code using these symbols. + +@item -j @var{sectionname} +@itemx --only-section=@var{sectionname} +Copy only the named section from the input file to the output file. +This option may be given more than once. Note that using this option +inappropriately may make the output file unusable. + +@item -R @var{sectionname} +@itemx --remove-section=@var{sectionname} +Remove any section named @var{sectionname} from the output file. This +option may be given more than once. Note that using this option +inappropriately may make the output file unusable. + +@item -S +@itemx --strip-all +Do not copy relocation and symbol information from the source file. + +@item -g +@itemx --strip-debug +Do not copy debugging symbols from the source file. + +@item --strip-unneeded +Strip all symbols that are not needed for relocation processing. + +@item -K @var{symbolname} +@itemx --keep-symbol=@var{symbolname} +Copy only symbol @var{symbolname} from the source file. This option may +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. + +@item -G @var{symbolname} +@itemx --keep-global-symbol=@var{symbolname} +Keep only symbol @var{symbolname} global. Make all other symbols local +to the file, so that they are not visible externally. This option 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 +Do not copy non-global symbols from the source file. +@c FIXME any reason to prefer "non-global" to "local" here? + +@item -X +@itemx --discard-locals +Do not copy compiler-generated local symbols. +(These usually start with @samp{L} or @samp{.}.) + +@item -b @var{byte} +@itemx --byte=@var{byte} +Keep only every @var{byte}th byte of the input file (header data is not +affected). @var{byte} can be in the range from 0 to @var{interleave}-1, +where @var{interleave} is given by the @option{-i} or @option{--interleave} +option, or the default of 4. This option is useful for creating files +to program @sc{rom}. It is typically used with an @code{srec} output +target. + +@item -i @var{interleave} +@itemx --interleave=@var{interleave} +Only copy one out of every @var{interleave} bytes. Select which byte to +copy with the @option{-b} or @option{--byte} option. The default is 4. +@command{objcopy} ignores this option if you do not specify either @option{-b} or +@option{--byte}. + +@item -p +@itemx --preserve-dates +Set the access and modification dates of the output file to be the same +as those of the input file. + +@item --debugging +Convert debugging information, if possible. This is not the default +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 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 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 @option{--gap-fill} (default zero). + +@item --set-start @var{val} +Set the start address of the new file to @var{val}. Not all object file +formats support setting the start address. + +@item --change-start @var{incr} +@itemx --adjust-start @var{incr} +@cindex changing start address +Change the start address by adding @var{incr}. Not all object file +formats support setting the start address. + +@item --change-addresses @var{incr} +@itemx --adjust-vma @var{incr} +@cindex changing object addresses +Change the VMA and LMA addresses of all sections, as well as the start +address, by adding @var{incr}. Some object file formats do not permit +section addresses to be changed arbitrarily. Note that this does not +relocate the sections; if the program expects sections to be loaded at a +certain address, and this option is used to change the sections such +that they are loaded at a different address, the program may fail. + +@item --change-section-address @var{section}@{=,+,-@}@var{val} +@itemx --adjust-section-vma @var{section}@{=,+,-@}@var{val} +@cindex changing section address +Set or change both the VMA address and the LMA address of the named +@var{section}. If @samp{=} is used, the section address is set to +@var{val}. Otherwise, @var{val} is added to or subtracted from the +section address. See the comments under @option{--change-addresses}, +above. If @var{section} does not exist in the input file, a warning will +be issued, unless @option{--no-change-warnings} is used. + +@item --change-section-lma @var{section}@{=,+,-@}@var{val} +@cindex changing section LMA +Set or change the LMA address of the named @var{section}. The LMA +address is the address where the section will be loaded into memory at +program load time. Normally this is the same as the VMA address, which +is the address of the section at program run time, but on some systems, +especially those where a program is held in ROM, the two can be +different. If @samp{=} is used, the section address is set to +@var{val}. Otherwise, @var{val} is added to or subtracted from the +section address. See the comments under @option{--change-addresses}, +above. If @var{section} does not exist in the input file, a warning +will be issued, unless @option{--no-change-warnings} is used. + +@item --change-section-vma @var{section}@{=,+,-@}@var{val} +@cindex changing section VMA +Set or change the VMA address of the named @var{section}. The VMA +address is the address where the section will be located once the +program has started executing. Normally this is the same as the LMA +address, which is the address where the section will be loaded into +memory, but on some systems, especially those where a program is held in +ROM, the two can be different. If @samp{=} is used, the section address +is set to @var{val}. Otherwise, @var{val} is added to or subtracted +from the section address. See the comments under +@option{--change-addresses}, above. If @var{section} does not exist in +the input file, a warning will be issued, unless +@option{--no-change-warnings} is used. + +@item --change-warnings +@itemx --adjust-warnings +If @option{--change-section-address} or @option{--change-section-lma} or +@option{--change-section-vma} is used, and the named section does not +exist, issue a warning. This is the default. + +@item --no-change-warnings +@itemx --no-adjust-warnings +Do not issue a warning if @option{--change-section-address} or +@option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even +if 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{contents}, @samp{load}, @samp{noload}, +@samp{readonly}, @samp{code}, @samp{data}, @samp{rom}, @samp{share}, and +@samp{debug}. 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 +contents of the new section are taken from the file @var{filename}. The +size of the section will be the size of the file. This option only +works on file formats which can support sections with arbitrary names. + +@item --rename-section @var{oldname}=@var{newname}[,@var{flags}] +Rename a section from @var{oldname} to @var{newname}, optionally +changing the section's flags to @var{flags} in the process. This has +the advantage over usng a linker script to perform the rename in that +the output stays as an object file and does not become a linked +executable. + +This option is particularly helpful when the input format is binary, +since this will always create a section called .data. If for example, +you wanted instead to create a section called .rodata containing binary +data you could use the following command line to achieve it: + +@smallexample + objcopy -I binary -O -B \ + --rename-section .data=.rodata,alloc,load,readonly,data,contents \ + +@end smallexample + +@item --change-leading-char +Some object file formats use special characters at the start of +symbols. The most common such character is underscore, which compilers +often add before every symbol. This option tells @command{objcopy} to +change the leading character of every symbol when it converts between +object file formats. If the object file formats use the same leading +character, this option has no effect. Otherwise, it will add a +character, or remove a character, or change a character, as +appropriate. + +@item --remove-leading-char +If the first character of a global symbol is a special symbol leading +character used by the object file format, remove the character. The +most common symbol leading character is underscore. This option will +remove a leading underscore from all global symbols. This can be useful +if you want to link together objects of different file formats with +different conventions for symbol names. This is different from +@option{--change-leading-char} because it always changes the symbol name +when appropriate, regardless of the object file format of the output +file. + +@item --srec-len=@var{ival} +Meaningful only for srec output. Set the maximum length of the Srecords +being produced to @var{ival}. This length covers both address, data and +crc fields. + +@item --srec-forceS3 +Meaningful only for srec output. Avoid generation of S1/S2 records, +creating S3-only record format. + +@item --redefine-sym @var{old}=@var{new} +Change the name of a symbol @var{old}, to @var{new}. This can be useful +when one is trying link two things together for which you have no +source, and there are name collisions. + +@item --weaken +Change all global symbols in the file to be weak. This can be useful +when building an object which will be linked against other objects using +the @option{-R} option to the linker. This option is only effective when +using an object file format which supports weak symbols. + +@item --keep-symbols=@var{filename} +Apply @option{--keep-symbol} option to each symbol listed in the file +@var{filename}. @var{filename} is simply a flat file, with one symbol +name per line. Line comments may be introduced by the hash character. +This option may be given more than once. + +@item --strip-symbols=@var{filename} +Apply @option{--strip-symbol} option to each symbol listed in the file +@var{filename}. @var{filename} is simply a flat file, with one symbol +name per line. Line comments may be introduced by the hash character. +This option may be given more than once. + +@item --keep-global-symbols=@var{filename} +Apply @option{--keep-global-symbol} option to each symbol listed in the +file @var{filename}. @var{filename} is simply a flat file, with one +symbol name per line. Line comments may be introduced by the hash +character. This option may be given more than once. + +@item --localize-symbols=@var{filename} +Apply @option{--localize-symbol} option to each symbol listed in the file +@var{filename}. @var{filename} is simply a flat file, with one symbol +name per line. Line comments may be introduced by the hash character. +This option may be given more than once. + +@item --weaken-symbols=@var{filename} +Apply @option{--weaken-symbol} option to each symbol listed in the file +@var{filename}. @var{filename} is simply a flat file, with one symbol +name per line. Line comments may be introduced by the hash character. +This option may be given more than once. + +@item --alt-machine-code=@var{index} +If the output architecture has alternate machine codes, use the +@var{index}th code instead of the default one. This is useful in case +a machine is assigned an official code and the tool-chain adopts the +new code, but other applications still depend on the original code +being used. + +@item -V +@itemx --version +Show the version number of @command{objcopy}. + +@item -v +@itemx --verbose +Verbose output: list all object files modified. In the case of +archives, @samp{objcopy -V} lists all members of the archive. + +@item --help +Show a summary of the options to @command{objcopy}. +@end table + +@c man end + +@ignore +@c man begin SEEALSO objcopy +ld(1), objdump(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node objdump +@chapter objdump + +@cindex object file information +@kindex objdump + +@c man title objdump display information from object files. + +@smallexample +@c man begin SYNOPSIS objdump +objdump [@option{-a}|@option{--archive-headers}] + [@option{-b} @var{bfdname}|@option{--target=@var{bfdname}}] + [@option{-C}|@option{--demangle}[=@var{style}] ] + [@option{-d}|@option{--disassemble}] + [@option{-D}|@option{--disassemble-all}] + [@option{-z}|@option{--disassemble-zeroes}] + [@option{-EB}|@option{-EL}|@option{--endian=}@{big | little @}] + [@option{-f}|@option{--file-headers}] + [@option{--file-start-context}] + [@option{-g}|@option{--debugging}] + [@option{-h}|@option{--section-headers}|@option{--headers}] + [@option{-i}|@option{--info}] + [@option{-j} @var{section}|@option{--section=}@var{section}] + [@option{-l}|@option{--line-numbers}] + [@option{-S}|@option{--source}] + [@option{-m} @var{machine}|@option{--architecture=}@var{machine}] + [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}] + [@option{-p}|@option{--private-headers}] + [@option{-r}|@option{--reloc}] + [@option{-R}|@option{--dynamic-reloc}] + [@option{-s}|@option{--full-contents}] + [@option{-G}|@option{--stabs}] + [@option{-t}|@option{--syms}] + [@option{-T}|@option{--dynamic-syms}] + [@option{-x}|@option{--all-headers}] + [@option{-w}|@option{--wide}] + [@option{--start-address=}@var{address}] + [@option{--stop-address=}@var{address}] + [@option{--prefix-addresses}] + [@option{--[no-]show-raw-insn}] + [@option{--adjust-vma=}@var{offset}] + [@option{-V}|@option{--version}] + [@option{-H}|@option{--help}] + @var{objfile}@dots{} +@c man end +@end smallexample + +@c man begin DESCRIPTION objdump + +@command{objdump} displays information about one or more object files. +The options control what particular information to display. This +information is mostly useful to programmers who are working on the +compilation tools, as opposed to programmers who just want their +program to compile and work. + +@var{objfile}@dots{} are the object files to be examined. When you +specify archives, @command{objdump} shows information on each of the member +object files. + +@c man end + +@c man begin OPTIONS objdump + +The long and short forms of options, shown here as alternatives, are +equivalent. At least one option from the list +@option{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given. + +@table @env +@item -a +@itemx --archive-header +@cindex archive headers +If any of the @var{objfile} files are archives, display the archive +header information (in a format similar to @samp{ls -l}). Besides the +information you could list with @samp{ar tv}, @samp{objdump -a} shows +the object file format of each archive member. + +@item --adjust-vma=@var{offset} +@cindex section addresses in objdump +@cindex VMA in objdump +When dumping information, first add @var{offset} to all the section +addresses. This is useful if the section addresses do not correspond to +the symbol table, which can happen when putting sections at particular +addresses when using a format which can not represent section addresses, +such as a.out. + +@item -b @var{bfdname} +@itemx --target=@var{bfdname} +@cindex object code format +Specify that the object-code format for the object files is +@var{bfdname}. This option may not be necessary; @var{objdump} can +automatically recognize many formats. + +For example, +@example +objdump -b oasys -m vax -h fu.o +@end example +@noindent +displays summary information from the section headers (@option{-h}) of +@file{fu.o}, which is explicitly identified (@option{-m}) as a VAX object +file in the format produced by Oasys compilers. You can list the +formats available with the @option{-i} option. +@xref{Target Selection}, for more information. + +@item -C +@itemx --demangle[=@var{style}] +@cindex demangling in objdump +Decode (@dfn{demangle}) low-level symbol names into user-level names. +Besides removing any initial underscore prepended by the system, this +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. + +@item -G +@item --debugging +Display debugging information. This attempts to parse debugging +information stored in the file and print it out using a C like syntax. +Only certain types of debugging information have been implemented. + +@item -d +@itemx --disassemble +@cindex disassembling object code +@cindex machine instructions +Display the assembler mnemonics for the machine instructions from +@var{objfile}. This option only disassembles those sections which are +expected to contain instructions. + +@item -D +@itemx --disassemble-all +Like @option{-d}, but disassemble the contents of all sections, not just +those expected to contain instructions. + +@item --prefix-addresses +When disassembling, print the complete address on each line. This is +the older disassembly format. + +@item --disassemble-zeroes +Normally the disassembly output will skip blocks of zeroes. This +option directs the disassembler to disassemble those blocks, just like +any other data. + +@item -EB +@itemx -EL +@itemx --endian=@{big|little@} +@cindex endianness +@cindex disassembly endianness +Specify the endianness of the object files. This only affects +disassembly. This can be useful when disassembling a file format which +does not describe endianness information, such as S-records. + +@item -f +@itemx --file-header +@cindex object file header +Display summary information from the overall header of +each of the @var{objfile} files. + +@item --file-start-context +@cindex source code context +Specify that when displaying interlisted source code/disassembly +(assumes @option{-S}) from a file that has not yet been displayed, extend the +context to the start of the file. + +@item -h +@itemx --section-header +@itemx --header +@cindex section headers +Display summary information from the section headers of the +object file. + +File segments may be relocated to nonstandard addresses, for example by +using the @option{-Ttext}, @option{-Tdata}, or @option{-Tbss} options to +@command{ld}. However, some object file formats, such as a.out, do not +store the starting address of the file segments. In those situations, +although @command{ld} relocates the sections correctly, using @samp{objdump +-h} to list the file section headers cannot show the correct addresses. +Instead, it shows the usual addresses, which are implicit for the +target. + +@item --help +Print a summary of the options to @command{objdump} and exit. + +@item -i +@itemx --info +@cindex architectures available +@cindex object formats available +Display a list showing all architectures and object formats available +for specification with @option{-b} or @option{-m}. + +@item -j @var{name} +@itemx --section=@var{name} +@cindex section information +Display information only for section @var{name}. + +@item -l +@itemx --line-numbers +@cindex source filenames for object files +Label the display (using debugging information) with the filename and +source line numbers corresponding to the object code or relocs shown. +Only useful with @option{-d}, @option{-D}, or @option{-r}. + +@item -m @var{machine} +@itemx --architecture=@var{machine} +@cindex architecture +@cindex disassembly architecture +Specify the architecture to use when disassembling object files. This +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 @option{-i} option. + +@item -M @var{options} +@itemx --disassembler-options=@var{options} +Pass target specific information to the disassembler. Only supported on +some targets. + +If the target is an ARM architecture then this switch can be used to +select which register name set is used during disassembler. Specifying +@option{-M reg-name-std} (the default) will select the register names as +used in ARM's instruction set documentation, but with register 13 called +'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying +@option{-M reg-names-apcs} will select the name set used by the ARM +Procedure Call Standard, whilst specifying @option{-M reg-names-raw} will +just use @samp{r} followed by the register number. + +There are also two variants on the APCS register naming scheme enabled +by @option{-M reg-names-atpcs} and @option{-M reg-names-special-atpcs} which +use the ARM/Thumb Procedure Call Standard naming conventions. (Either +with the normal register name or the special register names). + +This option can also be used for ARM architectures to force the +disassembler to interpret all instructions as Thumb instructions by +using the switch @option{--disassembler-options=force-thumb}. This can be +useful when attempting to disassemble thumb code produced by other +compilers. + +For the x86, some of the options duplicate functions of the @option{-m} +switch, but allow finer grained control. Multiple selections from the +following may be specified as a comma separated string. +@option{x86-64}, @option{i386} and @option{i8086} select disassembly for +the given architecture. @option{intel} and @option{att} select between +intel syntax mode and AT&T syntax mode. @option{addr32}, +@option{addr16}, @option{data32} and @option{data16} specify the default +address size and operand size. These four options will be overridden if +@option{x86-64}, @option{i386} or @option{i8086} appear later in the +option string. Lastly, @option{suffix}, when in AT&T mode, +instructs the dissassembler to print a mnemonic suffix even when the +suffix could be inferred by the operands. + +For PPC, @option{booke}, @option{booke32} and @option{booke64} select +disassembly of BookE instructions. @option{32} and @option{64} select +PowerPC and PowerPC64 disassembly, respectively. + +@item -p +@itemx --private-headers +Print information that is specific to the object file format. The exact +information printed depends upon the object file format. For some +object file formats, no additional information is printed. + +@item -r +@itemx --reloc +@cindex relocation entries, in object file +Print the relocation entries of the file. If used with @option{-d} or +@option{-D}, the relocations are printed interspersed with the +disassembly. + +@item -R +@itemx --dynamic-reloc +@cindex dynamic relocation entries, in object file +Print the dynamic relocation entries of the file. This is only +meaningful for dynamic objects, such as certain types of shared +libraries. + +@item -s +@itemx --full-contents +@cindex sections, full contents +@cindex object file sections +Display the full contents of any sections requested. + +@item -S +@itemx --source +@cindex source disassembly +@cindex disassembly, with source +Display source code intermixed with disassembly, if possible. Implies +@option{-d}. + +@item --show-raw-insn +When disassembling instructions, print the instruction in hex as well as +in symbolic form. This is the default except when +@option{--prefix-addresses} is used. + +@item --no-show-raw-insn +When disassembling instructions, do not print the instruction bytes. +This is the default when @option{--prefix-addresses} is used. + +@item -G +@item --stabs +@cindex stab +@cindex .stab +@cindex debug symbols +@cindex ELF object file format +Display the full contents of any sections requested. Display the +contents of the .stab and .stab.index and .stab.excl sections from an +ELF file. This is only useful on systems (such as Solaris 2.0) in which +@code{.stab} debugging symbol-table entries are carried in an ELF +section. In most other file formats, debugging symbol-table entries are +interleaved with linkage symbols, and are visible in the @option{--syms} +output. +@ifclear man +For more information on stabs symbols, see @ref{Top,Stabs,Stabs +Overview,stabs.info, The ``stabs'' debug format}. +@end ifclear + +@item --start-address=@var{address} +@cindex start-address +Start displaying data at the specified address. This affects the output +of the @option{-d}, @option{-r} and @option{-s} options. + +@item --stop-address=@var{address} +@cindex stop-address +Stop displaying data at the specified address. This affects the output +of the @option{-d}, @option{-r} and @option{-s} options. + +@item -t +@itemx --syms +@cindex symbol table entries, printing +Print the symbol table entries of the file. +This is similar to the information provided by the @samp{nm} program. + +@item -T +@itemx --dynamic-syms +@cindex dynamic symbol table entries, printing +Print the dynamic symbol table entries of the file. This is only +meaningful for dynamic objects, such as certain types of shared +libraries. This is similar to the information provided by the @samp{nm} +program when given the @option{-D} (@option{--dynamic}) option. + +@item --version +Print the version number of @command{objdump} and exit. + +@item -x +@itemx --all-header +@cindex all header information, object file +@cindex header information, all +Display all available header information, including the symbol table and +relocation entries. Using @option{-x} is equivalent to specifying all of +@option{-a -f -h -r -t}. + +@item -w +@itemx --wide +@cindex wide output, printing +Format some lines for output devices that have more than 80 columns. +Also do not truncate symbol names when they are displayed. +@end table + +@c man end + +@ignore +@c man begin SEEALSO objdump +nm(1), readelf(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node ranlib +@chapter ranlib + +@kindex ranlib +@cindex archive contents +@cindex symbol index + +@c man title ranlib generate index to archive. + +@smallexample +@c man begin SYNOPSIS ranlib +ranlib [@option{-vV}] @var{archive} +@c man end +@end smallexample + +@c man begin DESCRIPTION ranlib + +@command{ranlib} generates an index to the contents of an archive and +stores it in the archive. The index lists each symbol defined by a +member of an archive that is a relocatable object file. + +You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. + +An archive with such an index speeds up linking to the library and +allows routines in the library to call each other without regard to +their placement in the archive. + +The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; running +@command{ranlib} is completely equivalent to executing @samp{ar -s}. +@xref{ar}. + +@c man end + +@c man begin OPTIONS ranlib + +@table @env +@item -v +@itemx -V +@itemx --version +Show the version number of @command{ranlib}. +@end table + +@c man end + +@ignore +@c man begin SEEALSO ranlib +ar(1), nm(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node size +@chapter size + +@kindex size +@cindex section sizes + +@c man title size list section sizes and total size. + +@smallexample +@c man begin SYNOPSIS size +size [@option{-A}|@option{-B}|@option{--format=}@var{compatibility}] + [@option{--help}] + [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] + [@option{-t}|@option{--totals}] + [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] + [@var{objfile}@dots{}] +@c man end +@end smallexample + +@c man begin DESCRIPTION size + +The @sc{gnu} @command{size} utility lists the section sizes---and the total +size---for each of the object or archive files @var{objfile} in its +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. + +@c man end + +@c man begin OPTIONS size + +The command line options have the following meanings: + +@table @env +@item -A +@itemx -B +@itemx --format=@var{compatibility} +@cindex @command{size} display format +Using one of these options, you can choose whether the output from @sc{gnu} +@command{size} resembles output from System V @command{size} (using @option{-A}, +or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or +@option{--format=berkeley}). The default is the one-line format similar to +Berkeley's. +@c Bonus for doc-source readers: you can also say --format=strange (or +@c anything else that starts with 's') for sysv, and --format=boring (or +@c anything else that starts with 'b') for Berkeley. + +Here is an example of the Berkeley (default) format of output from +@command{size}: +@smallexample +$ size --format=Berkeley ranlib size +text data bss dec hex filename +294880 81920 11592 388392 5ed28 ranlib +294880 81920 11888 388688 5ee50 size +@end smallexample + +@noindent +This is the same data, but displayed closer to System V conventions: + +@smallexample +$ size --format=SysV ranlib size +ranlib : +section size addr +.text 294880 8192 +.data 81920 303104 +.bss 11592 385024 +Total 388392 + + +size : +section size addr +.text 294880 8192 +.data 81920 303104 +.bss 11888 385024 +Total 388688 +@end smallexample + +@item --help +Show a summary of acceptable arguments and options. + +@item -d +@itemx -o +@itemx -x +@itemx --radix=@var{number} +@cindex @command{size} number format +@cindex radix for section sizes +Using one of these options, you can control whether the size of each +section is given in decimal (@option{-d}, or @option{--radix=10}); octal +(@option{-o}, or @option{--radix=8}); or hexadecimal (@option{-x}, or +@option{--radix=16}). In @option{--radix=@var{number}}, only the three +values (8, 10, 16) are supported. The total size is always given in two +radices; decimal and hexadecimal for @option{-d} or @option{-x} output, or +octal and hexadecimal if you're using @option{-o}. + +@item -t +@itemx --totals +Show totals of all objects listed (Berkeley format listing mode only). + +@item --target=@var{bfdname} +@cindex object code format +Specify that the object-code format for @var{objfile} is +@var{bfdname}. This option may not be necessary; @command{size} can +automatically recognize many formats. +@xref{Target Selection}, for more information. + +@item -V +@itemx --version +Display the version number of @command{size}. +@end table + +@c man end + +@ignore +@c man begin SEEALSO size +ar(1), objdump(1), readelf(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node strings +@chapter strings +@kindex strings +@cindex listings strings +@cindex printing strings +@cindex strings, printing + +@c man title strings print the strings of printable characters in files. + +@smallexample +@c man begin SYNOPSIS strings +strings [@option{-afov}] [@option{-}@var{min-len}] + [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] + [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] + [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] + [@option{-}] [@option{--all}] [@option{--print-file-name}] + [@option{--target=}@var{bfdname}] + [@option{--help}] [@option{--version}] @var{file}@dots{} +@c man end +@end smallexample + +@c man begin DESCRIPTION strings + +For each @var{file} given, @sc{gnu} @command{strings} prints the printable +character sequences that are at least 4 characters long (or the number +given with the options below) and are followed by an unprintable +character. By default, it only prints the strings from the initialized +and loaded sections of object files; for other types of files, it prints +the strings from the whole file. + +@command{strings} is mainly useful for determining the contents of non-text +files. + +@c man end + +@c man begin OPTIONS strings + +@table @env +@item -a +@itemx --all +@itemx - +Do not scan only the initialized and loaded sections of object files; +scan the whole files. + +@item -f +@itemx --print-file-name +Print the name of the file before each string. + +@item --help +Print a summary of the program usage on the standard output and exit. + +@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. + +@item -o +Like @samp{-t o}. Some other versions of @command{strings} have @option{-o} +act like @samp{-t d} instead. Since we can not be compatible with both +ways, we simply chose one. + +@item -t @var{radix} +@itemx --radix=@var{radix} +Print the offset within the file before each string. The single +character argument specifies the radix of the offset---@samp{o} for +octal, @samp{x} for hexadecimal, or @samp{d} for decimal. + +@item -e @var{encoding} +@itemx --encoding=@var{encoding} +Select the character encoding of the strings that are to be found. +Possible values for @var{encoding} are: @samp{s} = single-byte +characters (ASCII, ISO 8859, etc., default), @samp{b} = 16-bit +Bigendian, @samp{l} = 16-bit Littleendian, @samp{B} = 32-bit Bigendian, +@samp{L} = 32-bit Littleendian. Useful for finding wide character +strings. + +@item --target=@var{bfdname} +@cindex object code format +Specify an object code format other than your system's default format. +@xref{Target Selection}, for more information. + +@item -v +@itemx --version +Print the program version number on the standard output and exit. +@end table + +@c man end + +@ignore +@c man begin SEEALSO strings +ar(1), nm(1), objdump(1), ranlib(1), readelf(1) +and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node strip +@chapter strip + +@kindex strip +@cindex removing symbols +@cindex discarding symbols +@cindex symbols, discarding + +@c man title strip Discard symbols from object files. + +@smallexample +@c man begin SYNOPSIS strip +strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname} ] + [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname} ] + [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname} ] + [@option{-s}|@option{--strip-all}] [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}] + [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname} ] + [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname} ] + [@option{-x}|@option{--discard-all} ] [@option{-X} |@option{--discard-locals}] + [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname} ] + [@option{-o} @var{file} ] [@option{-p}|@option{--preserve-dates}] + [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] [@option{--help}] + @var{objfile}@dots{} +@c man end +@end smallexample + +@c man begin DESCRIPTION strip + +@sc{gnu} @command{strip} discards all symbols from object files +@var{objfile}. The list of object files may include archives. +At least one object file must be given. + +@command{strip} modifies the files named in its argument, +rather than writing modified copies under different names. + +@c man end + +@c man begin OPTIONS strip + +@table @env +@item -F @var{bfdname} +@itemx --target=@var{bfdname} +Treat the original @var{objfile} as a file with the object +code format @var{bfdname}, and rewrite it in the same format. +@xref{Target Selection}, for more information. + +@item --help +Show a summary of the options to @command{strip} and exit. + +@item -I @var{bfdname} +@itemx --input-target=@var{bfdname} +Treat the original @var{objfile} as a file with the object +code format @var{bfdname}. +@xref{Target Selection}, for more information. + +@item -O @var{bfdname} +@itemx --output-target=@var{bfdname} +Replace @var{objfile} with a file in the output format @var{bfdname}. +@xref{Target Selection}, for more information. + +@item -R @var{sectionname} +@itemx --remove-section=@var{sectionname} +Remove any section named @var{sectionname} from the output file. This +option may be given more than once. Note that using this option +inappropriately may make the output file unusable. + +@item -s +@itemx --strip-all +Remove all symbols. + +@item -g +@itemx -S +@itemx -d +@itemx --strip-debug +Remove debugging symbols only. + +@item --strip-unneeded +Remove all symbols that are not needed for relocation processing. + +@item -K @var{symbolname} +@itemx --keep-symbol=@var{symbolname} +Keep only symbol @var{symbolname} from the source file. This option may +be given more than once. + +@item -N @var{symbolname} +@itemx --strip-symbol=@var{symbolname} +Remove symbol @var{symbolname} from the source file. This option may be +given more than once, and may be combined with strip options other than +@option{-K}. + +@item -o @var{file} +Put the stripped output in @var{file}, rather than replacing the +existing file. When this argument is used, only one @var{objfile} +argument may be specified. + +@item -p +@itemx --preserve-dates +Preserve the access and modification dates of the file. + +@item -x +@itemx --discard-all +Remove non-global symbols. + +@item -X +@itemx --discard-locals +Remove compiler-generated local symbols. +(These usually start with @samp{L} or @samp{.}.) + +@item -V +@itemx --version +Show the version number for @command{strip}. + +@item -v +@itemx --verbose +Verbose output: list all object files modified. In the case of +archives, @samp{strip -v} lists all members of the archive. +@end table + +@c man end + +@ignore +@c man begin SEEALSO strip +the Info entries for @file{binutils}. +@c man end +@end ignore + +@node c++filt, addr2line, strip, Top +@chapter c++filt + +@kindex c++filt +@cindex demangling C++ symbols + +@c man title cxxfilt Demangle C++ and Java symbols. + +@smallexample +@c man begin SYNOPSIS cxxfilt +c++filt [@option{-_}|@option{--strip-underscores}] + [@option{-j}|@option{--java}] + [@option{-n}|@option{--no-strip-underscores}] + [@option{-s} @var{format}|@option{--format=}@var{format}] + [@option{--help}] [@option{--version}] [@var{symbol}@dots{}] +@c man end +@end smallexample + +@c man begin DESCRIPTION cxxfilt + +@kindex cxxfilt +The C++ and Java languages provides function overloading, which means +that you can write many functions with the same name (providing each +takes parameters of different types). All C++ and Java function names +are encoded into a low-level assembly label (this process is known as +@dfn{mangling}). The @command{c++filt} +@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on +MS-DOS this program is named @command{cxxfilt}.} +program does the inverse mapping: it decodes (@dfn{demangles}) low-level +names into user-level names so that the linker can keep these overloaded +functions from clashing. + +Every alphanumeric word (consisting of letters, digits, underscores, +dollars, or periods) seen in the input is a potential label. If the +label decodes into a C++ name, the C++ name replaces the low-level +name in the output. + +You can use @command{c++filt} to decipher individual symbols: + +@example +c++filt @var{symbol} +@end example + +If no @var{symbol} arguments are given, @command{c++filt} reads symbol +names from the standard input and writes the demangled names to the +standard output. All results are printed on the standard output. + +@c man end + +@c man begin OPTIONS cxxfilt + +@table @env +@item -_ +@itemx --strip-underscores +On some systems, both the C and C++ compilers put an underscore in front +of every name. For example, the C name @code{foo} gets the low-level +name @code{_foo}. This option removes the initial underscore. Whether +@command{c++filt} removes the underscore by default is target dependent. + +@item -j +@itemx --java +Prints demangled names using Java syntax. The default is to use C++ +syntax. + +@item -n +@itemx --no-strip-underscores +Do not remove the initial underscore. + +@item -s @var{format} +@itemx --format=@var{format} +@sc{gnu} @command{nm} can decode three different methods of mangling, used by +different C++ compilers. The argument to this option selects which +method it uses: + +@table @code +@item gnu +the one used by the @sc{gnu} compiler (the default method) +@item lucid +the one used by the Lucid compiler +@item arm +the one specified by the C++ Annotated Reference Manual +@item hp +the one used by the HP compiler +@item edg +the one used by the EDG compiler +@item gnu-new-abi +the one used by the @sc{gnu} compiler with the new ABI. +@end table + +@item --help +Print a summary of the options to @command{c++filt} and exit. + +@item --version +Print the version number of @command{c++filt} and exit. +@end table + +@c man end + +@ignore +@c man begin SEEALSO cxxfilt +the Info entries for @file{binutils}. +@c man end +@end ignore + +@quotation +@emph{Warning:} @command{c++filt} is a new utility, and the details of its +user interface are subject to change in future releases. In particular, +a command-line option may be required in the the future to decode a name +passed as an argument on the command line; in other words, + +@example +c++filt @var{symbol} +@end example + +@noindent +may in a future release become + +@example +c++filt @var{option} @var{symbol} +@end example +@end quotation + +@node addr2line +@chapter addr2line + +@kindex addr2line +@cindex address to file name and line number + +@c man title addr2line convert addresses into file names and line numbers. + +@smallexample +@c man begin SYNOPSIS addr2line +addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}] + [@option{-C}|@option{--demangle}[=@var{style}] + [@option{-e} @var{filename}|@option{--exe=}@var{filename}] + [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] + [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] + [addr addr @dots{}] +@c man end +@end smallexample + +@c man begin DESCRIPTION addr2line + +@command{addr2line} translates program addresses into file names and line +numbers. Given an address and an executable, it uses the debugging +information in the executable to figure out which file name and line +number are associated with a given address. + +The executable to use is specified with the @option{-e} option. The +default is the file @file{a.out}. + +@command{addr2line} has two modes of operation. + +In the first, hexadecimal addresses are specified on the command line, +and @command{addr2line} displays the file name and line number for each +address. + +In the second, @command{addr2line} reads hexadecimal addresses from +standard input, and prints the file name and line number for each +address on standard output. In this mode, @command{addr2line} may be used +in a pipe to convert dynamically chosen addresses. + +The format of the output is @samp{FILENAME:LINENO}. The file name and +line number for each address is printed on a separate line. If the +@command{-f} option is used, then each @samp{FILENAME:LINENO} line is +preceded by a @samp{FUNCTIONNAME} line which is the name of the function +containing the address. + +If the file name or function name can not be determined, +@command{addr2line} will print two question marks in their place. If the +line number can not be determined, @command{addr2line} will print 0. + +@c man end + +@c man begin OPTIONS addr2line + +The long and short forms of options, shown here as alternatives, are +equivalent. + +@table @env +@item -b @var{bfdname} +@itemx --target=@var{bfdname} +@cindex object code format +Specify that the object-code format for the object files is +@var{bfdname}. + +@item -C +@itemx --demangle[=@var{style}] +@cindex demangling in objdump +Decode (@dfn{demangle}) low-level symbol names into user-level names. +Besides removing any initial underscore prepended by the system, this +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. + +@item -e @var{filename} +@itemx --exe=@var{filename} +Specify the name of the executable for which addresses should be +translated. The default file is @file{a.out}. + +@item -f +@itemx --functions +Display function names as well as file and line number information. + +@item -s +@itemx --basenames +Display only the base of each file name. +@end table + +@c man end + +@ignore +@c man begin SEEALSO addr2line +Info entries for @file{binutils}. +@c man end +@end ignore + +@node nlmconv +@chapter nlmconv + +@command{nlmconv} converts a relocatable object file into a NetWare +Loadable Module. + +@ignore +@command{nlmconv} currently works with @samp{i386} object +files in @code{coff}, @sc{elf}, or @code{a.out} format, and @sc{SPARC} +object files in @sc{elf}, or @code{a.out} format@footnote{ +@command{nlmconv} should work with any @samp{i386} or @sc{sparc} object +format in the Binary File Descriptor library. It has only been tested +with the above formats.}. +@end ignore + +@quotation +@emph{Warning:} @command{nlmconv} is not always built as part of the binary +utilities, since it is only useful for NLM targets. +@end quotation + +@c man title nlmconv converts object code into an NLM. + +@smallexample +@c man begin SYNOPSIS nlmconv +nlmconv [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] + [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] + [@option{-T} @var{headerfile}|@option{--header-file=}@var{headerfile}] + [@option{-d}|@option{--debug}] [@option{-l} @var{linker}|@option{--linker=}@var{linker}] + [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] + @var{infile} @var{outfile} +@c man end +@end smallexample + +@c man begin DESCRIPTION nlmconv + +@command{nlmconv} converts the relocatable @samp{i386} object file +@var{infile} into the NetWare Loadable Module @var{outfile}, optionally +reading @var{headerfile} for NLM header information. For instructions +on writing the NLM command file language used in header files, see the +@samp{linkers} section, @samp{NLMLINK} in particular, of the @cite{NLM +Development and Tools Overview}, which is part of the NLM Software +Developer's Kit (``NLM SDK''), available from Novell, Inc. +@command{nlmconv} uses the @sc{gnu} Binary File Descriptor library to read +@var{infile}; +@ifclear man +see @ref{BFD,,BFD,ld.info,Using LD}, for more information. +@end ifclear + +@command{nlmconv} can perform a link step. In other words, you can list +more than one object file for input if you list them in the definitions +file (rather than simply specifying one input file on the command line). +In this case, @command{nlmconv} calls the linker for you. + +@c man end + +@c man begin OPTIONS nlmconv + +@table @env +@item -I @var{bfdname} +@itemx --input-target=@var{bfdname} +Object format of the input file. @command{nlmconv} can usually determine +the format of a given file (so no default is necessary). +@xref{Target Selection}, for more information. + +@item -O @var{bfdname} +@itemx --output-target=@var{bfdname} +Object format of the output file. @command{nlmconv} infers the output +format based on the input format, e.g. for a @samp{i386} input file the +output format is @samp{nlm32-i386}. +@xref{Target Selection}, for more information. + +@item -T @var{headerfile} +@itemx --header-file=@var{headerfile} +Reads @var{headerfile} for NLM header information. For instructions on +writing the NLM command file language used in header files, see@ see the +@samp{linkers} section, of the @cite{NLM Development and Tools +Overview}, which is part of the NLM Software Developer's Kit, available +from Novell, Inc. + +@item -d +@itemx --debug +Displays (on standard error) the linker command line used by @command{nlmconv}. + +@item -l @var{linker} +@itemx --linker=@var{linker} +Use @var{linker} for any linking. @var{linker} can be an absolute or a +relative pathname. + +@item -h +@itemx --help +Prints a usage summary. + +@item -V +@itemx --version +Prints the version number for @command{nlmconv}. +@end table + +@c man end + +@ignore +@c man begin SEEALSO nlmconv +the Info entries for @file{binutils}. +@c man end +@end ignore + +@node windres +@chapter windres + +@command{windres} may be used to manipulate Windows resources. + +@quotation +@emph{Warning:} @command{windres} is not always built as part of the binary +utilities, since it is only useful for Windows targets. +@end quotation + +@c man title windres manipulate Windows resources. + +@smallexample +@c man begin SYNOPSIS windres +windres [options] [input-file] [output-file] +@c man end +@end smallexample + +@c man begin DESCRIPTION windres + +@command{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 @command{windres} converts from the @code{rc} format to the @code{res} +format, it is acting like the Windows Resource Compiler. When +@command{windres} converts from the @code{res} format to the @code{coff} +format, it is acting like the Windows @code{CVTRES} program. + +When @command{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, @command{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, @command{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 @command{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. + +@c man end + +@c man begin OPTIONS windres + +@table @env +@item -i @var{filename} +@itemx --input @var{filename} +The name of the input file. If this option is not used, then +@command{windres} will use the first non-option argument as the input file +name. If there are no non-option arguments, then @command{windres} will +read from standard input. @command{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 +@command{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 @command{windres} will write to standard output. +@command{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, @command{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, +@command{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 @option{--help} option to see a list +of supported targets. Normally @command{windres} will use the default +format, which is the first one listed by the @option{--help} option. +@ifclear man +@ref{Target Selection}. +@end ifclear + +@item --preprocessor @var{program} +When @command{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. +@command{windres} will pass this to the preprocessor as an @option{-I} +option. @command{windres} will also search this directory when looking for +files named in the @code{rc} file. + +@item -D @var{target} +@itemx --define @var{sym}[=@var{val}] +Specify a @option{-D} option to pass to the preprocessor when reading an +@code{rc} file. + +@item -v +Enable verbose mode. This tells you what the preprocessor is if you +didn't specify one. + +@item --language @var{val} +Specify the default language to use when reading an @code{rc} file. +@var{val} should be a hexadecimal language code. The low eight bits are +the language, and the high eight bits are the sublanguage. + +@item --use-temp-file +Use a temporary file to instead of using popen to read the output of +the preprocessor. Use this option if the popen implementation is buggy +on the host (eg., certain non-English language versions of Windows 95 and +Windows 98 are known to have buggy popen where the output will instead +go the console). + +@item --no-use-temp-file +Use popen, not a temporary file, to read the output of the preprocessor. +This is the default behaviour. + +@item --help +Prints a usage summary. + +@item --version +Prints the version number for @command{windres}. + +@item --yydebug +If @command{windres} is compiled with @code{YYDEBUG} defined as @code{1}, +this will turn on parser debugging. +@end table + +@c man end + +@ignore +@c man begin SEEALSO windres +the Info entries for @file{binutils}. +@c man end +@end ignore + +@node dlltool +@chapter Create files needed to build and use DLLs +@cindex DLL +@kindex dlltool + +@command{dlltool} may be used to create the files needed to build and use +dynamic link libraries (DLLs). + +@quotation +@emph{Warning:} @command{dlltool} is not always built as part of the binary +utilities, since it is only useful for those targets which support DLLs. +@end quotation + +@c man title dlltool Create files needed to build and use DLLs. + +@smallexample +@c man begin SYNOPSIS dlltool +dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] + [@option{-b}|@option{--base-file} @var{base-file-name}] + [@option{-e}|@option{--output-exp} @var{exports-file-name}] + [@option{-z}|@option{--output-def} @var{def-file-name}] + [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] + [@option{--exclude-symbols} @var{list}] + [@option{--no-default-excludes}] + [@option{-S}|@option{--as} @var{path-to-assembler}] [@option{-f}|@option{--as-flags} @var{options}] + [@option{-D}|@option{--dllname} @var{name}] [@option{-m}|@option{--machine} @var{machine}] + [@option{-a}|@option{--add-indirect}] [@option{-U}|@option{--add-underscore}] [@option{-k}|@option{--kill-at}] + [@option{-A}|@option{--add-stdcall-alias}] + [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] + [@option{-n}|@option{--nodelete}] [@option{-v}|@option{--verbose}] + [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] + [object-file @dots{}] +@c man end +@end smallexample + +@c man begin DESCRIPTION dlltool + +@command{dlltool} reads its inputs, which can come from the @option{-d} and +@option{-b} options as well as object files specified on the command +line. It then processes these inputs and if the @option{-e} option has +been specified it creates a exports file. If the @option{-l} option +has been specified it creates a library file and if the @option{-z} option +has been specified it creates a def file. Any or all of the @option{-e}, +@option{-l} and @option{-z} options can be present in one invocation of +dlltool. + +When creating a DLL, along with the source for the DLL, it is necessary +to have three other files. @command{dlltool} can help with the creation of +these files. + +The first file is a @samp{.def} file which specifies which functions are +exported from the DLL, which functions the DLL imports, and so on. This +is a text file and can be created by hand, or @command{dlltool} can be used +to create it using the @option{-z} option. In this case @command{dlltool} +will scan the object files specified on its command line looking for +those functions which have been specially marked as being exported and +put entries for them in the .def file it creates. + +In order to mark a function as being exported from a DLL, it needs to +have an @option{-export:} entry in the @samp{.drectve} +section of the object file. This can be done in C by using the +asm() operator: + +@smallexample + asm (".section .drectve"); + asm (".ascii \"-export:my_func\""); + + int my_func (void) @{ @dots{} @} +@end smallexample + +The second file needed for DLL creation is an exports file. This file +is linked with the object files that make up the body of the DLL and it +handles the interface between the DLL and the outside world. This is a +binary file and it can be created by giving the @option{-e} option to +@command{dlltool} when it is creating or reading in a .def file. + +The third file needed for DLL creation is the library file that programs +will link with in order to access the functions in the DLL. This file +can be created by giving the @option{-l} option to dlltool when it +is creating or reading in a .def file. + +@command{dlltool} builds the library file by hand, but it builds the +exports file by creating temporary files containing assembler statements +and then assembling these. The @option{-S} command line option can be +used to specify the path to the assembler that dlltool will use, +and the @option{-f} option can be used to pass specific flags to that +assembler. The @option{-n} can be used to prevent dlltool from deleting +these temporary assembler files when it is done, and if @option{-n} is +specified twice then this will prevent dlltool from deleting the +temporary object files it used to build the library. + +Here is an example of creating a DLL from a source file @samp{dll.c} and +also creating a program (from an object file called @samp{program.o}) +that uses that DLL: + +@smallexample + gcc -c dll.c + dlltool -e exports.o -l dll.lib dll.o + gcc dll.o exports.o -o dll.dll + gcc program.o dll.lib -o program +@end smallexample + +@c man end + +@c man begin OPTIONS dlltool + +The command line options have the following meanings: + +@table @env + +@item -d @var{filename} +@itemx --input-def @var{filename} +@cindex input .def file +Specifies the name of a .def file to be read in and processed. + +@item -b @var{filename} +@itemx --base-file @var{filename} +@cindex base files +Specifies the name of a base file to be read in and processed. The +contents of this file will be added to the relocation section in the +exports file generated by dlltool. + +@item -e @var{filename} +@itemx --output-exp @var{filename} +Specifies the name of the export file to be created by dlltool. + +@item -z @var{filename} +@itemx --output-def @var{filename} +Specifies the name of the .def file to be created by dlltool. + +@item -l @var{filename} +@itemx --output-lib @var{filename} +Specifies the name of the library file to be created by dlltool. + +@item --export-all-symbols +Treat all global and weak defined symbols found in the input object +files as symbols to be exported. There is a small list of symbols which +are not exported by default; see the @option{--no-default-excludes} +option. You may add to the list of symbols to not export by using the +@option{--exclude-symbols} option. + +@item --no-export-all-symbols +Only export symbols explicitly listed in an input .def file or in +@samp{.drectve} sections in the input object files. This is the default +behaviour. The @samp{.drectve} sections are created by @samp{dllexport} +attributes in the source code. + +@item --exclude-symbols @var{list} +Do not export the symbols in @var{list}. This is a list of symbol names +separated by comma or colon characters. The symbol names should not +contain a leading underscore. This is only meaningful when +@option{--export-all-symbols} is used. + +@item --no-default-excludes +When @option{--export-all-symbols} is used, it will by default avoid +exporting certain special symbols. The current list of symbols to avoid +exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0}, +@samp{impure_ptr}. You may use the @option{--no-default-excludes} option +to go ahead and export these special symbols. This is only meaningful +when @option{--export-all-symbols} is used. + +@item -S @var{path} +@itemx --as @var{path} +Specifies the path, including the filename, of the assembler to be used +to create the exports file. + +@item -f @var{options} +@itemx --as-flags @var{options} +Specifies any specific command line options to be passed to the +assembler when building the exports file. This option will work even if +the @option{-S} option is not used. This option only takes one argument, +and if it occurs more than once on the command line, then later +occurrences will override earlier occurrences. So if it is necessary to +pass multiple options to the assembler they should be enclosed in +double quotes. + +@item -D @var{name} +@itemx --dll-name @var{name} +Specifies the name to be stored in the .def file as the name of the DLL +when the @option{-e} option is used. If this option is not present, then +the filename given to the @option{-e} option will be used as the name of +the DLL. + +@item -m @var{machine} +@itemx -machine @var{machine} +Specifies the type of machine for which the library file should be +built. @command{dlltool} has a built in default type, depending upon how +it was created, but this option can be used to override that. This is +normally only useful when creating DLLs for an ARM processor, when the +contents of the DLL are actually encode using Thumb instructions. + +@item -a +@itemx --add-indirect +Specifies that when @command{dlltool} is creating the exports file it +should add a section which allows the exported functions to be +referenced without using the import library. Whatever the hell that +means! + +@item -U +@itemx --add-underscore +Specifies that when @command{dlltool} is creating the exports file it +should prepend an underscore to the names of the exported functions. + +@item -k +@itemx --kill-at +Specifies that when @command{dlltool} is creating the exports file it +should not append the string @samp{@@ }. These numbers are +called ordinal numbers and they represent another way of accessing the +function in a DLL, other than by name. + +@item -A +@itemx --add-stdcall-alias +Specifies that when @command{dlltool} is creating the exports file it +should add aliases for stdcall symbols without @samp{@@ } +in addition to the symbols with @samp{@@ }. + +@item -x +@itemx --no-idata4 +Specifies that when @command{dlltool} is creating the exports and library +files it should omit the @code{.idata4} section. This is for compatibility +with certain operating systems. + +@item -c +@itemx --no-idata5 +Specifies that when @command{dlltool} is creating the exports and library +files it should omit the @code{.idata5} section. This is for compatibility +with certain operating systems. + +@item -i +@itemx --interwork +Specifies that @command{dlltool} should mark the objects in the library +file and exports file that it produces as supporting interworking +between ARM and Thumb code. + +@item -n +@itemx --nodelete +Makes @command{dlltool} preserve the temporary assembler files it used to +create the exports file. If this option is repeated then dlltool will +also preserve the temporary object files it uses to create the library +file. + +@item -v +@itemx --verbose +Make dlltool describe what it is doing. + +@item -h +@itemx --help +Displays a list of command line options and then exits. + +@item -V +@itemx --version +Displays dlltool's version number and then exits. + +@end table + +@c man end + +@ignore +@c man begin SEEALSO dlltool +the Info entries for @file{binutils}. +@c man end +@end ignore + +@node readelf +@chapter readelf + +@cindex ELF file information +@kindex readelf + +@c man title readelf Displays information about ELF files. + +@smallexample +@c man begin SYNOPSIS readelf +readelf [@option{-a}|@option{--all}] + [@option{-h}|@option{--file-header}] + [@option{-l}|@option{--program-headers}|@option{--segments}] + [@option{-S}|@option{--section-headers}|@option{--sections}] + [@option{-e}|@option{--headers}] + [@option{-s}|@option{--syms}|@option{--symbols}] + [@option{-n}|@option{--notes}] + [@option{-r}|@option{--relocs}] + [@option{-u}|@option{--unwind}] + [@option{-d}|@option{--dynamic}] + [@option{-V}|@option{--version-info}] + [@option{-D}|@option{--use-dynamic}] + [@option{-x} |@option{--hex-dump=}] + [@option{-w[liaprmfs]}|@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str]] + [@option{-histogram}] + [@option{-v}|@option{--version}] + [@option{-W}|@option{--wide}] + [@option{-H}|@option{--help}] + @var{elffile}@dots{} +@c man end +@end smallexample + +@c man begin DESCRIPTION readelf + +@command{readelf} displays information about one or more ELF format object +files. The options control what particular information to display. + +@var{elffile}@dots{} are the object files to be examined. At the +moment, @command{readelf} does not support examining archives, nor does it +support examing 64 bit ELF files. + +@c man end + +@c man begin OPTIONS readelf + +The long and short forms of options, shown here as alternatives, are +equivalent. At least one option besides @samp{-v} or @samp{-H} must be +given. + +@table @env +@item -a +@itemx --all +Equivalent to specifiying @option{--file-header}, +@option{--program-headers}, @option{--sections}, @option{--symbols}, +@option{--relocs}, @option{--dynamic}, @option{--notes} and +@option{--version-info}. + +@item -h +@itemx --file-header +@cindex ELF file header information +Displays the information contained in the ELF header at the start of the +file. + +@item -l +@itemx --program-headers +@itemx --segments +@cindex ELF program header information +@cindex ELF segment information +Displays the information contained in the file's segment headers, if it +has any. + +@item -S +@itemx --sections +@itemx --section-headers +@cindex ELF section information +Displays the information contained in the file's section headers, if it +has any. + +@item -s +@itemx --symbols +@itemx --syms +@cindex ELF symbol table information +Displays the entries in symbol table section of the file, if it has one. + +@item -e +@itemx --headers +Display all the headers in the file. Equivalent to @option{-h -l -S}. + +@item -n +@itemx --notes +@cindex ELF core notes +Displays the contents of the NOTE segment, if it exists. + +@item -r +@itemx --relocs +@cindex ELF reloc information +Displays the contents of the file's relocation section, if it has one. + +@item -u +@itemx --unwind +@cindex unwind information +Displays the contents of the file's unwind section, if it has one. Only +the unwind sections for IA64 ELF files are currently supported. + +@item -d +@itemx --dynamic +@cindex ELF dynamic section information +Displays the contents of the file's dynamic section, if it has one. + +@item -V +@itemx --version-info +@cindex ELF version sections informations +Displays the contents of the version sections in the file, it they +exist. + +@item -D +@itemx --use-dynamic +When displaying symbols, this option makes @command{readelf} use the +symbol table in the file's dynamic section, rather than the one in the +symbols section. + +@item -x +@itemx --hex-dump= +Displays the contents of the indicated section as a hexadecimal dump. + +@item -w[liaprmfs] +@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str] +Displays the contents of the debug sections in the file, if any are +present. If one of the optional letters or words follows the switch +then only data found in those specific sections will be dumped. + +@item --histogram +Display a histogram of bucket list lengths when displaying the contents +of the symbol tables. + +@item -v +@itemx --version +Display the version number of readelf. + +@item -W +@itemx --wide +Don't break output lines to fit into 80 columns. By default +@command{readelf} breaks section header and segment listing lines for +64-bit ELF files, so that they fit into 80 columns. This option causes +@command{readelf} to print each section header resp. each segment one a +single line, which is far more readable on terminals wider than 80 columns. + +@item -H +@itemx --help +Display the command line options understood by @command{readelf}. + +@end table + +@c man end + +@ignore +@c man begin SEEALSO readelf +objdump(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + +@node Selecting The Target System +@chapter Selecting the target system + +You can specify three aspects of the target system to the @sc{gnu} +binary file utilities, each in several ways: + +@itemize @bullet +@item +the target + +@item +the architecture + +@item +the linker emulation (which applies to the linker only) +@end itemize + +In the following summaries, the lists of ways to specify values are in +order of decreasing precedence. The ways listed first override those +listed later. + +The commands to list valid values only list the values for which the +programs you are running were configured. If they were configured with +@option{--enable-targets=all}, the commands list most of the available +values, but a few are left out; not all targets can be configured in at +once because some of them can only be configured @dfn{native} (on hosts +with the same type as the target system). + +@menu +* Target Selection:: +* Architecture Selection:: +* Linker Emulation Selection:: +@end menu + +@node Target Selection +@section Target Selection + +A @dfn{target} is an object file format. A given target may be +supported for multiple architectures (@pxref{Architecture Selection}). +A target selection may also have variations for different operating +systems or architectures. + +The command to list valid target values is @samp{objdump -i} +(the first column of output contains the relevant information). + +Some sample values are: @samp{a.out-hp300bsd}, @samp{ecoff-littlemips}, +@samp{a.out-sunos-big}. + +You can also specify a target using a configuration triplet. This is +the same sort of name that is passed to @file{configure} to specify a +target. When you use a configuration triplet as an argument, it must be +fully canonicalized. You can see the canonical version of a triplet by +running the shell script @file{config.sub} which is included with the +sources. + +Some sample configuration triplets are: @samp{m68k-hp-bsd}, +@samp{mips-dec-ultrix}, @samp{sparc-sun-sunos}. + +@subheading @command{objdump} Target + +Ways to specify: + +@enumerate +@item +command line option: @option{-b} or @option{--target} + +@item +environment variable @code{GNUTARGET} + +@item +deduced from the input file +@end enumerate + +@subheading @command{objcopy} and @command{strip} Input Target + +Ways to specify: + +@enumerate +@item +command line options: @option{-I} or @option{--input-target}, or @option{-F} or @option{--target} + +@item +environment variable @code{GNUTARGET} + +@item +deduced from the input file +@end enumerate + +@subheading @command{objcopy} and @command{strip} Output Target + +Ways to specify: + +@enumerate +@item +command line options: @option{-O} or @option{--output-target}, or @option{-F} or @option{--target} + +@item +the input target (see ``@command{objcopy} and @command{strip} Input Target'' above) + +@item +environment variable @code{GNUTARGET} + +@item +deduced from the input file +@end enumerate + +@subheading @command{nm}, @command{size}, and @command{strings} Target + +Ways to specify: + +@enumerate +@item +command line option: @option{--target} + +@item +environment variable @code{GNUTARGET} + +@item +deduced from the input file +@end enumerate + +@subheading Linker Input Target + +Ways to specify: + +@enumerate +@item +command line option: @option{-b} or @option{--format} +(@pxref{Options,,Options,ld.info,Using LD}) + +@item +script command @code{TARGET} +(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) + +@item +environment variable @code{GNUTARGET} +(@pxref{Environment,,Environment,ld.info,Using LD}) + +@item +the default target of the selected linker emulation +(@pxref{Linker Emulation Selection}) +@end enumerate + +@subheading Linker Output Target + +Ways to specify: + +@enumerate +@item +command line option: @option{-oformat} +(@pxref{Options,,Options,ld.info,Using LD}) + +@item +script command @code{OUTPUT_FORMAT} +(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) + +@item +the linker input target (see ``Linker Input Target'' above) +@end enumerate + +@node Architecture Selection +@section Architecture selection + +An @dfn{architecture} is a type of @sc{cpu} on which an object file is +to run. Its name may contain a colon, separating the name of the +processor family from the name of the particular @sc{cpu}. + +The command to list valid architecture values is @samp{objdump -i} (the +second column contains the relevant information). + +Sample values: @samp{m68k:68020}, @samp{mips:3000}, @samp{sparc}. + +@subheading @command{objdump} Architecture + +Ways to specify: + +@enumerate +@item +command line option: @option{-m} or @option{--architecture} + +@item +deduced from the input file +@end enumerate + +@subheading @command{objcopy}, @command{nm}, @command{size}, @command{strings} Architecture + +Ways to specify: + +@enumerate +@item +deduced from the input file +@end enumerate + +@subheading Linker Input Architecture + +Ways to specify: + +@enumerate +@item +deduced from the input file +@end enumerate + +@subheading Linker Output Architecture + +Ways to specify: + +@enumerate +@item +script command @code{OUTPUT_ARCH} +(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) + +@item +the default architecture from the linker output target +(@pxref{Target Selection}) +@end enumerate + +@node Linker Emulation Selection +@section Linker emulation selection + +A linker @dfn{emulation} is a ``personality'' of the linker, which gives +the linker default values for the other aspects of the target system. +In particular, it consists of + +@itemize @bullet +@item +the linker script + +@item +the target + +@item +several ``hook'' functions that are run at certain stages of the linking +process to do special things that some targets require +@end itemize + +The command to list valid linker emulation values is @samp{ld -V}. + +Sample values: @samp{hp300bsd}, @samp{mipslit}, @samp{sun4}. + +Ways to specify: + +@enumerate +@item +command line option: @option{-m} +(@pxref{Options,,Options,ld.info,Using LD}) + +@item +environment variable @code{LDEMULATION} + +@item +compiled-in @code{DEFAULT_EMULATION} from @file{Makefile}, +which comes from @code{EMUL} in @file{config/@var{target}.mt} +@end enumerate + +@node Reporting Bugs +@chapter Reporting Bugs +@cindex bugs +@cindex reporting bugs + +Your bug reports play an essential role in making the binary utilities +reliable. + +Reporting a bug may help you by bringing a solution to your problem, or +it may not. But in any case the principal function of a bug report is +to help the entire community by making the next version of the binary +utilities work better. Bug reports are your contribution to their +maintenance. + +In order for a bug report to serve its purpose, you must include the +information that enables us to fix the bug. + +@menu +* Bug Criteria:: Have you found a bug? +* Bug Reporting:: How to report bugs +@end menu + +@node Bug Criteria +@section Have you found a bug? +@cindex bug criteria + +If you are not sure whether you have found a bug, here are some guidelines: + +@itemize @bullet +@cindex fatal signal +@cindex crash +@item +If a binary utility gets a fatal signal, for any input whatever, that is +a bug. Reliable utilities never crash. + +@cindex error on valid input +@item +If a binary utility produces an error message for valid input, that is a +bug. + +@item +If you are an experienced user of binary utilities, your suggestions for +improvement are welcome in any case. +@end itemize + +@node Bug Reporting +@section How to report bugs +@cindex bug reports +@cindex bugs, reporting + +A number of companies and individuals offer support for @sc{gnu} +products. If you obtained the binary utilities from a support +organization, we recommend you contact that organization first. + +You can find contact information for many support companies and +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-binutils@@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 +fact or leave it out, state it! + +Often people omit facts because they think they know what causes the +problem and assume that some details do not matter. Thus, you might +assume that the name of a file you use in an example does not matter. +Well, probably it does not, but one cannot be sure. Perhaps the bug is +a stray memory reference which happens to fetch from the location where +that pathname is stored in memory; perhaps, if the pathname were +different, the contents of that location would fool the utility into +doing the right thing despite the bug. Play it safe and give a +specific, complete example. That is the easiest thing for you to do, +and the most helpful. + +Keep in mind that the purpose of a bug report is to enable us to fix the bug if +it is new to us. Therefore, always write your bug reports on the assumption +that the bug has not been reported previously. + +Sometimes people give a few sketchy facts and ask, ``Does this ring a +bell?'' Those bug reports are useless, and we urge everyone to +@emph{refuse to respond to them} except to chide the sender to report +bugs properly. + +To enable us to fix the bug, you should include all these things: + +@itemize @bullet +@item +The version of the utility. Each utility announces it if you start it +with the @option{--version} argument. + +Without this, we will not know whether there is any point in looking for +the bug in the current version of the binary utilities. + +@item +Any patches you may have applied to the source, including any patches +made to the @code{BFD} library. + +@item +The type of machine you are using, and the operating system name and +version number. + +@item +What compiler (and its version) was used to compile the utilities---e.g. +``@code{gcc-2.7}''. + +@item +The command arguments you gave the utility to observe the bug. To +guarantee you will not omit something important, list them all. A copy +of the Makefile (or the output from make) is sufficient. + +If we were to try to guess the arguments, we would probably guess wrong +and then we might not encounter the bug. + +@item +A complete input file, or set of input files, that will reproduce the +bug. If the utility is reading an object file or files, then it is +generally most helpful to send the actual object files, uuencoded if +necessary to get them through the mail system. Note that +@samp{bug-binutils@@gnu.org} is a mailing list, so you should avoid +sending very large files to it. Making the files available for +anonymous FTP is OK. + +If the source files were produced exclusively using @sc{gnu} programs +(e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it +may be OK to send the source files rather than the object files. In +this case, be sure to say exactly what version of @command{gcc}, or +whatever, was used to produce the object files. Also say how +@command{gcc}, or whatever, was configured. + +@item +A description of what behavior you observe that you believe is +incorrect. For example, ``It gets a fatal signal.'' + +Of course, if the bug is that the utility gets a fatal signal, then we +will certainly notice it. But if the bug is incorrect output, we might +not notice unless it is glaringly wrong. You might as well not give us +a chance to make a mistake. + +Even if the problem you experience is a fatal signal, you should still +say so explicitly. Suppose something strange is going on, such as your +copy of the utility is out of synch, or you have encountered a bug in +the C library on your system. (This has happened!) Your copy might +crash and ours would not. If you told us to expect a crash, then when +ours fails to crash, we would know that the bug was not happening for +us. If you had not told us to expect a crash, then we would not be able +to draw any conclusion from our observations. + +@item +If you wish to suggest changes to the source, send us context diffs, as +generated by @command{diff} with the @option{-u}, @option{-c}, or @option{-p} +option. Always send diffs from the old file to the new file. If you +wish to discuss something in the @command{ld} source, refer to it by +context, not by line number. + +The line numbers in our development sources will not match those in your +sources. Your line numbers would convey no useful information to us. +@end itemize + +Here are some things that are not necessary: + +@itemize @bullet +@item +A description of the envelope of the bug. + +Often people who encounter a bug spend a lot of time investigating +which changes to the input file will make the bug go away and which +changes will not affect it. + +This is often time consuming and not very useful, because the way we +will find the bug is by running a single example under the debugger +with breakpoints, not by pure deduction from a series of examples. +We recommend that you save your time for something else. + +Of course, if you can find a simpler example to report @emph{instead} +of the original one, that is a convenience for us. Errors in the +output will be easier to spot, running under the debugger will take +less time, and so on. + +However, simplification is not vital; if you do not want to do this, +report the bug anyway and send us the entire test case you used. + +@item +A patch for the bug. + +A patch for the bug does help us if it is a good one. But do not omit +the necessary information, such as the test case, on the assumption that +a patch is all we need. We might see problems with your patch and decide +to fix the problem another way, or we might not understand it at all. + +Sometimes with programs as complicated as the binary utilities it is +very hard to construct an example that will make the program follow a +certain path through the code. If you do not send us the example, we +will not be able to construct one, so we will not be able to verify that +the bug is fixed. + +And if we cannot understand what bug you are trying to fix, or why your +patch should be an improvement, we will not install it. A test case will +help us to understand. + +@item +A guess about what the bug is or what it depends on. + +Such guesses are usually wrong. Even we cannot guess right about such +things without first using the debugger to find the facts. +@end itemize + +@node GNU Free Documentation License +@chapter GNU Free Documentation License +@cindex GNU Free Documentation License + + GNU Free Documentation License + + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". +@end smallexample + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@node Index +@unnumbered Index + +@printindex cp + +@contents +@bye diff --git a/contrib/binutils/binutils/nm.c b/contrib/binutils/binutils/nm.c index 7928375..d9d4c47 100644 --- a/contrib/binutils/binutils/nm.c +++ b/contrib/binutils/binutils/nm.c @@ -152,7 +152,7 @@ print_symbol_filename_posix PARAMS ((bfd * archive_bfd, bfd * abfd)); static void -print_value PARAMS ((bfd_vma)); +print_value PARAMS ((bfd *, bfd_vma)); static void print_symbol_info_bsd PARAMS ((symbol_info * info, bfd * abfd)); @@ -245,6 +245,11 @@ static char value_format[] = "%016lx"; /* We don't use value_format for this case. */ #endif #endif +#ifdef BFD64 +static int print_width = 16; +#else +static int print_width = 8; +#endif static int print_radix = 16; /* Print formats for printing stab info. */ static char other_format[] = "%02x"; @@ -292,9 +297,9 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("Usage: %s [OPTION]... [FILE]...\n"), program_name); - fprintf (stream, _("List symbols from FILEs (a.out by default).\n")); - fprintf (stream, _("\n\ + fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); + fprintf (stream, _(" List symbols in [file(s)] (a.out by default).\n")); + fprintf (stream, _(" The options are:\n\ -a, --debug-syms Display debugger-only symbols\n\ -A, --print-file-name Print name of the input file before every symbol\n\ -B Same as --format=bsd\n\ @@ -308,7 +313,6 @@ usage (stream, status) -f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',\n\ `sysv' or `posix'. The default is `bsd'\n\ -g, --extern-only Display only external symbols\n\ - -h, --help Display this information\n\ -l, --line-numbers Use debugging information to find a filename and\n\ line number for each symbol\n\ -n, --numeric-sort Sort symbols numerically by address\n\ @@ -321,8 +325,9 @@ usage (stream, status) -t, --radix=RADIX Use RADIX for printing symbol values\n\ --target=BFDNAME Specify the target object format as BFDNAME\n\ -u, --undefined-only Display only undefined symbols\n\ - -V, --version Display this program's version number\n\ -X 32_64 (ignored)\n\ + -h, --help Display this information\n\ + -V, --version Display this program's version number\n\ \n")); list_supported_targets (program_name, stream); if (status == 0) @@ -389,6 +394,8 @@ set_output_format (f) format = &formats[i]; } +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -400,6 +407,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -411,7 +421,7 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvVX:", + while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrst:uvVvX:", long_options, (int *) 0)) != EOF) { switch (c) @@ -452,6 +462,7 @@ main (argc, argv) case 'g': external_only = 1; break; + case 'H': case 'h': usage (stdout, 0); case 'l': @@ -939,6 +950,7 @@ display_rel_file (abfd, archive_bfd) PTR minisyms; unsigned int size; struct size_sym *symsizes; + char buf[30]; if (! dynamic) { @@ -959,6 +971,9 @@ display_rel_file (abfd, archive_bfd) return; } + bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); + print_width = strlen (buf); + /* Discard the symbols we don't want to print. It's OK to do this in place; we'll free the storage anyway (after printing). */ @@ -1437,7 +1452,8 @@ print_symbol_filename_posix (archive_bfd, abfd) /* Print a symbol value. */ static void -print_value (val) +print_value (abfd, val) + bfd *abfd; bfd_vma val; { #if ! defined (BFD64) || BFD_HOST_64BIT_LONG @@ -1445,7 +1461,7 @@ print_value (val) #else /* We have a 64 bit value to print, but the host is only 32 bit. */ if (print_radix == 16) - fprintf_vma (stdout, val); + bfd_fprintf_vma (abfd, stdout, val); else { char buf[30]; @@ -1474,13 +1490,12 @@ print_symbol_info_bsd (info, abfd) { if (bfd_is_undefined_symclass (info->type)) { -#ifdef BFD64 - printf (" "); -#endif + if (print_width == 16) + printf (" "); printf (" "); } else - print_value (info->value); + print_value (abfd, info->value); printf (" %c", info->type); if (info->type == '-') { @@ -1503,7 +1518,7 @@ print_symbol_info_sysv (info, abfd) if (bfd_is_undefined_symclass (info->type)) printf (" "); /* Value */ else - print_value (info->value); + print_value (abfd, info->value); printf ("| %c |", info->type); /* Class */ if (info->type == '-') { @@ -1526,7 +1541,7 @@ print_symbol_info_posix (info, abfd) if (bfd_is_undefined_symclass (info->type)) printf (" "); else - print_value (info->value); + print_value (abfd, info->value); /* POSIX.2 wants the symbol size printed here, when applicable; BFD currently doesn't provide it, so we take the easy way out by considering it to never be applicable. */ diff --git a/contrib/binutils/binutils/objcopy.c b/contrib/binutils/binutils/objcopy.c index e6e2e98..1a819e8 100644 --- a/contrib/binutils/binutils/objcopy.c +++ b/contrib/binutils/binutils/objcopy.c @@ -48,6 +48,18 @@ struct redefine_node struct redefine_node *next; }; +typedef struct section_rename +{ + const char * old_name; + const char * new_name; + flagword flags; + struct section_rename * next; +} +section_rename; + +/* List of sections to be renamed. */ +static section_rename * section_rename_list; + static void copy_usage PARAMS ((FILE *, int)); static void strip_usage PARAMS ((FILE *, int)); static flagword parse_flags PARAMS ((const char *)); @@ -73,6 +85,8 @@ static int strip_main PARAMS ((int, char **)); static int copy_main PARAMS ((int, char **)); static const char *lookup_sym_redefinition PARAMS((const char *)); static void redefine_list_append PARAMS ((const char *, const char *)); +static const char * find_section_rename PARAMS ((bfd *, sec_ptr, flagword *)); +static void add_section_rename PARAMS ((const char *, const char *, flagword)); #define RETURN_NONFATAL(s) {bfd_nonfatal (s); status = 1; return;} @@ -134,7 +148,11 @@ struct section_list }; static struct section_list *change_sections; + +/* True if some sections are to be removed. */ static boolean sections_removed; + +/* True if only some sections are to be copied. */ static boolean sections_copied; /* Changes to the start address. */ @@ -153,8 +171,10 @@ static bfd_byte gap_fill = 0; static boolean pad_to_set = false; static bfd_vma pad_to; -/* List of sections to add. */ +/* Use alternate machine code? */ +static int use_alt_mach_code = 0; +/* List of sections to add. */ struct section_add { /* Next section to add. */ @@ -171,23 +191,20 @@ struct section_add asection *section; }; +/* List of sections to add to the output BFD. */ static struct section_add *add_sections; /* Whether to convert debugging information. */ - static boolean convert_debugging = false; /* Whether to change the leading character in symbol names. */ - static boolean change_leading_char = false; /* Whether to remove the leading character from global symbol names. */ - static boolean remove_leading_char = false; /* List of symbols to strip, keep, localize, keep-global, weaken, or redefine. */ - static struct symlist *strip_specific_list = NULL; static struct symlist *keep_specific_list = NULL; static struct symlist *localize_specific_list = NULL; @@ -196,7 +213,6 @@ static struct symlist *weaken_specific_list = NULL; static struct redefine_node *redefine_sym_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. */ @@ -226,6 +242,8 @@ static boolean weaken = false; #define OPTION_LOCALIZE_SYMBOLS (OPTION_KEEP_SYMBOLS + 1) #define OPTION_KEEPGLOBAL_SYMBOLS (OPTION_LOCALIZE_SYMBOLS + 1) #define OPTION_WEAKEN_SYMBOLS (OPTION_KEEPGLOBAL_SYMBOLS + 1) +#define OPTION_RENAME_SECTION (OPTION_WEAKEN_SYMBOLS + 1) +#define OPTION_ALT_MACH_CODE (OPTION_RENAME_SECTION + 1) /* Options to handle if running as "strip". */ @@ -262,6 +280,7 @@ static struct option copy_options[] = {"adjust-vma", required_argument, 0, OPTION_CHANGE_ADDRESSES}, {"adjust-section-vma", required_argument, 0, OPTION_CHANGE_SECTION_ADDRESS}, {"adjust-warnings", no_argument, 0, OPTION_CHANGE_WARNINGS}, + {"binary-architecture", required_argument, 0, 'B'}, {"byte", required_argument, 0, 'b'}, {"change-addresses", required_argument, 0, OPTION_CHANGE_ADDRESSES}, {"change-leading-char", no_argument, 0, OPTION_CHANGE_LEADING_CHAR}, @@ -291,6 +310,7 @@ static struct option copy_options[] = {"keep-global-symbol", required_argument, 0, 'G'}, {"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR}, {"remove-section", required_argument, 0, 'R'}, + {"rename-section", required_argument, 0, OPTION_RENAME_SECTION}, {"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS}, {"set-start", required_argument, 0, OPTION_SET_START}, {"strip-all", no_argument, 0, 'S'}, @@ -310,6 +330,7 @@ static struct option copy_options[] = {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"weaken-symbols", required_argument, 0, OPTION_WEAKEN_SYMBOLS}, + {"alt-machine-code", required_argument, 0, OPTION_ALT_MACH_CODE}, {0, no_argument, 0, 0} }; @@ -330,16 +351,22 @@ extern unsigned int Chunk; on by the --srec-forceS3 command line switch. */ extern boolean S3Forced; +/* Defined in bfd/binary.c. Used to set architecture of input binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; + + static void copy_usage (stream, exit_status) FILE *stream; int exit_status; { - fprintf (stream, _("Usage: %s in-file [out-file]\n"), program_name); - fprintf (stream, _(" The switches are:\n")); + fprintf (stream, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name); + fprintf (stream, _(" Copies a binary file, possibly transforming it in the process\n")); + fprintf (stream, _(" The options are:\n")); fprintf (stream, _("\ -I --input-target Assume input file is in format \n\ -O --output-target Create an output file in format \n\ + -B --binary-architecture Set arch of output file, when input is binary\n\ -F --target Set both input and output format to \n\ --debugging Convert debugging information, if possible\n\ -p --preserve-dates Copy modified/access timestamps to the output\n\ @@ -376,6 +403,7 @@ copy_usage (stream, exit_status) --set-section-flags =\n\ Set section 's properties to \n\ --add-section = Add section found in to output\n\ + --rename-section =[,] Rename section to \n\ --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ --redefine-sym = Redefine symbol name to \n\ @@ -386,6 +414,7 @@ copy_usage (stream, exit_status) --localize-symbols -L for all symbols listed in \n\ --keep-global-symbols -G for all symbols listed in \n\ --weaken-symbols -W for all symbols listed in \n\ + --alt-machine-code Use alternate machine code for output\n\ -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ @@ -401,19 +430,20 @@ strip_usage (stream, exit_status) FILE *stream; int exit_status; { - fprintf (stream, _("Usage: %s in-file(s)\n"), program_name); - fprintf (stream, _(" The switches are:\n")); + fprintf (stream, _("Usage: %s in-file(s)\n"), program_name); + fprintf (stream, _(" Removes symbols and sections from files\n")); + fprintf (stream, _(" The options are:\n")); fprintf (stream, _("\ - -I --input-target Assume input file is in format \n\ - -O --output-target Create an output file in format \n\ - -F --target Set both input and output format to \n\ + -I --input-target= Assume input file is in format \n\ + -O --output-target= Create an output file in format \n\ + -F --target= Set both input and output format to \n\ -p --preserve-dates Copy modified/access timestamps to the output\n\ - -R --remove-section Remove section from the output\n\ + -R --remove-section= Remove section from the output\n\ -s --strip-all Remove all symbol and relocation information\n\ - -g -S --strip-debug Remove all debugging symbols\n\ + -g -S -d --strip-debug Remove all debugging symbols\n\ --strip-unneeded Remove all symbols not needed by relocations\n\ - -N --strip-symbol Do not copy symbol \n\ - -K --keep-symbol Only copy symbol \n\ + -N --strip-symbol= Do not copy symbol \n\ + -K --keep-symbol= Only copy symbol \n\ -x --discard-all Remove all non-global symbols\n\ -X --discard-locals Remove any compiler-generated symbols\n\ -v --verbose List all object files modified\n\ @@ -661,10 +691,9 @@ is_specified_symbol (name, list) struct symlist *tmp_list; for (tmp_list = list; tmp_list; tmp_list = tmp_list->next) - { - if (strcmp (name, tmp_list->name) == 0) - return true; - } + if (strcmp (name, tmp_list->name) == 0) + return true; + return false; } @@ -718,6 +747,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) flagword flags = sym->flags; const char *name = bfd_asymbol_name (sym); int keep; + boolean undefined; if (redefine_sym_list) { @@ -750,10 +780,12 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) } } + undefined = bfd_is_und_section (bfd_get_section (sym)); + if (remove_leading_char && ((flags & BSF_GLOBAL) != 0 || (flags & BSF_WEAK) != 0 - || bfd_is_und_section (bfd_get_section (sym)) + || undefined || bfd_is_com_section (bfd_get_section (sym))) && name[0] == bfd_get_symbol_leading_char (abfd)) name = bfd_asymbol_name (sym) = name + 1; @@ -776,7 +808,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) keep = 1; else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */ || (flags & BSF_WEAK) != 0 - || bfd_is_und_section (bfd_get_section (sym)) + || undefined || bfd_is_com_section (bfd_get_section (sym))) keep = strip_symbols != STRIP_UNNEEDED; else if ((flags & BSF_DEBUGGING) != 0) /* Debugging symbol. */ @@ -806,7 +838,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) sym->flags &=~ BSF_GLOBAL; sym->flags |= BSF_WEAK; } - if (keep && (flags & (BSF_GLOBAL | BSF_WEAK)) + if (keep && !undefined && (flags & (BSF_GLOBAL | BSF_WEAK)) && (is_specified_symbol (name, localize_specific_list) || (keepglobal_specific_list != NULL && ! is_specified_symbol (name, keepglobal_specific_list)))) @@ -824,27 +856,22 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) return dst_count; } +/* Find the redefined name of symbol SOURCE. */ + static const char * lookup_sym_redefinition (source) const char *source; { - const char *result; struct redefine_node *list; - result = source; - for (list = redefine_sym_list; list != NULL; list = list->next) - { - if (strcmp (source, list->source) == 0) - { - result = list->target; - break; - } - } - return result; + if (strcmp (source, list->source) == 0) + return list->target; + + return source; } -/* Add a node to a symbol redefine list */ +/* Add a node to a symbol redefine list. */ static void redefine_list_append (source, target) @@ -858,18 +885,14 @@ redefine_list_append (source, target) for (p = &redefine_sym_list; (list = *p) != NULL; p = &list->next) { if (strcmp (source, list->source) == 0) - { - fatal (_("%s: Multiple redefinition of symbol \"%s\""), - "--redefine-sym", - source); - } + fatal (_("%s: Multiple redefinition of symbol \"%s\""), + "--redefine-sym", + source); if (strcmp (target, list->target) == 0) - { - fatal (_("%s: Symbol \"%s\" is target of more than one redefinition"), - "--redefine-sym", - target); - } + fatal (_("%s: Symbol \"%s\" is target of more than one redefinition"), + "--redefine-sym", + target); } new_node = (struct redefine_node *) xmalloc (sizeof (struct redefine_node)); @@ -881,7 +904,6 @@ redefine_list_append (source, target) *p = new_node; } - /* Keep only every `copy_byte'th byte in MEMHUNK, which is *SIZE bytes long. Adjust *SIZE. */ @@ -894,6 +916,7 @@ filter_bytes (memhunk, size) for (; from < end; from += interleave) *to++ = *from; + if (*size % interleave > (bfd_size_type) copy_byte) *size = (*size / interleave) + 1; else @@ -937,13 +960,18 @@ copy_object (ibfd, obfd) start = bfd_get_start_address (ibfd); start += change_start; - if (!bfd_set_start_address (obfd, start) - || !bfd_set_file_flags (obfd, - (bfd_get_file_flags (ibfd) - & bfd_applicable_file_flags (obfd)))) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + /* Neither the start address nor the flags + need to be set for a core file. */ + if (bfd_get_format (obfd) != bfd_core) + { + if (!bfd_set_start_address (obfd, start) + || !bfd_set_file_flags (obfd, + (bfd_get_file_flags (ibfd) + & bfd_applicable_file_flags (obfd)))) + RETURN_NONFATAL (bfd_get_filename (ibfd)); + } - /* Copy architecture of input file to output file */ + /* Copy architecture of input file to output file. */ if (!bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd))) non_fatal (_("Warning: Output file cannot represent architecture %s"), @@ -1099,8 +1127,8 @@ copy_object (ibfd, obfd) } } - /* Symbol filtering must happen after the output sections have - been created, but before their contents are set. */ + /* Symbol filtering must happen after the output sections + have been created, but before their contents are set. */ dhandle = NULL; symsize = bfd_get_symtab_upper_bound (ibfd); if (symsize < 0) @@ -1181,7 +1209,6 @@ copy_object (ibfd, obfd) int c, i; /* Fill in the gaps. */ - if (max_gap > 8192) max_gap = 8192; buf = (bfd_byte *) xmalloc (max_gap); @@ -1197,6 +1224,7 @@ copy_object (ibfd, obfd) left = gaps[i]; off = bfd_section_size (obfd, osections[i]) - left; + while (left > 0) { bfd_size_type now; @@ -1221,7 +1249,7 @@ copy_object (ibfd, obfd) from the input BFD to the output BFD. This is done last to permit the routine to look at the filtered symbol table, which is important for the ECOFF code at least. */ - if (!bfd_copy_private_bfd_data (ibfd, obfd)) + if (! bfd_copy_private_bfd_data (ibfd, obfd)) { non_fatal (_("%s: error copying private BFD data: %s"), bfd_get_filename (obfd), @@ -1229,6 +1257,15 @@ copy_object (ibfd, obfd) status = 1; return; } + + /* Switch to the alternate machine code. We have to do this at the + very end, because we only initialize the header when we create + the first section. */ + if (use_alt_mach_code != 0) + { + if (!bfd_alt_mach_code (obfd, use_alt_mach_code)) + non_fatal (_("unknown alternate machine code, ignored")); + } } /* Read each archive element in turn from IBFD, copy the @@ -1265,6 +1302,10 @@ copy_archive (ibfd, obfd, output_target) list = NULL; this_element = bfd_openr_next_archived_file (ibfd, NULL); + + if (!bfd_set_format (obfd, bfd_get_format (ibfd))) + RETURN_NONFATAL (bfd_get_filename (obfd)); + while (!status && this_element != (bfd *) NULL) { /* Create an output file for this member. */ @@ -1278,6 +1319,7 @@ copy_archive (ibfd, obfd, output_target) if (preserve_dates) { stat_status = bfd_stat_arch_elt (this_element, &buf); + if (stat_status != 0) non_fatal (_("internal stat error on %s"), bfd_get_filename (this_element)); @@ -1291,9 +1333,6 @@ copy_archive (ibfd, obfd, output_target) if (output_bfd == (bfd *) NULL) RETURN_NONFATAL (output_name); - if (!bfd_set_format (obfd, bfd_get_format (ibfd))) - RETURN_NONFATAL (bfd_get_filename (obfd)); - if (bfd_check_format (this_element, bfd_object) == true) copy_object (this_element, output_bfd); @@ -1352,7 +1391,6 @@ copy_file (input_filename, output_filename, input_target, output_target) /* To allow us to do "strip *" without dying on the first non-object file, failures are nonfatal. */ - ibfd = bfd_openr (input_filename, input_target); if (ibfd == NULL) RETURN_NONFATAL (input_filename); @@ -1372,7 +1410,8 @@ copy_file (input_filename, output_filename, input_target, output_target) copy_archive (ibfd, obfd, output_target); } - else if (bfd_check_format_matches (ibfd, bfd_object, &matching)) + else if (bfd_check_format_matches (ibfd, bfd_object, &matching) + || bfd_check_format_matches (ibfd, bfd_core, &matching)) { bfd *obfd; @@ -1407,8 +1446,68 @@ copy_file (input_filename, output_filename, input_target, output_target) } } -/* Create a section in OBFD with the same name and attributes - as ISECTION in IBFD. */ +/* Add a name to the section renaming list. */ + +static void +add_section_rename (old_name, new_name, flags) + const char * old_name; + const char * new_name; + flagword flags; +{ + section_rename * rename; + + /* Check for conflicts first. */ + for (rename = section_rename_list; rename != NULL; rename = rename->next) + if (strcmp (rename->old_name, old_name) == 0) + { + /* Silently ignore duplicate definitions. */ + if (strcmp (rename->new_name, new_name) == 0 + && rename->flags == flags) + return; + + fatal (_("Multiple renames of section %s"), old_name); + } + + rename = (section_rename *) xmalloc (sizeof (* rename)); + + rename->old_name = old_name; + rename->new_name = new_name; + rename->flags = flags; + rename->next = section_rename_list; + + section_rename_list = rename; +} + +/* Check the section rename list for a new name of the input section + ISECTION. Return the new name if one is found. + Also set RETURNED_FLAGS to the flags to be used for this section. */ + +static const char * +find_section_rename (ibfd, isection, returned_flags) + bfd * ibfd ATTRIBUTE_UNUSED; + sec_ptr isection; + flagword * returned_flags; +{ + const char * old_name = bfd_section_name (ibfd, isection); + section_rename * rename; + + /* Default to using the flags of the input section. */ + * returned_flags = bfd_get_section_flags (ibfd, isection); + + for (rename = section_rename_list; rename != NULL; rename = rename->next) + if (strcmp (rename->old_name, old_name) == 0) + { + if (rename->flags != (flagword) -1) + * returned_flags = rename->flags; + + return rename->new_name; + } + + return old_name; +} + +/* Create a section in OBFD with the same + name and attributes as ISECTION in IBFD. */ static void setup_section (ibfd, isection, obfdarg) @@ -1424,7 +1523,8 @@ setup_section (ibfd, isection, obfdarg) bfd_vma lma; flagword flags; const char *err; - + const char * name; + if ((bfd_get_section_flags (ibfd, isection) & SEC_DEBUGGING) != 0 && (strip_symbols == STRIP_DEBUG || strip_symbols == STRIP_UNNEEDED @@ -1442,7 +1542,10 @@ setup_section (ibfd, isection, obfdarg) if (sections_copied && (p == NULL || ! p->copy)) return; - osection = bfd_make_section_anyway (obfd, bfd_section_name (ibfd, isection)); + /* Get the, possibly new, name of the output section. */ + name = find_section_rename (ibfd, isection, & flags); + + osection = bfd_make_section_anyway (obfd, name); if (osection == NULL) { @@ -1499,15 +1602,17 @@ setup_section (ibfd, isection, obfdarg) goto loser; } - flags = bfd_get_section_flags (ibfd, isection); if (p != NULL && p->set_flags) - flags = p->flags | (flags & SEC_HAS_CONTENTS); + flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC)); if (!bfd_set_section_flags (obfd, osection, flags)) { err = _("flags"); goto loser; } + /* Copy merge entity size. */ + osection->entsize = isection->entsize; + /* This used to be mangle_section; we do here to avoid using bfd_get_section_by_name since some formats allow multiple sections with the same name. */ @@ -1522,7 +1627,7 @@ setup_section (ibfd, isection, obfdarg) goto loser; } - /* All went well */ + /* All went well. */ return; loser: @@ -1551,8 +1656,8 @@ copy_section (ibfd, isection, obfdarg) bfd_size_type size; long relsize; - /* If we have already failed earlier on, do not keep on generating - complaints now. */ + /* If we have already failed earlier on, + do not keep on generating complaints now. */ if (status != 0) return; @@ -1562,9 +1667,7 @@ copy_section (ibfd, isection, obfdarg) || strip_symbols == STRIP_ALL || discard_locals == LOCALS_ALL || convert_debugging)) - { - return; - } + return; p = find_section_list (bfd_section_name (ibfd, isection), false); @@ -1579,8 +1682,12 @@ copy_section (ibfd, isection, obfdarg) if (size == 0 || osection == 0) return; + /* Core files do not need to be relocated. */ + if (bfd_get_format (obfd) == bfd_core) + relsize = 0; + else + relsize = bfd_get_reloc_upper_bound (ibfd, isection); - relsize = bfd_get_reloc_upper_bound (ibfd, isection); if (relsize < 0) RETURN_NONFATAL (bfd_get_filename (ibfd)); @@ -1611,6 +1718,7 @@ copy_section (ibfd, isection, obfdarg) free (relpp); relpp = temp_relpp; } + bfd_set_reloc (obfd, osection, (relcount == 0 ? (arelent **) NULL : relpp), relcount); } @@ -1618,7 +1726,8 @@ copy_section (ibfd, isection, obfdarg) isection->_cooked_size = isection->_raw_size; isection->reloc_done = true; - if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS) + if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS + && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS) { PTR memhunk = (PTR) xmalloc ((unsigned) size); @@ -1840,7 +1949,7 @@ strip_main (argc, argv) struct section_list *p; char *output_file = NULL; - while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXVv", + while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXHhVv", strip_options, (int *) 0)) != EOF) { switch (c) @@ -1895,7 +2004,9 @@ strip_main (argc, argv) show_version = true; break; case 0: - break; /* we've been given a long option */ + /* We've been given a long option. */ + break; + case 'H': case 'h': strip_usage (stdout, 0); default: @@ -1964,6 +2075,7 @@ copy_main (argc, argv) int argc; char *argv[]; { + char * binary_architecture = NULL; char *input_filename = NULL, *output_filename = NULL; char *input_target = NULL, *output_target = NULL; boolean show_version = false; @@ -1972,7 +2084,7 @@ copy_main (argc, argv) struct section_list *p; struct stat statbuf; - while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:", + while ((c = getopt_long (argc, argv, "b:B:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXHhVvW:", copy_options, (int *) 0)) != EOF) { switch (c) @@ -1983,6 +2095,10 @@ copy_main (argc, argv) fatal (_("byte number must be non-negative")); break; + case 'B': + binary_architecture = optarg; + break; + case 'i': interleave = atoi (optarg); if (interleave < 1) @@ -2257,9 +2373,7 @@ copy_main (argc, argv) s = strchr (optarg, '='); if (s == NULL) - { - fatal (_("bad format for %s"), "--redefine-sym"); - } + fatal (_("bad format for %s"), "--redefine-sym"); len = s - optarg; source = (char *) xmalloc (len + 1); @@ -2300,6 +2414,50 @@ copy_main (argc, argv) } break; + case OPTION_RENAME_SECTION: + { + flagword flags; + const char *eq, *fl; + char *old_name; + char *new_name; + unsigned int len; + + eq = strchr (optarg, '='); + if (eq == NULL) + fatal (_("bad format for %s"), "--rename-section"); + + len = eq - optarg; + if (len == 0) + fatal (_("bad format for %s"), "--rename-section"); + + old_name = (char *) xmalloc (len + 1); + strncpy (old_name, optarg, len); + old_name[len] = 0; + + eq++; + fl = strchr (eq, ','); + if (fl) + { + flags = parse_flags (fl + 1); + len = fl - eq; + } + else + { + flags = -1; + len = strlen (eq); + } + + if (len == 0) + fatal (_("bad format for %s"), "--rename-section"); + + new_name = (char *) xmalloc (len + 1); + strncpy (new_name, eq, len); + new_name[len] = 0; + + add_section_rename (old_name, new_name, flags); + } + break; + case OPTION_SET_START: set_start = parse_vma (optarg, "--set-start"); set_start_set = true; @@ -2333,9 +2491,16 @@ copy_main (argc, argv) add_specific_symbols (optarg, &weaken_specific_list); break; + case OPTION_ALT_MACH_CODE: + use_alt_mach_code = atoi (optarg); + if (use_alt_mach_code <= 0) + fatal (_("alternate machine code index must be positive")); + break; + case 0: break; /* we've been given a long option */ + case 'H': case 'h': copy_usage (stdout, 0); @@ -2364,6 +2529,26 @@ copy_main (argc, argv) if (output_target == (char *) NULL) output_target = input_target; + if (binary_architecture != (char *) NULL) + { + if (input_target && strcmp (input_target, "binary") == 0) + { + const bfd_arch_info_type * temp_arch_info; + + temp_arch_info = bfd_scan_arch (binary_architecture); + + if (temp_arch_info != NULL) + bfd_external_binary_architecture = temp_arch_info->arch; + else + fatal (_("architecture %s unknown"), binary_architecture); + } + else + { + non_fatal (_("Warning: input target 'binary' required for binary architecture parameter.")); + non_fatal (_(" Argument %s ignored"), binary_architecture); + } + } + if (preserve_dates) if (stat (input_filename, & statbuf) < 0) fatal (_("Cannot stat: %s: %s"), input_filename, strerror (errno)); @@ -2388,6 +2573,7 @@ copy_main (argc, argv) else { copy_file (input_filename, output_filename, input_target, output_target); + if (status == 0 && preserve_dates) set_times (output_filename, &statbuf); } @@ -2432,6 +2618,8 @@ copy_main (argc, argv) return 0; } +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -2440,6 +2628,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/contrib/binutils/binutils/objdump.c b/contrib/binutils/binutils/objdump.c index 27002ab..2b422b0 100644 --- a/contrib/binutils/binutils/objdump.c +++ b/contrib/binutils/binutils/objdump.c @@ -23,7 +23,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "getopt.h" #include "progress.h" #include "bucomm.h" -#include +#include "safe-ctype.h" #include "dis-asm.h" #include "libiberty.h" #include "demangle.h" @@ -108,122 +108,62 @@ static long dynsymcount = 0; /* Static declarations. */ -static void -usage PARAMS ((FILE *, int)); - -static void -nonfatal PARAMS ((const char *)); - -static void -display_file PARAMS ((char *filename, char *target)); - -static void -dump_section_header PARAMS ((bfd *, asection *, PTR)); - -static void -dump_headers PARAMS ((bfd *)); - -static void -dump_data PARAMS ((bfd *abfd)); - -static void -dump_relocs PARAMS ((bfd *abfd)); - -static void -dump_dynamic_relocs PARAMS ((bfd * abfd)); - -static void -dump_reloc_set PARAMS ((bfd *, asection *, arelent **, long)); - -static void -dump_symbols PARAMS ((bfd *abfd, boolean dynamic)); - -static void -dump_bfd_header PARAMS ((bfd *)); - -static void -dump_bfd_private_header PARAMS ((bfd *)); - -static void -display_bfd PARAMS ((bfd *abfd)); - -static void -display_target_list PARAMS ((void)); - -static void -display_info_table PARAMS ((int, int)); - -static void -display_target_tables PARAMS ((void)); - -static void -display_info PARAMS ((void)); - -static void -objdump_print_value PARAMS ((bfd_vma, struct disassemble_info *, boolean)); - -static void -objdump_print_symname PARAMS ((bfd *, struct disassemble_info *, asymbol *)); - -static asymbol * -find_symbol_for_address PARAMS ((bfd *, asection *, bfd_vma, boolean, long *)); - -static void -objdump_print_addr_with_sym PARAMS ((bfd *, asection *, asymbol *, bfd_vma, - struct disassemble_info *, boolean)); - -static void -objdump_print_addr PARAMS ((bfd_vma, struct disassemble_info *, boolean)); - -static void -objdump_print_address PARAMS ((bfd_vma, struct disassemble_info *)); - -static void -show_line PARAMS ((bfd *, asection *, bfd_vma)); - -static void -disassemble_bytes PARAMS ((struct disassemble_info *, disassembler_ftype, - boolean, bfd_byte *, bfd_vma, bfd_vma, - arelent ***, arelent **)); - -static void -disassemble_data PARAMS ((bfd *)); - -static const char * -endian_string PARAMS ((enum bfd_endian)); - -static asymbol ** -slurp_symtab PARAMS ((bfd *)); - -static asymbol ** -slurp_dynamic_symtab PARAMS ((bfd *)); - -static long -remove_useless_symbols PARAMS ((asymbol **, long)); - -static int -compare_symbols PARAMS ((const PTR, const PTR)); - -static int -compare_relocs PARAMS ((const PTR, const PTR)); - -static void -dump_stabs PARAMS ((bfd *)); - -static boolean -read_section_stabs PARAMS ((bfd *, const char *, const char *)); - -static void -print_section_stabs PARAMS ((bfd *, const char *, const char *)); +static void usage PARAMS ((FILE *, int)); +static void nonfatal PARAMS ((const char *)); +static void display_file PARAMS ((char *filename, char *target)); +static void dump_section_header PARAMS ((bfd *, asection *, PTR)); +static void dump_headers PARAMS ((bfd *)); +static void dump_data PARAMS ((bfd *abfd)); +static void dump_relocs PARAMS ((bfd *abfd)); +static void dump_dynamic_relocs PARAMS ((bfd * abfd)); +static void dump_reloc_set PARAMS ((bfd *, asection *, arelent **, long)); +static void dump_symbols PARAMS ((bfd *abfd, boolean dynamic)); +static void dump_bfd_header PARAMS ((bfd *)); +static void dump_bfd_private_header PARAMS ((bfd *)); +static void dump_bfd PARAMS ((bfd *)); +static void display_bfd PARAMS ((bfd *abfd)); +static void display_target_list PARAMS ((void)); +static void display_info_table PARAMS ((int, int)); +static void display_target_tables PARAMS ((void)); +static void display_info PARAMS ((void)); +static void objdump_print_value + PARAMS ((bfd_vma, struct disassemble_info *, boolean)); +static void objdump_print_symname + PARAMS ((bfd *, struct disassemble_info *, asymbol *)); +static asymbol *find_symbol_for_address + PARAMS ((bfd *, asection *, bfd_vma, boolean, long *)); +static void objdump_print_addr_with_sym + PARAMS ((bfd *, asection *, asymbol *, bfd_vma, + struct disassemble_info *, boolean)); +static void objdump_print_addr + PARAMS ((bfd_vma, struct disassemble_info *, boolean)); +static void objdump_print_address + PARAMS ((bfd_vma, struct disassemble_info *)); +static int objdump_symbol_at_address + PARAMS ((bfd_vma, struct disassemble_info *)); +static void show_line PARAMS ((bfd *, asection *, bfd_vma)); +static void disassemble_bytes + PARAMS ((struct disassemble_info *, disassembler_ftype, boolean, + bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **)); +static void disassemble_data PARAMS ((bfd *)); +static const char *endian_string PARAMS ((enum bfd_endian)); +static asymbol ** slurp_symtab PARAMS ((bfd *)); +static asymbol ** slurp_dynamic_symtab PARAMS ((bfd *)); +static long remove_useless_symbols PARAMS ((asymbol **, long)); +static int compare_symbols PARAMS ((const PTR, const PTR)); +static int compare_relocs PARAMS ((const PTR, const PTR)); +static void dump_stabs PARAMS ((bfd *)); +static boolean read_section_stabs PARAMS ((bfd *, const char *, const char *)); +static void print_section_stabs PARAMS ((bfd *, const char *, const char *)); static void usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("Usage: %s OPTION... FILE...\n"), program_name); - fprintf (stream, _("Display information from object FILE.\n")); - fprintf (stream, _("\n At least one of the following switches must be given:\n")); + fprintf (stream, _("Usage: %s \n"), program_name); + fprintf (stream, _(" Display information from object .\n")); + fprintf (stream, _(" At least one of the following switches must be given:\n")); fprintf (stream, _("\ -a, --archive-headers Display archive header information\n\ -f, --file-headers Display the contents of the overall file header\n\ @@ -240,7 +180,7 @@ usage (stream, status) -T, --dynamic-syms Display the contents of the dynamic symbol table\n\ -r, --reloc Display the relocation entries in the file\n\ -R, --dynamic-reloc Display the dynamic relocation entries in the file\n\ - -V, --version Display this program's version number\n\ + -v, --version Display this program's version number\n\ -i, --info List object formats and architectures supported\n\ -H, --help Display this information\n\ ")); @@ -268,6 +208,7 @@ usage (stream, status) --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\ \n")); list_supported_targets (program_name, stream); + list_supported_architectures (program_name, stream); disassembler_usage (stream); } @@ -343,10 +284,10 @@ dump_section_header (abfd, section, ignored) printf ("%3d %-13s %08lx ", section->index, bfd_get_section_name (abfd, section), (unsigned long) bfd_section_size (abfd, section) / opb); - printf_vma (bfd_get_section_vma (abfd, section)); + bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section)); printf (" "); - printf_vma (section->lma); - printf (" %08lx 2**%u", section->filepos, + bfd_printf_vma (abfd, section->lma); + printf (" %08lx 2**%u", (unsigned long) section->filepos, bfd_get_section_alignment (abfd, section)); if (! wide_output) printf ("\n "); @@ -363,9 +304,6 @@ dump_section_header (abfd, section, ignored) PF (SEC_CONSTRUCTOR_BSS, "CONSTRUCTOR BSS"); PF (SEC_LOAD, "LOAD"); PF (SEC_RELOC, "RELOC"); -#ifdef SEC_BALIGN - PF (SEC_BALIGN, "BALIGN"); -#endif PF (SEC_READONLY, "READONLY"); PF (SEC_CODE, "CODE"); PF (SEC_DATA, "DATA"); @@ -378,6 +316,7 @@ dump_section_header (abfd, section, ignored) PF (SEC_CLINK, "CLINK"); PF (SEC_SMALL_DATA, "SMALL_DATA"); PF (SEC_SHARED, "SHARED"); + PF (SEC_ARCH_BIT_0, "ARCH_BIT_0"); if ((section->flags & SEC_LINK_ONCE) != 0) { @@ -667,8 +606,10 @@ objdump_print_value (vma, info, skip_zeroes) { char buf[30]; char *p; + struct objdump_disasm_info *aux + = (struct objdump_disasm_info *) info->application_data; - sprintf_vma (buf, vma); + bfd_sprintf_vma (aux->abfd, buf, vma); if (! skip_zeroes) p = buf; else @@ -1166,35 +1107,20 @@ typedef struct /* sprintf to a "stream" */ static int -#ifdef ANSI_PROTOTYPES -objdump_sprintf (SFILE *f, const char *format, ...) -#else -objdump_sprintf (va_alist) - va_dcl -#endif +objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...)) { -#ifndef ANSI_PROTOTYPES - SFILE *f; - const char *format; -#endif char *buf; - va_list args; size_t n; -#ifdef ANSI_PROTOTYPES - va_start (args, format); -#else - va_start (args); - f = va_arg (args, SFILE *); - format = va_arg (args, const char *); -#endif + VA_OPEN (args, format); + VA_FIXEDARG (args, SFILE *, f); + VA_FIXEDARG (args, const char *, format); vasprintf (&buf, format, args); - va_end (args); - if (buf == NULL) { + va_end (args); fatal (_("Out of virtual memory")); } @@ -1216,13 +1142,16 @@ objdump_sprintf (va_alist) free (buf); + VA_CLOSE (args); return n; } /* The number of zeroes we want to see before we start skipping them. The number is arbitrarily chosen. */ +#ifndef SKIP_ZEROES #define SKIP_ZEROES (8) +#endif /* The number of zeroes to skip at the end of a section. If the number of zeroes at the end is between SKIP_ZEROES_AT_END and @@ -1231,7 +1160,9 @@ objdump_sprintf (va_alist) attempt to avoid disassembling zeroes inserted by section alignment. */ +#ifndef SKIP_ZEROES_AT_END #define SKIP_ZEROES_AT_END (3) +#endif /* Disassemble some data in memory between given values. */ @@ -1274,8 +1205,10 @@ disassemble_bytes (info, disassemble_fn, insns, data, char buf[30]; char *s; - sprintf_vma (buf, section->vma + - bfd_section_size (section->owner, section) / opb); + bfd_sprintf_vma + (aux->abfd, buf, + (section->vma + + bfd_section_size (section->owner, section) / opb)); s = buf; while (s[0] == '0' && s[1] == '0' && s[2] == '0' && s[3] == '0' && s[4] == '0') @@ -1328,13 +1261,16 @@ disassemble_bytes (info, disassemble_fn, insns, data, done_dot = false; if (with_line_numbers || with_source_code) - show_line (aux->abfd, section, addr_offset); + /* The line number tables will refer to unadjusted + section VMAs, so we must undo any VMA modifications + when calling show_line. */ + show_line (aux->abfd, section, addr_offset - adjust_section_vma); if (! prefix_addresses) { char *s; - sprintf_vma (buf, section->vma + addr_offset); + bfd_sprintf_vma (aux->abfd, buf, section->vma + addr_offset); for (s = buf + skip_addr_chars; *s == '0'; s++) *s = ' '; if (*s == '\0') @@ -1393,7 +1329,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, for (j = addr_offset * opb; j < addr_offset * opb + octets; ++j) { - if (isprint (data[j])) + if (ISPRINT (data[j])) buf[j - addr_offset * opb] = data[j]; else buf[j - addr_offset * opb] = '.'; @@ -1471,7 +1407,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, putchar ('\n'); j = addr_offset * opb + pb; - sprintf_vma (buf, section->vma + j / opb); + bfd_sprintf_vma (aux->abfd, buf, section->vma + j / opb); for (s = buf + skip_addr_chars; *s == '0'; s++) *s = ' '; if (*s == '\0') @@ -1728,6 +1664,7 @@ disassemble_data (abfd) disasm_info.buffer = data; disasm_info.buffer_vma = section->vma; disasm_info.buffer_length = datasize; + disasm_info.section = section; if (start_address == (bfd_vma) -1 || start_address < disasm_info.buffer_vma) addr_offset = 0; @@ -1997,7 +1934,7 @@ print_section_stabs (abfd, stabsect_name, strsect_name) else printf ("%-6d", type); printf (" %-6d %-6d ", other, desc); - printf_vma (value); + bfd_printf_vma (abfd, value); printf (" %-6lu", strx); /* Symbols with type == 0 (N_UNDF) specify the length of the @@ -2046,7 +1983,7 @@ dump_section_stabs (abfd, stabsect_name, strsect_name) match or a section followed by a number. */ if (strncmp (stabsect_name, s->name, len) == 0 && (s->name[len] == '\000' - || isdigit ((unsigned char) s->name[len]))) + || ISDIGIT (s->name[len]))) { if (read_section_stabs (abfd, s->name, strsect_name)) { @@ -2081,7 +2018,7 @@ dump_bfd_header (abfd) PF (D_PAGED, "D_PAGED"); PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE"); printf (_("\nstart address 0x")); - printf_vma (abfd->start_address); + bfd_printf_vma (abfd, abfd->start_address); printf ("\n"); } @@ -2333,7 +2270,7 @@ dump_data (abfd) if (j >= stop_offset * opb) printf (" "); else - printf ("%c", isprint (data[j]) ? data[j] : '.'); + printf ("%c", ISPRINT (data[j]) ? data[j] : '.'); } putchar ('\n'); } @@ -2530,7 +2467,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) if (width == 0) { char buf[30]; - sprintf_vma (buf, (bfd_vma) -1); + bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); width = strlen (buf) - 7; } printf ("OFFSET %*s TYPE %*s VALUE \n", width, "", 12, ""); @@ -2598,7 +2535,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) } if (sym_name) { - printf_vma (q->address); + bfd_printf_vma (abfd, q->address); if (q->howto->name) printf (" %-16s ", q->howto->name); else @@ -2610,7 +2547,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) { if (section_name == (CONST char *) NULL) section_name = "*unknown*"; - printf_vma (q->address); + bfd_printf_vma (abfd, q->address); printf (" %-16s [%s]", q->howto->name, section_name); @@ -2618,7 +2555,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) if (q->addend) { printf ("+0x"); - printf_vma (q->addend); + bfd_printf_vma (abfd, q->addend); } printf ("\n"); } @@ -2796,11 +2733,13 @@ display_target_tables () static void display_info () { - printf (_("BFD header file version %s\n"), BFD_VERSION); + printf (_("BFD header file version %s\n"), BFD_VERSION_STRING); display_target_list (); display_target_tables (); } +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -2813,6 +2752,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -2824,14 +2766,14 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "pib:m:M:VCdDlfahHrRtTxsSj:wE:zgG", + while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSj:wE:zgG", long_options, (int *) 0)) != EOF) { switch (c) { case 0: - break; /* we've been given a long option */ + break; /* We've been given a long option. */ case 'm': machine = optarg; break; @@ -2852,12 +2794,12 @@ main (argc, argv) if (optarg != NULL) { enum demangling_styles style; - + style = cplus_demangle_name_to_style (optarg); if (style == unknown_demangling) fatal (_("unknown demangling style `%s'"), optarg); - + cplus_demangle_set_style (style); } break; @@ -2895,7 +2837,7 @@ main (argc, argv) usage (stderr, 1); } break; - + case 'f': dump_file_header = true; seenflag = true; @@ -2973,6 +2915,7 @@ main (argc, argv) case 'H': usage (stdout, 0); seenflag = true; + case 'v': case 'V': show_version = true; seenflag = true; diff --git a/contrib/binutils/binutils/po/binutils.pot b/contrib/binutils/binutils/po/binutils.pot index 2919fb3..ef601f0 100644 --- a/contrib/binutils/binutils/po/binutils.pot +++ b/contrib/binutils/binutils/po/binutils.pot @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-05-28 19:38+0100\n" +"POT-Creation-Date: 2002-01-17 13:58+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8-bit\n" +"Content-Transfer-Encoding: 8bit\n" -#: addr2line.c:76 +#: addr2line.c:73 #, c-format msgid "" "Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n" @@ -22,175 +22,175 @@ msgid "" " [--basenames] [--functions] [addr addr ...]\n" msgstr "" -#: addr2line.c:83 ar.c:288 nlmconv.c:1119 objcopy.c:373 objcopy.c:405 -#: readelf.c:1974 size.c:91 strings.c:530 windres.c:737 +#: addr2line.c:80 ar.c:289 nlmconv.c:1121 objcopy.c:423 objcopy.c:455 +#: readelf.c:2181 size.c:91 strings.c:655 windres.c:737 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: addr2line.c:243 +#: addr2line.c:240 #, c-format msgid "%s: can not get addresses from archive" msgstr "" -#: addr2line.c:310 nm.c:436 objdump.c:2857 +#: addr2line.c:312 nm.c:447 objdump.c:2800 #, c-format msgid "unknown demangling style `%s'" msgstr "" -#: ar.c:236 +#: ar.c:237 #, c-format msgid "no entry %s in archive\n" msgstr "" -#: ar.c:253 +#: ar.c:254 #, c-format msgid "" "Usage: %s [-X32_64] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] " "archive-file file...\n" msgstr "" -#: ar.c:256 +#: ar.c:257 #, c-format msgid " %s -M [ \n" msgstr "" #. xgetext:c-format -#: dlltool.c:3108 +#: dlltool.c:3140 #, c-format msgid "" " -m --machine Create as DLL for . [default: %s]\n" msgstr "" -#: dlltool.c:3109 +#: dlltool.c:3141 msgid "" " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3110 +#: dlltool.c:3142 msgid " -e --output-exp Generate an export file.\n" msgstr "" -#: dlltool.c:3111 +#: dlltool.c:3143 msgid " -l --output-lib Generate an interface library.\n" msgstr "" -#: dlltool.c:3112 +#: dlltool.c:3144 msgid " -a --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dlltool.c:3113 +#: dlltool.c:3145 msgid "" " -D --dllname Name of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3114 +#: dlltool.c:3146 msgid " -d --input-def Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3115 +#: dlltool.c:3147 msgid " -z --output-def Name of .def file to be created.\n" msgstr "" -#: dlltool.c:3116 +#: dlltool.c:3148 msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dlltool.c:3117 +#: dlltool.c:3149 msgid " --no-export-all-symbols Only export listed symbols\n" msgstr "" -#: dlltool.c:3118 +#: dlltool.c:3150 msgid " --exclude-symbols Don't export \n" msgstr "" -#: dlltool.c:3119 +#: dlltool.c:3151 msgid " --no-default-excludes Clear default exclude symbols\n" msgstr "" -#: dlltool.c:3120 +#: dlltool.c:3152 msgid " -b --base-file Read linker generated base file.\n" msgstr "" -#: dlltool.c:3121 +#: dlltool.c:3153 msgid " -x --no-idata4 Don't generate idata$4 section.\n" msgstr "" -#: dlltool.c:3122 +#: dlltool.c:3154 msgid " -c --no-idata5 Don't generate idata$5 section.\n" msgstr "" -#: dlltool.c:3123 +#: dlltool.c:3155 msgid "" " -U --add-underscore Add underscores to symbols in interface " "library.\n" msgstr "" -#: dlltool.c:3124 +#: dlltool.c:3156 msgid " -k --kill-at Kill @ from exported names.\n" msgstr "" -#: dlltool.c:3125 +#: dlltool.c:3157 msgid " -A --add-stdcall-alias Add aliases without @.\n" msgstr "" -#: dlltool.c:3126 +#: dlltool.c:3158 msgid " -S --as Use for assembler.\n" msgstr "" -#: dlltool.c:3127 +#: dlltool.c:3159 msgid " -f --as-flags Pass to the assembler.\n" msgstr "" -#: dlltool.c:3128 +#: dlltool.c:3160 msgid "" " -C --compat-implib Create backward compatible import library.\n" msgstr "" -#: dlltool.c:3129 +#: dlltool.c:3161 msgid "" " -n --no-delete Keep temp files (repeat for extra " "preservation).\n" msgstr "" -#: dlltool.c:3130 +#: dlltool.c:3162 msgid " -v --verbose Be verbose.\n" msgstr "" -#: dlltool.c:3131 +#: dlltool.c:3163 msgid " -V --version Display the program version.\n" msgstr "" -#: dlltool.c:3132 +#: dlltool.c:3164 msgid " -h --help Display this information.\n" msgstr "" -#: dlltool.c:3134 +#: dlltool.c:3166 msgid "" " -M --mcore-elf Process mcore-elf object files into .\n" msgstr "" -#: dlltool.c:3135 +#: dlltool.c:3167 msgid " -L --linker Use as the linker.\n" msgstr "" -#: dlltool.c:3136 +#: dlltool.c:3168 msgid " -F --linker-flags Pass to the linker.\n" msgstr "" -#: dlltool.c:3280 +#: dlltool.c:3315 #, c-format msgid "Unable to open base-file: %s" msgstr "" -#: dlltool.c:3309 +#: dlltool.c:3344 #, c-format msgid "Machine '%s' not supported" msgstr "" -#: dlltool.c:3412 dllwrap.c:241 +#: dlltool.c:3447 dllwrap.c:240 #, c-format msgid "Tried file: %s" msgstr "" -#: dlltool.c:3419 dllwrap.c:248 +#: dlltool.c:3454 dllwrap.c:247 #, c-format msgid "Using file: %s" msgstr "" -#: dllwrap.c:335 +#: dllwrap.c:334 #, c-format msgid "Keeping temporary base file %s" msgstr "" -#: dllwrap.c:337 +#: dllwrap.c:336 #, c-format msgid "Deleting temporary base file %s" msgstr "" -#: dllwrap.c:351 +#: dllwrap.c:350 #, c-format msgid "Keeping temporary exp file %s" msgstr "" -#: dllwrap.c:353 +#: dllwrap.c:352 #, c-format msgid "Deleting temporary exp file %s" msgstr "" -#: dllwrap.c:366 +#: dllwrap.c:365 #, c-format msgid "Keeping temporary def file %s" msgstr "" -#: dllwrap.c:368 +#: dllwrap.c:367 #, c-format msgid "Deleting temporary def file %s" msgstr "" -#: dllwrap.c:521 +#: dllwrap.c:520 msgid " Generic options:\n" msgstr "" -#: dllwrap.c:522 +#: dllwrap.c:521 msgid " --quiet, -q Work quietly\n" msgstr "" -#: dllwrap.c:523 +#: dllwrap.c:522 msgid " --verbose, -v Verbose\n" msgstr "" -#: dllwrap.c:524 +#: dllwrap.c:523 msgid " --version Print dllwrap version\n" msgstr "" -#: dllwrap.c:525 +#: dllwrap.c:524 msgid " --implib Synonym for --output-lib\n" msgstr "" -#: dllwrap.c:526 +#: dllwrap.c:525 #, c-format msgid " Options for %s:\n" msgstr "" -#: dllwrap.c:527 +#: dllwrap.c:526 msgid " --driver-name Defaults to \"gcc\"\n" msgstr "" -#: dllwrap.c:528 +#: dllwrap.c:527 msgid " --driver-flags Override default ld flags\n" msgstr "" -#: dllwrap.c:529 +#: dllwrap.c:528 msgid " --dlltool-name Defaults to \"dlltool\"\n" msgstr "" -#: dllwrap.c:530 +#: dllwrap.c:529 msgid " --entry Specify alternate DLL entry point\n" msgstr "" -#: dllwrap.c:531 +#: dllwrap.c:530 msgid " --image-base Specify image base address\n" msgstr "" -#: dllwrap.c:532 +#: dllwrap.c:531 msgid " --target i386-cygwin32 or i386-mingw32\n" msgstr "" -#: dllwrap.c:533 +#: dllwrap.c:532 msgid " --dry-run Show what needs to be run\n" msgstr "" -#: dllwrap.c:534 +#: dllwrap.c:533 msgid " --mno-cygwin Create Mingw DLL\n" msgstr "" -#: dllwrap.c:535 +#: dllwrap.c:534 msgid " Options passed to DLLTOOL:\n" msgstr "" -#: dllwrap.c:536 +#: dllwrap.c:535 msgid " --machine \n" msgstr "" -#: dllwrap.c:537 +#: dllwrap.c:536 msgid " --output-exp Generate export file.\n" msgstr "" -#: dllwrap.c:538 +#: dllwrap.c:537 msgid " --output-lib Generate input library.\n" msgstr "" -#: dllwrap.c:539 +#: dllwrap.c:538 msgid " --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dllwrap.c:540 +#: dllwrap.c:539 msgid " --dllname Name of input dll to put into output lib.\n" msgstr "" -#: dllwrap.c:541 +#: dllwrap.c:540 msgid " --def Name input .def file\n" msgstr "" -#: dllwrap.c:542 +#: dllwrap.c:541 msgid " --output-def Name output .def file\n" msgstr "" -#: dllwrap.c:543 +#: dllwrap.c:542 msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dllwrap.c:544 +#: dllwrap.c:543 msgid " --no-export-all-symbols Only export .drectve symbols\n" msgstr "" -#: dllwrap.c:545 +#: dllwrap.c:544 msgid " --exclude-symbols Exclude from .def\n" msgstr "" -#: dllwrap.c:546 +#: dllwrap.c:545 msgid " --no-default-excludes Zap default exclude symbols\n" msgstr "" -#: dllwrap.c:547 +#: dllwrap.c:546 msgid " --base-file Read linker generated base file\n" msgstr "" -#: dllwrap.c:548 +#: dllwrap.c:547 msgid " --no-idata4 Don't generate idata$4 section\n" msgstr "" -#: dllwrap.c:549 +#: dllwrap.c:548 msgid " --no-idata5 Don't generate idata$5 section\n" msgstr "" -#: dllwrap.c:550 +#: dllwrap.c:549 msgid " -U Add underscores to .lib\n" msgstr "" -#: dllwrap.c:551 +#: dllwrap.c:550 msgid " -k Kill @ from exported names\n" msgstr "" -#: dllwrap.c:552 +#: dllwrap.c:551 msgid " --add-stdcall-alias Add aliases without @\n" msgstr "" -#: dllwrap.c:553 +#: dllwrap.c:552 msgid " --as Use for assembler\n" msgstr "" -#: dllwrap.c:554 +#: dllwrap.c:553 msgid " --nodelete Keep temp files.\n" msgstr "" -#: dllwrap.c:555 +#: dllwrap.c:554 msgid " Rest are passed unmodified to the language driver\n" msgstr "" -#: dllwrap.c:816 +#: dllwrap.c:824 msgid "Must provide at least one of -o or --dllname options" msgstr "" -#: dllwrap.c:844 -msgid "no export definition file provided" -msgstr "" - -#: dllwrap.c:845 -msgid "creating one, but that may not be what you want" +#: dllwrap.c:852 +msgid "" +"no export definition file provided.\n" +"Creating one, but that may not be what you want" msgstr "" -#: dllwrap.c:1006 +#: dllwrap.c:1014 #, c-format msgid "DLLTOOL name : %s\n" msgstr "" -#: dllwrap.c:1007 +#: dllwrap.c:1015 #, c-format msgid "DLLTOOL options : %s\n" msgstr "" -#: dllwrap.c:1008 +#: dllwrap.c:1016 #, c-format msgid "DRIVER name : %s\n" msgstr "" -#: dllwrap.c:1009 +#: dllwrap.c:1017 #, c-format msgid "DRIVER options : %s\n" msgstr "" @@ -1189,119 +1191,119 @@ msgstr "" msgid "IEEE unsupported complex type size %u\n" msgstr "" -#: nlmconv.c:275 srconv.c:1966 +#: nlmconv.c:278 srconv.c:2020 msgid "input and output files must be different" msgstr "" -#: nlmconv.c:322 +#: nlmconv.c:325 msgid "input file named both on command line and with INPUT" msgstr "" -#: nlmconv.c:331 +#: nlmconv.c:334 msgid "no input file" msgstr "" -#: nlmconv.c:361 +#: nlmconv.c:364 msgid "no name for output file" msgstr "" -#: nlmconv.c:374 +#: nlmconv.c:377 msgid "warning: input and output formats are not compatible" msgstr "" -#: nlmconv.c:403 +#: nlmconv.c:406 msgid "make .bss section" msgstr "" -#: nlmconv.c:412 +#: nlmconv.c:415 msgid "make .nlmsections section" msgstr "" -#: nlmconv.c:414 +#: nlmconv.c:417 msgid "set .nlmsections flags" msgstr "" -#: nlmconv.c:442 +#: nlmconv.c:445 msgid "set .bss vma" msgstr "" -#: nlmconv.c:449 +#: nlmconv.c:452 msgid "set .data size" msgstr "" -#: nlmconv.c:629 +#: nlmconv.c:632 #, c-format msgid "warning: symbol %s imported but not in import list" msgstr "" -#: nlmconv.c:649 +#: nlmconv.c:652 msgid "set start address" msgstr "" -#: nlmconv.c:698 +#: nlmconv.c:701 #, c-format msgid "warning: START procedure %s not defined" msgstr "" -#: nlmconv.c:700 +#: nlmconv.c:703 #, c-format msgid "warning: EXIT procedure %s not defined" msgstr "" -#: nlmconv.c:702 +#: nlmconv.c:705 #, c-format msgid "warning: CHECK procedure %s not defined" msgstr "" -#: nlmconv.c:723 nlmconv.c:912 +#: nlmconv.c:726 nlmconv.c:915 msgid "custom section" msgstr "" -#: nlmconv.c:744 nlmconv.c:941 +#: nlmconv.c:747 nlmconv.c:944 msgid "help section" msgstr "" -#: nlmconv.c:766 nlmconv.c:959 +#: nlmconv.c:769 nlmconv.c:962 msgid "message section" msgstr "" -#: nlmconv.c:782 nlmconv.c:992 +#: nlmconv.c:785 nlmconv.c:995 msgid "module section" msgstr "" -#: nlmconv.c:802 nlmconv.c:1008 +#: nlmconv.c:805 nlmconv.c:1011 msgid "rpc section" msgstr "" #. There is no place to record this information. -#: nlmconv.c:838 +#: nlmconv.c:841 #, c-format msgid "%s: warning: shared libraries can not have uninitialized data" msgstr "" -#: nlmconv.c:859 nlmconv.c:1027 +#: nlmconv.c:862 nlmconv.c:1030 msgid "shared section" msgstr "" -#: nlmconv.c:867 +#: nlmconv.c:870 msgid "warning: No version number given" msgstr "" -#: nlmconv.c:907 nlmconv.c:936 nlmconv.c:954 nlmconv.c:1003 nlmconv.c:1022 +#: nlmconv.c:910 nlmconv.c:939 nlmconv.c:957 nlmconv.c:1006 nlmconv.c:1025 #, c-format msgid "%s: read: %s" msgstr "" -#: nlmconv.c:929 +#: nlmconv.c:932 msgid "warning: MAP and FULLMAP are not supported; try ld -M" msgstr "" -#: nlmconv.c:1099 +#: nlmconv.c:1101 #, c-format msgid "%s: Convert an object file into a NetWare Loadable Module\n" msgstr "" -#: nlmconv.c:1111 +#: nlmconv.c:1113 #, c-format msgid "" "Usage: %s [-dhV] [-I bfdname] [-O bfdname] [-T header-file] [-l linker]\n" @@ -1311,73 +1313,73 @@ msgid "" " [in-file [out-file]]\n" msgstr "" -#: nlmconv.c:1151 +#: nlmconv.c:1153 #, c-format msgid "support not compiled in for %s" msgstr "" -#: nlmconv.c:1191 +#: nlmconv.c:1193 msgid "make section" msgstr "" -#: nlmconv.c:1205 +#: nlmconv.c:1207 msgid "set section size" msgstr "" -#: nlmconv.c:1211 +#: nlmconv.c:1213 msgid "set section alignment" msgstr "" -#: nlmconv.c:1215 +#: nlmconv.c:1217 msgid "set section flags" msgstr "" -#: nlmconv.c:1226 +#: nlmconv.c:1228 msgid "set .nlmsections size" msgstr "" -#: nlmconv.c:1314 nlmconv.c:1322 nlmconv.c:1331 nlmconv.c:1336 +#: nlmconv.c:1316 nlmconv.c:1324 nlmconv.c:1333 nlmconv.c:1338 msgid "set .nlmsection contents" msgstr "" -#: nlmconv.c:1839 +#: nlmconv.c:1841 msgid "stub section sizes" msgstr "" -#: nlmconv.c:1888 +#: nlmconv.c:1890 msgid "writing stub" msgstr "" -#: nlmconv.c:1978 +#: nlmconv.c:1980 #, c-format msgid "unresolved PC relative reloc against %s" msgstr "" -#: nlmconv.c:2042 +#: nlmconv.c:2044 #, c-format msgid "overflow when adjusting relocation against %s" msgstr "" -#: nlmconv.c:2159 +#: nlmconv.c:2161 #, c-format msgid "%s: execution of %s failed: " msgstr "" -#: nlmconv.c:2174 +#: nlmconv.c:2176 #, c-format msgid "Execution of %s failed" msgstr "" -#: nm.c:294 +#: nm.c:300 #, c-format msgid "Usage: %s [OPTION]... [FILE]...\n" msgstr "" -#: nm.c:295 +#: nm.c:301 msgid "List symbols from FILEs (a.out by default).\n" msgstr "" -#: nm.c:296 +#: nm.c:302 msgid "" "\n" " -a, --debug-syms Display debugger-only symbols\n" @@ -1415,31 +1417,31 @@ msgid "" "\n" msgstr "" -#: nm.c:328 objdump.c:274 +#: nm.c:334 objdump.c:216 #, c-format msgid "Report bugs to %s.\n" msgstr "" -#: nm.c:361 +#: nm.c:367 #, c-format msgid "%s: invalid radix" msgstr "" -#: nm.c:386 +#: nm.c:392 #, c-format msgid "%s: invalid output format" msgstr "" -#: nm.c:493 +#: nm.c:504 msgid "Only -X 32_64 is supported" msgstr "" -#: nm.c:535 +#: nm.c:546 #, c-format msgid "data size %ld" msgstr "" -#: nm.c:1325 +#: nm.c:1340 #, c-format msgid "" "\n" @@ -1448,7 +1450,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1327 +#: nm.c:1342 #, c-format msgid "" "\n" @@ -1457,14 +1459,14 @@ msgid "" "\n" msgstr "" -#: nm.c:1328 nm.c:1382 +#: nm.c:1343 nm.c:1397 msgid "" "Name Value Class Type Size Line " "Section\n" "\n" msgstr "" -#: nm.c:1379 +#: nm.c:1394 #, c-format msgid "" "\n" @@ -1473,7 +1475,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1381 +#: nm.c:1396 #, c-format msgid "" "\n" @@ -1482,26 +1484,28 @@ msgid "" "\n" msgstr "" -#: nm.c:1550 +#: nm.c:1564 msgid "" "\n" "Archive index:\n" msgstr "" -#: objcopy.c:322 +#: objcopy.c:363 #, c-format -msgid "Usage: %s in-file [out-file]\n" +msgid "Usage: %s in-file [out-file]\n" msgstr "" -#: objcopy.c:323 objcopy.c:383 -msgid " The switches are:\n" +#: objcopy.c:364 objcopy.c:433 +msgid " The options are:\n" msgstr "" -#: objcopy.c:324 +#: objcopy.c:365 msgid "" " -I --input-target Assume input file is in format \n" " -O --output-target Create an output file in format " "\n" +" -B --binary-architecture Set arch of output file, when input is " +"binary\n" " -F --target Set both input and output format to " "\n" " --debugging Convert debugging information, if " @@ -1519,6 +1523,7 @@ msgid "" " -K --keep-symbol Only copy symbol \n" " -L --localize-symbol Force symbol to be marked as a " "local\n" +" -G --keep-global-symbol Localize all symbols except \n" " -W --weaken-symbol Force symbol to be marked as a " "weak\n" " --weaken Force all global symbols to be marked as " @@ -1554,6 +1559,7 @@ msgid "" "\n" " --add-section = Add section found in to " "output\n" +" --rename-section =[,] Rename section to \n" " --change-leading-char Force output format's leading character " "style\n" " --remove-leading-char Remove leading character from global " @@ -1563,17 +1569,23 @@ msgid "" "Srecords\n" " --srec-forceS3 Restrict the type of generated Srecords " "to S3\n" +" --strip-symbols -N for all symbols listed in \n" +" --keep-symbols -K for all symbols listed in \n" +" --localize-symbols -L for all symbols listed in \n" +" --keep-global-symbols -G for all symbols listed in \n" +" --weaken-symbols -W for all symbols listed in \n" +" --alt-machine-code Use alternate machine code for output\n" " -v --verbose List all object files modified\n" " -V --version Display this program's version number\n" " -h --help Display this output\n" msgstr "" -#: objcopy.c:382 +#: objcopy.c:432 #, c-format -msgid "Usage: %s in-file(s)\n" +msgid "Usage: %s in-file(s)\n" msgstr "" -#: objcopy.c:384 +#: objcopy.c:434 msgid "" " -I --input-target Assume input file is in format \n" " -O --output-target Create an output file in format " @@ -1598,182 +1610,216 @@ msgid "" " -o Place stripped output into \n" msgstr "" -#: objcopy.c:454 +#: objcopy.c:504 #, c-format msgid "unrecognized section flag `%s'" msgstr "" -#: objcopy.c:455 +#: objcopy.c:505 #, c-format msgid "supported flags: %s" msgstr "" -#: objcopy.c:712 +#: objcopy.c:582 objcopy.c:2206 +#, c-format +msgid "cannot stat: %s: %s" +msgstr "" + +#: objcopy.c:589 objcopy.c:2224 +#, c-format +msgid "cannot open: %s: %s" +msgstr "" + +#: objcopy.c:592 objcopy.c:2228 +#, c-format +msgid "%s: fread failed" +msgstr "" + +#: objcopy.c:665 +#, c-format +msgid "Ignoring rubbish found on line %d of %s" +msgstr "" + +#: objcopy.c:886 #, c-format msgid "%s: Multiple redefinition of symbol \"%s\"" msgstr "" -#: objcopy.c:719 +#: objcopy.c:891 #, c-format msgid "%s: Symbol \"%s\" is target of more than one redefinition" msgstr "" -#: objcopy.c:772 +#: objcopy.c:943 msgid "Unable to change endianness of input file(s)" msgstr "" -#: objcopy.c:780 +#: objcopy.c:951 #, c-format msgid "copy from %s(%s) to %s(%s)\n" msgstr "" -#: objcopy.c:799 +#: objcopy.c:975 #, c-format msgid "Warning: Output file cannot represent architecture %s" msgstr "" -#: objcopy.c:826 +#: objcopy.c:1002 #, c-format msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:912 +#: objcopy.c:1088 #, c-format msgid "Can't fill gap after %s: %s" msgstr "" -#: objcopy.c:937 +#: objcopy.c:1113 #, c-format msgid "Can't add padding to %s: %s" msgstr "" -#: objcopy.c:1075 +#: objcopy.c:1252 #, c-format msgid "%s: error copying private BFD data: %s" msgstr "" -#: objcopy.c:1109 +#: objcopy.c:1265 +msgid "unknown alternate machine code, ignored" +msgstr "" + +#: objcopy.c:1295 #, c-format msgid "cannot mkdir %s for archive copying (error: %s)" msgstr "" -#: objcopy.c:1298 +#: objcopy.c:1466 +#, c-format +msgid "Multiple renames of section %s" +msgstr "" + +#: objcopy.c:1550 msgid "making" msgstr "" -#: objcopy.c:1307 +#: objcopy.c:1559 msgid "size" msgstr "" -#: objcopy.c:1321 +#: objcopy.c:1573 msgid "vma" msgstr "" -#: objcopy.c:1347 +#: objcopy.c:1599 msgid "alignment" msgstr "" -#: objcopy.c:1356 +#: objcopy.c:1607 msgid "flags" msgstr "" -#: objcopy.c:1370 +#: objcopy.c:1624 msgid "private data" msgstr "" -#: objcopy.c:1378 +#: objcopy.c:1632 #, c-format msgid "%s: section `%s': error in %s: %s" msgstr "" -#: objcopy.c:1652 +#: objcopy.c:1910 #, c-format msgid "%s: can't create debugging section: %s" msgstr "" -#: objcopy.c:1667 +#: objcopy.c:1925 #, c-format msgid "%s: can't set debugging section contents: %s" msgstr "" -#: objcopy.c:1676 +#: objcopy.c:1934 #, c-format msgid "%s: don't know how to write debugging information for %s" msgstr "" -#: objcopy.c:1782 +#: objcopy.c:2041 #, c-format msgid "%s: cannot stat: %s" msgstr "" -#: objcopy.c:1832 +#: objcopy.c:2092 msgid "byte number must be non-negative" msgstr "" -#: objcopy.c:1838 +#: objcopy.c:2102 msgid "interleave must be positive" msgstr "" -#: objcopy.c:1858 objcopy.c:1866 +#: objcopy.c:2122 objcopy.c:2130 #, c-format msgid "%s both copied and removed" msgstr "" -#: objcopy.c:1935 objcopy.c:2005 objcopy.c:2106 objcopy.c:2134 +#: objcopy.c:2203 objcopy.c:2273 objcopy.c:2373 objcopy.c:2400 objcopy.c:2424 +#: objcopy.c:2428 objcopy.c:2448 #, c-format msgid "bad format for %s" msgstr "" -#: objcopy.c:1938 +#: objcopy.c:2342 #, c-format -msgid "cannot stat: %s: %s" +msgid "Warning: truncating gap-fill from 0x%s to 0x%x" msgstr "" -#: objcopy.c:1956 -#, c-format -msgid "cannot open: %s: %s" +#: objcopy.c:2494 +msgid "alternate machine code index must be positive" msgstr "" -#: objcopy.c:1960 -#, c-format -msgid "%s: fread failed" +#: objcopy.c:2512 +msgid "byte number must be less than interleave" msgstr "" -#: objcopy.c:2074 +#: objcopy.c:2539 #, c-format -msgid "Warning: truncating gap-fill from 0x%s to 0x%x" +msgid "architecture %s unknown" msgstr "" -#: objcopy.c:2176 -msgid "byte number must be less than interleave" +#: objcopy.c:2543 +msgid "" +"Warning: input target 'binary' required for binary architecture parameter." +msgstr "" + +#: objcopy.c:2544 +#, c-format +msgid " Argument %s ignored" msgstr "" -#: objcopy.c:2195 +#: objcopy.c:2550 #, c-format msgid "Cannot stat: %s: %s" msgstr "" -#: objcopy.c:2235 objcopy.c:2249 +#: objcopy.c:2590 objcopy.c:2604 #, c-format msgid "%s %s%c0x%s never used" msgstr "" -#: objdump.c:223 +#: objdump.c:164 #, c-format msgid "Usage: %s OPTION... FILE...\n" msgstr "" -#: objdump.c:224 +#: objdump.c:165 msgid "Display information from object FILE.\n" msgstr "" -#: objdump.c:225 +#: objdump.c:166 msgid "" "\n" " At least one of the following switches must be given:\n" msgstr "" -#: objdump.c:226 +#: objdump.c:167 msgid "" " -a, --archive-headers Display archive header information\n" " -f, --file-headers Display the contents of the overall file header\n" @@ -1799,13 +1845,13 @@ msgid "" " -H, --help Display this information\n" msgstr "" -#: objdump.c:248 +#: objdump.c:189 msgid "" "\n" " The following switches are optional:\n" msgstr "" -#: objdump.c:249 +#: objdump.c:190 msgid "" " -b, --target=BFDNAME Specify the target object format as " "BFDNAME\n" @@ -1838,130 +1884,130 @@ msgid "" "\n" msgstr "" -#: objdump.c:419 +#: objdump.c:359 msgid "Sections:\n" msgstr "" -#: objdump.c:422 +#: objdump.c:362 msgid "Idx Name Size VMA LMA File off Algn" msgstr "" -#: objdump.c:424 +#: objdump.c:364 msgid "" "Idx Name Size VMA LMA File off " "Algn" msgstr "" -#: objdump.c:428 +#: objdump.c:368 msgid " Flags" msgstr "" -#: objdump.c:478 +#: objdump.c:418 #, c-format msgid "%s: not a dynamic object" msgstr "" -#: objdump.c:494 +#: objdump.c:434 #, c-format msgid "%s: No dynamic symbols" msgstr "" -#: objdump.c:1197 +#: objdump.c:1124 msgid "Out of virtual memory" msgstr "" -#: objdump.c:1616 +#: objdump.c:1553 #, c-format msgid "Can't use supplied machine %s" msgstr "" -#: objdump.c:1634 +#: objdump.c:1571 #, c-format msgid "Can't disassemble for architecture %s\n" msgstr "" -#: objdump.c:1716 +#: objdump.c:1653 #, c-format msgid "Disassembly of section %s:\n" msgstr "" -#: objdump.c:1890 +#: objdump.c:1828 #, c-format msgid "" "No %s section present\n" "\n" msgstr "" -#: objdump.c:1897 +#: objdump.c:1835 #, c-format msgid "%s has no %s section" msgstr "" -#: objdump.c:1911 +#: objdump.c:1849 #, c-format msgid "Reading %s section of %s failed: %s" msgstr "" -#: objdump.c:1923 +#: objdump.c:1861 #, c-format msgid "Reading %s section of %s failed: %s\n" msgstr "" -#: objdump.c:1966 +#: objdump.c:1904 #, c-format msgid "" "Contents of %s section:\n" "\n" msgstr "" -#: objdump.c:2066 +#: objdump.c:2004 #, c-format msgid "architecture: %s, " msgstr "" -#: objdump.c:2069 +#: objdump.c:2007 #, c-format msgid "flags 0x%08x:\n" msgstr "" -#: objdump.c:2082 +#: objdump.c:2020 msgid "" "\n" "start address 0x" msgstr "" -#: objdump.c:2114 +#: objdump.c:2052 #, c-format msgid "" "\n" "%s: file format %s\n" msgstr "" -#: objdump.c:2156 +#: objdump.c:2094 #, c-format msgid "%s: printing debugging information failed" msgstr "" -#: objdump.c:2233 +#: objdump.c:2171 #, c-format msgid "In archive %s:\n" msgstr "" -#: objdump.c:2285 +#: objdump.c:2223 #, c-format msgid "Contents of section %s:\n" msgstr "" -#: objdump.c:2798 +#: objdump.c:2736 #, c-format msgid "BFD header file version %s\n" msgstr "" -#: objdump.c:2882 +#: objdump.c:2825 msgid "unrecognized -E option" msgstr "" -#: objdump.c:2893 +#: objdump.c:2836 #, c-format msgid "unrecognized --endian type `%s'" msgstr "" @@ -2000,1017 +2046,1065 @@ msgstr "" msgid "Last stabs entries before error:\n" msgstr "" -#: readelf.c:271 -#, c-format -msgid "Unable to seek to start of %s at %x\n" -msgstr "" - -#: readelf.c:279 +#: readelf.c:318 #, c-format -msgid "Out of memory allocating %d bytes for %s\n" +msgid "%s: Error: " msgstr "" -#: readelf.c:285 +#: readelf.c:329 #, c-format -msgid "Unable to read in %d bytes of %s\n" +msgid "%s: Warning: " msgstr "" -#: readelf.c:295 +#: readelf.c:351 #, c-format msgid "Unable to seek to %x for %s\n" msgstr "" -#: readelf.c:300 -#, c-format -msgid "Unable to read data at %x for %s\n" -msgstr "" - -#: readelf.c:315 readelf.c:341 +#: readelf.c:362 #, c-format -msgid "%s: Error: " +msgid "Out of memory allocating %d bytes for %s\n" msgstr "" -#: readelf.c:327 readelf.c:356 +#: readelf.c:370 #, c-format -msgid "%s: Warning: " +msgid "Unable to read in %d bytes of %s\n" msgstr "" -#: readelf.c:409 readelf.c:548 +#: readelf.c:423 readelf.c:581 #, c-format msgid "Unhandled data length: %d\n" msgstr "" -#: readelf.c:612 +#: readelf.c:660 msgid "Don't know about relocations on this machine architecture\n" msgstr "" -#: readelf.c:643 readelf.c:670 readelf.c:713 readelf.c:738 +#: readelf.c:682 readelf.c:711 readelf.c:757 readelf.c:784 +msgid "relocs" +msgstr "" + +#: readelf.c:693 readelf.c:722 readelf.c:767 readelf.c:794 msgid "out of memory parsing relocs" msgstr "" -#: readelf.c:787 +#: readelf.c:845 msgid "" -" Offset Info Type Symbol's Value Symbol's Name " +" Offset Info Type Symbol's Value Symbol's Name " "Addend\n" msgstr "" -#: readelf.c:790 -msgid " Offset Info Type Symbol's Value Symbol's Name\n" +#: readelf.c:848 +msgid " Offset Info Type Symbol's Value Symbol's Name\n" +msgstr "" + +#: readelf.c:854 +msgid "" +" Offset Info Type Symbol's Value " +"Symbol's Name Addend\n" +msgstr "" + +#: readelf.c:857 +msgid "" +" Offset Info Type Symbol's Value " +"Symbol's Name\n" msgstr "" -#: readelf.c:950 readelf.c:952 +#: readelf.c:1061 readelf.c:1063 #, c-format msgid "unrecognised: %-7lx" msgstr "" -#: readelf.c:977 +#: readelf.c:1085 #, c-format msgid "" msgstr "" -#: readelf.c:1193 +#: readelf.c:1315 #, c-format msgid "Processor Specific: %lx" msgstr "" -#: readelf.c:1212 +#: readelf.c:1334 #, c-format msgid "Operating System specific: %lx" msgstr "" -#: readelf.c:1215 readelf.c:1756 +#: readelf.c:1337 readelf.c:1961 #, c-format msgid ": %lx" msgstr "" -#: readelf.c:1229 +#: readelf.c:1351 msgid "NONE (None)" msgstr "" -#: readelf.c:1230 +#: readelf.c:1352 msgid "REL (Relocatable file)" msgstr "" -#: readelf.c:1231 +#: readelf.c:1353 msgid "EXEC (Executable file)" msgstr "" -#: readelf.c:1232 +#: readelf.c:1354 msgid "DYN (Shared object file)" msgstr "" -#: readelf.c:1233 +#: readelf.c:1355 msgid "CORE (Core file)" msgstr "" -#: readelf.c:1237 +#: readelf.c:1359 #, c-format msgid "Processor Specific: (%x)" msgstr "" -#: readelf.c:1239 +#: readelf.c:1361 #, c-format msgid "OS Specific: (%x)" msgstr "" -#: readelf.c:1241 readelf.c:1327 readelf.c:1907 +#: readelf.c:1363 readelf.c:1460 readelf.c:2112 #, c-format msgid ": %x" msgstr "" -#: readelf.c:1254 +#: readelf.c:1376 msgid "None" msgstr "" -#: readelf.c:1946 +#: readelf.c:2152 msgid "Usage: readelf {options} elf-file(s)\n" msgstr "" -#: readelf.c:1947 +#: readelf.c:2153 msgid " Options are:\n" msgstr "" -#: readelf.c:1948 +#: readelf.c:2154 msgid " -a or --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" msgstr "" -#: readelf.c:1949 +#: readelf.c:2155 msgid " -h or --file-header Display the ELF file header\n" msgstr "" -#: readelf.c:1950 +#: readelf.c:2156 msgid " -l or --program-headers or --segments\n" msgstr "" -#: readelf.c:1951 +#: readelf.c:2157 msgid " Display the program headers\n" msgstr "" -#: readelf.c:1952 +#: readelf.c:2158 msgid " -S or --section-headers or --sections\n" msgstr "" -#: readelf.c:1953 +#: readelf.c:2159 msgid " Display the sections' header\n" msgstr "" -#: readelf.c:1954 +#: readelf.c:2160 msgid " -e or --headers Equivalent to: -h -l -S\n" msgstr "" -#: readelf.c:1955 +#: readelf.c:2161 msgid " -s or --syms or --symbols Display the symbol table\n" msgstr "" -#: readelf.c:1956 +#: readelf.c:2162 msgid " -n or --notes Display the core notes (if present)\n" msgstr "" -#: readelf.c:1957 +#: readelf.c:2163 msgid " -r or --relocs Display the relocations (if present)\n" msgstr "" -#: readelf.c:1958 +#: readelf.c:2164 msgid " -u or --unwind Display the unwind info (if present)\n" msgstr "" -#: readelf.c:1959 +#: readelf.c:2165 msgid " -d or --dynamic Display the dynamic segment (if present)\n" msgstr "" -#: readelf.c:1960 +#: readelf.c:2166 msgid " -V or --version-info Display the version sections (if present)\n" msgstr "" -#: readelf.c:1961 +#: readelf.c:2167 msgid "" " -A or --arch-specific Display architecture specific information (if " "any).\n" msgstr "" -#: readelf.c:1962 +#: readelf.c:2168 msgid "" " -D or --use-dynamic Use the dynamic section info when displaying " "symbols\n" msgstr "" -#: readelf.c:1963 +#: readelf.c:2169 msgid " -x or --hex-dump=\n" msgstr "" -#: readelf.c:1964 +#: readelf.c:2170 msgid " Dump the contents of section \n" msgstr "" -#: readelf.c:1965 +#: readelf.c:2171 msgid "" -" -w[liaprf] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]\n" +" -w[liaprmfs] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro," +"=frames,=str]\n" msgstr "" -#: readelf.c:1966 +#: readelf.c:2172 msgid "" " Display the contents of DWARF2 debug sections\n" msgstr "" -#: readelf.c:1968 +#: readelf.c:2174 msgid " -i or --instruction-dump=\n" msgstr "" -#: readelf.c:1969 +#: readelf.c:2175 msgid "" " Disassemble the contents of section \n" msgstr "" -#: readelf.c:1971 +#: readelf.c:2177 msgid " -I or --histogram Display histogram of bucket list lengths\n" msgstr "" -#: readelf.c:1972 +#: readelf.c:2178 msgid " -v or --version Display the version number of readelf\n" msgstr "" -#: readelf.c:1973 +#: readelf.c:2179 +msgid "" +" -W or --wide Don't split lines or truncate symbols to fit " +"into 80 columns\n" +msgstr "" + +#: readelf.c:2180 msgid " -H or --help Display this information\n" msgstr "" -#: readelf.c:1991 +#: readelf.c:2198 msgid "Out of memory allocating dump request table." msgstr "" -#: readelf.c:2136 +#: readelf.c:2357 #, c-format msgid "Unrecognised debug option '%s'\n" msgstr "" -#: readelf.c:2161 +#: readelf.c:2385 #, c-format msgid "Invalid option '-%c'\n" msgstr "" -#: readelf.c:2174 +#: readelf.c:2398 msgid "Nothing to do.\n" msgstr "" -#: readelf.c:2187 readelf.c:2204 readelf.c:4267 +#: readelf.c:2411 readelf.c:2428 readelf.c:4700 msgid "none" msgstr "" -#: readelf.c:2188 -msgid "ELF32" -msgstr "" - -#: readelf.c:2189 -msgid "ELF64" -msgstr "" - -#: readelf.c:2191 readelf.c:2208 readelf.c:2236 +#: readelf.c:2415 readelf.c:2432 readelf.c:2460 #, c-format msgid "" msgstr "" -#: readelf.c:2205 +#: readelf.c:2429 msgid "2's complement, little endian" msgstr "" -#: readelf.c:2206 +#: readelf.c:2430 msgid "2's complement, big endian" msgstr "" -#: readelf.c:2221 -msgid "UNIX - System V" -msgstr "" - -#: readelf.c:2222 -msgid "UNIX - HP-UX" -msgstr "" - -#: readelf.c:2223 -msgid "UNIX - NetBSD" -msgstr "" - -#: readelf.c:2224 -msgid "UNIX - Linux" -msgstr "" - -#: readelf.c:2225 -msgid "GNU/Hurd" -msgstr "" - -#: readelf.c:2226 -msgid "UNIX - Solaris" -msgstr "" - -#: readelf.c:2227 -msgid "UNIX - AIX" -msgstr "" - -#: readelf.c:2228 -msgid "UNIX - IRIX" -msgstr "" - -#: readelf.c:2229 -msgid "UNIX - FreeBSD" -msgstr "" - -#: readelf.c:2230 -msgid "UNIX - TRU64" -msgstr "" - -#: readelf.c:2231 -msgid "Novell - Modesto" -msgstr "" - -#: readelf.c:2232 -msgid "UNIX - OpenBSD" -msgstr "" - -#: readelf.c:2233 +#: readelf.c:2457 msgid "Standalone App" msgstr "" -#: readelf.c:2234 -msgid "ARM" -msgstr "" - -#: readelf.c:2251 +#: readelf.c:2475 msgid "Not an ELF file - it has the wrong magic bytes at the start\n" msgstr "" -#: readelf.c:2259 +#: readelf.c:2483 msgid "ELF Header:\n" msgstr "" -#: readelf.c:2260 +#: readelf.c:2484 msgid " Magic: " msgstr "" -#: readelf.c:2264 +#: readelf.c:2488 #, c-format msgid " Class: %s\n" msgstr "" -#: readelf.c:2266 +#: readelf.c:2490 #, c-format msgid " Data: %s\n" msgstr "" -#: readelf.c:2268 +#: readelf.c:2492 #, c-format msgid " Version: %d %s\n" msgstr "" -#: readelf.c:2275 +#: readelf.c:2499 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: readelf.c:2277 +#: readelf.c:2501 #, c-format msgid " ABI Version: %d\n" msgstr "" -#: readelf.c:2279 +#: readelf.c:2503 #, c-format msgid " Type: %s\n" msgstr "" -#: readelf.c:2281 +#: readelf.c:2505 #, c-format msgid " Machine: %s\n" msgstr "" -#: readelf.c:2283 +#: readelf.c:2507 #, c-format msgid " Version: 0x%lx\n" msgstr "" -#: readelf.c:2286 +#: readelf.c:2510 msgid " Entry point address: " msgstr "" -#: readelf.c:2288 +#: readelf.c:2512 msgid "" "\n" " Start of program headers: " msgstr "" -#: readelf.c:2290 +#: readelf.c:2514 msgid "" " (bytes into file)\n" " Start of section headers: " msgstr "" -#: readelf.c:2292 +#: readelf.c:2516 msgid " (bytes into file)\n" msgstr "" -#: readelf.c:2294 +#: readelf.c:2518 #, c-format msgid " Flags: 0x%lx%s\n" msgstr "" -#: readelf.c:2297 +#: readelf.c:2521 #, c-format msgid " Size of this header: %ld (bytes)\n" msgstr "" -#: readelf.c:2299 +#: readelf.c:2523 #, c-format msgid " Size of program headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2301 +#: readelf.c:2525 #, c-format msgid " Number of program headers: %ld\n" msgstr "" -#: readelf.c:2303 +#: readelf.c:2527 #, c-format msgid " Size of section headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2305 +#: readelf.c:2529 #, c-format -msgid " Number of section headers: %ld\n" +msgid " Number of section headers: %ld" msgstr "" -#: readelf.c:2307 +#: readelf.c:2534 #, c-format -msgid " Section header string table index: %ld\n" +msgid " Section header string table index: %ld" +msgstr "" + +#: readelf.c:2568 readelf.c:2604 +msgid "program headers" msgstr "" -#: readelf.c:2392 +#: readelf.c:2638 msgid "" "\n" "There are no program headers in this file.\n" msgstr "" -#: readelf.c:2398 +#: readelf.c:2644 #, c-format msgid "" "\n" "Elf file type is %s\n" msgstr "" -#: readelf.c:2399 +#: readelf.c:2645 msgid "Entry point " msgstr "" -#: readelf.c:2401 +#: readelf.c:2647 #, c-format msgid "" "\n" "There are %d program headers, starting at offset " msgstr "" -#: readelf.c:2412 readelf.c:2588 readelf.c:2630 readelf.c:2673 readelf.c:2714 -#: readelf.c:3660 readelf.c:3701 readelf.c:3877 readelf.c:4798 readelf.c:4812 -#: readelf.c:8251 readelf.c:8291 +#: readelf.c:2658 readelf.c:2883 readelf.c:2929 readelf.c:2992 readelf.c:3059 +#: readelf.c:4087 readelf.c:4130 readelf.c:4310 readelf.c:5246 readelf.c:5260 +#: readelf.c:9246 readelf.c:9286 msgid "Out of memory\n" msgstr "" -#: readelf.c:2430 +#: readelf.c:2676 #, c-format msgid "" "\n" "Program Header%s:\n" msgstr "" -#: readelf.c:2434 +#: readelf.c:2680 msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" msgstr "" -#: readelf.c:2438 +#: readelf.c:2683 +msgid "" +" Type Offset VirtAddr PhysAddr FileSiz " +"MemSiz Flg Align\n" +msgstr "" + +#: readelf.c:2687 msgid " Type Offset VirtAddr PhysAddr\n" msgstr "" -#: readelf.c:2440 +#: readelf.c:2689 msgid " FileSiz MemSiz Flags Align\n" msgstr "" -#: readelf.c:2498 +#: readelf.c:2789 msgid "more than one dynamic segment\n" msgstr "" -#: readelf.c:2506 +#: readelf.c:2797 msgid "Unable to find program interpreter name\n" msgstr "" -#: readelf.c:2513 +#: readelf.c:2804 #, c-format msgid "" "\n" " [Requesting program interpreter: %s]" msgstr "" -#: readelf.c:2531 +#: readelf.c:2822 msgid "" "\n" " Section to Segment mapping:\n" msgstr "" -#: readelf.c:2532 +#: readelf.c:2823 msgid " Segment Sections...\n" msgstr "" -#: readelf.c:2796 +#: readelf.c:2874 readelf.c:2920 +msgid "section headers" +msgstr "" + +#: readelf.c:2968 readelf.c:3035 +msgid "symbols" +msgstr "" + +#: readelf.c:2979 readelf.c:3046 +msgid "symtab shndx" +msgstr "" + +#: readelf.c:3147 msgid "" "\n" "There are no sections in this file.\n" msgstr "" -#: readelf.c:2802 +#: readelf.c:3153 #, c-format msgid "There are %d section headers, starting at offset 0x%lx:\n" msgstr "" -#: readelf.c:2840 +#: readelf.c:3170 readelf.c:3479 readelf.c:3826 readelf.c:5397 +msgid "string table" +msgstr "" + +#: readelf.c:3191 msgid "File contains multiple dynamic symbol tables\n" msgstr "" -#: readelf.c:2853 +#: readelf.c:3203 msgid "File contains multiple dynamic string tables\n" msgstr "" -#: readelf.c:2888 +#: readelf.c:3209 +msgid "dynamic strings" +msgstr "" + +#: readelf.c:3215 +msgid "File contains multiple symtab shndx tables\n" +msgstr "" + +#: readelf.c:3250 #, c-format msgid "" "\n" "Section Header%s:\n" msgstr "" -#: readelf.c:2892 +#: readelf.c:3254 msgid "" " [Nr] Name Type Addr Off Size ES Flg Lk " "Inf Al\n" msgstr "" -#: readelf.c:2895 -msgid " [Nr] Name Type Address Offset\n" -msgstr "" - -#: readelf.c:2896 -msgid " Size EntSize Flags Link Info Align\n" -msgstr "" - -#: readelf.c:2943 -msgid "Key to Flags:\n" +#: readelf.c:3257 +msgid "" +" [Nr] Name Type Address Off Size ES " +"Flg Lk Inf Al\n" msgstr "" -#: readelf.c:2944 -msgid " W (write), A (alloc), X (execute), M (merge), S (strings)\n" +#: readelf.c:3260 +msgid " [Nr] Name Type Address Offset\n" msgstr "" -#: readelf.c:2945 -msgid " I (info), L (link order), G (group), x (unknown)\n" +#: readelf.c:3261 +msgid " Size EntSize Flags Link Info Align\n" msgstr "" -#: readelf.c:2946 +#: readelf.c:3356 msgid "" +"Key to Flags:\n" +" W (write), A (alloc), X (execute), M (merge), S (strings)\n" +" I (info), L (link order), G (group), x (unknown)\n" " O (extra OS processing required) o (OS specific), p (processor specific)\n" msgstr "" -#: readelf.c:3004 +#: readelf.c:3417 #, c-format msgid "" "\n" "Relocation section at offset 0x%lx contains %ld bytes:\n" msgstr "" -#: readelf.c:3011 +#: readelf.c:3424 msgid "" "\n" "There are no dynamic relocations in this file.\n" msgstr "" -#: readelf.c:3039 +#: readelf.c:3451 msgid "" "\n" "Relocation section " msgstr "" -#: readelf.c:3046 readelf.c:3480 +#: readelf.c:3458 readelf.c:3905 #, c-format msgid " at offset 0x%lx contains %lu entries:\n" msgstr "" -#: readelf.c:3074 +#: readelf.c:3496 msgid "" "\n" "There are no relocations in this file.\n" msgstr "" -#: readelf.c:3318 readelf.c:3330 +#: readelf.c:3692 +msgid "unwind table" +msgstr "" + +#: readelf.c:3743 readelf.c:3755 readelf.c:7608 readelf.c:7619 #, c-format -msgid "Skipping unexpected symbol type %u" +msgid "Skipping unexpected symbol type %u\n" msgstr "" -#: readelf.c:3338 +#: readelf.c:3763 #, c-format -msgid "Skipping unexpected relocation type %s" +msgid "Skipping unexpected relocation type %s\n" msgstr "" -#: readelf.c:3383 readelf.c:3408 +#: readelf.c:3808 readelf.c:3833 msgid "" "\n" "There are no unwind sections in this file.\n" msgstr "" -#: readelf.c:3459 +#: readelf.c:3884 msgid "" "\n" "Could not find unwind info section for " msgstr "" -#: readelf.c:3473 +#: readelf.c:3896 +msgid "unwind info" +msgstr "" + +#: readelf.c:3898 msgid "" "\n" "Unwind section " msgstr "" -#: readelf.c:3754 +#: readelf.c:4071 readelf.c:4114 +msgid "dynamic segment" +msgstr "" + +#: readelf.c:4183 msgid "" "\n" "There is no dynamic segment in this file.\n" msgstr "" -#: readelf.c:3788 +#: readelf.c:4217 msgid "Unable to seek to end of file!" msgstr "" -#: readelf.c:3797 +#: readelf.c:4228 msgid "Unable to determine the number of symbols to load\n" msgstr "" -#: readelf.c:3827 +#: readelf.c:4258 msgid "Unable to seek to end of file\n" msgstr "" -#: readelf.c:3833 +#: readelf.c:4264 msgid "Unable to determine the length of the dynamic string table\n" msgstr "" -#: readelf.c:3894 +#: readelf.c:4269 +msgid "dynamic string table" +msgstr "" + +#: readelf.c:4303 +msgid "symbol information" +msgstr "" + +#: readelf.c:4327 #, c-format msgid "" "\n" "Dynamic segment at offset 0x%x contains %ld entries:\n" msgstr "" -#: readelf.c:3897 +#: readelf.c:4330 msgid " Tag Type Name/Value\n" msgstr "" -#: readelf.c:3933 +#: readelf.c:4366 msgid "Auxiliary library" msgstr "" -#: readelf.c:3937 +#: readelf.c:4370 msgid "Filter library" msgstr "" -#: readelf.c:3941 +#: readelf.c:4374 msgid "Configuration file" msgstr "" -#: readelf.c:3945 +#: readelf.c:4378 msgid "Dependency audit library" msgstr "" -#: readelf.c:3949 +#: readelf.c:4382 msgid "Audit library" msgstr "" -#: readelf.c:3967 readelf.c:3993 readelf.c:4019 +#: readelf.c:4400 readelf.c:4426 readelf.c:4452 msgid "Flags:" msgstr "" -#: readelf.c:3969 readelf.c:3995 readelf.c:4021 +#: readelf.c:4402 readelf.c:4428 readelf.c:4454 msgid " None\n" msgstr "" -#: readelf.c:4140 +#: readelf.c:4573 #, c-format msgid "Shared library: [%s]" msgstr "" -#: readelf.c:4143 +#: readelf.c:4576 msgid " program interpreter" msgstr "" -#: readelf.c:4147 +#: readelf.c:4580 #, c-format msgid "Library soname: [%s]" msgstr "" -#: readelf.c:4151 +#: readelf.c:4584 #, c-format msgid "Library rpath: [%s]" msgstr "" -#: readelf.c:4155 +#: readelf.c:4588 #, c-format msgid "Library runpath: [%s]" msgstr "" -#: readelf.c:4216 +#: readelf.c:4649 #, c-format msgid "Not needed object: [%s]\n" msgstr "" -#: readelf.c:4313 +#: readelf.c:4746 #, c-format msgid "" "\n" "Version definition section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:4316 +#: readelf.c:4749 msgid " Addr: 0x" msgstr "" -#: readelf.c:4318 readelf.c:4506 +#: readelf.c:4751 readelf.c:4946 #, c-format msgid " Offset: %#08lx Link: %lx (%s)\n" msgstr "" -#: readelf.c:4348 +#: readelf.c:4758 +msgid "version definition section" +msgstr "" + +#: readelf.c:4784 #, c-format msgid " %#06x: Rev: %d Flags: %s" msgstr "" -#: readelf.c:4351 +#: readelf.c:4787 #, c-format msgid " Index: %d Cnt: %d " msgstr "" -#: readelf.c:4362 +#: readelf.c:4798 #, c-format msgid "Name: %s\n" msgstr "" -#: readelf.c:4364 +#: readelf.c:4800 #, c-format msgid "Name index: %ld\n" msgstr "" -#: readelf.c:4379 +#: readelf.c:4815 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: readelf.c:4382 +#: readelf.c:4818 #, c-format msgid " %#06x: Parent %d, name index: %ld\n" msgstr "" -#: readelf.c:4401 +#: readelf.c:4837 #, c-format msgid "" "\n" "Version needs section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:4404 +#: readelf.c:4840 msgid " Addr: 0x" msgstr "" -#: readelf.c:4406 +#: readelf.c:4842 #, c-format msgid " Offset: %#08lx Link to section: %ld (%s)\n" msgstr "" -#: readelf.c:4432 +#: readelf.c:4848 +msgid "version need section" +msgstr "" + +#: readelf.c:4870 #, c-format msgid " %#06x: Version: %d" msgstr "" -#: readelf.c:4435 +#: readelf.c:4873 #, c-format msgid " File: %s" msgstr "" -#: readelf.c:4437 +#: readelf.c:4875 #, c-format msgid " File: %lx" msgstr "" -#: readelf.c:4439 +#: readelf.c:4877 #, c-format msgid " Cnt: %d\n" msgstr "" -#: readelf.c:4457 +#: readelf.c:4895 #, c-format msgid " %#06x: Name: %s" msgstr "" -#: readelf.c:4460 +#: readelf.c:4898 #, c-format msgid " %#06x: Name index: %lx" msgstr "" -#: readelf.c:4463 +#: readelf.c:4901 #, c-format msgid " Flags: %s Version: %d\n" msgstr "" -#: readelf.c:4501 +#: readelf.c:4937 +msgid "version string table" +msgstr "" + +#: readelf.c:4941 #, c-format msgid "" "\n" "Version symbols section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:4504 +#: readelf.c:4944 msgid " Addr: " msgstr "" -#: readelf.c:4535 +#: readelf.c:4954 +msgid "version symbol data" +msgstr "" + +#: readelf.c:4981 msgid " 0 (*local*) " msgstr "" -#: readelf.c:4539 +#: readelf.c:4985 msgid " 1 (*global*) " msgstr "" -#: readelf.c:4673 +#: readelf.c:5020 readelf.c:5454 +msgid "version need" +msgstr "" + +#: readelf.c:5030 +msgid "version need aux (2)" +msgstr "" + +#: readelf.c:5071 readelf.c:5516 +msgid "version def" +msgstr "" + +#: readelf.c:5090 readelf.c:5531 +msgid "version def aux" +msgstr "" + +#: readelf.c:5121 msgid "" "\n" "No version information found in this file.\n" msgstr "" -#: readelf.c:4691 readelf.c:4726 +#: readelf.c:5139 readelf.c:5174 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4693 readelf.c:4738 +#: readelf.c:5141 readelf.c:5186 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4695 readelf.c:4741 +#: readelf.c:5143 readelf.c:5189 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4804 +#: readelf.c:5252 msgid "Unable to read in dynamic data\n" msgstr "" -#: readelf.c:4846 +#: readelf.c:5294 msgid "Unable to seek to start of dynamic information" msgstr "" -#: readelf.c:4852 +#: readelf.c:5300 msgid "Failed to read in number of buckets\n" msgstr "" -#: readelf.c:4858 +#: readelf.c:5306 msgid "Failed to read in number of chains\n" msgstr "" -#: readelf.c:4878 +#: readelf.c:5326 msgid "" "\n" "Symbol table for image:\n" msgstr "" -#: readelf.c:4880 +#: readelf.c:5328 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4882 +#: readelf.c:5330 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4926 +#: readelf.c:5375 #, c-format msgid "" "\n" "Symbol table '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:4930 +#: readelf.c:5379 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4932 +#: readelf.c:5381 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:5042 +#: readelf.c:5427 +msgid "version data" +msgstr "" + +#: readelf.c:5467 +msgid "version need aux (3)" +msgstr "" + +#: readelf.c:5492 msgid "bad dynamic symbol" msgstr "" -#: readelf.c:5102 +#: readelf.c:5554 msgid "" "\n" "Dynamic symbol information is not available for displaying symbols.\n" msgstr "" -#: readelf.c:5114 +#: readelf.c:5566 #, c-format msgid "" "\n" "Histogram for bucket list length (total of %d buckets):\n" msgstr "" -#: readelf.c:5116 +#: readelf.c:5568 #, c-format msgid " Length Number %% of total Coverage\n" msgstr "" -#: readelf.c:5121 readelf.c:5140 readelf.c:7933 readelf.c:8126 +#: readelf.c:5573 readelf.c:5592 readelf.c:8825 readelf.c:9017 msgid "Out of memory" msgstr "" -#: readelf.c:5189 +#: readelf.c:5641 #, c-format msgid "" "\n" "Dynamic info segment at offset 0x%lx contains %d entries:\n" msgstr "" -#: readelf.c:5192 +#: readelf.c:5644 msgid " Num: Name BoundTo Flags\n" msgstr "" -#: readelf.c:5240 +#: readelf.c:5696 #, c-format msgid "" "\n" "Assembly dump of section %s\n" msgstr "" -#: readelf.c:5263 +#: readelf.c:5719 #, c-format msgid "" "\n" "Section '%s' has no data to dump.\n" msgstr "" -#: readelf.c:5268 +#: readelf.c:5724 #, c-format msgid "" "\n" "Hex dump of section '%s':\n" msgstr "" -#: readelf.c:5420 -msgid "badly formed extended line op encountered!" +#: readelf.c:5729 +msgid "section data" msgstr "" -#: readelf.c:5427 +#: readelf.c:5878 +msgid "badly formed extended line op encountered!\n" +msgstr "" + +#: readelf.c:5885 #, c-format msgid " Extended opcode %d: " msgstr "" -#: readelf.c:5432 +#: readelf.c:5890 msgid "" "End of Sequence\n" "\n" msgstr "" -#: readelf.c:5438 +#: readelf.c:5896 #, c-format msgid "set Address to 0x%lx\n" msgstr "" -#: readelf.c:5443 +#: readelf.c:5901 msgid " define new File Table entry\n" msgstr "" -#: readelf.c:5444 readelf.c:5566 +#: readelf.c:5902 readelf.c:6031 msgid " Entry\tDir\tTime\tSize\tName\n" msgstr "" -#: readelf.c:5446 +#: readelf.c:5904 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:5449 readelf.c:5451 readelf.c:5453 readelf.c:5578 readelf.c:5580 -#: readelf.c:5582 +#: readelf.c:5907 readelf.c:5909 readelf.c:5911 readelf.c:6043 readelf.c:6045 +#: readelf.c:6047 #, c-format msgid "%lu\t" msgstr "" -#: readelf.c:5454 +#: readelf.c:5912 #, c-format msgid "" "%s\n" "\n" msgstr "" -#: readelf.c:5458 +#: readelf.c:5916 #, c-format msgid "UNKNOWN: length %d\n" msgstr "" -#: readelf.c:5484 +#: readelf.c:5942 #, c-format msgid "" "\n" @@ -3018,503 +3112,629 @@ msgid "" "\n" msgstr "" -#: readelf.c:5496 +#: readelf.c:5954 +msgid "64-bit DWARF line info is not supported yet.\n" +msgstr "" + +#: readelf.c:5961 msgid "The line info appears to be corrupt - the section is too small\n" msgstr "" -#: readelf.c:5504 +#: readelf.c:5969 msgid "Only DWARF version 2 line info is currently supported.\n" msgstr "" -#: readelf.c:5519 +#: readelf.c:5984 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:5520 +#: readelf.c:5985 #, c-format msgid " DWARF Version: %d\n" msgstr "" -#: readelf.c:5521 +#: readelf.c:5986 #, c-format msgid " Prologue Length: %d\n" msgstr "" -#: readelf.c:5522 +#: readelf.c:5987 #, c-format msgid " Minimum Instruction Length: %d\n" msgstr "" -#: readelf.c:5523 +#: readelf.c:5988 #, c-format msgid " Initial value of 'is_stmt': %d\n" msgstr "" -#: readelf.c:5524 +#: readelf.c:5989 #, c-format msgid " Line Base: %d\n" msgstr "" -#: readelf.c:5525 +#: readelf.c:5990 #, c-format msgid " Line Range: %d\n" msgstr "" -#: readelf.c:5526 +#: readelf.c:5991 #, c-format msgid " Opcode Base: %d\n" msgstr "" -#: readelf.c:5535 +#: readelf.c:6000 msgid "" "\n" " Opcodes:\n" msgstr "" -#: readelf.c:5538 +#: readelf.c:6003 #, c-format msgid " Opcode %d has %d args\n" msgstr "" -#: readelf.c:5544 +#: readelf.c:6009 msgid "" "\n" " The Directory Table is empty.\n" msgstr "" -#: readelf.c:5547 +#: readelf.c:6012 msgid "" "\n" " The Directory Table:\n" msgstr "" -#: readelf.c:5551 +#: readelf.c:6016 #, c-format msgid " %s\n" msgstr "" -#: readelf.c:5562 +#: readelf.c:6027 msgid "" "\n" " The File Name Table is empty.\n" msgstr "" -#: readelf.c:5565 +#: readelf.c:6030 msgid "" "\n" " The File Name Table:\n" msgstr "" -#: readelf.c:5573 +#: readelf.c:6038 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:5584 +#: readelf.c:6049 #, c-format msgid "%s\n" msgstr "" #. Now display the statements. -#: readelf.c:5592 +#: readelf.c:6057 msgid "" "\n" " Line Number Statements:\n" msgstr "" -#: readelf.c:5611 +#: readelf.c:6073 +#, c-format +msgid " Special opcode %d: advance Address by %d to 0x%lx" +msgstr "" + +#: readelf.c:6077 +#, c-format +msgid " and Line by %d to %d\n" +msgstr "" + +#: readelf.c:6088 msgid " Copy\n" msgstr "" -#: readelf.c:5618 +#: readelf.c:6095 #, c-format msgid " Advance PC by %d to %lx\n" msgstr "" -#: readelf.c:5626 +#: readelf.c:6103 #, c-format msgid " Advance Line by %d to %d\n" msgstr "" -#: readelf.c:5633 +#: readelf.c:6110 #, c-format msgid " Set File Name to entry %d in the File Name Table\n" msgstr "" -#: readelf.c:5641 +#: readelf.c:6118 #, c-format msgid " Set column to %d\n" msgstr "" -#: readelf.c:5648 +#: readelf.c:6125 #, c-format msgid " Set is_stmt to %d\n" msgstr "" -#: readelf.c:5653 +#: readelf.c:6130 msgid " Set basic block\n" msgstr "" -#: readelf.c:5661 +#: readelf.c:6138 #, c-format msgid " Advance PC by constant %d to 0x%lx\n" msgstr "" -#: readelf.c:5669 +#: readelf.c:6146 #, c-format msgid " Advance PC by fixed size amount %d to 0x%lx\n" msgstr "" -#: readelf.c:5677 +#: readelf.c:6151 +msgid " Set prologue_end to true\n" +msgstr "" + +#: readelf.c:6155 +msgid " Set epilogue_begin to true\n" +msgstr "" + +#: readelf.c:6161 #, c-format -msgid " Special opcode %d: advance Address by %d to 0x%lx" +msgid " Set ISA to %d\n" msgstr "" -#: readelf.c:5681 +#: readelf.c:6165 #, c-format -msgid " and Line by %d to %d\n" +msgid " Unknown opcode %d with operands: " msgstr "" -#: readelf.c:5704 readelf.c:6133 +#: readelf.c:6197 readelf.c:6658 readelf.c:6730 #, c-format msgid "" "Contents of the %s section:\n" "\n" msgstr "" -#: readelf.c:5727 +#: readelf.c:6216 +msgid "64-bit DWARF pubnames are not supported yet.\n" +msgstr "" + +#: readelf.c:6226 msgid "Only DWARF 2 pubnames are currently supported\n" msgstr "" -#: readelf.c:5734 +#: readelf.c:6233 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:5736 +#: readelf.c:6235 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:5738 +#: readelf.c:6237 #, c-format msgid " Offset into .debug_info section: %ld\n" msgstr "" -#: readelf.c:5740 +#: readelf.c:6239 #, c-format msgid " Size of area in .debug_info section: %ld\n" msgstr "" -#: readelf.c:5743 +#: readelf.c:6242 msgid "" "\n" " Offset\tName\n" msgstr "" -#: readelf.c:5825 +#: readelf.c:6333 #, c-format msgid "Unknown TAG value: %lx" msgstr "" -#: readelf.c:5920 +#: readelf.c:6443 #, c-format msgid "Unknown AT value: %lx" msgstr "" -#: readelf.c:5957 +#: readelf.c:6480 #, c-format msgid "Unknown FORM value: %lx" msgstr "" -#: readelf.c:6139 +#: readelf.c:6679 +#, c-format +msgid " DW_MACINFO_start_file - lineno: %d filenum: %d\n" +msgstr "" + +#: readelf.c:6684 +msgid " DW_MACINFO_end_file\n" +msgstr "" + +#: readelf.c:6692 +#, c-format +msgid " DW_MACINFO_define - lineno : %d macro : %s\n" +msgstr "" + +#: readelf.c:6700 +#, c-format +msgid " DW_MACINFO_undef - lineno : %d macro : %s\n" +msgstr "" + +#: readelf.c:6711 +#, c-format +msgid " DW_MACINFO_vendor_ext - constant : %d string : %s\n" +msgstr "" + +#: readelf.c:6739 msgid " Number TAG\n" msgstr "" -#: readelf.c:6145 +#: readelf.c:6745 #, c-format msgid " %ld %s [%s]\n" msgstr "" -#: readelf.c:6148 +#: readelf.c:6748 msgid "has children" msgstr "" -#: readelf.c:6148 +#: readelf.c:6748 msgid "no children" msgstr "" -#: readelf.c:6152 +#: readelf.c:6752 #, c-format msgid " %-18s %s\n" msgstr "" -#: readelf.c:6171 +#: readelf.c:6773 #, c-format msgid " %lu byte block: " msgstr "" -#: readelf.c:6478 +#: readelf.c:7096 msgid "(User defined location op)" msgstr "" -#: readelf.c:6480 +#: readelf.c:7098 msgid "(Unknown location op)" msgstr "" -#: readelf.c:6607 +#: readelf.c:7137 +msgid "debug_str section data" +msgstr "" + +#: readelf.c:7156 +msgid "" +msgstr "" + +#: readelf.c:7159 +msgid "" +msgstr "" + +#: readelf.c:7179 +msgid "" +"\n" +"The .debug_str section is empty.\n" +msgstr "" + +#: readelf.c:7183 +msgid "" +"Contents of the .debug_str section:\n" +"\n" +msgstr "" + +#: readelf.c:7354 #, c-format -msgid "Unable to handle FORM: %d" +msgid " (indirect string, offset: 0x%lx): " msgstr "" -#: readelf.c:6611 +#: readelf.c:7363 #, c-format -msgid "Unrecognised form: %d" +msgid "Unrecognised form: %d\n" msgstr "" -#: readelf.c:6624 +#: readelf.c:7376 msgid "(not inlined)" msgstr "" -#: readelf.c:6625 +#: readelf.c:7377 msgid "(inlined)" msgstr "" -#: readelf.c:6626 +#: readelf.c:7378 msgid "(declared as inline but ignored)" msgstr "" -#: readelf.c:6627 +#: readelf.c:7379 msgid "(declared as inline and inlined)" msgstr "" -#: readelf.c:6628 +#: readelf.c:7380 #, c-format msgid " (Unknown inline attribute value: %lx)" msgstr "" -#: readelf.c:6757 readelf.c:6883 +#: readelf.c:7545 readelf.c:7746 #, c-format msgid "" "The section %s contains:\n" "\n" msgstr "" -#: readelf.c:6779 +#: readelf.c:7568 +msgid "64-bit DWARF debug info is not supported yet.\n" +msgstr "" + +#: readelf.c:7637 #, c-format msgid " Compilation Unit @ %lx:\n" msgstr "" -#: readelf.c:6780 +#: readelf.c:7638 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6781 +#: readelf.c:7639 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:6782 +#: readelf.c:7640 #, c-format msgid " Abbrev Offset: %ld\n" msgstr "" -#: readelf.c:6783 +#: readelf.c:7641 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:6787 +#: readelf.c:7645 msgid "Only version 2 DWARF debug information is currently supported.\n" msgstr "" -#: readelf.c:6809 +#: readelf.c:7666 msgid "Unable to locate .debug_abbrev section!\n" msgstr "" -#: readelf.c:6849 +#: readelf.c:7672 +msgid "debug_abbrev section data" +msgstr "" + +#: readelf.c:7709 #, c-format msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: readelf.c:6854 +#: readelf.c:7714 #, c-format -msgid " <%d><%x>: Abbrev Number: %lu (%s)\n" +msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" +msgstr "" + +#: readelf.c:7767 +msgid "64-bit DWARF aranges are not supported yet.\n" msgstr "" -#: readelf.c:6904 +#: readelf.c:7773 msgid "Only DWARF 2 aranges are currently supported.\n" msgstr "" -#: readelf.c:6908 +#: readelf.c:7777 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6909 +#: readelf.c:7778 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:6910 +#: readelf.c:7779 #, c-format msgid " Offset into .debug_info: %lx\n" msgstr "" -#: readelf.c:6911 +#: readelf.c:7780 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:6912 +#: readelf.c:7781 #, c-format msgid " Segment Size: %d\n" msgstr "" -#: readelf.c:6914 +#: readelf.c:7783 msgid "" "\n" " Address Length\n" msgstr "" -#: readelf.c:7092 +#: readelf.c:7965 #, c-format msgid "The section %s contains:\n" msgstr "" -#: readelf.c:7620 +#: readelf.c:7988 +msgid "64-bit DWARF format frames are not supported yet.\n" +msgstr "" + +#: readelf.c:8499 #, c-format msgid "Displaying the debug contents of section %s is not yet supported.\n" msgstr "" -#: readelf.c:7683 +#: readelf.c:8565 #, c-format msgid "" "\n" "Section '%s' has no debugging data.\n" msgstr "" -#: readelf.c:7702 +#: readelf.c:8570 readelf.c:8632 +msgid "debug section data" +msgstr "" + +#: readelf.c:8586 #, c-format msgid "Unrecognised debug section: %s\n" msgstr "" -#: readelf.c:7774 +#: readelf.c:8660 msgid "Some sections were not dumped because they do not exist!\n" msgstr "" -#: readelf.c:7957 +#: readelf.c:8733 +msgid "liblist" +msgstr "" + +#: readelf.c:8818 +msgid "options" +msgstr "" + +#: readelf.c:8849 #, c-format msgid "" "\n" "Section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:8119 +#: readelf.c:9010 msgid "conflict list with without table" msgstr "" -#: readelf.c:8147 +#: readelf.c:9028 readelf.c:9044 +msgid "conflict" +msgstr "" + +#: readelf.c:9054 #, c-format msgid "" "\n" -"Section '.conflict' contains %d entries:\n" +"Section '.conflict' contains %ld entries:\n" msgstr "" -#: readelf.c:8148 +#: readelf.c:9056 msgid " Num: Index Value Name" msgstr "" -#: readelf.c:8173 +#: readelf.c:9083 msgid "NT_PRSTATUS (prstatus structure)" msgstr "" -#: readelf.c:8174 +#: readelf.c:9084 msgid "NT_FPREGSET (floating point registers)" msgstr "" -#: readelf.c:8175 +#: readelf.c:9085 msgid "NT_PRPSINFO (prpsinfo structure)" msgstr "" -#: readelf.c:8176 +#: readelf.c:9086 msgid "NT_TASKSTRUCT (task structure)" msgstr "" -#: readelf.c:8177 +#: readelf.c:9087 msgid "NT_PRXFPREG (user_xfpregs structure)" msgstr "" -#: readelf.c:8178 +#: readelf.c:9088 msgid "NT_PSTATUS (pstatus structure)" msgstr "" -#: readelf.c:8179 +#: readelf.c:9089 msgid "NT_FPREGS (floating point registers)" msgstr "" -#: readelf.c:8180 +#: readelf.c:9090 msgid "NT_PSINFO (psinfo structure)" msgstr "" -#: readelf.c:8181 +#: readelf.c:9091 msgid "NT_LWPSTATUS (lwpstatus_t structure)" msgstr "" -#: readelf.c:8182 +#: readelf.c:9092 msgid "NT_LWPSINFO (lwpsinfo_t structure)" msgstr "" -#: readelf.c:8183 +#: readelf.c:9093 msgid "NT_WIN32PSTATUS (win32_pstatus strcuture)" msgstr "" -#: readelf.c:8185 +#: readelf.c:9095 readelf.c:9119 #, c-format msgid "Unknown note type: (0x%08x)" msgstr "" -#: readelf.c:8223 +#. NetBSD core "procinfo" structure. +#: readelf.c:9109 +msgid "NetBSD procinfo structure" +msgstr "" + +#: readelf.c:9136 readelf.c:9150 +msgid "PT_GETREGS (reg structure)" +msgstr "" + +#: readelf.c:9138 readelf.c:9152 +msgid "PT_GETFPREGS (fpreg structure)" +msgstr "" + +#: readelf.c:9158 +#, c-format +msgid "PT_FIRSTMACH+%d" +msgstr "" + +#: readelf.c:9212 +msgid "notes" +msgstr "" + +#: readelf.c:9218 #, c-format msgid "" "\n" "Notes at offset 0x%08lx with length 0x%08lx:\n" msgstr "" -#: readelf.c:8225 +#: readelf.c:9220 msgid " Owner\t\tData size\tDescription\n" msgstr "" -#: readelf.c:8336 +#: readelf.c:9331 msgid "No note segments present in the core file.\n" msgstr "" -#: readelf.c:8414 -msgid "This instance of readelf has been built without support for a\n" -msgstr "" - -#: readelf.c:8415 -msgid "64 bit data type and so it cannot read 64 bit ELF files.\n" +#: readelf.c:9409 +msgid "" +"This instance of readelf has been built without support for a\n" +"64 bit data type and so it cannot read 64 bit ELF files.\n" msgstr "" -#: readelf.c:8450 +#: readelf.c:9452 #, c-format msgid "Cannot stat input file %s.\n" msgstr "" -#: readelf.c:8457 +#: readelf.c:9459 #, c-format msgid "Input file %s not found.\n" msgstr "" -#: readelf.c:8463 +#: readelf.c:9465 #, c-format msgid "%s: Failed to read file header\n" msgstr "" -#: readelf.c:8477 +#: readelf.c:9479 #, c-format msgid "" "\n" @@ -3919,27 +4139,27 @@ msgstr "" msgid "default is --format=sysv\n" msgstr "" -#: size.c:141 +#: size.c:146 #, c-format msgid "invalid argument to --format: %s" msgstr "" -#: size.c:168 +#: size.c:173 #, c-format msgid "Invalid radix: %s\n" msgstr "" -#: srconv.c:1880 +#: srconv.c:1931 #, c-format msgid "Usage: %s [-dhVq] in-file [out-file]\n" msgstr "" -#: srconv.c:1887 +#: srconv.c:1938 #, c-format msgid "%s: Convert a COFF object file into a SYSROFF object file\n" msgstr "" -#: srconv.c:2020 +#: srconv.c:2074 #, c-format msgid "unable to open output file %s" msgstr "" @@ -4039,39 +4259,40 @@ msgstr "" msgid "no argument types in mangled string\n" msgstr "" -#: strings.c:177 +#: strings.c:199 #, c-format msgid "invalid number %s" msgstr "" -#: strings.c:513 +#: strings.c:638 #, c-format msgid "invalid integer argument %s" msgstr "" -#: strings.c:523 +#: strings.c:648 #, c-format msgid "" -"Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n" -" [--all] [--print-file-name] [--bytes=min-len] [--radix={o,x,d}]\n" -" [--target=bfdname] [--help] [--version] file...\n" +"Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-e {s,b,l,B,L}]\n" +" [-] [--all] [--print-file-name] [--bytes=min-len] [--radix={o,x,d}]\n" +" [--target=bfdname] [--encoding {s,b,l,B,L}] [--help] [--version] " +"file...\n" msgstr "" -#: sysdump.c:712 +#: sysdump.c:733 #, c-format msgid "Usage: %s [-hV] in-file\n" msgstr "" -#: sysdump.c:781 +#: sysdump.c:805 #, c-format msgid "cannot open input file %s" msgstr "" -#: version.c:39 -msgid "Copyright 1997, 98, 99, 2000, 2001 Free Software Foundation, Inc.\n" +#: version.c:35 +msgid "Copyright 2001 Free Software Foundation, Inc.\n" msgstr "" -#: version.c:40 +#: version.c:36 msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" @@ -4158,7 +4379,7 @@ msgid "" "No input-file is stdin, default rc. No output-file is stdout, default rc.\n" msgstr "" -#: windres.c:980 +#: windres.c:983 msgid "no resources" msgstr "" diff --git a/contrib/binutils/binutils/rclex.l b/contrib/binutils/binutils/rclex.l index d05d1c0..c9073e2 100644 --- a/contrib/binutils/binutils/rclex.l +++ b/contrib/binutils/binutils/rclex.l @@ -1,5 +1,5 @@ %{ /* rclex.l -- lexer for Windows rc files parser */ -/* Copyright 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright 1997, 1998, 1999, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -26,10 +26,10 @@ #include "bfd.h" #include "bucomm.h" #include "libiberty.h" +#include "safe-ctype.h" #include "windres.h" #include "rcparse.h" -#include #include /* Whether we are in rcdata mode, in which we returns the lengths of @@ -252,18 +252,18 @@ cpp_line (s) char *send, *fn; ++s; - while (isspace ((unsigned char) *s)) + while (ISSPACE (*s)) ++s; line = strtol (s, &send, 0); - if (*send != '\0' && ! isspace ((unsigned char) *send)) + if (*send != '\0' && ! ISSPACE (*send)) return; /* Subtract 1 because we are about to count the newline. */ rc_lineno = line - 1; s = send; - while (isspace ((unsigned char) *s)) + while (ISSPACE (*s)) ++s; if (*s != '"') @@ -423,8 +423,8 @@ handle_quotes (input, len) else { ++t; - assert (isspace ((unsigned char) *t)); - while (isspace ((unsigned char) *t)) + assert (ISSPACE (*t)); + while (ISSPACE (*t)) ++t; if (*t == '\0') break; diff --git a/contrib/binutils/binutils/rcparse.y b/contrib/binutils/binutils/rcparse.y index 89004e7..152c8ee 100644 --- a/contrib/binutils/binutils/rcparse.y +++ b/contrib/binutils/binutils/rcparse.y @@ -1,5 +1,5 @@ %{ /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -26,8 +26,7 @@ #include "bucomm.h" #include "libiberty.h" #include "windres.h" - -#include +#include "safe-ctype.h" /* The current language. */ @@ -245,7 +244,7 @@ acc_event: $$.flags = ACC_CONTROL | ACC_VIRTKEY; ++s; ch = *s; - ch = toupper ((unsigned char) ch); + ch = TOUPPER (ch); } $$.key = ch; if (s[1] != '\0') @@ -455,7 +454,7 @@ styles: } | styles LANGUAGE numexpr cnumexpr { - sub_res_info.language = $3 | ($4 << 8); + sub_res_info.language = $3 | ($4 << SUBLANG_SHIFT); } | styles VERSIONK numexpr { @@ -874,7 +873,7 @@ icon: language: LANGUAGE numexpr cnumexpr { - language = $2 | ($3 << 8); + language = $2 | ($3 << SUBLANG_SHIFT); } ; @@ -1259,8 +1258,7 @@ id: /* It seems that resource ID's are forced to upper case. */ copy = xstrdup ($1); for (s = copy; *s != '\0'; s++) - if (islower ((unsigned char) *s)) - *s = toupper ((unsigned char) *s); + *s = TOUPPER (*s); res_string_to_id (&$$, copy); free (copy); } @@ -1297,8 +1295,7 @@ resref: /* It seems that resource ID's are forced to upper case. */ copy = xstrdup ($1); for (s = copy; *s != '\0'; s++) - if (islower ((unsigned char) *s)) - *s = toupper ((unsigned char) *s); + *s = TOUPPER (*s); res_string_to_id (&$$, copy); free (copy); } @@ -1329,7 +1326,7 @@ suboptions: | suboptions LANGUAGE numexpr cnumexpr { $$ = $1; - $$.language = $3 | ($4 << 8); + $$.language = $3 | ($4 << SUBLANG_SHIFT); } | suboptions VERSIONK numexpr { diff --git a/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c index 7befc88..2480c76 100644 --- a/contrib/binutils/binutils/readelf.c +++ b/contrib/binutils/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Originally developed by Eric Youngdale Modifications by Nick Clifton @@ -64,9 +64,11 @@ #include "elf/mn10200.h" #include "elf/mn10300.h" #include "elf/hppa.h" +#include "elf/h8.h" #include "elf/arc.h" #include "elf/fr30.h" #include "elf/mcore.h" +#include "elf/mmix.h" #include "elf/i960.h" #include "elf/pj.h" #include "elf/avr.h" @@ -74,30 +76,33 @@ #include "elf/cris.h" #include "elf/i860.h" #include "elf/x86-64.h" +#include "elf/s390.h" +#include "elf/xstormy16.h" #include "bucomm.h" #include "getopt.h" -char * program_name = "readelf"; -unsigned int dynamic_addr; +char * program_name = "readelf"; +unsigned int dynamic_addr; bfd_size_type dynamic_size; -unsigned int rela_addr; -unsigned int rela_size; -char * dynamic_strings; +unsigned int rela_addr; +unsigned int rela_size; +char * dynamic_strings; char * string_table; unsigned long string_table_length; unsigned long num_dynamic_syms; Elf_Internal_Sym * dynamic_symbols; Elf_Internal_Syminfo * dynamic_syminfo; -unsigned long dynamic_syminfo_offset; +unsigned long dynamic_syminfo_offset; unsigned int dynamic_syminfo_nent; -char program_interpreter [64]; -int dynamic_info[DT_JMPREL + 1]; -int version_info[16]; -int loadaddr = 0; +char program_interpreter [64]; +int dynamic_info[DT_JMPREL + 1]; +int version_info[16]; +int loadaddr = 0; Elf_Internal_Ehdr elf_header; Elf_Internal_Shdr * section_headers; Elf_Internal_Dyn * dynamic_segment; +Elf_Internal_Shdr * symtab_shndx_hdr; int show_name; int do_dynamic; int do_syms; @@ -109,6 +114,7 @@ int do_using_dynamic; int do_header; int do_dump; int do_version; +int do_wide; int do_histogram; int do_debugging; int do_debug_info; @@ -118,6 +124,8 @@ int do_debug_pubnames; int do_debug_aranges; int do_debug_frames; int do_debug_frames_interp; +int do_debug_macinfo; +int do_debug_str; int do_arch; int do_notes; int is_32bit_elf; @@ -145,11 +153,13 @@ print_mode; /* Forward declarations for dumb compilers. */ static void print_vma PARAMS ((bfd_vma, print_mode)); +static void print_symbol PARAMS ((int, char *)); static bfd_vma (* byte_get) PARAMS ((unsigned char *, int)); static bfd_vma byte_get_little_endian PARAMS ((unsigned char *, int)); static bfd_vma byte_get_big_endian PARAMS ((unsigned char *, int)); static const char * get_mips_dynamic_type PARAMS ((unsigned long)); static const char * get_sparc64_dynamic_type PARAMS ((unsigned long)); +static const char * get_ppc64_dynamic_type PARAMS ((unsigned long)); static const char * get_parisc_dynamic_type PARAMS ((unsigned long)); static const char * get_dynamic_type PARAMS ((unsigned long)); static int slurp_rela_relocs PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Rela **, unsigned long *)); @@ -182,18 +192,21 @@ static void dynamic_segment_mips_val PARAMS ((Elf_Internal_Dyn static void dynamic_segment_parisc_val PARAMS ((Elf_Internal_Dyn *)); static int process_dynamic_segment PARAMS ((FILE *)); static int process_symbol_table PARAMS ((FILE *)); +static int process_syminfo PARAMS ((FILE *)); static int process_section_contents PARAMS ((FILE *)); -static void process_file PARAMS ((char *)); +static void process_mips_fpe_exception PARAMS ((int)); +static int process_mips_specific PARAMS ((FILE *)); +static int process_file PARAMS ((char *)); static int process_relocs PARAMS ((FILE *)); static int process_version_sections PARAMS ((FILE *)); static char * get_ver_flags PARAMS ((unsigned int)); -static int get_32bit_section_headers PARAMS ((FILE *)); -static int get_64bit_section_headers PARAMS ((FILE *)); +static int get_32bit_section_headers PARAMS ((FILE *, unsigned int)); +static int get_64bit_section_headers PARAMS ((FILE *, unsigned int)); static int get_32bit_program_headers PARAMS ((FILE *, Elf_Internal_Phdr *)); static int get_64bit_program_headers PARAMS ((FILE *, Elf_Internal_Phdr *)); static int get_file_header PARAMS ((FILE *)); -static Elf_Internal_Sym * get_32bit_elf_symbols PARAMS ((FILE *, unsigned long, unsigned long)); -static Elf_Internal_Sym * get_64bit_elf_symbols PARAMS ((FILE *, unsigned long, unsigned long)); +static Elf_Internal_Sym * get_32bit_elf_symbols PARAMS ((FILE *, Elf_Internal_Shdr *)); +static Elf_Internal_Sym * get_64bit_elf_symbols PARAMS ((FILE *, Elf_Internal_Shdr *)); static const char * get_elf_section_flags PARAMS ((bfd_vma)); static int * get_dynamic_data PARAMS ((FILE *, unsigned int)); static int get_32bit_dynamic_segment PARAMS ((FILE *)); @@ -205,11 +218,18 @@ static int dump_section PARAMS ((Elf32_Internal_Shdr *, static int display_debug_section PARAMS ((Elf32_Internal_Shdr *, FILE *)); static int display_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_not_supported PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int prescan_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_lines PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int display_debug_pubnames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_abbrev PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_aranges PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_frames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int display_debug_macinfo PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int display_debug_str PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static unsigned char * process_abbrev_section PARAMS ((unsigned char *, unsigned char *)); +static void load_debug_str PARAMS ((FILE *)); +static void free_debug_str PARAMS ((void)); +static const char * fetch_indirect_string PARAMS ((unsigned long)); static unsigned long read_leb128 PARAMS ((unsigned char *, int *, int)); static int process_extended_line_op PARAMS ((unsigned char *, int, int)); static void reset_state_machine PARAMS ((int)); @@ -220,18 +240,21 @@ static void free_abbrevs PARAMS ((void)); static void add_abbrev PARAMS ((unsigned long, unsigned long, int)); static void add_abbrev_attr PARAMS ((unsigned long, unsigned long)); static unsigned char * read_and_display_attr PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long, unsigned long)); +static unsigned char * read_and_display_attr_value PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long, unsigned long)); static unsigned char * display_block PARAMS ((unsigned char *, unsigned long)); static void decode_location_expression PARAMS ((unsigned char *, unsigned int, unsigned long)); -static void request_dump PARAMS ((unsigned int, char)); -static const char * get_elf_class PARAMS ((unsigned char)); -static const char * get_data_encoding PARAMS ((unsigned char)); -static const char * get_osabi_name PARAMS ((unsigned char)); +static void request_dump PARAMS ((unsigned int, int)); +static const char * get_elf_class PARAMS ((unsigned int)); +static const char * get_data_encoding PARAMS ((unsigned int)); +static const char * get_osabi_name PARAMS ((unsigned int)); static int guess_is_rela PARAMS ((unsigned long)); -static char * get_note_type PARAMS ((unsigned int)); +static const char * get_note_type PARAMS ((unsigned int)); +static const char * get_netbsd_elfcore_note_type PARAMS ((unsigned int)); static int process_note PARAMS ((Elf32_Internal_Note *)); static int process_corefile_note_segment PARAMS ((FILE *, bfd_vma, bfd_vma)); static int process_corefile_note_segments PARAMS ((FILE *)); static int process_corefile_contents PARAMS ((FILE *)); +static int process_arch_specific PARAMS ((FILE *)); typedef int Elf32_Word; @@ -245,6 +268,22 @@ typedef int Elf32_Word; ((X)->sh_name >= string_table_length \ ? "" : string_table + (X)->sh_name)) +/* Given st_shndx I, map to section_headers index. */ +#define SECTION_HEADER_INDEX(I) \ + ((I) < SHN_LORESERVE \ + ? (I) \ + : ((I) <= SHN_HIRESERVE \ + ? 0 \ + : (I) - (SHN_HIRESERVE + 1 - SHN_LORESERVE))) + +/* Reverse of the above. */ +#define SECTION_HEADER_NUM(N) \ + ((N) < SHN_LORESERVE \ + ? (N) \ + : (N) + (SHN_HIRESERVE + 1 - SHN_LORESERVE)) + +#define SECTION_HEADER(I) (section_headers + SECTION_HEADER_INDEX (I)) + #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ #define BYTE_GET(field) byte_get (field, sizeof (field)) @@ -263,104 +302,79 @@ typedef int Elf32_Word; #define BYTE_GET8(field) byte_get (field, 8) #endif -#define NUM_ELEM(array) (sizeof (array) / sizeof ((array)[0])) - -#define GET_DATA_ALLOC(offset, size, var, type, reason) \ - if (fseek (file, offset, SEEK_SET)) \ - { \ - error (_("Unable to seek to start of %s at %x\n"), reason, offset); \ - return 0; \ - } \ - \ - var = (type) malloc (size); \ - \ - if (var == NULL) \ - { \ - error (_("Out of memory allocating %d bytes for %s\n"), size, reason); \ - return 0; \ - } \ - \ - if (fread (var, size, 1, file) != 1) \ - { \ - error (_("Unable to read in %d bytes of %s\n"), size, reason); \ - free (var); \ - var = NULL; \ - return 0; \ - } - - -#define GET_DATA(offset, var, reason) \ - if (fseek (file, offset, SEEK_SET)) \ - { \ - error (_("Unable to seek to %x for %s\n"), offset, reason); \ - return 0; \ - } \ - else if (fread (& var, sizeof (var), 1, file) != 1) \ - { \ - error (_("Unable to read data at %x for %s\n"), offset, reason); \ - return 0; \ - } - -#define GET_ELF_SYMBOLS(file, offset, size) \ - (is_32bit_elf ? get_32bit_elf_symbols (file, offset, size) \ - : get_64bit_elf_symbols (file, offset, size)) - - -#ifdef ANSI_PROTOTYPES +#define NUM_ELEM(array) (sizeof (array) / sizeof ((array)[0])) + +#define GET_ELF_SYMBOLS(file, section) \ + (is_32bit_elf ? get_32bit_elf_symbols (file, section) \ + : get_64bit_elf_symbols (file, section)) + + static void -error (const char * message, ...) +error VPARAMS ((const char *message, ...)) { - va_list args; + VA_OPEN (args, message); + VA_FIXEDARG (args, const char *, message); fprintf (stderr, _("%s: Error: "), program_name); - va_start (args, message); vfprintf (stderr, message, args); - va_end (args); - return; + VA_CLOSE (args); } static void -warn (const char * message, ...) +warn VPARAMS ((const char *message, ...)) { - va_list args; + VA_OPEN (args, message); + VA_FIXEDARG (args, const char *, message); fprintf (stderr, _("%s: Warning: "), program_name); - va_start (args, message); vfprintf (stderr, message, args); - va_end (args); - return; + VA_CLOSE (args); } -#else -static void -error (va_alist) - va_dcl -{ - char * message; - va_list args; - fprintf (stderr, _("%s: Error: "), program_name); - va_start (args); - message = va_arg (args, char *); - vfprintf (stderr, message, args); - va_end (args); - return; -} +static PTR get_data PARAMS ((PTR, FILE *, long, size_t, const char *)); -static void -warn (va_alist) - va_dcl +static PTR +get_data (var, file, offset, size, reason) + PTR var; + FILE *file; + long offset; + size_t size; + const char *reason; { - char * message; - va_list args; + PTR mvar; - fprintf (stderr, _("%s: Warning: "), program_name); - va_start (args); - message = va_arg (args, char *); - vfprintf (stderr, message, args); - va_end (args); - return; + if (size == 0) + return NULL; + + if (fseek (file, offset, SEEK_SET)) + { + error (_("Unable to seek to %x for %s\n"), offset, reason); + return NULL; + } + + mvar = var; + if (mvar == NULL) + { + mvar = (PTR) malloc (size); + + if (mvar == NULL) + { + error (_("Out of memory allocating %d bytes for %s\n"), + size, reason); + return NULL; + } + } + + if (fread (mvar, size, 1, file) != 1) + { + error (_("Unable to read in %d bytes of %s\n"), size, reason); + if (mvar != var) + free (mvar); + return NULL; + } + + return mvar; } -#endif static bfd_vma byte_get_little_endian (field, size) @@ -454,7 +468,7 @@ print_vma (vma, mode) printf ("%lx", vma); #else if (_bfd_int64_high (vma)) - printf ("%lx%lx", _bfd_int64_high (vma), _bfd_int64_low (vma)); + printf ("%lx%8.8lx", _bfd_int64_high (vma), _bfd_int64_low (vma)); else printf ("%lx", _bfd_int64_low (vma)); #endif @@ -500,6 +514,25 @@ print_vma (vma, mode) #endif } +/* Display a symbol on stdout. If do_wide is not true then + format the symbol to be at most WIDTH characters, + truhncating as necessary. If WIDTH is negative then + format the string to be exactly - WIDTH characters, + truncating or padding as necessary. */ + +static void +print_symbol (width, symbol) + int width; + char * symbol; +{ + if (do_wide) + printf (symbol); + else if (width < 0) + printf ("%-*.*s", width, width, symbol); + else + printf ("%-.*s", width, symbol); +} + static bfd_vma byte_get_big_endian (field, size) unsigned char * field; @@ -563,7 +596,9 @@ guess_is_rela (e_machine) case EM_386: case EM_486: case EM_960: + case EM_M32R: case EM_CYGNUS_M32R: + case EM_D10V: case EM_CYGNUS_D10V: case EM_MIPS: case EM_MIPS_RS3_LE: @@ -571,23 +606,37 @@ guess_is_rela (e_machine) /* Targets that use RELA relocations. */ case EM_68K: + case EM_H8_300: + case EM_H8_300H: + case EM_H8S: case EM_SPARC32PLUS: case EM_SPARCV9: case EM_SPARC: case EM_PPC: + case EM_PPC64: + case EM_V850: case EM_CYGNUS_V850: + case EM_D30V: case EM_CYGNUS_D30V: + case EM_MN10200: case EM_CYGNUS_MN10200: + case EM_MN10300: case EM_CYGNUS_MN10300: + case EM_FR30: case EM_CYGNUS_FR30: case EM_SH: case EM_ALPHA: case EM_MCORE: case EM_IA_64: case EM_AVR: + case EM_AVR_OLD: case EM_CRIS: case EM_860: case EM_X86_64: + case EM_S390: + case EM_S390_OLD: + case EM_MMIX: + case EM_XSTORMY16: return TRUE; case EM_MMA: @@ -630,8 +679,10 @@ slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) { Elf32_External_Rela * erelas; - GET_DATA_ALLOC (rel_offset, rel_size, erelas, - Elf32_External_Rela *, "relocs"); + erelas = (Elf32_External_Rela *) get_data (NULL, file, rel_offset, + rel_size, _("relocs")); + if (!erelas) + return 0; nrelas = rel_size / sizeof (Elf32_External_Rela); @@ -657,8 +708,10 @@ slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) { Elf64_External_Rela * erelas; - GET_DATA_ALLOC (rel_offset, rel_size, erelas, - Elf64_External_Rela *, "relocs"); + erelas = (Elf64_External_Rela *) get_data (NULL, file, rel_offset, + rel_size, _("relocs")); + if (!erelas) + return 0; nrelas = rel_size / sizeof (Elf64_External_Rela); @@ -701,8 +754,10 @@ slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) { Elf32_External_Rel * erels; - GET_DATA_ALLOC (rel_offset, rel_size, erels, - Elf32_External_Rel *, "relocs"); + erels = (Elf32_External_Rel *) get_data (NULL, file, rel_offset, + rel_size, _("relocs")); + if (!erels) + return 0; nrels = rel_size / sizeof (Elf32_External_Rel); @@ -726,8 +781,10 @@ slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) { Elf64_External_Rel * erels; - GET_DATA_ALLOC (rel_offset, rel_size, erels, - Elf64_External_Rel *, "relocs"); + erels = (Elf64_External_Rel *) get_data (NULL, file, rel_offset, + rel_size, _("relocs")); + if (!erels) + return 0; nrels = rel_size / sizeof (Elf64_External_Rel); @@ -782,12 +839,24 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) return 0; } - if (is_rela) - printf - (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + if (is_32bit_elf) + { + if (is_rela) + printf + (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + else + printf + (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + } else - printf - (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + { + if (is_rela) + printf + (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + else + printf + (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + } for (i = 0; i < rel_size; i++) { @@ -827,11 +896,26 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) #endif } + if (is_32bit_elf) + { #ifdef _bfd_int64_low - printf (" %8.8lx %5.5lx ", _bfd_int64_low (offset), _bfd_int64_low (info)); + printf ("%8.8lx %8.8lx ", _bfd_int64_low (offset), _bfd_int64_low (info)); #else - printf (" %8.8lx %5.5lx ", offset, info); + printf ("%8.8lx %8.8lx ", offset, info); #endif + } + else + { +#ifdef _bfd_int64_low + printf ("%8.8lx%8.8lx %8.8lx%8.8lx ", + _bfd_int64_high (offset), + _bfd_int64_low (offset), + _bfd_int64_high (info), + _bfd_int64_low (info)); +#else + printf ("%16.16lx %16.16lx ", offset, info); +#endif + } switch (elf_header.e_machine) { @@ -839,6 +923,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = NULL; break; + case EM_M32R: case EM_CYGNUS_M32R: rtype = elf_m32r_reloc_type (type); break; @@ -857,6 +942,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) break; case EM_AVR: + case EM_AVR_OLD: rtype = elf_avr_reloc_type (type); break; @@ -867,14 +953,17 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_sparc_reloc_type (type); break; + case EM_V850: case EM_CYGNUS_V850: rtype = v850_reloc_type (type); break; + case EM_D10V: case EM_CYGNUS_D10V: rtype = elf_d10v_reloc_type (type); break; + case EM_D30V: case EM_CYGNUS_D30V: rtype = elf_d30v_reloc_type (type); break; @@ -883,14 +972,17 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_sh_reloc_type (type); break; + case EM_MN10300: case EM_CYGNUS_MN10300: rtype = elf_mn10300_reloc_type (type); break; + case EM_MN10200: case EM_CYGNUS_MN10200: rtype = elf_mn10200_reloc_type (type); break; + case EM_FR30: case EM_CYGNUS_FR30: rtype = elf_fr30_reloc_type (type); break; @@ -899,7 +991,12 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_mcore_reloc_type (type); break; + case EM_MMIX: + rtype = elf_mmix_reloc_type (type); + break; + case EM_PPC: + case EM_PPC64: rtype = elf_ppc_reloc_type (type); break; @@ -916,7 +1013,6 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_arm_reloc_type (type); break; - case EM_CYGNUS_ARC: case EM_ARC: rtype = elf_arc_reloc_type (type); break; @@ -925,7 +1021,14 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_hppa_reloc_type (type); break; + case EM_H8_300: + case EM_H8_300H: + case EM_H8S: + rtype = elf_h8_reloc_type (type); + break; + case EM_PJ: + case EM_PJ_OLD: rtype = elf_pj_reloc_type (type); break; case EM_IA_64: @@ -943,6 +1046,15 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) case EM_X86_64: rtype = elf_x86_64_reloc_type (type); break; + + case EM_S390_OLD: + case EM_S390: + rtype = elf_s390_reloc_type (type); + break; + + case EM_XSTORMY16: + rtype = elf_xstormy16_reloc_type (type); + break; } if (rtype == NULL) @@ -956,31 +1068,27 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) if (symtab_index) { - if (symtab != NULL) + if (symtab == NULL || symtab_index >= nsyms) + printf (" bad symbol index: %08lx", (unsigned long) symtab_index); + else { - if (symtab_index >= nsyms) - printf (" bad symbol index: %08lx", (unsigned long) symtab_index); - else - { - Elf_Internal_Sym * psym; + Elf_Internal_Sym * psym; - psym = symtab + symtab_index; + psym = symtab + symtab_index; - printf (" "); - print_vma (psym->st_value, LONG_HEX); - printf (" "); + printf (" "); + print_vma (psym->st_value, LONG_HEX); + printf (" "); - if (psym->st_name == 0) - printf ("%-25.25s", - SECTION_NAME (section_headers + psym->st_shndx)); - else if (strtab == NULL) - printf (_(""), psym->st_name); - else - printf ("%-25.25s", strtab + psym->st_name); + if (psym->st_name == 0) + print_symbol (-25, SECTION_NAME (section_headers + psym->st_shndx)); + else if (strtab == NULL) + printf (_(""), psym->st_name); + else + print_symbol (-25, strtab + psym->st_name); - if (is_rela) - printf (" + %lx", (unsigned long) relas [i].r_addend); - } + if (is_rela) + printf (" + %lx", (unsigned long) relas [i].r_addend); } } else if (is_rela) @@ -1071,6 +1179,18 @@ get_sparc64_dynamic_type (type) } static const char * +get_ppc64_dynamic_type (type) + unsigned long type; +{ + switch (type) + { + case DT_PPC64_GLINK: return "PPC64_GLINK"; + default: + return NULL; + } +} + +static const char * get_parisc_dynamic_type (type) unsigned long type; { @@ -1182,6 +1302,9 @@ get_dynamic_type (type) case EM_SPARCV9: result = get_sparc64_dynamic_type (type); break; + case EM_PPC64: + result = get_ppc64_dynamic_type (type); + break; default: result = NULL; break; @@ -1251,32 +1374,33 @@ get_machine_name (e_machine) switch (e_machine) { - case EM_NONE: return _("None"); - case EM_M32: return "WE32100"; - case EM_SPARC: return "Sparc"; - case EM_386: return "Intel 80386"; - case EM_68K: return "MC68000"; - case EM_88K: return "MC88000"; - case EM_486: return "Intel 80486"; - case EM_860: return "Intel 80860"; - case EM_MIPS: return "MIPS R3000"; - case EM_S370: return "IBM System/370"; + case EM_NONE: return _("None"); + case EM_M32: return "WE32100"; + case EM_SPARC: return "Sparc"; + case EM_386: return "Intel 80386"; + case EM_68K: return "MC68000"; + case EM_88K: return "MC88000"; + case EM_486: return "Intel 80486"; + case EM_860: return "Intel 80860"; + case EM_MIPS: return "MIPS R3000"; + case EM_S370: return "IBM System/370"; case EM_MIPS_RS3_LE: return "MIPS R4000 big-endian"; case EM_OLD_SPARCV9: return "Sparc v9 (old)"; - case EM_PARISC: return "HPPA"; + case EM_PARISC: return "HPPA"; case EM_PPC_OLD: return "Power PC (old)"; case EM_SPARC32PLUS: return "Sparc v8+" ; - case EM_960: return "Intel 90860"; - case EM_PPC: return "PowerPC"; - case EM_V800: return "NEC V800"; - case EM_FR20: return "Fujitsu FR20"; - case EM_RH32: return "TRW RH32"; + case EM_960: return "Intel 90860"; + case EM_PPC: return "PowerPC"; + case EM_PPC64: return "PowerPC64"; + case EM_V800: return "NEC V800"; + case EM_FR20: return "Fujitsu FR20"; + case EM_RH32: return "TRW RH32"; case EM_MCORE: return "MCORE"; case EM_ARM: return "ARM"; case EM_OLD_ALPHA: return "Digital Alpha (old)"; case EM_SH: return "Hitachi SH"; - case EM_SPARCV9: return "Sparc v9"; - case EM_TRICORE: return "Siemens Tricore"; + case EM_SPARCV9: return "Sparc v9"; + case EM_TRICORE: return "Siemens Tricore"; case EM_ARC: return "ARC"; case EM_H8_300: return "Hitachi H8/300"; case EM_H8_300H: return "Hitachi H8/300H"; @@ -1286,15 +1410,22 @@ get_machine_name (e_machine) case EM_MIPS_X: return "Stanford MIPS-X"; case EM_COLDFIRE: return "Motorola Coldfire"; case EM_68HC12: return "Motorola M68HC12"; - case EM_ALPHA: return "Alpha"; - case EM_CYGNUS_D10V: return "d10v"; - case EM_CYGNUS_D30V: return "d30v"; - case EM_CYGNUS_ARC: return "ARC"; - case EM_CYGNUS_M32R: return "Mitsubishi M32r"; - case EM_CYGNUS_V850: return "NEC v850"; - case EM_CYGNUS_MN10300: return "mn10300"; - case EM_CYGNUS_MN10200: return "mn10200"; - case EM_CYGNUS_FR30: return "Fujitsu FR30"; + case EM_ALPHA: return "Alpha"; + case EM_CYGNUS_D10V: + case EM_D10V: return "d10v"; + case EM_CYGNUS_D30V: + case EM_D30V: return "d30v"; + case EM_CYGNUS_M32R: + case EM_M32R: return "Mitsubishi M32r"; + case EM_CYGNUS_V850: + case EM_V850: return "NEC v850"; + case EM_CYGNUS_MN10300: + case EM_MN10300: return "mn10300"; + case EM_CYGNUS_MN10200: + case EM_MN10200: return "mn10200"; + case EM_CYGNUS_FR30: + case EM_FR30: return "Fujitsu FR30"; + case EM_PJ_OLD: case EM_PJ: return "picoJava"; case EM_MMA: return "Fujitsu Multimedia Accelerator"; case EM_PCP: return "Siemens PCP"; @@ -1314,15 +1445,19 @@ get_machine_name (e_machine) case EM_SVX: return "Silicon Graphics SVx"; case EM_ST19: return "STMicroelectronics ST19 8-bit microcontroller"; case EM_VAX: return "Digital VAX"; + case EM_AVR_OLD: case EM_AVR: return "Atmel AVR 8-bit microcontroller"; case EM_CRIS: return "Axis Communications 32-bit embedded processor"; - case EM_JAVELIN: return "Infineon Technologies 32-bit embedded cpu"; - case EM_FIREPATH: return "Element 14 64-bit DSP processor"; - case EM_ZSP: return "LSI Logic's 16-bit DSP processor"; + case EM_JAVELIN: return "Infineon Technologies 32-bit embedded cpu"; + case EM_FIREPATH: return "Element 14 64-bit DSP processor"; + case EM_ZSP: return "LSI Logic's 16-bit DSP processor"; case EM_MMIX: return "Donald Knuth's educational 64-bit processor"; - case EM_HUANY: return "Harvard Universitys's machine-independent object format"; - case EM_PRISM: return "SiTera Prism"; + case EM_HUANY: return "Harvard Universitys's machine-independent object format"; + case EM_PRISM: return "SiTera Prism"; case EM_X86_64: return "Advanced Micro Devices X86-64"; + case EM_S390_OLD: + case EM_S390: return "IBM S/390"; + case EM_XSTORMY16: return "Sanyo Xstormy16 CPU core"; default: sprintf (buff, _(": %x"), e_machine); return buff; @@ -1357,12 +1492,36 @@ decode_ARM_machine_flags (e_flags, buf) switch (eabi) { default: - strcat (buf, ", "); + strcat (buf, ", "); if (e_flags) unknown = 1; break; case EF_ARM_EABI_VER1: + strcat (buf, ", Version1 EABI"); + while (e_flags) + { + unsigned flag; + + /* Process flags one bit at a time. */ + flag = e_flags & - e_flags; + e_flags &= ~ flag; + + switch (flag) + { + case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */ + strcat (buf, ", sorted symbol tables"); + break; + + default: + unknown = 1; + break; + } + } + break; + + case EF_ARM_EABI_VER2: + strcat (buf, ", Version2 EABI"); while (e_flags) { unsigned flag; @@ -1373,10 +1532,18 @@ decode_ARM_machine_flags (e_flags, buf) switch (flag) { - case EF_ARM_SYMSARESORTED: /* Conflicts with EF_INTERWORK. */ + case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */ strcat (buf, ", sorted symbol tables"); break; + case EF_ARM_DYNSYMSUSESEGIDX: + strcat (buf, ", dynamic symbols use segment index"); + break; + + case EF_ARM_MAPSYMSFIRST: + strcat (buf, ", mapping symbols precede others"); + break; + default: unknown = 1; break; @@ -1385,6 +1552,7 @@ decode_ARM_machine_flags (e_flags, buf) break; case EF_ARM_EABI_UNKNOWN: + strcat (buf, ", GNU EABI"); while (e_flags) { unsigned flag; @@ -1395,35 +1563,35 @@ decode_ARM_machine_flags (e_flags, buf) switch (flag) { - case EF_INTERWORK: + case EF_ARM_INTERWORK: strcat (buf, ", interworking enabled"); break; - case EF_APCS_26: + case EF_ARM_APCS_26: strcat (buf, ", uses APCS/26"); break; - case EF_APCS_FLOAT: + case EF_ARM_APCS_FLOAT: strcat (buf, ", uses APCS/float"); break; - case EF_PIC: + case EF_ARM_PIC: strcat (buf, ", position independent"); break; - case EF_ALIGN8: + case EF_ARM_ALIGN8: strcat (buf, ", 8 bit structure alignment"); break; - case EF_NEW_ABI: + case EF_ARM_NEW_ABI: strcat (buf, ", uses new ABI"); break; - case EF_OLD_ABI: + case EF_ARM_OLD_ABI: strcat (buf, ", uses old ABI"); break; - case EF_SOFT_FLOAT: + case EF_ARM_SOFT_FLOAT: strcat (buf, ", software FP"); break; @@ -1474,6 +1642,7 @@ get_machine_flags (e_flags, e_machine) strcat (buf, ", relocatable-lib"); break; + case EM_V850: case EM_CYGNUS_V850: switch (e_flags & EF_V850_ARCH) { @@ -1492,6 +1661,7 @@ get_machine_flags (e_flags, e_machine) } break; + case EM_M32R: case EM_CYGNUS_M32R: if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH) strcat (buf, ", m32r"); @@ -1509,29 +1679,17 @@ get_machine_flags (e_flags, e_machine) if (e_flags & EF_MIPS_CPIC) strcat (buf, ", cpic"); + if (e_flags & EF_MIPS_UCODE) + strcat (buf, ", ugen_reserved"); + if (e_flags & EF_MIPS_ABI2) strcat (buf, ", abi2"); - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) - strcat (buf, ", mips1"); - - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2) - strcat (buf, ", mips2"); - - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3) - strcat (buf, ", mips3"); + if (e_flags & EF_MIPS_OPTIONS_FIRST) + strcat (buf, ", odk first"); - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4) - strcat (buf, ", mips4"); - - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5) - strcat (buf, ", mips5"); - - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32) - strcat (buf, ", mips32"); - - if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64) - strcat (buf, ", mips64"); + if (e_flags & EF_MIPS_32BITMODE) + strcat (buf, ", 32bitmode"); switch ((e_flags & EF_MIPS_MACH)) { @@ -1540,10 +1698,48 @@ get_machine_flags (e_flags, e_machine) case E_MIPS_MACH_4100: strcat (buf, ", 4100"); break; case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break; case E_MIPS_MACH_4111: strcat (buf, ", 4111"); break; - case E_MIPS_MACH_MIPS32_4K: strcat (buf, ", mips32-4k"); break; case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break; - default: strcat (buf, " UNKNOWN"); break; + case 0: + /* We simply ignore the field in this case to avoid confusion: + MIPS ELF does not specify EF_MIPS_MACH, it is a GNU + extension. */ + break; + default: strcat (buf, ", unknown CPU"); break; + } + + switch ((e_flags & EF_MIPS_ABI)) + { + case E_MIPS_ABI_O32: strcat (buf, ", o32"); break; + case E_MIPS_ABI_O64: strcat (buf, ", o64"); break; + case E_MIPS_ABI_EABI32: strcat (buf, ", eabi32"); break; + case E_MIPS_ABI_EABI64: strcat (buf, ", eabi64"); break; + case 0: + /* We simply ignore the field in this case to avoid confusion: + MIPS ELF does not specify EF_MIPS_ABI, it is a GNU extension. + This means it is likely to be an o32 file, but not for + sure. */ + break; + default: strcat (buf, ", unknown ABI"); break; + } + + if (e_flags & EF_MIPS_ARCH_ASE_MDMX) + strcat (buf, ", mdmx"); + + if (e_flags & EF_MIPS_ARCH_ASE_M16) + strcat (buf, ", mips16"); + + switch ((e_flags & EF_MIPS_ARCH)) + { + case E_MIPS_ARCH_1: strcat (buf, ", mips1"); break; + case E_MIPS_ARCH_2: strcat (buf, ", mips2"); break; + case E_MIPS_ARCH_3: strcat (buf, ", mips3"); break; + case E_MIPS_ARCH_4: strcat (buf, ", mips4"); break; + case E_MIPS_ARCH_5: strcat (buf, ", mips5"); break; + case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break; + case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break; + default: strcat (buf, ", unknown ISA"); break; } + break; case EM_SPARCV9: @@ -1602,6 +1798,7 @@ get_machine_flags (e_flags, e_machine) break; case EM_PJ: + case EM_PJ_OLD: if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS) strcat (buf, ", new calling convention"); @@ -1683,6 +1880,10 @@ get_ia64_segment_type (type) { case PT_IA_64_ARCHEXT: return "IA_64_ARCHEXT"; case PT_IA_64_UNWIND: return "IA_64_UNWIND"; + case PT_HP_TLS: return "HP_TLS"; + case PT_IA_64_HP_OPT_ANOT: return "HP_OPT_ANNOT"; + case PT_IA_64_HP_HSL_ANOT: return "HP_HSL_ANNOT"; + case PT_IA_64_HP_STACK: return "HP_STACK"; default: break; } @@ -1706,6 +1907,9 @@ get_segment_type (p_type) case PT_SHLIB: return "SHLIB"; case PT_PHDR: return "PHDR"; + case PT_GNU_EH_FRAME: + return "GNU_EH_FRAME"; + default: if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) { @@ -1742,6 +1946,9 @@ get_segment_type (p_type) case EM_PARISC: result = get_parisc_segment_type (p_type); break; + case EM_IA_64: + result = get_ia64_segment_type (p_type); + break; default: result = NULL; break; @@ -1897,12 +2104,12 @@ get_section_type_name (sh_type) if (result != NULL) return result; - sprintf (buff, "SHT_LOPROC+%x", sh_type - SHT_LOPROC); + sprintf (buff, "LOPROC+%x", sh_type - SHT_LOPROC); } else if ((sh_type >= SHT_LOOS) && (sh_type <= SHT_HIOS)) - sprintf (buff, "SHT_LOOS+%x", sh_type - SHT_LOOS); + sprintf (buff, "LOOS+%x", sh_type - SHT_LOOS); else if ((sh_type >= SHT_LOUSER) && (sh_type <= SHT_HIUSER)) - sprintf (buff, "SHT_LOUSER+%x", sh_type - SHT_LOUSER); + sprintf (buff, "LOUSER+%x", sh_type - SHT_LOUSER); else sprintf (buff, _(": %x"), sh_type); @@ -1936,6 +2143,7 @@ struct option options [] = #endif {"version", no_argument, 0, 'v'}, + {"wide", no_argument, 0, 'W'}, {"help", no_argument, 0, 'H'}, {0, no_argument, 0, 0} }; @@ -1943,34 +2151,38 @@ struct option options [] = static void usage () { - fprintf (stdout, _("Usage: readelf {options} elf-file(s)\n")); - fprintf (stdout, _(" Options are:\n")); - fprintf (stdout, _(" -a or --all Equivalent to: -h -l -S -s -r -d -V -A -I\n")); - fprintf (stdout, _(" -h or --file-header Display the ELF file header\n")); - fprintf (stdout, _(" -l or --program-headers or --segments\n")); - fprintf (stdout, _(" Display the program headers\n")); - fprintf (stdout, _(" -S or --section-headers or --sections\n")); - fprintf (stdout, _(" Display the sections' header\n")); - fprintf (stdout, _(" -e or --headers Equivalent to: -h -l -S\n")); - fprintf (stdout, _(" -s or --syms or --symbols Display the symbol table\n")); - fprintf (stdout, _(" -n or --notes Display the core notes (if present)\n")); - fprintf (stdout, _(" -r or --relocs Display the relocations (if present)\n")); - fprintf (stdout, _(" -u or --unwind Display the unwind info (if present)\n")); - fprintf (stdout, _(" -d or --dynamic Display the dynamic segment (if present)\n")); - fprintf (stdout, _(" -V or --version-info Display the version sections (if present)\n")); - fprintf (stdout, _(" -A or --arch-specific Display architecture specific information (if any).\n")); - fprintf (stdout, _(" -D or --use-dynamic Use the dynamic section info when displaying symbols\n")); - fprintf (stdout, _(" -x or --hex-dump=\n")); - fprintf (stdout, _(" Dump the contents of section \n")); - fprintf (stdout, _(" -w[liaprf] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]\n")); - fprintf (stdout, _(" Display the contents of DWARF2 debug sections\n")); + fprintf (stdout, _("Usage: readelf elf-file(s)\n")); + fprintf (stdout, _(" Display information about the contents of ELF format files\n")); + fprintf (stdout, _(" Options are:\n\ + -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n\ + -h --file-header Display the ELF file header\n\ + -l --program-headers Display the program headers\n\ + --segments An alias for --program-headers\n\ + -S --section-headers Display the sections' header\n\ + --sections An alias for --section-headers\n\ + -e --headers Equivalent to: -h -l -S\n\ + -s --syms Display the symbol table\n\ + --symbols An alias for --syms\n\ + -n --notes Display the core notes (if present)\n\ + -r --relocs Display the relocations (if present)\n\ + -u --unwind Display the unwind info (if present)\n\ + -d --dynamic Display the dynamic segment (if present)\n\ + -V --version-info Display the version sections (if present)\n\ + -A --arch-specific Display architecture specific information (if any).\n\ + -D --use-dynamic Use the dynamic section info when displaying symbols\n\ + -x --hex-dump= Dump the contents of section \n\ + -w --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str]\n\ + Display the contents of DWARF2 debug sections\n")); #ifdef SUPPORT_DISASSEMBLY - fprintf (stdout, _(" -i or --instruction-dump=\n")); - fprintf (stdout, _(" Disassemble the contents of section \n")); + fprintf (stdout, _("\ + -i --instruction-dump=\n\ + Disassemble the contents of section \n")); #endif - fprintf (stdout, _(" -I or --histogram Display histogram of bucket list lengths\n")); - fprintf (stdout, _(" -v or --version Display the version number of readelf\n")); - fprintf (stdout, _(" -H or --help Display this information\n")); + fprintf (stdout, _("\ + -I --histogram Display histogram of bucket list lengths\n\ + -W --wide Allow output width to exceed 80 characters\n\ + -H --help Display this information\n\ + -v --version Display the version number of readelf\n")); fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (0); @@ -1979,7 +2191,7 @@ usage () static void request_dump (section, type) unsigned int section; - char type; + int type; { if (section >= num_dump_sects) { @@ -2018,7 +2230,7 @@ parse_args (argc, argv) usage (); while ((c = getopt_long - (argc, argv, "ersuahnldSDAIw::x:i:vV", options, NULL)) != EOF) + (argc, argv, "ersuahnldSDAIw::x:i:vVW", options, NULL)) != EOF) { char * cp; int section; @@ -2098,44 +2310,58 @@ parse_args (argc, argv) do_debugging = 1; else { + unsigned int index = 0; + do_debugging = 0; - switch (optarg[0]) - { - case 'i': - case 'I': - do_debug_info = 1; - break; - case 'a': - case 'A': - do_debug_abbrevs = 1; - break; + while (optarg[index]) + switch (optarg[index++]) + { + case 'i': + case 'I': + do_debug_info = 1; + break; - case 'l': - case 'L': - do_debug_lines = 1; - break; + case 'a': + case 'A': + do_debug_abbrevs = 1; + break; - case 'p': - case 'P': - do_debug_pubnames = 1; - break; + case 'l': + case 'L': + do_debug_lines = 1; + break; - case 'r': - case 'R': - do_debug_aranges = 1; - break; + case 'p': + case 'P': + do_debug_pubnames = 1; + break; - case 'F': - do_debug_frames_interp = 1; - case 'f': - do_debug_frames = 1; - break; + case 'r': + case 'R': + do_debug_aranges = 1; + break; - default: - warn (_("Unrecognised debug option '%s'\n"), optarg); - break; - } + case 'F': + do_debug_frames_interp = 1; + case 'f': + do_debug_frames = 1; + break; + + case 'm': + case 'M': + do_debug_macinfo = 1; + break; + + case 's': + case 'S': + do_debug_str = 1; + break; + + default: + warn (_("Unrecognised debug option '%s'\n"), optarg); + break; + } } break; #ifdef SUPPORT_DISASSEMBLY @@ -2155,6 +2381,9 @@ parse_args (argc, argv) case 'V': do_version ++; break; + case 'W': + do_wide ++; + break; default: oops: /* xgettext:c-format */ @@ -2178,15 +2407,15 @@ parse_args (argc, argv) static const char * get_elf_class (elf_class) - unsigned char elf_class; + unsigned int elf_class; { static char buff [32]; switch (elf_class) { case ELFCLASSNONE: return _("none"); - case ELFCLASS32: return _("ELF32"); - case ELFCLASS64: return _("ELF64"); + case ELFCLASS32: return "ELF32"; + case ELFCLASS64: return "ELF64"; default: sprintf (buff, _(""), elf_class); return buff; @@ -2195,7 +2424,7 @@ get_elf_class (elf_class) static const char * get_data_encoding (encoding) - unsigned char encoding; + unsigned int encoding; { static char buff [32]; @@ -2212,26 +2441,26 @@ get_data_encoding (encoding) static const char * get_osabi_name (osabi) - unsigned char osabi; + unsigned int osabi; { static char buff [32]; switch (osabi) { - case ELFOSABI_NONE: return _("UNIX - System V"); - case ELFOSABI_HPUX: return _("UNIX - HP-UX"); - case ELFOSABI_NETBSD: return _("UNIX - NetBSD"); - case ELFOSABI_LINUX: return _("UNIX - Linux"); - case ELFOSABI_HURD: return _("GNU/Hurd"); - case ELFOSABI_SOLARIS: return _("UNIX - Solaris"); - case ELFOSABI_AIX: return _("UNIX - AIX"); - case ELFOSABI_IRIX: return _("UNIX - IRIX"); - case ELFOSABI_FREEBSD: return _("UNIX - FreeBSD"); - case ELFOSABI_TRU64: return _("UNIX - TRU64"); - case ELFOSABI_MODESTO: return _("Novell - Modesto"); - case ELFOSABI_OPENBSD: return _("UNIX - OpenBSD"); + case ELFOSABI_NONE: return "UNIX - System V"; + case ELFOSABI_HPUX: return "UNIX - HP-UX"; + case ELFOSABI_NETBSD: return "UNIX - NetBSD"; + case ELFOSABI_LINUX: return "UNIX - Linux"; + case ELFOSABI_HURD: return "GNU/Hurd"; + case ELFOSABI_SOLARIS: return "UNIX - Solaris"; + case ELFOSABI_AIX: return "UNIX - AIX"; + case ELFOSABI_IRIX: return "UNIX - IRIX"; + case ELFOSABI_FREEBSD: return "UNIX - FreeBSD"; + case ELFOSABI_TRU64: return "UNIX - TRU64"; + case ELFOSABI_MODESTO: return "Novell - Modesto"; + case ELFOSABI_OPENBSD: return "UNIX - OpenBSD"; case ELFOSABI_STANDALONE: return _("Standalone App"); - case ELFOSABI_ARM: return _("ARM"); + case ELFOSABI_ARM: return "ARM"; default: sprintf (buff, _(""), osabi); return buff; @@ -2302,10 +2531,26 @@ process_file_header () (long) elf_header.e_phnum); printf (_(" Size of section headers: %ld (bytes)\n"), (long) elf_header.e_shentsize); - printf (_(" Number of section headers: %ld\n"), + printf (_(" Number of section headers: %ld"), (long) elf_header.e_shnum); - printf (_(" Section header string table index: %ld\n"), + if (section_headers != NULL && elf_header.e_shnum == 0) + printf (" (%ld)", (long) section_headers[0].sh_size); + putc ('\n', stdout); + printf (_(" Section header string table index: %ld"), (long) elf_header.e_shstrndx); + if (section_headers != NULL && elf_header.e_shstrndx == SHN_XINDEX) + printf (" (%ld)", (long) section_headers[0].sh_link); + putc ('\n', stdout); + } + + if (section_headers != NULL) + { + if (elf_header.e_shnum == 0) + elf_header.e_shnum = section_headers[0].sh_size; + if (elf_header.e_shstrndx == SHN_XINDEX) + elf_header.e_shstrndx = section_headers[0].sh_link; + free (section_headers); + section_headers = NULL; } return 1; @@ -2322,9 +2567,12 @@ get_32bit_program_headers (file, program_headers) Elf32_Internal_Phdr * internal; unsigned int i; - GET_DATA_ALLOC (elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, - phdrs, Elf32_External_Phdr *, "program headers"); + phdrs = ((Elf32_External_Phdr *) + get_data (NULL, file, elf_header.e_phoff, + elf_header.e_phentsize * elf_header.e_phnum, + _("program headers"))); + if (!phdrs) + return 0; for (i = 0, internal = program_headers, external = phdrs; i < elf_header.e_phnum; @@ -2355,9 +2603,12 @@ get_64bit_program_headers (file, program_headers) Elf64_Internal_Phdr * internal; unsigned int i; - GET_DATA_ALLOC (elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, - phdrs, Elf64_External_Phdr *, "program headers"); + phdrs = ((Elf64_External_Phdr *) + get_data (NULL, file, elf_header.e_phoff, + elf_header.e_phentsize * elf_header.e_phnum, + _("program headers"))); + if (!phdrs) + return 0; for (i = 0, internal = program_headers, external = phdrs; i < elf_header.e_phnum; @@ -2432,6 +2683,9 @@ process_program_headers (file) if (is_32bit_elf) printf (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n")); + else if (do_wide) + printf + (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n")); else { printf @@ -2466,6 +2720,48 @@ process_program_headers (file) (segment->p_flags & PF_X ? 'E' : ' ')); printf ("%#lx", (unsigned long) segment->p_align); } + else if (do_wide) + { + if ((unsigned long) segment->p_offset == segment->p_offset) + printf ("0x%6.6lx ", (unsigned long) segment->p_offset); + else + { + print_vma (segment->p_offset, FULL_HEX); + putchar (' '); + } + + print_vma (segment->p_vaddr, FULL_HEX); + putchar (' '); + print_vma (segment->p_paddr, FULL_HEX); + putchar (' '); + + if ((unsigned long) segment->p_filesz == segment->p_filesz) + printf ("0x%6.6lx ", (unsigned long) segment->p_filesz); + else + { + print_vma (segment->p_filesz, FULL_HEX); + putchar (' '); + } + + if ((unsigned long) segment->p_memsz == segment->p_memsz) + printf ("0x%6.6lx", (unsigned long) segment->p_memsz); + else + { + print_vma (segment->p_offset, FULL_HEX); + } + + printf (" %c%c%c ", + (segment->p_flags & PF_R ? 'R' : ' '), + (segment->p_flags & PF_W ? 'W' : ' '), + (segment->p_flags & PF_X ? 'E' : ' ')); + + if ((unsigned long) segment->p_align == segment->p_align) + printf ("%#lx", (unsigned long) segment->p_align); + else + { + print_vma (segment->p_align, PREFIX_HEX); + } + } else { print_vma (segment->p_offset, FULL_HEX); @@ -2522,7 +2818,7 @@ process_program_headers (file) if (loadaddr == -1) { - /* Very strange. */ + /* Very strange. */ loadaddr = 0; } @@ -2535,7 +2831,7 @@ process_program_headers (file) for (i = 0; i < elf_header.e_phnum; i++) { - int j; + unsigned int j; Elf_Internal_Shdr * section; segment = program_headers + i; @@ -2543,7 +2839,7 @@ process_program_headers (file) printf (" %2.2d ", i); - for (j = 0; j < elf_header.e_shnum; j++, section ++) + for (j = 1; j < elf_header.e_shnum; j++, section ++) { if (section->sh_size > 0 /* Compare allocated sections by VMA, unallocated @@ -2569,19 +2865,23 @@ process_program_headers (file) static int -get_32bit_section_headers (file) +get_32bit_section_headers (file, num) FILE * file; + unsigned int num; { Elf32_External_Shdr * shdrs; Elf32_Internal_Shdr * internal; unsigned int i; - GET_DATA_ALLOC (elf_header.e_shoff, - elf_header.e_shentsize * elf_header.e_shnum, - shdrs, Elf32_External_Shdr *, "section headers"); + shdrs = ((Elf32_External_Shdr *) + get_data (NULL, file, elf_header.e_shoff, + elf_header.e_shentsize * num, + _("section headers"))); + if (!shdrs) + return 0; - section_headers = (Elf_Internal_Shdr *) malloc - (elf_header.e_shnum * sizeof (Elf_Internal_Shdr)); + section_headers = ((Elf_Internal_Shdr *) + malloc (num * sizeof (Elf_Internal_Shdr))); if (section_headers == NULL) { @@ -2590,7 +2890,7 @@ get_32bit_section_headers (file) } for (i = 0, internal = section_headers; - i < elf_header.e_shnum; + i < num; i ++, internal ++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); @@ -2611,19 +2911,23 @@ get_32bit_section_headers (file) } static int -get_64bit_section_headers (file) +get_64bit_section_headers (file, num) FILE * file; + unsigned int num; { Elf64_External_Shdr * shdrs; Elf64_Internal_Shdr * internal; unsigned int i; - GET_DATA_ALLOC (elf_header.e_shoff, - elf_header.e_shentsize * elf_header.e_shnum, - shdrs, Elf64_External_Shdr *, "section headers"); + shdrs = ((Elf64_External_Shdr *) + get_data (NULL, file, elf_header.e_shoff, + elf_header.e_shentsize * num, + _("section headers"))); + if (!shdrs) + return 0; - section_headers = (Elf_Internal_Shdr *) malloc - (elf_header.e_shnum * sizeof (Elf_Internal_Shdr)); + section_headers = ((Elf_Internal_Shdr *) + malloc (num * sizeof (Elf_Internal_Shdr))); if (section_headers == NULL) { @@ -2632,7 +2936,7 @@ get_64bit_section_headers (file) } for (i = 0, internal = section_headers; - i < elf_header.e_shnum; + i < num; i ++, internal ++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); @@ -2653,26 +2957,47 @@ get_64bit_section_headers (file) } static Elf_Internal_Sym * -get_32bit_elf_symbols (file, offset, number) +get_32bit_elf_symbols (file, section) FILE * file; - unsigned long offset; - unsigned long number; + Elf_Internal_Shdr *section; { + unsigned long number; Elf32_External_Sym * esyms; + Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym * isyms; Elf_Internal_Sym * psym; unsigned int j; - GET_DATA_ALLOC (offset, number * sizeof (Elf32_External_Sym), - esyms, Elf32_External_Sym *, "symbols"); + esyms = ((Elf32_External_Sym *) + get_data (NULL, file, section->sh_offset, + section->sh_size, _("symbols"))); + if (!esyms) + return NULL; + + shndx = NULL; + if (symtab_shndx_hdr != NULL + && (symtab_shndx_hdr->sh_link + == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) + { + shndx = ((Elf_External_Sym_Shndx *) + get_data (NULL, file, symtab_shndx_hdr->sh_offset, + symtab_shndx_hdr->sh_size, _("symtab shndx"))); + if (!shndx) + { + free (esyms); + return NULL; + } + } + number = section->sh_size / section->sh_entsize; isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym)); if (isyms == NULL) { error (_("Out of memory\n")); + if (shndx) + free (shndx); free (esyms); - return NULL; } @@ -2684,36 +3009,62 @@ get_32bit_elf_symbols (file, offset, number) psym->st_value = BYTE_GET (esyms[j].st_value); psym->st_size = BYTE_GET (esyms[j].st_size); psym->st_shndx = BYTE_GET (esyms[j].st_shndx); + if (psym->st_shndx == SHN_XINDEX && shndx != NULL) + psym->st_shndx + = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); psym->st_info = BYTE_GET (esyms[j].st_info); psym->st_other = BYTE_GET (esyms[j].st_other); } + if (shndx) + free (shndx); free (esyms); return isyms; } static Elf_Internal_Sym * -get_64bit_elf_symbols (file, offset, number) +get_64bit_elf_symbols (file, section) FILE * file; - unsigned long offset; - unsigned long number; + Elf_Internal_Shdr *section; { + unsigned long number; Elf64_External_Sym * esyms; + Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym * isyms; Elf_Internal_Sym * psym; unsigned int j; - GET_DATA_ALLOC (offset, number * sizeof (Elf64_External_Sym), - esyms, Elf64_External_Sym *, "symbols"); + esyms = ((Elf64_External_Sym *) + get_data (NULL, file, section->sh_offset, + section->sh_size, _("symbols"))); + if (!esyms) + return NULL; + + shndx = NULL; + if (symtab_shndx_hdr != NULL + && (symtab_shndx_hdr->sh_link + == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) + { + shndx = ((Elf_External_Sym_Shndx *) + get_data (NULL, file, symtab_shndx_hdr->sh_offset, + symtab_shndx_hdr->sh_size, _("symtab shndx"))); + if (!shndx) + { + free (esyms); + return NULL; + } + } + number = section->sh_size / section->sh_entsize; isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym)); if (isyms == NULL) { error (_("Out of memory\n")); + if (shndx) + free (shndx); free (esyms); - return NULL; } @@ -2725,10 +3076,15 @@ get_64bit_elf_symbols (file, offset, number) psym->st_info = BYTE_GET (esyms[j].st_info); psym->st_other = BYTE_GET (esyms[j].st_other); psym->st_shndx = BYTE_GET (esyms[j].st_shndx); + if (psym->st_shndx == SHN_XINDEX && shndx != NULL) + psym->st_shndx + = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); psym->st_value = BYTE_GET8 (esyms[j].st_value); psym->st_size = BYTE_GET8 (esyms[j].st_size); } + if (shndx) + free (shndx); free (esyms); return isyms; @@ -2786,7 +3142,7 @@ process_section_headers (file) FILE * file; { Elf_Internal_Shdr * section; - int i; + unsigned int i; section_headers = NULL; @@ -2804,25 +3160,25 @@ process_section_headers (file) if (is_32bit_elf) { - if (! get_32bit_section_headers (file)) + if (! get_32bit_section_headers (file, elf_header.e_shnum)) return 0; } - else if (! get_64bit_section_headers (file)) + else if (! get_64bit_section_headers (file, elf_header.e_shnum)) return 0; /* Read in the string table, so that we have names to display. */ - section = section_headers + elf_header.e_shstrndx; + section = SECTION_HEADER (elf_header.e_shstrndx); if (section->sh_size != 0) { - GET_DATA_ALLOC (section->sh_offset, section->sh_size, - string_table, char *, "string table"); + string_table = (char *) get_data (NULL, file, section->sh_offset, + section->sh_size, _("string table")); string_table_length = section->sh_size; } /* Scan the sections for the dynamic symbol table - and dynamic string table and debug sections. */ + and dynamic string table and debug sections. */ dynamic_symbols = NULL; dynamic_strings = NULL; dynamic_syminfo = NULL; @@ -2842,8 +3198,7 @@ process_section_headers (file) } num_dynamic_syms = section->sh_size / section->sh_entsize; - dynamic_symbols = - GET_ELF_SYMBOLS (file, section->sh_offset, num_dynamic_syms); + dynamic_symbols = GET_ELF_SYMBOLS (file, section); } else if (section->sh_type == SHT_STRTAB && strcmp (name, ".dynstr") == 0) @@ -2854,12 +3209,22 @@ process_section_headers (file) continue; } - GET_DATA_ALLOC (section->sh_offset, section->sh_size, - dynamic_strings, char *, "dynamic strings"); + dynamic_strings = (char *) get_data (NULL, file, section->sh_offset, + section->sh_size, + _("dynamic strings")); + } + else if (section->sh_type == SHT_SYMTAB_SHNDX) + { + if (symtab_shndx_hdr != NULL) + { + error (_("File contains multiple symtab shndx tables\n")); + continue; + } + symtab_shndx_hdr = section; } else if ((do_debugging || do_debug_info || do_debug_abbrevs || do_debug_lines || do_debug_pubnames || do_debug_aranges - || do_debug_frames) + || do_debug_frames || do_debug_macinfo || do_debug_str) && strncmp (name, ".debug_", 7) == 0) { name += 7; @@ -2871,6 +3236,8 @@ process_section_headers (file) || (do_debug_pubnames && (strcmp (name, "pubnames") == 0)) || (do_debug_aranges && (strcmp (name, "aranges") == 0)) || (do_debug_frames && (strcmp (name, "frame") == 0)) + || (do_debug_macinfo && (strcmp (name, "macinfo") == 0)) + || (do_debug_str && (strcmp (name, "str") == 0)) ) request_dump (i, DEBUG_DUMP); } @@ -2890,6 +3257,9 @@ process_section_headers (file) if (is_32bit_elf) printf (_(" [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n")); + else if (do_wide) + printf + (_(" [Nr] Name Type Address Off Size ES Flg Lk Inf Al\n")); else { printf (_(" [Nr] Name Type Address Offset\n")); @@ -2900,8 +3270,8 @@ process_section_headers (file) i < elf_header.e_shnum; i ++, section ++) { - printf (" [%2d] %-17.17s %-15.15s ", - i, + printf (" [%2u] %-17.17s %-15.15s ", + SECTION_HEADER_NUM (i), SECTION_NAME (section), get_section_type_name (section->sh_type)); @@ -2921,29 +3291,77 @@ process_section_headers (file) (unsigned long) section->sh_info, (unsigned long) section->sh_addralign); } - else + else if (do_wide) { - putchar (' '); print_vma (section->sh_addr, LONG_HEX); - printf (" %8.8lx", section->sh_offset); - printf ("\n "); - print_vma (section->sh_size, LONG_HEX); - printf (" "); - print_vma (section->sh_entsize, LONG_HEX); - printf (" %3s ", get_elf_section_flags (section->sh_flags)); + if ((long) section->sh_offset == section->sh_offset) + printf (" %6.6lx", (unsigned long) section->sh_offset); + else + { + putchar (' '); + print_vma (section->sh_offset, LONG_HEX); + } - printf (" %2ld %3lx %ld\n", - (unsigned long) section->sh_link, - (unsigned long) section->sh_info, - (unsigned long) section->sh_addralign); + if ((unsigned long) section->sh_size == section->sh_size) + printf (" %6.6lx", (unsigned long) section->sh_size); + else + { + putchar (' '); + print_vma (section->sh_size, LONG_HEX); + } + + if ((unsigned long) section->sh_entsize == section->sh_entsize) + printf (" %2.2lx", (unsigned long) section->sh_entsize); + else + { + putchar (' '); + print_vma (section->sh_entsize, LONG_HEX); + } + + printf (" %3s ", get_elf_section_flags (section->sh_flags)); + + printf ("%2ld %3lx ", + (unsigned long) section->sh_link, + (unsigned long) section->sh_info); + + if ((unsigned long) section->sh_addralign == section->sh_addralign) + printf ("%2ld\n", (unsigned long) section->sh_addralign); + else + { + print_vma (section->sh_addralign, DEC); + putchar ('\n'); + } + } + else + { + putchar (' '); + print_vma (section->sh_addr, LONG_HEX); + if ((long) section->sh_offset == section->sh_offset) + printf (" %8.8lx", (unsigned long) section->sh_offset); + else + { + printf (" "); + print_vma (section->sh_offset, LONG_HEX); + } + printf ("\n "); + print_vma (section->sh_size, LONG_HEX); + printf (" "); + print_vma (section->sh_entsize, LONG_HEX); + + printf (" %3s ", get_elf_section_flags (section->sh_flags)); + + printf (" %2ld %3lx %ld\n", + (unsigned long) section->sh_link, + (unsigned long) section->sh_info, + (unsigned long) section->sh_addralign); } } - printf (_("Key to Flags:\n")); - printf (_(" W (write), A (alloc), X (execute), M (merge), S (strings)\n")); - printf (_(" I (info), L (link order), G (group), x (unknown)\n")); - printf (_(" O (extra OS processing required) o (OS specific), p (processor specific)\n")); + printf (_("Key to Flags:\n\ + W (write), A (alloc), X (execute), M (merge), S (strings)\n\ + I (info), L (link order), G (group), x (unknown)\n\ + O (extra OS processing required) o (OS specific), p (processor specific)\n")); return 1; } @@ -3030,7 +3448,6 @@ process_relocs (file) if (rel_size) { Elf32_Internal_Shdr * strsec; - Elf32_Internal_Shdr * symsec; Elf_Internal_Sym * symtab; char * strtab; int is_rela; @@ -3046,25 +3463,35 @@ process_relocs (file) printf (_(" at offset 0x%lx contains %lu entries:\n"), rel_offset, (unsigned long) (rel_size / section->sh_entsize)); - symsec = section_headers + section->sh_link; - - nsyms = symsec->sh_size / symsec->sh_entsize; - symtab = GET_ELF_SYMBOLS (file, symsec->sh_offset, nsyms); + symtab = NULL; + strtab = NULL; + nsyms = 0; + if (section->sh_link) + { + Elf32_Internal_Shdr * symsec; - if (symtab == NULL) - continue; + symsec = SECTION_HEADER (section->sh_link); + nsyms = symsec->sh_size / symsec->sh_entsize; + symtab = GET_ELF_SYMBOLS (file, symsec); - strsec = section_headers + symsec->sh_link; + if (symtab == NULL) + continue; - GET_DATA_ALLOC (strsec->sh_offset, strsec->sh_size, strtab, - char *, "string table"); + strsec = SECTION_HEADER (symsec->sh_link); + strtab = (char *) get_data (NULL, file, strsec->sh_offset, + strsec->sh_size, + _("string table")); + } is_rela = section->sh_type == SHT_RELA; - dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela); + dump_relocations (file, rel_offset, rel_size, + symtab, nsyms, strtab, is_rela); - free (strtab); - free (symtab); + if (strtab) + free (strtab); + if (symtab) + free (symtab); found = 1; } @@ -3266,7 +3693,10 @@ slurp_ia64_unwind_table (file, aux, sec) /* Second, build the unwind table from the contents of the unwind section: */ size = sec->sh_size; - GET_DATA_ALLOC (sec->sh_offset, size, table, char *, "unwind table"); + table = (char *) get_data (NULL, file, sec->sh_offset, + size, _("unwind table")); + if (!table) + return 0; tep = aux->table = xmalloc (size / (3 * addr_size) * sizeof (aux->table[0])); for (tp = table; tp < table + size; tp += 3 * addr_size, ++ tep) @@ -3299,7 +3729,7 @@ slurp_ia64_unwind_table (file, aux, sec) ++relsec) { if (relsec->sh_type != SHT_RELA - || section_headers + relsec->sh_info != sec) + || SECTION_HEADER (relsec->sh_info) != sec) continue; if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size, @@ -3315,7 +3745,7 @@ slurp_ia64_unwind_table (file, aux, sec) if (ELF32_ST_TYPE (sym->st_info) != STT_SECTION) { - warn (_("Skipping unexpected symbol type %u"), + warn (_("Skipping unexpected symbol type %u\n"), ELF32_ST_TYPE (sym->st_info)); continue; } @@ -3327,7 +3757,7 @@ slurp_ia64_unwind_table (file, aux, sec) if (ELF64_ST_TYPE (sym->st_info) != STT_SECTION) { - warn (_("Skipping unexpected symbol type %u"), + warn (_("Skipping unexpected symbol type %u\n"), ELF64_ST_TYPE (sym->st_info)); continue; } @@ -3335,7 +3765,7 @@ slurp_ia64_unwind_table (file, aux, sec) if (strncmp (relname, "R_IA64_SEGREL", 13) != 0) { - warn (_("Skipping unexpected relocation type %s"), relname); + warn (_("Skipping unexpected relocation type %s\n"), relname); continue; } @@ -3393,12 +3823,12 @@ process_unwind (file) if (sec->sh_type == SHT_SYMTAB) { aux.nsyms = sec->sh_size / sec->sh_entsize; - aux.symtab = GET_ELF_SYMBOLS (file, sec->sh_offset, aux.nsyms); + aux.symtab = GET_ELF_SYMBOLS (file, sec); - strsec = section_headers + sec->sh_link; + strsec = SECTION_HEADER (sec->sh_link); aux.strtab_size = strsec->sh_size; - GET_DATA_ALLOC (strsec->sh_offset, aux.strtab_size, - aux.strtab, char *, "string table"); + aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset, + aux.strtab_size, _("string table")); } else if (sec->sh_type == SHT_IA_64_UNWIND) unwcount++; @@ -3467,8 +3897,8 @@ process_unwind (file) { aux.info_size = sec->sh_size; aux.info_addr = sec->sh_addr; - GET_DATA_ALLOC (sec->sh_offset, aux.info_size, aux.info, - char *, "unwind info"); + aux.info = (char *) get_data (NULL, file, sec->sh_offset, + aux.info_size, _("unwind info")); printf (_("\nUnwind section ")); @@ -3478,7 +3908,7 @@ process_unwind (file) printf ("'%s'", SECTION_NAME (unwsec)); printf (_(" at offset 0x%lx contains %lu entries:\n"), - unwsec->sh_offset, + (unsigned long) unwsec->sh_offset, (unsigned long) (unwsec->sh_size / (3 * addr_size))); (void) slurp_ia64_unwind_table (file, & aux, unwsec); @@ -3642,8 +4072,10 @@ get_32bit_dynamic_segment (file) Elf_Internal_Dyn * entry; bfd_size_type i; - GET_DATA_ALLOC (dynamic_addr, dynamic_size, - edyn, Elf32_External_Dyn *, "dynamic segment"); + edyn = (Elf32_External_Dyn *) get_data (NULL, file, dynamic_addr, + dynamic_size, _("dynamic segment")); + if (!edyn) + return 0; /* SGI's ELF has more than one section in the DYNAMIC segment. Determine how large this .dynamic is now. We can do this even before the byte @@ -3683,8 +4115,10 @@ get_64bit_dynamic_segment (file) Elf_Internal_Dyn * entry; bfd_size_type i; - GET_DATA_ALLOC (dynamic_addr, dynamic_size, - edyn, Elf64_External_Dyn *, "dynamic segment"); + edyn = (Elf64_External_Dyn *) get_data (NULL, file, dynamic_addr, + dynamic_size, _("dynamic segment")); + if (!edyn) + return 0; /* SGI's ELF has more than one section in the DYNAMIC segment. Determine how large this .dynamic is now. We can do this even before the byte @@ -3771,7 +4205,7 @@ process_dynamic_segment (file) i < dynamic_size; ++i, ++ entry) { - unsigned long offset; + Elf32_Internal_Shdr section; if (entry->d_tag != DT_SYMTAB) continue; @@ -3781,24 +4215,26 @@ process_dynamic_segment (file) /* Since we do not know how big the symbol table is, we default to reading in the entire file (!) and processing that. This is overkill, I know, but it - should work. */ - offset = entry->d_un.d_val - loadaddr; + should work. */ + section.sh_offset = entry->d_un.d_val - loadaddr; if (fseek (file, 0, SEEK_END)) error (_("Unable to seek to end of file!")); + section.sh_size = ftell (file) - section.sh_offset; if (is_32bit_elf) - num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf32_External_Sym); + section.sh_entsize = sizeof (Elf32_External_Sym); else - num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf64_External_Sym); + section.sh_entsize = sizeof (Elf64_External_Sym); + num_dynamic_syms = section.sh_size / section.sh_entsize; if (num_dynamic_syms < 1) { error (_("Unable to determine the number of symbols to load\n")); continue; } - dynamic_symbols = GET_ELF_SYMBOLS (file, offset, num_dynamic_syms); + dynamic_symbols = GET_ELF_SYMBOLS (file, §ion); } } @@ -3820,7 +4256,7 @@ process_dynamic_segment (file) /* Since we do not know how big the string table is, we default to reading in the entire file (!) and processing that. This is overkill, I know, but it - should work. */ + should work. */ offset = entry->d_un.d_val - loadaddr; if (fseek (file, 0, SEEK_END)) @@ -3834,9 +4270,8 @@ process_dynamic_segment (file) continue; } - GET_DATA_ALLOC (offset, str_tab_len, dynamic_strings, char *, - "dynamic string table"); - + dynamic_strings = (char *) get_data (NULL, file, offset, str_tab_len, + _("dynamic string table")); break; } } @@ -3868,8 +4303,11 @@ process_dynamic_segment (file) Elf_Internal_Syminfo * syminfo; /* There is a syminfo section. Read the data. */ - GET_DATA_ALLOC (dynamic_syminfo_offset, syminsz, extsyminfo, - Elf_External_Syminfo *, "symbol information"); + extsyminfo = ((Elf_External_Syminfo *) + get_data (NULL, file, dynamic_syminfo_offset, + syminsz, _("symbol information"))); + if (!extsyminfo) + return 0; dynamic_syminfo = (Elf_Internal_Syminfo *) malloc (syminsz); if (dynamic_syminfo == NULL) @@ -4317,11 +4755,14 @@ process_version_sections (file) printf_vma (section->sh_addr); printf (_(" Offset: %#08lx Link: %lx (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, - SECTION_NAME (section_headers + section->sh_link)); + SECTION_NAME (SECTION_HEADER (section->sh_link))); - GET_DATA_ALLOC (section->sh_offset, section->sh_size, - edefs, Elf_External_Verdef *, - "version definition section"); + edefs = ((Elf_External_Verdef *) + get_data (NULL, file, section->sh_offset, + section->sh_size, + _("version definition section"))); + if (!edefs) + break; for (idx = cnt = 0; cnt < section->sh_info; ++ cnt) { @@ -4405,11 +4846,13 @@ process_version_sections (file) printf_vma (section->sh_addr); printf (_(" Offset: %#08lx Link to section: %ld (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, - SECTION_NAME (section_headers + section->sh_link)); + SECTION_NAME (SECTION_HEADER (section->sh_link))); - GET_DATA_ALLOC (section->sh_offset, section->sh_size, - eneed, Elf_External_Verneed *, - "version need section"); + eneed = ((Elf_External_Verneed *) + get_data (NULL, file, section->sh_offset, + section->sh_size, _("version need section"))); + if (!eneed) + break; for (idx = cnt = 0; cnt < section->sh_info; ++cnt) { @@ -4477,26 +4920,28 @@ process_version_sections (file) case SHT_GNU_versym: { Elf32_Internal_Shdr * link_section; - int total; - int cnt; - unsigned char * edata; - unsigned short * data; - char * strtab; - Elf_Internal_Sym * symbols; + int total; + int cnt; + unsigned char * edata; + unsigned short * data; + char * strtab; + Elf_Internal_Sym * symbols; Elf32_Internal_Shdr * string_sec; - link_section = section_headers + section->sh_link; + link_section = SECTION_HEADER (section->sh_link); total = section->sh_size / section->sh_entsize; found = 1; - symbols = GET_ELF_SYMBOLS (file, link_section->sh_offset, - link_section->sh_size / link_section->sh_entsize); + symbols = GET_ELF_SYMBOLS (file, link_section); - string_sec = section_headers + link_section->sh_link; + string_sec = SECTION_HEADER (link_section->sh_link); - GET_DATA_ALLOC (string_sec->sh_offset, string_sec->sh_size, - strtab, char *, "version string table"); + strtab = (char *) get_data (NULL, file, string_sec->sh_offset, + string_sec->sh_size, + _("version string table")); + if (!strtab) + break; printf (_("\nVersion symbols section '%s' contains %d entries:\n"), SECTION_NAME (section), total); @@ -4507,10 +4952,16 @@ process_version_sections (file) (unsigned long) section->sh_offset, section->sh_link, SECTION_NAME (link_section)); - GET_DATA_ALLOC (version_info [DT_VERSIONTAGIDX (DT_VERSYM)] - - loadaddr, - total * sizeof (short), edata, - unsigned char *, "version symbol data"); + edata = + ((unsigned char *) + get_data (NULL, file, + version_info[DT_VERSIONTAGIDX (DT_VERSYM)] - loadaddr, + total * sizeof (short), _("version symbol data"))); + if (!edata) + { + free (strtab); + break; + } data = (unsigned short *) malloc (total * sizeof (short)); @@ -4545,8 +4996,7 @@ process_version_sections (file) check_def = 1; check_need = 1; - if (symbols [cnt + j].st_shndx >= SHN_LORESERVE - || section_headers[symbols [cnt + j].st_shndx].sh_type + if (SECTION_HEADER (symbols [cnt + j].st_shndx)->sh_type != SHT_NOBITS) { if (symbols [cnt + j].st_shndx == SHN_UNDEF) @@ -4571,7 +5021,8 @@ process_version_sections (file) Elf_External_Vernaux evna; unsigned long a_off; - GET_DATA (offset, evn, "version need"); + get_data (&evn, file, offset, sizeof (evn), + _("version need")); ivn.vn_aux = BYTE_GET (evn.vn_aux); ivn.vn_next = BYTE_GET (evn.vn_next); @@ -4580,8 +5031,8 @@ process_version_sections (file) do { - GET_DATA (a_off, evna, - "version need aux (2)"); + get_data (&evna, file, a_off, sizeof (evna), + _("version need aux (2)")); ivna.vna_next = BYTE_GET (evna.vna_next); ivna.vna_other = BYTE_GET (evna.vna_other); @@ -4621,7 +5072,8 @@ process_version_sections (file) do { - GET_DATA (offset, evd, "version def"); + get_data (&evd, file, offset, sizeof (evd), + _("version def")); ivd.vd_next = BYTE_GET (evd.vd_next); ivd.vd_ndx = BYTE_GET (evd.vd_ndx); @@ -4638,8 +5090,9 @@ process_version_sections (file) ivd.vd_aux = BYTE_GET (evd.vd_aux); - GET_DATA (offset - ivd.vd_next + ivd.vd_aux, - evda, "version def aux"); + get_data (&evda, file, + offset - ivd.vd_next + ivd.vd_aux, + sizeof (evda), _("version def aux")); ivda.vda_name = BYTE_GET (evda.vda_name); @@ -4769,10 +5222,10 @@ get_symbol_index_type (type) default: if (type >= SHN_LOPROC && type <= SHN_HIPROC) return "PRC"; - else if (type >= SHN_LORESERVE && type <= SHN_HIRESERVE) - return "RSV"; else if (type >= SHN_LOOS && type <= SHN_HIOS) return "OS "; + else if (type >= SHN_LORESERVE && type <= SHN_HIRESERVE) + return "RSV"; else { static char buff [32]; @@ -4822,7 +5275,7 @@ get_dynamic_data (file, number) return i_data; } -/* Dump the symbol table */ +/* Dump the symbol table. */ static int process_symbol_table (file) FILE * file; @@ -4900,8 +5353,9 @@ process_symbol_table (file) printf (" %6s", get_symbol_type (ELF_ST_TYPE (psym->st_info))); printf (" %6s", get_symbol_binding (ELF_ST_BIND (psym->st_info))); printf (" %3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other))); - printf (" %3.3s", get_symbol_index_type (psym->st_shndx)); - printf (" %s\n", dynamic_strings + psym->st_name); + printf (" %3.3s ", get_symbol_index_type (psym->st_shndx)); + print_symbol (25, dynamic_strings + psym->st_name); + putchar ('\n'); } } } @@ -4931,8 +5385,7 @@ process_symbol_table (file) else printf (_(" Num: Value Size Type Bind Vis Ndx Name\n")); - symtab = GET_ELF_SYMBOLS (file, section->sh_offset, - section->sh_size / section->sh_entsize); + symtab = GET_ELF_SYMBOLS (file, section); if (symtab == NULL) continue; @@ -4942,10 +5395,11 @@ process_symbol_table (file) { Elf32_Internal_Shdr * string_sec; - string_sec = section_headers + section->sh_link; + string_sec = SECTION_HEADER (section->sh_link); - GET_DATA_ALLOC (string_sec->sh_offset, string_sec->sh_size, - strtab, char *, "string table"); + strtab = (char *) get_data (NULL, file, string_sec->sh_offset, + string_sec->sh_size, + _("string table")); } for (si = 0, psym = symtab; @@ -4959,8 +5413,8 @@ process_symbol_table (file) printf (" %-7s", get_symbol_type (ELF_ST_TYPE (psym->st_info))); printf (" %-6s", get_symbol_binding (ELF_ST_BIND (psym->st_info))); printf (" %-3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other))); - printf (" %4s", get_symbol_index_type (psym->st_shndx)); - printf (" %s", strtab + psym->st_name); + printf (" %4s ", get_symbol_index_type (psym->st_shndx)); + print_symbol (25, strtab + psym->st_name); if (section->sh_type == SHT_DYNSYM && version_info [DT_VERSIONTAGIDX (DT_VERSYM)] != 0) @@ -4974,14 +5428,13 @@ process_symbol_table (file) offset = version_info [DT_VERSIONTAGIDX (DT_VERSYM)] - loadaddr; - GET_DATA (offset + si * sizeof (vers_data), data, - "version data"); + get_data (&data, file, offset + si * sizeof (vers_data), + sizeof (data), _("version data")); vers_data = byte_get (data, 2); - is_nobits = psym->st_shndx < SHN_LORESERVE ? - (section_headers [psym->st_shndx].sh_type == SHT_NOBITS) - : 0; + is_nobits = (SECTION_HEADER (psym->st_shndx)->sh_type + == SHT_NOBITS); check_def = (psym->st_shndx != SHN_UNDEF); @@ -5002,7 +5455,8 @@ process_symbol_table (file) { unsigned long vna_off; - GET_DATA (offset, evn, "version need"); + get_data (&evn, file, offset, sizeof (evn), + _("version need")); ivn.vn_aux = BYTE_GET (evn.vn_aux); ivn.vn_next = BYTE_GET (evn.vn_next); @@ -5013,8 +5467,9 @@ process_symbol_table (file) { Elf_External_Vernaux evna; - GET_DATA (vna_off, evna, - "version need aux (3)"); + get_data (&evna, file, vna_off, + sizeof (evna), + _("version need aux (3)")); ivna.vna_other = BYTE_GET (evna.vna_other); ivna.vna_next = BYTE_GET (evna.vna_next); @@ -5062,7 +5517,8 @@ process_symbol_table (file) { Elf_External_Verdef evd; - GET_DATA (offset, evd, "version def"); + get_data (&evd, file, offset, sizeof (evd), + _("version def")); ivd.vd_ndx = BYTE_GET (evd.vd_ndx); ivd.vd_aux = BYTE_GET (evd.vd_aux); @@ -5076,7 +5532,8 @@ process_symbol_table (file) offset -= ivd.vd_next; offset += ivd.vd_aux; - GET_DATA (offset, evda, "version def aux"); + get_data (&evda, file, offset, sizeof (evda), + _("version def aux")); ivda.vda_name = BYTE_GET (evda.vda_name); @@ -5194,8 +5651,9 @@ process_syminfo (file) { unsigned short int flags = dynamic_syminfo[i].si_flags; - printf ("%4d: %-30s ", i, - dynamic_strings + dynamic_symbols[i].st_name); + printf ("%4d: ", i); + print_symbol (30, dynamic_strings + dynamic_symbols[i].st_name); + putchar (' '); switch (dynamic_syminfo[i].si_boundto) { @@ -5208,9 +5666,12 @@ process_syminfo (file) default: if (dynamic_syminfo[i].si_boundto > 0 && dynamic_syminfo[i].si_boundto < dynamic_size) - printf ("%-10s ", - dynamic_strings - + dynamic_segment[dynamic_syminfo[i].si_boundto].d_un.d_val); + { + print_symbol (10, dynamic_strings + + dynamic_segment + [dynamic_syminfo[i].si_boundto].d_un.d_val); + putchar (' ' ); + } else printf ("%-10d ", dynamic_syminfo[i].si_boundto); break; @@ -5269,8 +5730,10 @@ dump_section (section, file) addr = section->sh_addr; - GET_DATA_ALLOC (section->sh_offset, bytes, start, unsigned char *, - "section data"); + start = (unsigned char *) get_data (NULL, file, section->sh_offset, bytes, + _("section data")); + if (!start) + return 0; data = start; @@ -5417,7 +5880,7 @@ process_extended_line_op (data, is_stmt, pointer_size) if (len == 0) { - warn (_("badly formed extended line op encountered!")); + warn (_("badly formed extended line op encountered!\n")); return bytes_read; } @@ -5607,7 +6070,19 @@ display_debug_lines (section, start, file) op_code = * data ++; - switch (op_code) + if (op_code >= info.li_opcode_base) + { + op_code -= info.li_opcode_base; + adv = (op_code / info.li_line_range) * info.li_min_insn_length; + state_machine_regs.address += adv; + printf (_(" Special opcode %d: advance Address by %d to 0x%lx"), + op_code, adv, state_machine_regs.address); + adv = (op_code % info.li_line_range) + info.li_line_base; + state_machine_regs.line += adv; + printf (_(" and Line by %d to %d\n"), + adv, state_machine_regs.line); + } + else switch (op_code) { case DW_LNS_extended_op: data += process_extended_line_op (data, info.li_default_is_stmt, @@ -5677,20 +6152,36 @@ display_debug_lines (section, start, file) adv, state_machine_regs.address); break; + case DW_LNS_set_prologue_end: + printf (_(" Set prologue_end to true\n")); + break; + + case DW_LNS_set_epilogue_begin: + printf (_(" Set epilogue_begin to true\n")); + break; + + case DW_LNS_set_isa: + adv = read_leb128 (data, & bytes_read, 0); + data += bytes_read; + printf (_(" Set ISA to %d\n"), adv); + break; + default: - op_code -= info.li_opcode_base; - adv = (op_code / info.li_line_range) * info.li_min_insn_length; - state_machine_regs.address += adv; - printf (_(" Special opcode %d: advance Address by %d to 0x%lx"), - op_code, adv, state_machine_regs.address); - adv = (op_code % info.li_line_range) + info.li_line_base; - state_machine_regs.line += adv; - printf (_(" and Line by %d to %d\n"), - adv, state_machine_regs.line); + printf (_(" Unknown opcode %d with operands: "), op_code); + { + int i; + for (i = standard_opcodes[op_code - 1]; i > 0 ; --i) + { + printf ("0x%lx%s", read_leb128 (data, &bytes_read, 0), + i == 1 ? "" : ", "); + data += bytes_read; + } + putchar ('\n'); + } break; } } - printf ("\n"); + putchar ('\n'); } return 1; @@ -5779,58 +6270,67 @@ get_TAG_name (tag) { switch (tag) { - case DW_TAG_padding: return "DW_TAG_padding"; - case DW_TAG_array_type: return "DW_TAG_array_type"; - case DW_TAG_class_type: return "DW_TAG_class_type"; - case DW_TAG_entry_point: return "DW_TAG_entry_point"; - case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type"; - case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter"; - case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration"; - case DW_TAG_label: return "DW_TAG_label"; - case DW_TAG_lexical_block: return "DW_TAG_lexical_block"; - case DW_TAG_member: return "DW_TAG_member"; - case DW_TAG_pointer_type: return "DW_TAG_pointer_type"; - case DW_TAG_reference_type: return "DW_TAG_reference_type"; - case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; - case DW_TAG_string_type: return "DW_TAG_string_type"; - case DW_TAG_structure_type: return "DW_TAG_structure_type"; - case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type"; - case DW_TAG_typedef: return "DW_TAG_typedef"; - case DW_TAG_union_type: return "DW_TAG_union_type"; + case DW_TAG_padding: return "DW_TAG_padding"; + case DW_TAG_array_type: return "DW_TAG_array_type"; + case DW_TAG_class_type: return "DW_TAG_class_type"; + case DW_TAG_entry_point: return "DW_TAG_entry_point"; + case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type"; + case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter"; + case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration"; + case DW_TAG_label: return "DW_TAG_label"; + case DW_TAG_lexical_block: return "DW_TAG_lexical_block"; + case DW_TAG_member: return "DW_TAG_member"; + case DW_TAG_pointer_type: return "DW_TAG_pointer_type"; + case DW_TAG_reference_type: return "DW_TAG_reference_type"; + case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; + case DW_TAG_string_type: return "DW_TAG_string_type"; + case DW_TAG_structure_type: return "DW_TAG_structure_type"; + case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type"; + case DW_TAG_typedef: return "DW_TAG_typedef"; + case DW_TAG_union_type: return "DW_TAG_union_type"; case DW_TAG_unspecified_parameters: return "DW_TAG_unspecified_parameters"; - case DW_TAG_variant: return "DW_TAG_variant"; - case DW_TAG_common_block: return "DW_TAG_common_block"; - case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion"; - case DW_TAG_inheritance: return "DW_TAG_inheritance"; - case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine"; - case DW_TAG_module: return "DW_TAG_module"; - case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type"; - case DW_TAG_set_type: return "DW_TAG_set_type"; - case DW_TAG_subrange_type: return "DW_TAG_subrange_type"; - case DW_TAG_with_stmt: return "DW_TAG_with_stmt"; - case DW_TAG_access_declaration: return "DW_TAG_access_declaration"; - case DW_TAG_base_type: return "DW_TAG_base_type"; - case DW_TAG_catch_block: return "DW_TAG_catch_block"; - case DW_TAG_const_type: return "DW_TAG_const_type"; - case DW_TAG_constant: return "DW_TAG_constant"; - case DW_TAG_enumerator: return "DW_TAG_enumerator"; - case DW_TAG_file_type: return "DW_TAG_file_type"; - case DW_TAG_friend: return "DW_TAG_friend"; - case DW_TAG_namelist: return "DW_TAG_namelist"; - case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; - case DW_TAG_packed_type: return "DW_TAG_packed_type"; - case DW_TAG_subprogram: return "DW_TAG_subprogram"; - case DW_TAG_template_type_param: return "DW_TAG_template_type_param"; - case DW_TAG_template_value_param: return "DW_TAG_template_value_param"; - case DW_TAG_thrown_type: return "DW_TAG_thrown_type"; - case DW_TAG_try_block: return "DW_TAG_try_block"; - case DW_TAG_variant_part: return "DW_TAG_variant_part"; - case DW_TAG_variable: return "DW_TAG_variable"; - case DW_TAG_volatile_type: return "DW_TAG_volatile_type"; - case DW_TAG_MIPS_loop: return "DW_TAG_MIPS_loop"; - case DW_TAG_format_label: return "DW_TAG_format_label"; - case DW_TAG_function_template: return "DW_TAG_function_template"; - case DW_TAG_class_template: return "DW_TAG_class_template"; + case DW_TAG_variant: return "DW_TAG_variant"; + case DW_TAG_common_block: return "DW_TAG_common_block"; + case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion"; + case DW_TAG_inheritance: return "DW_TAG_inheritance"; + case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine"; + case DW_TAG_module: return "DW_TAG_module"; + case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type"; + case DW_TAG_set_type: return "DW_TAG_set_type"; + case DW_TAG_subrange_type: return "DW_TAG_subrange_type"; + case DW_TAG_with_stmt: return "DW_TAG_with_stmt"; + case DW_TAG_access_declaration: return "DW_TAG_access_declaration"; + case DW_TAG_base_type: return "DW_TAG_base_type"; + case DW_TAG_catch_block: return "DW_TAG_catch_block"; + case DW_TAG_const_type: return "DW_TAG_const_type"; + case DW_TAG_constant: return "DW_TAG_constant"; + case DW_TAG_enumerator: return "DW_TAG_enumerator"; + case DW_TAG_file_type: return "DW_TAG_file_type"; + case DW_TAG_friend: return "DW_TAG_friend"; + case DW_TAG_namelist: return "DW_TAG_namelist"; + case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; + case DW_TAG_packed_type: return "DW_TAG_packed_type"; + case DW_TAG_subprogram: return "DW_TAG_subprogram"; + case DW_TAG_template_type_param: return "DW_TAG_template_type_param"; + case DW_TAG_template_value_param: return "DW_TAG_template_value_param"; + case DW_TAG_thrown_type: return "DW_TAG_thrown_type"; + case DW_TAG_try_block: return "DW_TAG_try_block"; + case DW_TAG_variant_part: return "DW_TAG_variant_part"; + case DW_TAG_variable: return "DW_TAG_variable"; + case DW_TAG_volatile_type: return "DW_TAG_volatile_type"; + case DW_TAG_MIPS_loop: return "DW_TAG_MIPS_loop"; + case DW_TAG_format_label: return "DW_TAG_format_label"; + case DW_TAG_function_template: return "DW_TAG_function_template"; + case DW_TAG_class_template: return "DW_TAG_class_template"; + /* DWARF 2.1 values. */ + case DW_TAG_dwarf_procedure: return "DW_TAG_dwarf_procedure"; + case DW_TAG_restrict_type: return "DW_TAG_restrict_type"; + case DW_TAG_interface_type: return "DW_TAG_interface_type"; + case DW_TAG_namespace: return "DW_TAG_namespace"; + case DW_TAG_imported_module: return "DW_TAG_imported_module"; + case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type"; + case DW_TAG_partial_unit: return "DW_TAG_partial_unit"; + case DW_TAG_imported_unit: return "DW_TAG_imported_unit"; default: { static char buffer [100]; @@ -5847,100 +6347,100 @@ get_AT_name (attribute) { switch (attribute) { - case DW_AT_sibling: return "DW_AT_sibling"; - case DW_AT_location: return "DW_AT_location"; - case DW_AT_name: return "DW_AT_name"; - case DW_AT_ordering: return "DW_AT_ordering"; - case DW_AT_subscr_data: return "DW_AT_subscr_data"; - case DW_AT_byte_size: return "DW_AT_byte_size"; - case DW_AT_bit_offset: return "DW_AT_bit_offset"; - case DW_AT_bit_size: return "DW_AT_bit_size"; - case DW_AT_element_list: return "DW_AT_element_list"; - case DW_AT_stmt_list: return "DW_AT_stmt_list"; - case DW_AT_low_pc: return "DW_AT_low_pc"; - case DW_AT_high_pc: return "DW_AT_high_pc"; - case DW_AT_language: return "DW_AT_language"; - case DW_AT_member: return "DW_AT_member"; - case DW_AT_discr: return "DW_AT_discr"; - case DW_AT_discr_value: return "DW_AT_discr_value"; - case DW_AT_visibility: return "DW_AT_visibility"; - case DW_AT_import: return "DW_AT_import"; - case DW_AT_string_length: return "DW_AT_string_length"; - case DW_AT_common_reference: return "DW_AT_common_reference"; - case DW_AT_comp_dir: return "DW_AT_comp_dir"; - case DW_AT_const_value: return "DW_AT_const_value"; - case DW_AT_containing_type: return "DW_AT_containing_type"; - case DW_AT_default_value: return "DW_AT_default_value"; - case DW_AT_inline: return "DW_AT_inline"; - case DW_AT_is_optional: return "DW_AT_is_optional"; - case DW_AT_lower_bound: return "DW_AT_lower_bound"; - case DW_AT_producer: return "DW_AT_producer"; - case DW_AT_prototyped: return "DW_AT_prototyped"; - case DW_AT_return_addr: return "DW_AT_return_addr"; - case DW_AT_start_scope: return "DW_AT_start_scope"; - case DW_AT_stride_size: return "DW_AT_stride_size"; - case DW_AT_upper_bound: return "DW_AT_upper_bound"; - case DW_AT_abstract_origin: return "DW_AT_abstract_origin"; - case DW_AT_accessibility: return "DW_AT_accessibility"; - case DW_AT_address_class: return "DW_AT_address_class"; - case DW_AT_artificial: return "DW_AT_artificial"; - case DW_AT_base_types: return "DW_AT_base_types"; - case DW_AT_calling_convention: return "DW_AT_calling_convention"; - case DW_AT_count: return "DW_AT_count"; + case DW_AT_sibling: return "DW_AT_sibling"; + case DW_AT_location: return "DW_AT_location"; + case DW_AT_name: return "DW_AT_name"; + case DW_AT_ordering: return "DW_AT_ordering"; + case DW_AT_subscr_data: return "DW_AT_subscr_data"; + case DW_AT_byte_size: return "DW_AT_byte_size"; + case DW_AT_bit_offset: return "DW_AT_bit_offset"; + case DW_AT_bit_size: return "DW_AT_bit_size"; + case DW_AT_element_list: return "DW_AT_element_list"; + case DW_AT_stmt_list: return "DW_AT_stmt_list"; + case DW_AT_low_pc: return "DW_AT_low_pc"; + case DW_AT_high_pc: return "DW_AT_high_pc"; + case DW_AT_language: return "DW_AT_language"; + case DW_AT_member: return "DW_AT_member"; + case DW_AT_discr: return "DW_AT_discr"; + case DW_AT_discr_value: return "DW_AT_discr_value"; + case DW_AT_visibility: return "DW_AT_visibility"; + case DW_AT_import: return "DW_AT_import"; + case DW_AT_string_length: return "DW_AT_string_length"; + case DW_AT_common_reference: return "DW_AT_common_reference"; + case DW_AT_comp_dir: return "DW_AT_comp_dir"; + case DW_AT_const_value: return "DW_AT_const_value"; + case DW_AT_containing_type: return "DW_AT_containing_type"; + case DW_AT_default_value: return "DW_AT_default_value"; + case DW_AT_inline: return "DW_AT_inline"; + case DW_AT_is_optional: return "DW_AT_is_optional"; + case DW_AT_lower_bound: return "DW_AT_lower_bound"; + case DW_AT_producer: return "DW_AT_producer"; + case DW_AT_prototyped: return "DW_AT_prototyped"; + case DW_AT_return_addr: return "DW_AT_return_addr"; + case DW_AT_start_scope: return "DW_AT_start_scope"; + case DW_AT_stride_size: return "DW_AT_stride_size"; + case DW_AT_upper_bound: return "DW_AT_upper_bound"; + case DW_AT_abstract_origin: return "DW_AT_abstract_origin"; + case DW_AT_accessibility: return "DW_AT_accessibility"; + case DW_AT_address_class: return "DW_AT_address_class"; + case DW_AT_artificial: return "DW_AT_artificial"; + case DW_AT_base_types: return "DW_AT_base_types"; + case DW_AT_calling_convention: return "DW_AT_calling_convention"; + case DW_AT_count: return "DW_AT_count"; case DW_AT_data_member_location: return "DW_AT_data_member_location"; - case DW_AT_decl_column: return "DW_AT_decl_column"; - case DW_AT_decl_file: return "DW_AT_decl_file"; - case DW_AT_decl_line: return "DW_AT_decl_line"; - case DW_AT_declaration: return "DW_AT_declaration"; - case DW_AT_discr_list: return "DW_AT_discr_list"; - case DW_AT_encoding: return "DW_AT_encoding"; - case DW_AT_external: return "DW_AT_external"; - case DW_AT_frame_base: return "DW_AT_frame_base"; - case DW_AT_friend: return "DW_AT_friend"; - case DW_AT_identifier_case: return "DW_AT_identifier_case"; - case DW_AT_macro_info: return "DW_AT_macro_info"; - case DW_AT_namelist_items: return "DW_AT_namelist_items"; - case DW_AT_priority: return "DW_AT_priority"; - case DW_AT_segment: return "DW_AT_segment"; - case DW_AT_specification: return "DW_AT_specification"; - case DW_AT_static_link: return "DW_AT_static_link"; - case DW_AT_type: return "DW_AT_type"; - case DW_AT_use_location: return "DW_AT_use_location"; - case DW_AT_variable_parameter: return "DW_AT_variable_parameter"; - case DW_AT_virtuality: return "DW_AT_virtuality"; + case DW_AT_decl_column: return "DW_AT_decl_column"; + case DW_AT_decl_file: return "DW_AT_decl_file"; + case DW_AT_decl_line: return "DW_AT_decl_line"; + case DW_AT_declaration: return "DW_AT_declaration"; + case DW_AT_discr_list: return "DW_AT_discr_list"; + case DW_AT_encoding: return "DW_AT_encoding"; + case DW_AT_external: return "DW_AT_external"; + case DW_AT_frame_base: return "DW_AT_frame_base"; + case DW_AT_friend: return "DW_AT_friend"; + case DW_AT_identifier_case: return "DW_AT_identifier_case"; + case DW_AT_macro_info: return "DW_AT_macro_info"; + case DW_AT_namelist_items: return "DW_AT_namelist_items"; + case DW_AT_priority: return "DW_AT_priority"; + case DW_AT_segment: return "DW_AT_segment"; + case DW_AT_specification: return "DW_AT_specification"; + case DW_AT_static_link: return "DW_AT_static_link"; + case DW_AT_type: return "DW_AT_type"; + case DW_AT_use_location: return "DW_AT_use_location"; + case DW_AT_variable_parameter: return "DW_AT_variable_parameter"; + case DW_AT_virtuality: return "DW_AT_virtuality"; case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location"; /* DWARF 2.1 values. */ - case DW_AT_allocated: return "DW_AT_allocated"; - case DW_AT_associated: return "DW_AT_associated"; - case DW_AT_data_location: return "DW_AT_data_location"; - case DW_AT_stride: return "DW_AT_stride"; - case DW_AT_entry_pc: return "DW_AT_entry_pc"; - case DW_AT_use_UTF8: return "DW_AT_use_UTF8"; - case DW_AT_extension: return "DW_AT_extension"; - case DW_AT_ranges: return "DW_AT_ranges"; - case DW_AT_trampoline: return "DW_AT_trampoline"; - case DW_AT_call_column: return "DW_AT_call_column"; - case DW_AT_call_file: return "DW_AT_call_file"; - case DW_AT_call_line: return "DW_AT_call_line"; + case DW_AT_allocated: return "DW_AT_allocated"; + case DW_AT_associated: return "DW_AT_associated"; + case DW_AT_data_location: return "DW_AT_data_location"; + case DW_AT_stride: return "DW_AT_stride"; + case DW_AT_entry_pc: return "DW_AT_entry_pc"; + case DW_AT_use_UTF8: return "DW_AT_use_UTF8"; + case DW_AT_extension: return "DW_AT_extension"; + case DW_AT_ranges: return "DW_AT_ranges"; + case DW_AT_trampoline: return "DW_AT_trampoline"; + case DW_AT_call_column: return "DW_AT_call_column"; + case DW_AT_call_file: return "DW_AT_call_file"; + case DW_AT_call_line: return "DW_AT_call_line"; /* SGI/MIPS extensions. */ - case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde"; - case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin"; + case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde"; + case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin"; case DW_AT_MIPS_tail_loop_begin: return "DW_AT_MIPS_tail_loop_begin"; - case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin"; + case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin"; case DW_AT_MIPS_loop_unroll_factor: return "DW_AT_MIPS_loop_unroll_factor"; case DW_AT_MIPS_software_pipeline_depth: return "DW_AT_MIPS_software_pipeline_depth"; - case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; - case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride"; - case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name"; - case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin"; - case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines"; + case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; + case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride"; + case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name"; + case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin"; + case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines"; /* GNU extensions. */ - case DW_AT_sf_names: return "DW_AT_sf_names"; - case DW_AT_src_info: return "DW_AT_src_info"; - case DW_AT_mac_info: return "DW_AT_mac_info"; - case DW_AT_src_coords: return "DW_AT_src_coords"; - case DW_AT_body_begin: return "DW_AT_body_begin"; - case DW_AT_body_end: return "DW_AT_body_end"; + case DW_AT_sf_names: return "DW_AT_sf_names"; + case DW_AT_src_info: return "DW_AT_src_info"; + case DW_AT_mac_info: return "DW_AT_mac_info"; + case DW_AT_src_coords: return "DW_AT_src_coords"; + case DW_AT_body_begin: return "DW_AT_body_begin"; + case DW_AT_body_end: return "DW_AT_body_end"; default: { static char buffer [100]; @@ -5957,27 +6457,27 @@ get_FORM_name (form) { switch (form) { - case DW_FORM_addr: return "DW_FORM_addr"; - case DW_FORM_block2: return "DW_FORM_block2"; - case DW_FORM_block4: return "DW_FORM_block4"; - case DW_FORM_data2: return "DW_FORM_data2"; - case DW_FORM_data4: return "DW_FORM_data4"; - case DW_FORM_data8: return "DW_FORM_data8"; - case DW_FORM_string: return "DW_FORM_string"; - case DW_FORM_block: return "DW_FORM_block"; - case DW_FORM_block1: return "DW_FORM_block1"; - case DW_FORM_data1: return "DW_FORM_data1"; - case DW_FORM_flag: return "DW_FORM_flag"; - case DW_FORM_sdata: return "DW_FORM_sdata"; - case DW_FORM_strp: return "DW_FORM_strp"; - case DW_FORM_udata: return "DW_FORM_udata"; - case DW_FORM_ref_addr: return "DW_FORM_ref_addr"; - case DW_FORM_ref1: return "DW_FORM_ref1"; - case DW_FORM_ref2: return "DW_FORM_ref2"; - case DW_FORM_ref4: return "DW_FORM_ref4"; - case DW_FORM_ref8: return "DW_FORM_ref8"; + case DW_FORM_addr: return "DW_FORM_addr"; + case DW_FORM_block2: return "DW_FORM_block2"; + case DW_FORM_block4: return "DW_FORM_block4"; + case DW_FORM_data2: return "DW_FORM_data2"; + case DW_FORM_data4: return "DW_FORM_data4"; + case DW_FORM_data8: return "DW_FORM_data8"; + case DW_FORM_string: return "DW_FORM_string"; + case DW_FORM_block: return "DW_FORM_block"; + case DW_FORM_block1: return "DW_FORM_block1"; + case DW_FORM_data1: return "DW_FORM_data1"; + case DW_FORM_flag: return "DW_FORM_flag"; + case DW_FORM_sdata: return "DW_FORM_sdata"; + case DW_FORM_strp: return "DW_FORM_strp"; + case DW_FORM_udata: return "DW_FORM_udata"; + case DW_FORM_ref_addr: return "DW_FORM_ref_addr"; + case DW_FORM_ref1: return "DW_FORM_ref1"; + case DW_FORM_ref2: return "DW_FORM_ref2"; + case DW_FORM_ref4: return "DW_FORM_ref4"; + case DW_FORM_ref8: return "DW_FORM_ref8"; case DW_FORM_ref_udata: return "DW_FORM_ref_udata"; - case DW_FORM_indirect: return "DW_FORM_indirect"; + case DW_FORM_indirect: return "DW_FORM_indirect"; default: { static char buffer [100]; @@ -6150,6 +6650,80 @@ process_abbrev_section (start, end) static int +display_debug_macinfo (section, start, file) + Elf32_Internal_Shdr * section; + unsigned char * start; + FILE * file ATTRIBUTE_UNUSED; +{ + unsigned char * end = start + section->sh_size; + unsigned char * curr = start; + unsigned int bytes_read; + enum dwarf_macinfo_record_type op; + + printf (_("Contents of the %s section:\n\n"), SECTION_NAME (section)); + + while (curr < end) + { + unsigned int lineno; + const char * string; + + op = * curr; + curr ++; + + switch (op) + { + case DW_MACINFO_start_file: + { + unsigned int filenum; + + lineno = read_leb128 (curr, & bytes_read, 0); + curr += bytes_read; + filenum = read_leb128 (curr, & bytes_read, 0); + curr += bytes_read; + + printf (_(" DW_MACINFO_start_file - lineno: %d filenum: %d\n"), lineno, filenum); + } + break; + + case DW_MACINFO_end_file: + printf (_(" DW_MACINFO_end_file\n")); + break; + + case DW_MACINFO_define: + lineno = read_leb128 (curr, & bytes_read, 0); + curr += bytes_read; + string = curr; + curr += strlen (string) + 1; + printf (_(" DW_MACINFO_define - lineno : %d macro : %s\n"), lineno, string); + break; + + case DW_MACINFO_undef: + lineno = read_leb128 (curr, & bytes_read, 0); + curr += bytes_read; + string = curr; + curr += strlen (string) + 1; + printf (_(" DW_MACINFO_undef - lineno : %d macro : %s\n"), lineno, string); + break; + + case DW_MACINFO_vendor_ext: + { + unsigned int constant; + + constant = read_leb128 (curr, & bytes_read, 0); + curr += bytes_read; + string = curr; + curr += strlen (string) + 1; + printf (_(" DW_MACINFO_vendor_ext - constant : %d string : %s\n"), constant, string); + } + break; + } + } + + return 1; +} + + +static int display_debug_abbrev (section, start, file) Elf32_Internal_Shdr * section; unsigned char * start; @@ -6164,6 +6738,9 @@ display_debug_abbrev (section, start, file) { start = process_abbrev_section (start, end); + if (first_abbrev == NULL) + continue; + printf (_(" Number TAG\n")); for (entry = first_abbrev; entry; entry = entry->next) @@ -6182,6 +6759,8 @@ display_debug_abbrev (section, start, file) get_FORM_name (attr->form)); } } + + free_abbrevs (); } while (start); @@ -6525,12 +7104,132 @@ decode_location_expression (data, pointer_size, length) /* No way to tell where the next op is, so just bail. */ return; } + + /* Separate the ops. */ + printf ("; "); + } +} + + +static const char * debug_str_contents; +static bfd_vma debug_str_size; + +static void +load_debug_str (file) + FILE * file; +{ + Elf32_Internal_Shdr * sec; + unsigned int i; + + /* If it is already loaded, do nothing. */ + if (debug_str_contents != NULL) + return; + + /* Locate the .debug_str section. */ + for (i = 0, sec = section_headers; + i < elf_header.e_shnum; + i ++, sec ++) + if (strcmp (SECTION_NAME (sec), ".debug_str") == 0) + break; + + if (i == elf_header.e_shnum || sec->sh_size == 0) + return; + + debug_str_size = sec->sh_size; + + debug_str_contents = ((char *) + get_data (NULL, file, sec->sh_offset, sec->sh_size, + _("debug_str section data"))); +} + +static void +free_debug_str () +{ + if (debug_str_contents == NULL) + return; + + free ((char *) debug_str_contents); + debug_str_contents = NULL; + debug_str_size = 0; +} + +static const char * +fetch_indirect_string (offset) + unsigned long offset; +{ + if (debug_str_contents == NULL) + return _(""); + + if (offset > debug_str_size) + return _(""); + + return debug_str_contents + offset; +} + + +static int +display_debug_str (section, start, file) + Elf32_Internal_Shdr * section; + unsigned char * start; + FILE * file ATTRIBUTE_UNUSED; +{ + unsigned long bytes; + bfd_vma addr; + + addr = section->sh_addr; + bytes = section->sh_size; + + if (bytes == 0) + { + printf (_("\nThe .debug_str section is empty.\n")); + return 0; + } + + printf (_("Contents of the .debug_str section:\n\n")); + + while (bytes) + { + int j; + int k; + int lbytes; + + lbytes = (bytes > 16 ? 16 : bytes); + + printf (" 0x%8.8lx ", (unsigned long) addr); + + for (j = 0; j < 16; j++) + { + if (j < lbytes) + printf ("%2.2x", start [j]); + else + printf (" "); + + if ((j & 3) == 3) + printf (" "); + } + + for (j = 0; j < lbytes; j++) + { + k = start [j]; + if (k >= ' ' && k < 0x80) + printf ("%c", k); + else + printf ("."); + } + + putchar ('\n'); + + start += lbytes; + addr += lbytes; + bytes -= lbytes; } + + return 1; } static unsigned char * -read_and_display_attr (attribute, form, data, cu_offset, pointer_size) +read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) unsigned long attribute; unsigned long form; unsigned char * data; @@ -6541,8 +7240,6 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) unsigned char * block_start = NULL; int bytes_read; - printf (" %-18s:", get_AT_name (attribute)); - switch (form) { default: @@ -6554,6 +7251,11 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) data += pointer_size; break; + case DW_FORM_strp: + uvalue = byte_get (data, /* offset_size */ 4); + data += /* offset_size */ 4; + break; + case DW_FORM_ref1: case DW_FORM_flag: case DW_FORM_data1: @@ -6582,6 +7284,13 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) uvalue = read_leb128 (data, & bytes_read, 0); data += bytes_read; break; + + case DW_FORM_indirect: + form = read_leb128 (data, & bytes_read, 0); + data += bytes_read; + printf (" %s", get_FORM_name (form)); + return read_and_display_attr_value (attribute, form, data, cu_offset, + pointer_size); } switch (form) @@ -6647,12 +7356,16 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) break; case DW_FORM_strp: + printf (_(" (indirect string, offset: 0x%lx): "), uvalue); + printf (fetch_indirect_string (uvalue)); + break; + case DW_FORM_indirect: - warn (_("Unable to handle FORM: %d"), form); + /* Handled above. */ break; default: - warn (_("Unrecognised form: %d"), form); + warn (_("Unrecognised form: %d\n"), form); break; } @@ -6686,6 +7399,11 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) case DW_LANG_Ada83: printf ("(Ada)"); break; case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; + /* DWARF 2.1 values. */ + case DW_LANG_C99: printf ("(ANSI C99)"); break; + case DW_LANG_Ada95: printf ("(ADA 95)"); break; + case DW_LANG_Fortran95: printf ("(Fortran 95)"); break; + /* MIPS extension. */ case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break; default: printf ("(Unknown: %lx)", uvalue); break; } @@ -6703,6 +7421,8 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) case DW_ATE_signed_char: printf ("(signed char)"); break; case DW_ATE_unsigned: printf ("(unsigned)"); break; case DW_ATE_unsigned_char: printf ("(unsigned char)"); break; + /* DWARF 2.1 value. */ + case DW_ATE_imaginary_float: printf ("(imaginary float)"); break; default: if (uvalue >= DW_ATE_lo_user && uvalue <= DW_ATE_hi_user) @@ -6800,6 +7520,20 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size) break; } + return data; +} + +static unsigned char * +read_and_display_attr (attribute, form, data, cu_offset, pointer_size) + unsigned long attribute; + unsigned long form; + unsigned char * data; + unsigned long cu_offset; + unsigned long pointer_size; +{ + printf (" %-18s:", get_AT_name (attribute)); + data = read_and_display_attr_value (attribute, form, data, cu_offset, + pointer_size); printf ("\n"); return data; } @@ -6815,12 +7549,15 @@ display_debug_info (section, start, file) printf (_("The section %s contains:\n\n"), SECTION_NAME (section)); + load_debug_str (file); + while (start < end) { DWARF2_External_CompUnit * external; DWARF2_Internal_CompUnit compunit; + Elf32_Internal_Shdr * relsec; unsigned char * tags; - int i; + unsigned int i; int level; unsigned long cu_offset; @@ -6837,6 +7574,67 @@ display_debug_info (section, start, file) break; } + /* Check for RELA relocations in the abbrev_offset address, and + apply them. */ + for (relsec = section_headers; + relsec < section_headers + elf_header.e_shnum; + ++relsec) + { + unsigned long nrelas; + Elf_Internal_Rela *rela, *rp; + Elf32_Internal_Shdr *symsec; + Elf_Internal_Sym *symtab; + Elf_Internal_Sym *sym; + + if (relsec->sh_type != SHT_RELA + || SECTION_HEADER (relsec->sh_info) != section) + continue; + + if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size, + & rela, & nrelas)) + return 0; + + symsec = SECTION_HEADER (relsec->sh_link); + symtab = GET_ELF_SYMBOLS (file, symsec); + + for (rp = rela; rp < rela + nrelas; ++rp) + { + if (rp->r_offset + != (bfd_vma) ((unsigned char *) &external->cu_abbrev_offset + - section_begin)) + continue; + + if (is_32bit_elf) + { + sym = symtab + ELF32_R_SYM (rp->r_info); + + if (ELF32_ST_TYPE (sym->st_info) != STT_SECTION) + { + warn (_("Skipping unexpected symbol type %u\n"), + ELF32_ST_TYPE (sym->st_info)); + continue; + } + } + else + { + sym = symtab + ELF64_R_SYM (rp->r_info); + + if (ELF64_ST_TYPE (sym->st_info) != STT_SECTION) + { + warn (_("Skipping unexpected symbol type %u\n"), + ELF64_ST_TYPE (sym->st_info)); + continue; + } + } + + compunit.cu_abbrev_offset += rp->r_addend; + break; + } + + free (rela); + break; + } + tags = start + sizeof (* external); cu_offset = start - section_begin; start += compunit.cu_length + sizeof (external->cu_length); @@ -6853,8 +7651,7 @@ display_debug_info (section, start, file) continue; } - if (first_abbrev != NULL) - free_abbrevs (); + free_abbrevs (); /* Read in the abbrevs used by this compilation unit. */ @@ -6869,14 +7666,17 @@ display_debug_info (section, start, file) if (strcmp (SECTION_NAME (sec), ".debug_abbrev") == 0) break; - if (i == -1 || sec->sh_size == 0) + if (i == elf_header.e_shnum || sec->sh_size == 0) { warn (_("Unable to locate .debug_abbrev section!\n")); return 0; } - GET_DATA_ALLOC (sec->sh_offset, sec->sh_size, begin, unsigned char *, - "debug_abbrev section data"); + begin = ((unsigned char *) + get_data (NULL, file, sec->sh_offset, sec->sh_size, + _("debug_abbrev section data"))); + if (!begin) + return 0; process_abbrev_section (begin + compunit.cu_abbrev_offset, begin + sec->sh_size); @@ -6916,8 +7716,9 @@ display_debug_info (section, start, file) return 0; } - printf (_(" <%d><%x>: Abbrev Number: %lu (%s)\n"), - level, tags - section_begin - bytes_read, + printf (_(" <%d><%lx>: Abbrev Number: %lu (%s)\n"), + level, + (unsigned long) (tags - section_begin - bytes_read), abbrev_number, get_TAG_name (entry->tag)); @@ -6932,6 +7733,8 @@ display_debug_info (section, start, file) } } + free_debug_str (); + printf ("\n"); return 1; @@ -7040,6 +7843,10 @@ Frame_Chunk; in the frame info. */ #define DW_CFA_unreferenced (-1) +static void frame_need_space PARAMS ((Frame_Chunk *, int)); +static void frame_display_row PARAMS ((Frame_Chunk *, int *, int *)); +static int size_of_encoded_value PARAMS ((int)); + static void frame_need_space (fc, reg) Frame_Chunk * fc; @@ -7344,10 +8151,10 @@ display_debug_frames (section, start, file) start += augmentation_data_len; } - printf ("\n%08lx %08lx %08lx FDE cie=%08x pc=%08lx..%08lx\n", + printf ("\n%08lx %08lx %08lx FDE cie=%08lx pc=%08lx..%08lx\n", (unsigned long)(saved_start - section_start), length, cie_id, - cie->chunk_start - section_start, fc->pc_begin, - fc->pc_begin + fc->pc_range); + (unsigned long)(cie->chunk_start - section_start), + fc->pc_begin, fc->pc_begin + fc->pc_range); if (! do_debug_frames_interp && augmentation_data_len) { unsigned long i; @@ -7723,22 +8530,24 @@ prescan_debug_info (section, start, file) sections. */ struct { - char * name; + const char * const name; int (* display) PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); int (* prescan) PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); } debug_displays[] = { - { ".debug_info", display_debug_info, prescan_debug_info }, { ".debug_abbrev", display_debug_abbrev, NULL }, - { ".debug_line", display_debug_lines, NULL }, { ".debug_aranges", display_debug_aranges, NULL }, - { ".debug_pubnames", display_debug_pubnames, NULL }, { ".debug_frame", display_debug_frames, NULL }, + { ".debug_info", display_debug_info, prescan_debug_info }, + { ".debug_line", display_debug_lines, NULL }, + { ".debug_pubnames", display_debug_pubnames, NULL }, { ".eh_frame", display_debug_frames, NULL }, - { ".debug_macinfo", display_debug_not_supported, NULL }, + { ".debug_macinfo", display_debug_macinfo, NULL }, + { ".debug_str", display_debug_str, NULL }, + { ".debug_pubtypes", display_debug_not_supported, NULL }, - { ".debug_str", display_debug_not_supported, NULL }, + { ".debug_ranges", display_debug_not_supported, NULL }, { ".debug_static_func", display_debug_not_supported, NULL }, { ".debug_static_vars", display_debug_not_supported, NULL }, { ".debug_types", display_debug_not_supported, NULL }, @@ -7762,8 +8571,10 @@ display_debug_section (section, file) return 0; } - GET_DATA_ALLOC (section->sh_offset, length, start, unsigned char *, - "debug section data"); + start = (unsigned char *) get_data (NULL, file, section->sh_offset, length, + _("debug section data")); + if (!start) + return 0; /* See if we know how to display the contents of this section. */ if (strncmp (name, ".gnu.linkonce.wi.", 17) == 0) @@ -7783,8 +8594,7 @@ display_debug_section (section, file) /* If we loaded in the abbrev section at some point, we must release it here. */ - if (first_abbrev != NULL) - free_abbrevs (); + free_abbrevs (); return 1; } @@ -7822,8 +8632,11 @@ process_section_contents (file) unsigned char * start; length = section->sh_size; - GET_DATA_ALLOC (section->sh_offset, length, start, unsigned char *, - "debug section data"); + start = ((unsigned char *) + get_data (NULL, file, section->sh_offset, length, + _("debug section data"))); + if (!start) + return 0; debug_displays[j].prescan (section, start, file); free (start); @@ -7919,73 +8732,78 @@ process_mips_specific (file) Elf32_External_Lib * elib; size_t cnt; - GET_DATA_ALLOC (liblist_offset, liblistno * sizeof (Elf32_External_Lib), - elib, Elf32_External_Lib *, "liblist"); - - printf ("\nSection '.liblist' contains %lu entries:\n", - (unsigned long) liblistno); - fputs (" Library Time Stamp Checksum Version Flags\n", - stdout); - - for (cnt = 0; cnt < liblistno; ++cnt) + elib = ((Elf32_External_Lib *) + get_data (NULL, file, liblist_offset, + liblistno * sizeof (Elf32_External_Lib), + _("liblist"))); + if (elib) { - Elf32_Lib liblist; - time_t time; - char timebuf[20]; - struct tm * tmp; - - liblist.l_name = BYTE_GET (elib[cnt].l_name); - time = BYTE_GET (elib[cnt].l_time_stamp); - liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum); - liblist.l_version = BYTE_GET (elib[cnt].l_version); - liblist.l_flags = BYTE_GET (elib[cnt].l_flags); + printf ("\nSection '.liblist' contains %lu entries:\n", + (unsigned long) liblistno); + fputs (" Library Time Stamp Checksum Version Flags\n", + stdout); - tmp = gmtime (&time); - sprintf (timebuf, "%04u-%02u-%02uT%02u:%02u:%02u", - tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); - - printf ("%3lu: %-20s %s %#10lx %-7ld", (unsigned long) cnt, - dynamic_strings + liblist.l_name, timebuf, - liblist.l_checksum, liblist.l_version); - - if (liblist.l_flags == 0) - puts (" NONE"); - else + for (cnt = 0; cnt < liblistno; ++cnt) { - static const struct - { - const char * name; - int bit; - } - l_flags_vals[] = - { - { " EXACT_MATCH", LL_EXACT_MATCH }, - { " IGNORE_INT_VER", LL_IGNORE_INT_VER }, - { " REQUIRE_MINOR", LL_REQUIRE_MINOR }, - { " EXPORTS", LL_EXPORTS }, - { " DELAY_LOAD", LL_DELAY_LOAD }, - { " DELTA", LL_DELTA } - }; - int flags = liblist.l_flags; - size_t fcnt; - - for (fcnt = 0; - fcnt < sizeof (l_flags_vals) / sizeof (l_flags_vals[0]); - ++fcnt) - if ((flags & l_flags_vals[fcnt].bit) != 0) + Elf32_Lib liblist; + time_t time; + char timebuf[20]; + struct tm * tmp; + + liblist.l_name = BYTE_GET (elib[cnt].l_name); + time = BYTE_GET (elib[cnt].l_time_stamp); + liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum); + liblist.l_version = BYTE_GET (elib[cnt].l_version); + liblist.l_flags = BYTE_GET (elib[cnt].l_flags); + + tmp = gmtime (&time); + sprintf (timebuf, "%04u-%02u-%02uT%02u:%02u:%02u", + tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + + printf ("%3lu: ", (unsigned long) cnt); + print_symbol (20, dynamic_strings + liblist.l_name); + printf (" %s %#10lx %-7ld", timebuf, liblist.l_checksum, + liblist.l_version); + + if (liblist.l_flags == 0) + puts (" NONE"); + else + { + static const struct { - fputs (l_flags_vals[fcnt].name, stdout); - flags ^= l_flags_vals[fcnt].bit; + const char * name; + int bit; } - if (flags != 0) - printf (" %#x", (unsigned int) flags); + l_flags_vals[] = + { + { " EXACT_MATCH", LL_EXACT_MATCH }, + { " IGNORE_INT_VER", LL_IGNORE_INT_VER }, + { " REQUIRE_MINOR", LL_REQUIRE_MINOR }, + { " EXPORTS", LL_EXPORTS }, + { " DELAY_LOAD", LL_DELAY_LOAD }, + { " DELTA", LL_DELTA } + }; + int flags = liblist.l_flags; + size_t fcnt; + + for (fcnt = 0; + fcnt < sizeof (l_flags_vals) / sizeof (l_flags_vals[0]); + ++fcnt) + if ((flags & l_flags_vals[fcnt].bit) != 0) + { + fputs (l_flags_vals[fcnt].name, stdout); + flags ^= l_flags_vals[fcnt].bit; + } + if (flags != 0) + printf (" %#x", (unsigned int) flags); - puts (""); + puts (""); + } } - } - free (elib); + free (elib); + } } if (options_offset != 0) @@ -8001,194 +8819,194 @@ process_mips_specific (file) while (sect->sh_type != SHT_MIPS_OPTIONS) ++ sect; - GET_DATA_ALLOC (options_offset, sect->sh_size, eopt, - Elf_External_Options *, "options"); - - iopt = (Elf_Internal_Options *) malloc ((sect->sh_size / sizeof (eopt)) - * sizeof (* iopt)); - if (iopt == NULL) + eopt = (Elf_External_Options *) get_data (NULL, file, options_offset, + sect->sh_size, _("options")); + if (eopt) { - error (_("Out of memory")); - return 0; - } - - offset = cnt = 0; - option = iopt; + iopt = ((Elf_Internal_Options *) + malloc ((sect->sh_size / sizeof (eopt)) * sizeof (* iopt))); + if (iopt == NULL) + { + error (_("Out of memory")); + return 0; + } - while (offset < sect->sh_size) - { - Elf_External_Options * eoption; + offset = cnt = 0; + option = iopt; - eoption = (Elf_External_Options *) ((char *) eopt + offset); + while (offset < sect->sh_size) + { + Elf_External_Options * eoption; - option->kind = BYTE_GET (eoption->kind); - option->size = BYTE_GET (eoption->size); - option->section = BYTE_GET (eoption->section); - option->info = BYTE_GET (eoption->info); + eoption = (Elf_External_Options *) ((char *) eopt + offset); - offset += option->size; + option->kind = BYTE_GET (eoption->kind); + option->size = BYTE_GET (eoption->size); + option->section = BYTE_GET (eoption->section); + option->info = BYTE_GET (eoption->info); - ++option; - ++cnt; - } + offset += option->size; - printf (_("\nSection '%s' contains %d entries:\n"), - SECTION_NAME (sect), cnt); + ++option; + ++cnt; + } - option = iopt; + printf (_("\nSection '%s' contains %d entries:\n"), + SECTION_NAME (sect), cnt); - while (cnt-- > 0) - { - size_t len; + option = iopt; - switch (option->kind) + while (cnt-- > 0) { - case ODK_NULL: - /* This shouldn't happen. */ - printf (" NULL %d %lx", option->section, option->info); - break; - case ODK_REGINFO: - printf (" REGINFO "); - if (elf_header.e_machine == EM_MIPS) - { - /* 32bit form. */ - Elf32_External_RegInfo * ereg; - Elf32_RegInfo reginfo; - - ereg = (Elf32_External_RegInfo *) (option + 1); - reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); - reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); - reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); - reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); - reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); - reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value); - - printf ("GPR %08lx GP 0x%lx\n", - reginfo.ri_gprmask, - (unsigned long) reginfo.ri_gp_value); - printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n", - reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], - reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); - } - else + size_t len; + + switch (option->kind) { - /* 64 bit form. */ - Elf64_External_RegInfo * ereg; - Elf64_Internal_RegInfo reginfo; - - ereg = (Elf64_External_RegInfo *) (option + 1); - reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); - reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); - reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); - reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); - reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); - reginfo.ri_gp_value = BYTE_GET8 (ereg->ri_gp_value); - - printf ("GPR %08lx GP 0x", - reginfo.ri_gprmask); - printf_vma (reginfo.ri_gp_value); - printf ("\n"); - - printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n", - reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], - reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); + case ODK_NULL: + /* This shouldn't happen. */ + printf (" NULL %d %lx", option->section, option->info); + break; + case ODK_REGINFO: + printf (" REGINFO "); + if (elf_header.e_machine == EM_MIPS) + { + /* 32bit form. */ + Elf32_External_RegInfo * ereg; + Elf32_RegInfo reginfo; + + ereg = (Elf32_External_RegInfo *) (option + 1); + reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); + reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); + reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); + reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); + reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); + reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value); + + printf ("GPR %08lx GP 0x%lx\n", + reginfo.ri_gprmask, + (unsigned long) reginfo.ri_gp_value); + printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n", + reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], + reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); + } + else + { + /* 64 bit form. */ + Elf64_External_RegInfo * ereg; + Elf64_Internal_RegInfo reginfo; + + ereg = (Elf64_External_RegInfo *) (option + 1); + reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); + reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); + reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); + reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); + reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); + reginfo.ri_gp_value = BYTE_GET8 (ereg->ri_gp_value); + + printf ("GPR %08lx GP 0x", + reginfo.ri_gprmask); + printf_vma (reginfo.ri_gp_value); + printf ("\n"); + + printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n", + reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], + reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); + } + ++option; + continue; + case ODK_EXCEPTIONS: + fputs (" EXCEPTIONS fpe_min(", stdout); + process_mips_fpe_exception (option->info & OEX_FPU_MIN); + fputs (") fpe_max(", stdout); + process_mips_fpe_exception ((option->info & OEX_FPU_MAX) >> 8); + fputs (")", stdout); + + if (option->info & OEX_PAGE0) + fputs (" PAGE0", stdout); + if (option->info & OEX_SMM) + fputs (" SMM", stdout); + if (option->info & OEX_FPDBUG) + fputs (" FPDBUG", stdout); + if (option->info & OEX_DISMISS) + fputs (" DISMISS", stdout); + break; + case ODK_PAD: + fputs (" PAD ", stdout); + if (option->info & OPAD_PREFIX) + fputs (" PREFIX", stdout); + if (option->info & OPAD_POSTFIX) + fputs (" POSTFIX", stdout); + if (option->info & OPAD_SYMBOL) + fputs (" SYMBOL", stdout); + break; + case ODK_HWPATCH: + fputs (" HWPATCH ", stdout); + if (option->info & OHW_R4KEOP) + fputs (" R4KEOP", stdout); + if (option->info & OHW_R8KPFETCH) + fputs (" R8KPFETCH", stdout); + if (option->info & OHW_R5KEOP) + fputs (" R5KEOP", stdout); + if (option->info & OHW_R5KCVTL) + fputs (" R5KCVTL", stdout); + break; + case ODK_FILL: + fputs (" FILL ", stdout); + /* XXX Print content of info word? */ + break; + case ODK_TAGS: + fputs (" TAGS ", stdout); + /* XXX Print content of info word? */ + break; + case ODK_HWAND: + fputs (" HWAND ", stdout); + if (option->info & OHWA0_R4KEOP_CHECKED) + fputs (" R4KEOP_CHECKED", stdout); + if (option->info & OHWA0_R4KEOP_CLEAN) + fputs (" R4KEOP_CLEAN", stdout); + break; + case ODK_HWOR: + fputs (" HWOR ", stdout); + if (option->info & OHWA0_R4KEOP_CHECKED) + fputs (" R4KEOP_CHECKED", stdout); + if (option->info & OHWA0_R4KEOP_CLEAN) + fputs (" R4KEOP_CLEAN", stdout); + break; + case ODK_GP_GROUP: + printf (" GP_GROUP %#06lx self-contained %#06lx", + option->info & OGP_GROUP, + (option->info & OGP_SELF) >> 16); + break; + case ODK_IDENT: + printf (" IDENT %#06lx self-contained %#06lx", + option->info & OGP_GROUP, + (option->info & OGP_SELF) >> 16); + break; + default: + /* This shouldn't happen. */ + printf (" %3d ??? %d %lx", + option->kind, option->section, option->info); + break; } + + len = sizeof (* eopt); + while (len < option->size) + if (((char *) option)[len] >= ' ' + && ((char *) option)[len] < 0x7f) + printf ("%c", ((char *) option)[len++]); + else + printf ("\\%03o", ((char *) option)[len++]); + + fputs ("\n", stdout); ++option; - continue; - case ODK_EXCEPTIONS: - fputs (" EXCEPTIONS fpe_min(", stdout); - process_mips_fpe_exception (option->info & OEX_FPU_MIN); - fputs (") fpe_max(", stdout); - process_mips_fpe_exception ((option->info & OEX_FPU_MAX) >> 8); - fputs (")", stdout); - - if (option->info & OEX_PAGE0) - fputs (" PAGE0", stdout); - if (option->info & OEX_SMM) - fputs (" SMM", stdout); - if (option->info & OEX_FPDBUG) - fputs (" FPDBUG", stdout); - if (option->info & OEX_DISMISS) - fputs (" DISMISS", stdout); - break; - case ODK_PAD: - fputs (" PAD ", stdout); - if (option->info & OPAD_PREFIX) - fputs (" PREFIX", stdout); - if (option->info & OPAD_POSTFIX) - fputs (" POSTFIX", stdout); - if (option->info & OPAD_SYMBOL) - fputs (" SYMBOL", stdout); - break; - case ODK_HWPATCH: - fputs (" HWPATCH ", stdout); - if (option->info & OHW_R4KEOP) - fputs (" R4KEOP", stdout); - if (option->info & OHW_R8KPFETCH) - fputs (" R8KPFETCH", stdout); - if (option->info & OHW_R5KEOP) - fputs (" R5KEOP", stdout); - if (option->info & OHW_R5KCVTL) - fputs (" R5KCVTL", stdout); - break; - case ODK_FILL: - fputs (" FILL ", stdout); - /* XXX Print content of info word? */ - break; - case ODK_TAGS: - fputs (" TAGS ", stdout); - /* XXX Print content of info word? */ - break; - case ODK_HWAND: - fputs (" HWAND ", stdout); - if (option->info & OHWA0_R4KEOP_CHECKED) - fputs (" R4KEOP_CHECKED", stdout); - if (option->info & OHWA0_R4KEOP_CLEAN) - fputs (" R4KEOP_CLEAN", stdout); - break; - case ODK_HWOR: - fputs (" HWOR ", stdout); - if (option->info & OHWA0_R4KEOP_CHECKED) - fputs (" R4KEOP_CHECKED", stdout); - if (option->info & OHWA0_R4KEOP_CLEAN) - fputs (" R4KEOP_CLEAN", stdout); - break; - case ODK_GP_GROUP: - printf (" GP_GROUP %#06lx self-contained %#06lx", - option->info & OGP_GROUP, - (option->info & OGP_SELF) >> 16); - break; - case ODK_IDENT: - printf (" IDENT %#06lx self-contained %#06lx", - option->info & OGP_GROUP, - (option->info & OGP_SELF) >> 16); - break; - default: - /* This shouldn't happen. */ - printf (" %3d ??? %d %lx", - option->kind, option->section, option->info); - break; } - len = sizeof (* eopt); - while (len < option->size) - if (((char *) option)[len] >= ' ' - && ((char *) option)[len] < 0x7f) - printf ("%c", ((char *) option)[len++]); - else - printf ("\\%03o", ((char *) option)[len++]); - - fputs ("\n", stdout); - ++option; + free (eopt); } - - free (eopt); } if (conflicts_offset != 0 && conflictsno != 0) { - Elf32_External_Conflict * econf32; - Elf64_External_Conflict * econf64; Elf32_Conflict * iconf; size_t cnt; @@ -8207,31 +9025,50 @@ process_mips_specific (file) if (is_32bit_elf) { - GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (* econf32), - econf32, Elf32_External_Conflict *, "conflict"); + Elf32_External_Conflict * econf32; + + econf32 = ((Elf32_External_Conflict *) + get_data (NULL, file, conflicts_offset, + conflictsno * sizeof (* econf32), + _("conflict"))); + if (!econf32) + return 0; for (cnt = 0; cnt < conflictsno; ++cnt) iconf[cnt] = BYTE_GET (econf32[cnt]); + + free (econf32); } else { - GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (* econf64), - econf64, Elf64_External_Conflict *, "conflict"); + Elf64_External_Conflict * econf64; + + econf64 = ((Elf64_External_Conflict *) + get_data (NULL, file, conflicts_offset, + conflictsno * sizeof (* econf64), + _("conflict"))); + if (!econf64) + return 0; for (cnt = 0; cnt < conflictsno; ++cnt) iconf[cnt] = BYTE_GET (econf64[cnt]); + + free (econf64); } - printf (_("\nSection '.conflict' contains %d entries:\n"), conflictsno); + printf (_("\nSection '.conflict' contains %ld entries:\n"), + (long) conflictsno); puts (_(" Num: Index Value Name")); for (cnt = 0; cnt < conflictsno; ++cnt) { - Elf_Internal_Sym * psym = &dynamic_symbols[iconf[cnt]]; + Elf_Internal_Sym * psym = & dynamic_symbols [iconf [cnt]]; - printf ("%5lu: %8lu ", (unsigned long) cnt, iconf[cnt]); + printf ("%5lu: %8lu ", (unsigned long) cnt, iconf [cnt]); print_vma (psym->st_value, FULL_HEX); - printf (" %s\n", dynamic_strings + psym->st_name); + putchar (' '); + print_symbol (25, dynamic_strings + psym->st_name); + putchar ('\n'); } free (iconf); @@ -8240,7 +9077,7 @@ process_mips_specific (file) return 1; } -static char * +static const char * get_note_type (e_type) unsigned e_type; { @@ -8265,18 +9102,100 @@ get_note_type (e_type) } } +static const char * +get_netbsd_elfcore_note_type (e_type) + unsigned e_type; +{ + static char buff[64]; + + if (e_type == NT_NETBSDCORE_PROCINFO) + { + /* NetBSD core "procinfo" structure. */ + return _("NetBSD procinfo structure"); + } + + /* As of Jan 2002 there are no other machine-independent notes + defined for NetBSD core files. If the note type is less + than the start of the machine-dependent note types, we don't + understand it. */ + + if (e_type < NT_NETBSDCORE_FIRSTMACH) + { + sprintf (buff, _("Unknown note type: (0x%08x)"), e_type); + return buff; + } + + switch (elf_header.e_machine) + { + /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 + and PT_GETFPREGS == mach+2. */ + + case EM_OLD_ALPHA: + case EM_ALPHA: + case EM_SPARC: + case EM_SPARC32PLUS: + case EM_SPARCV9: + switch (e_type) + { + case NT_NETBSDCORE_FIRSTMACH+0: + return _("PT_GETREGS (reg structure)"); + case NT_NETBSDCORE_FIRSTMACH+2: + return _("PT_GETFPREGS (fpreg structure)"); + default: + break; + } + break; + + /* On all other arch's, PT_GETREGS == mach+1 and + PT_GETFPREGS == mach+3. */ + default: + switch (e_type) + { + case NT_NETBSDCORE_FIRSTMACH+1: + return _("PT_GETREGS (reg structure)"); + case NT_NETBSDCORE_FIRSTMACH+3: + return _("PT_GETFPREGS (fpreg structure)"); + default: + break; + } + } + + sprintf (buff, _("PT_FIRSTMACH+%d"), e_type - NT_NETBSDCORE_FIRSTMACH); + return buff; +} + /* Note that by the ELF standard, the name field is already null byte terminated, and namesz includes the terminating null byte. I.E. the value of namesz for the name "FSF" is 4. - If the value of namesz is zero, there is no name present. */ + If the value of namesz is zero, there is no name present. */ static int process_note (pnote) Elf32_Internal_Note * pnote; { + const char *nt; + + if (pnote->namesz == 0) + { + /* If there is no note name, then use the default set of + note type strings. */ + nt = get_note_type (pnote->type); + } + else if (strncmp (pnote->namedata, "NetBSD-CORE", 11) == 0) + { + /* NetBSD-specific core file notes. */ + nt = get_netbsd_elfcore_note_type (pnote->type); + } + else + { + /* Don't recognize this note name; just use the default set of + note type strings. */ + nt = get_note_type (pnote->type); + } + printf (" %s\t\t0x%08lx\t%s\n", pnote->namesz ? pnote->namedata : "(NONE)", - pnote->descsz, get_note_type (pnote->type)); + pnote->descsz, nt); return 1; } @@ -8294,7 +9213,10 @@ process_corefile_note_segment (file, offset, length) if (length <= 0) return 0; - GET_DATA_ALLOC (offset, length, pnotes, Elf_External_Note *, "notes"); + pnotes = (Elf_External_Note *) get_data (NULL, file, offset, length, + _("notes")); + if (!pnotes) + return 0; external = pnotes; @@ -8489,8 +9411,8 @@ get_file_header (file) overwritting things. */ if (sizeof (bfd_vma) < 8) { - error (_("This instance of readelf has been built without support for a\n")); - error (_("64 bit data type and so it cannot read 64 bit ELF files.\n")); + error (_("This instance of readelf has been built without support for a\n\ +64 bit data type and so it cannot read 64 bit ELF files.\n")); return 0; } @@ -8512,10 +9434,17 @@ get_file_header (file) elf_header.e_shstrndx = BYTE_GET (ehdr64.e_shstrndx); } + /* There may be some extensions in the first section header. Don't + bomb if we can't read it. */ + if (is_32bit_elf) + get_32bit_section_headers (file, 1); + else + get_64bit_section_headers (file, 1); + return 1; } -static void +static int process_file (file_name) char * file_name; { @@ -8526,21 +9455,21 @@ process_file (file_name) if (stat (file_name, & statbuf) < 0) { error (_("Cannot stat input file %s.\n"), file_name); - return; + return 1; } file = fopen (file_name, "rb"); if (file == NULL) { error (_("Input file %s not found.\n"), file_name); - return; + return 1; } if (! get_file_header (file)) { error (_("%s: Failed to read file header\n"), file_name); fclose (file); - return; + return 1; } /* Initialise per file variables. */ @@ -8557,7 +9486,7 @@ process_file (file_name) if (! process_file_header ()) { fclose (file); - return; + return 1; } process_section_headers (file); @@ -8615,12 +9544,14 @@ process_file (file_name) free (dynamic_syminfo); dynamic_syminfo = NULL; } + + return 0; } #ifdef SUPPORT_DISASSEMBLY /* Needed by the i386 disassembler. For extra credit, someone could fix this so that we insert symbolic addresses here, esp for GOT/PLT - symbols */ + symbols. */ void print_address (unsigned int addr, FILE * outfile) @@ -8628,7 +9559,7 @@ print_address (unsigned int addr, FILE * outfile) fprintf (outfile,"0x%8.8x", addr); } -/* Needed by the i386 disassembler. */ +/* Needed by the i386 disassembler. */ void db_task_printsym (unsigned int addr) { @@ -8636,14 +9567,21 @@ db_task_printsym (unsigned int addr) } #endif +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; char ** argv; { + int err; + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -8652,11 +9590,12 @@ main (argc, argv) if (optind < (argc - 1)) show_name = 1; + err = 0; while (optind < argc) - process_file (argv [optind ++]); + err |= process_file (argv [optind ++]); if (dump_sects != NULL) free (dump_sects); - return 0; + return err; } diff --git a/contrib/binutils/binutils/resrc.c b/contrib/binutils/binutils/resrc.c index fca874a..eb7db96 100644 --- a/contrib/binutils/binutils/resrc.c +++ b/contrib/binutils/binutils/resrc.c @@ -1,5 +1,5 @@ /* resrc.c -- read and write Windows rc files. - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -25,10 +25,10 @@ #include "bfd.h" #include "bucomm.h" #include "libiberty.h" +#include "safe-ctype.h" #include "windres.h" #include -#include #include #include #ifdef HAVE_UNISTD_H @@ -1889,8 +1889,8 @@ write_rc_resource (e, type, name, res, language) 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); + res->res_info.language & ((1<res_info.language >> SUBLANG_SHIFT) & 0xff); if (res->res_info.characteristics != 0) fprintf (e, "%sCHARACTERISTICS %lu\n", modifiers ? "// " : "", @@ -1976,7 +1976,7 @@ write_rc_accelerators (e, accelerators) fprintf (e, " "); if ((acc->key & 0x7f) == acc->key - && isprint ((unsigned char) acc->key) + && ISPRINT (acc->key) && (acc->flags & ACC_VIRTKEY) == 0) { fprintf (e, "\"%c\"", acc->key); @@ -2383,7 +2383,7 @@ write_rc_rcdata (e, rcdata, ind) s = ri->u.string.s; for (i = 0; i < ri->u.string.length; i++) { - if (isprint ((unsigned char) *s)) + if (ISPRINT (*s)) putc (*s, e); else fprintf (e, "\\%03o", *s); @@ -2421,7 +2421,7 @@ write_rc_rcdata (e, rcdata, ind) if (i + 4 < ri->u.buffer.length || ri->next != NULL) fprintf (e, ","); for (j = 0; j < 4; ++j) - if (! isprint (ri->u.buffer.data[i + j]) + if (! ISPRINT (ri->u.buffer.data[i + j]) && ri->u.buffer.data[i + j] != 0) break; if (j >= 4) @@ -2429,7 +2429,7 @@ write_rc_rcdata (e, rcdata, ind) fprintf (e, "\t// "); for (j = 0; j < 4; ++j) { - if (! isprint (ri->u.buffer.data[i + j])) + if (! ISPRINT (ri->u.buffer.data[i + j])) fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); else { @@ -2455,7 +2455,7 @@ write_rc_rcdata (e, rcdata, ind) if (i + 2 < ri->u.buffer.length || ri->next != NULL) fprintf (e, ","); for (j = 0; j < 2; ++j) - if (! isprint (ri->u.buffer.data[i + j]) + if (! ISPRINT (ri->u.buffer.data[i + j]) && ri->u.buffer.data[i + j] != 0) break; if (j >= 2) @@ -2463,7 +2463,7 @@ write_rc_rcdata (e, rcdata, ind) fprintf (e, "\t// "); for (j = 0; j < 2; ++j) { - if (! isprint (ri->u.buffer.data[i + j])) + if (! ISPRINT (ri->u.buffer.data[i + j])) fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); else { @@ -2483,7 +2483,7 @@ write_rc_rcdata (e, rcdata, ind) if (! first) indent (e, ind + 2); if ((ri->u.buffer.data[i] & 0x7f) == ri->u.buffer.data[i] - && isprint (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]); diff --git a/contrib/binutils/binutils/resres.c b/contrib/binutils/binutils/resres.c index 6a860eb..616772e 100644 --- a/contrib/binutils/binutils/resres.c +++ b/contrib/binutils/binutils/resres.c @@ -387,6 +387,8 @@ write_res_header (datasize, type, name, resinfo) reshdr.data_size = datasize; reshdr.header_size = 24 + get_id_size (type) + get_id_size (name); + reshdr.header_size = (reshdr.header_size + 3) & ~3; + res_align_file (); write_res_data (&reshdr, sizeof (reshdr), 1); write_res_id (type); @@ -513,7 +515,9 @@ read_unistring (len) static void res_align_file (void) { - if (fseek (fres, ftell (fres) % 4, SEEK_CUR) != 0) + int pos = ftell (fres); + int skip = ((pos + 3) & ~3) - pos; + if (fseek (fres, skip, SEEK_CUR) != 0) fatal ("%s: %s: unable to align file", program_name, filename); } diff --git a/contrib/binutils/binutils/size.c b/contrib/binutils/binutils/size.c index 47a91ad..3293e44 100644 --- a/contrib/binutils/binutils/size.c +++ b/contrib/binutils/binutils/size.c @@ -1,22 +1,22 @@ /* size.c -- report size of various sections of an executable file. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 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. */ /* Extensions/incompatibilities: o - BSD output has filenames at the end. @@ -26,8 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ o - We also handle core files. o - We also handle archives. If you write shell scripts which manipulate this info then you may be - out of luck; there's no --compatibility or --pedantic option. -*/ + out of luck; there's no --compatibility or --pedantic option. */ #include "bfd.h" #include "getopt.h" @@ -43,49 +42,63 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ enum { decimal, octal, hex - } radix = decimal; + } +radix = decimal; + int berkeley_format = BSD_DEFAULT; /* 0 means use AT&T-style output. */ int show_version = 0; int show_help = 0; +int show_totals = 0; + +static bfd_size_type total_bsssize; +static bfd_size_type total_datasize; +static bfd_size_type total_textsize; /* Program exit status. */ int return_code = 0; static char *target = NULL; -/* Static declarations */ +/* Static declarations. */ -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)); +static void usage PARAMS ((FILE *, int)); +static void display_file PARAMS ((char *)); +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)); +static void lprint_number PARAMS ((int, bfd_size_type)); #endif -static void rprint_number PARAMS ((int, bfd_size_type)); +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_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)); -static void berkeley_sum PARAMS ((bfd *, sec_ptr, PTR)); +static void print_sysv_format PARAMS ((bfd *)); +static void print_sizes PARAMS ((bfd * file)); +static void berkeley_sum PARAMS ((bfd *, sec_ptr, PTR)); static void usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("\ -Usage: %s [-A | --format=sysv | -B | --format=berkeley]\n\ - [-o | --radix=8 | -d | --radix=10 | -h | --radix=16]\n\ - [-V | --version] [--target=bfdname] [--help] [file...]\n"), - program_name); + fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); + fprintf (stream, _(" Displays the sizes of sections inside binary files\n")); + fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n")); + fprintf (stream, _(" The options are:\n\ + -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\ + -o|-d|-h --radix={8|10|16} Display numbers in octal, decimal or hex\n\ + -t --totals Display the total sizes (Berkeley only)\n\ + --target= Set the binary file format\n\ + -h --help Display this information\n\ + -v --version Display the program's version\n\ +\n"), #if BSD_DEFAULT - fputs (_("default is --format=berkeley\n"), stream); + "berkeley" #else - fputs (_("default is --format=sysv\n"), stream); + "sysv" #endif +); list_supported_targets (program_name, stream); if (status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); @@ -97,11 +110,14 @@ struct option long_options[] = {"format", required_argument, 0, 200}, {"radix", required_argument, 0, 201}, {"target", required_argument, 0, 202}, + {"totals", no_argument, &show_totals, 1}, {"version", no_argument, &show_version, 1}, {"help", no_argument, &show_help, 1}, {0, no_argument, 0, 0} }; +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -113,6 +129,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -122,7 +141,7 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "ABVdfox", long_options, + while ((c = getopt_long (argc, argv, "ABHhVvdfotx", long_options, (int *) 0)) != EOF) switch (c) { @@ -176,6 +195,7 @@ main (argc, argv) case 'B': berkeley_format = 1; break; + case 'v': case 'V': show_version = 1; break; @@ -188,6 +208,9 @@ main (argc, argv) case 'o': radix = octal; break; + case 't': + show_totals = 1; + break; case 'f': /* FIXME : For sysv68, `-f' means `full format', i.e. `[fname:] M(.text) + N(.data) + O(.bss) + P(.comment) = Q' where `fname: ' appears only if there are >= 2 input files, @@ -200,6 +223,8 @@ main (argc, argv) break; case 0: break; + case 'h': + case 'H': case '?': usage (stderr, 1); } @@ -215,6 +240,20 @@ main (argc, argv) for (; optind < argc;) display_file (argv[optind++]); + if (show_totals && berkeley_format) + { + bfd_size_type total = total_textsize + total_datasize + total_bsssize; + + rprint_number (7, total_textsize); + putchar('\t'); + rprint_number (7, total_datasize); + putchar('\t'); + rprint_number (7, total_bsssize); + printf (((radix == octal) ? "\t%7lo\t%7lx\t" : "\t%7lu\t%7lx\t"), + (unsigned long) total, (unsigned long) total); + fputs ("(TOTALS)\n", stdout); + } + return return_code; } @@ -248,7 +287,7 @@ display_bfd (abfd) if (bfd_check_format_matches (abfd, bfd_core, &matching)) { - CONST char *core_cmd; + const char *core_cmd; print_sizes (abfd); fputs (" (core file", stdout); @@ -294,7 +333,7 @@ display_archive (file) } display_bfd (arfile); - /* Don't close the archive elements; we need them for next_archive */ + /* Don't close the archive elements; we need them for next_archive. */ } } @@ -303,6 +342,7 @@ display_file (filename) char *filename; { bfd *file = bfd_openr (filename, target); + if (file == NULL) { bfd_nonfatal (filename); @@ -330,6 +370,7 @@ size_number (num) bfd_size_type num; { char buffer[40]; + sprintf (buffer, (radix == decimal ? "%lu" : ((radix == octal) ? "0%lo" : "0x%lx")), @@ -348,6 +389,7 @@ lprint_number (width, num) bfd_size_type num; { char buffer[40]; + sprintf (buffer, (radix == decimal ? "%lu" : ((radix == octal) ? "0%lo" : "0x%lx")), @@ -364,6 +406,7 @@ rprint_number (width, num) bfd_size_type num; { char buffer[40]; + sprintf (buffer, (radix == decimal ? "%lu" : ((radix == octal) ? "0%lo" : "0x%lx")), @@ -423,6 +466,13 @@ print_berkeley_format (abfd) total = textsize + datasize + bsssize; + if (show_totals) + { + total_textsize += textsize; + total_datasize += datasize; + total_bsssize += bsssize; + } + rprint_number (7, textsize); putchar ('\t'); rprint_number (7, datasize); @@ -432,6 +482,7 @@ print_berkeley_format (abfd) (unsigned long) total, (unsigned long) total); fputs (bfd_get_filename (abfd), stdout); + if (bfd_my_archive (abfd)) printf (" (ex %s)", bfd_get_filename (bfd_my_archive (abfd))); } @@ -450,15 +501,18 @@ sysv_internal_sizer (file, sec, ignore) PTR ignore ATTRIBUTE_UNUSED; { 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)) + + 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); } @@ -471,9 +525,10 @@ sysv_internal_printer (file, sec, ignore) PTR ignore ATTRIBUTE_UNUSED; { 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)) + + if ( ! bfd_is_abs_section (sec) + && ! bfd_is_com_section (sec) + && ! bfd_is_und_section (sec)) { svi_total += size; @@ -489,12 +544,13 @@ static void print_sysv_format (file) bfd *file; { - /* size all of the columns */ + /* 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; @@ -504,11 +560,13 @@ print_sysv_format (file) svi_total = 0; printf ("%s ", bfd_get_filename (file)); + if (bfd_my_archive (file)) printf (" (ex %s)", bfd_get_filename (bfd_my_archive (file))); 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 ("%-*s ", svi_namelen, "Total"); diff --git a/contrib/binutils/binutils/srconv.c b/contrib/binutils/binutils/srconv.c index d5a2324..5361420 100644 --- a/contrib/binutils/binutils/srconv.c +++ b/contrib/binutils/binutils/srconv.c @@ -1,5 +1,5 @@ /* srconv.c -- Sysroff conversion program - Copyright 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -36,17 +36,67 @@ #include "coff/internal.h" #include "../bfd/libcoff.h" -#define PROGRAM_VERSION "1.5" /*#define FOOP1 1 */ static int addrsize; static char *toolname; static char **rnames; -static void wr_cs (); -static void walk_tree_scope (); -static void wr_globals (); -static int find_base (); +static int get_member_id PARAMS ((int)); +static int get_ordinary_id PARAMS ((int)); +static char *section_translate PARAMS ((char *)); +static char *strip_suffix PARAMS ((char *)); +static void checksum PARAMS ((FILE *, char *, int, int)); +static void writeINT PARAMS ((int, char *, int *, int, FILE *)); +static void writeBITS PARAMS ((int, char *, int *, int)); +static void writeBARRAY PARAMS ((barray, char *, int *, int, FILE *)); +static void writeCHARS PARAMS ((char *, char *, int *, int, FILE *)); +static void wr_tr PARAMS ((void)); +static void wr_un PARAMS ((struct coff_ofile *, struct coff_sfile *, int, int)); +static void wr_hd PARAMS ((struct coff_ofile *)); +static void wr_sh PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_ob PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_rl PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_object_body PARAMS ((struct coff_ofile *)); +static void wr_dps_start + PARAMS ((struct coff_sfile *, struct coff_section *, struct coff_scope *, + int, int)); +static void wr_dps_end + PARAMS ((struct coff_section *, struct coff_scope *, int)); +static int *nints PARAMS ((int)); +static void walk_tree_type_1 + PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, + int)); +static void walk_tree_type + PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, + int)); +static void walk_tree_symbol + PARAMS ((struct coff_sfile *, struct coff_section *, + struct coff_symbol *, int)); +static void walk_tree_scope + PARAMS ((struct coff_section *, struct coff_sfile *, struct coff_scope *, + int, int)); +static void walk_tree_sfile + PARAMS ((struct coff_section *, struct coff_sfile *)); +static void wr_program_structure + PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static void wr_du PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_dus PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static int find_base PARAMS ((struct coff_sfile *, struct coff_section *)); +static void wr_dln PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_globals + PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_debug PARAMS ((struct coff_ofile *)); +static void wr_cs PARAMS ((void)); +static int wr_sc PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static void wr_er PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_ed PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_unit_info PARAMS ((struct coff_ofile *)); +static void wr_module PARAMS ((struct coff_ofile *)); +static int align PARAMS ((int)); +static void prescan PARAMS ((struct coff_ofile *)); +static void show_usage PARAMS ((FILE *, int)); +extern int main PARAMS ((int, char **)); static FILE *file; static bfd *abfd; @@ -72,9 +122,8 @@ get_member_id (x) int x; { if (ids2[x]) - { - return ids2[x]; - } + return ids2[x]; + ids2[x] = base2++; return ids2[x]; } @@ -84,9 +133,8 @@ get_ordinary_id (x) int x; { if (ids1[x]) - { - return ids1[x]; - } + return ids1[x]; + ids1[x] = base1++; return ids1[x]; } @@ -103,11 +151,8 @@ section_translate (n) return n; } - - #define DATE "940201073000"; /* Just a time on my birthday */ - static char * strip_suffix (name) @@ -115,6 +160,7 @@ strip_suffix (name) { int i; char *res; + for (i = 0; name[i] != 0 && name[i] != '.'; i++) ; res = (char *) xmalloc (i + 1); @@ -123,7 +169,6 @@ strip_suffix (name) return res; } - /* IT LEN stuff CS */ static void checksum (file, ptr, size, code) @@ -136,6 +181,7 @@ checksum (file, ptr, size, code) int last; int sum = 0; int bytes = size / 8; + last = !(code & 0xff00); if (size & 0x7) abort (); @@ -143,17 +189,14 @@ checksum (file, ptr, size, code) ptr[1] = bytes + 1; for (j = 0; j < bytes; j++) - { - sum += ptr[j]; - } - /* Glue on a checksum too */ + sum += ptr[j]; + + /* Glue on a checksum too. */ ptr[bytes] = ~sum; fwrite (ptr, bytes + 1, 1, file); } - - static void writeINT (n, ptr, idx, size, file) int n; @@ -171,11 +214,12 @@ writeINT (n, ptr, idx, size, file) if (byte > 240) { - /* Lets write out that record and do another one */ + /* Lets write out that record and do another one. */ checksum (file, ptr, *idx, code | 0x1000); *idx = 16; byte = *idx / 8; } + switch (size) { case 0: @@ -199,7 +243,6 @@ writeINT (n, ptr, idx, size, file) *idx += size * 8; } - static void writeBITS (val, ptr, idx, size) int val; @@ -210,12 +253,13 @@ writeBITS (val, ptr, idx, size) int byte = *idx / 8; int bit = *idx % 8; int old; + *idx += size; old = ptr[byte]; - /* Turn off all about to change bits */ + /* Turn off all about to change bits. */ old &= ~((~0 >> (8 - bit - size)) & ((1 << size) - 1)); - /* Turn on the bits we want */ + /* Turn on the bits we want. */ old |= (val & ((1 << size) - 1)) << (8 - bit - size); ptr[byte] = old; } @@ -229,14 +273,12 @@ writeBARRAY (data, ptr, idx, size, file) FILE *file; { int i; + writeINT (data.len, ptr, idx, 1, file); for (i = 0; i < data.len; i++) - { - writeINT (data.data[i], ptr, idx, 1, file); - } + writeINT (data.data[i], ptr, idx, 1, file); } - static void writeCHARS (string, ptr, idx, size, file) char *string; @@ -249,7 +291,7 @@ writeCHARS (string, ptr, idx, size, file) if (i > 240) { - /* Lets write out that record and do another one */ + /* Lets write out that record and do another one. */ checksum (file, ptr, *idx, code | 0x1000); *idx = 16; i = *idx / 8; @@ -257,12 +299,12 @@ writeCHARS (string, ptr, idx, size, file) if (size == 0) { - /* Variable length string */ + /* Variable length string. */ size = strlen (string); ptr[i++] = size; } - /* BUG WAITING TO HAPPEN */ + /* BUG WAITING TO HAPPEN. */ memcpy (ptr + i, string, size); i += size; *idx = i * 8; @@ -271,7 +313,6 @@ writeCHARS (string, ptr, idx, size, file) #define SYSROFF_SWAP_OUT #include "sysroff.c" - static char *rname_sh[] = { "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15" @@ -285,13 +326,14 @@ static char *rname_h8300[] = static void wr_tr () { - /* The TR block is not normal - it doesn't have any contents. */ + /* The TR block is not normal - it doesn't have any contents. */ - static char b[] = { - 0xff, /* IT */ - 0x03, /* RL */ - 0xfd, /* CS */ - }; + static char b[] = + { + 0xff, /* IT */ + 0x03, /* RL */ + 0xfd, /* CS */ + }; fwrite (b, 1, sizeof (b), file); } @@ -303,7 +345,6 @@ wr_un (ptr, sfile, first, nsecs) int nsecs ATTRIBUTE_UNUSED; { struct IT_un un; - struct coff_symbol *s; un.spare1 = 0; @@ -314,17 +355,16 @@ wr_un (ptr, sfile, first, nsecs) un.format = FORMAT_OM; un.spare1 = 0; - #if 1 - un.nsections = ptr->nsections - 1; /* Don't count the abs section */ + un.nsections = ptr->nsections - 1; /* Don't count the abs section. */ #else - /*NEW - only count sections with size */ + /*NEW - only count sections with size. */ un.nsections = nsecs; #endif un.nextdefs = 0; un.nextrefs = 0; - /* Count all the undefined and defined variables with global scope */ + /* Count all the undefined and defined variables with global scope. */ if (first) { @@ -346,7 +386,6 @@ wr_un (ptr, sfile, first, nsecs) sysroff_swap_un_out (file, &un); } - static void wr_hd (p) struct coff_ofile *p; @@ -355,18 +394,16 @@ wr_hd (p) hd.spare1 = 0; if (bfd_get_file_flags (abfd) & EXEC_P) - { - hd.mt = MTYPE_ABS_LM; - } + hd.mt = MTYPE_ABS_LM; else - { - hd.mt = MTYPE_OMS_OR_LMS; - } + hd.mt = MTYPE_OMS_OR_LMS; + hd.cd = DATE; hd.nu = p->nsources; /* Always one unit */ hd.code = 0; /* Always ASCII */ hd.ver = "0200"; /* Version 2.00 */ + switch (bfd_get_arch (abfd)) { case bfd_arch_h8300: @@ -465,7 +502,8 @@ wr_ob (p, section) while (i < section->bfd_section->_raw_size) { struct IT_ob ob; - int todo = 200; /* Copy in 200 byte lumps */ + int todo = 200; /* Copy in 200 byte lumps. */ + ob.spare = 0; if (i + todo > section->bfd_section->_raw_size) todo = section->bfd_section->_raw_size - i; @@ -485,32 +523,33 @@ wr_ob (p, section) ob.saf = 0; } - ob.cpf = 0; /* Never compress */ + ob.cpf = 0; /* Never compress. */ ob.data.len = todo; bfd_get_section_contents (abfd, section->bfd_section, stuff, i, todo); ob.data.data = stuff; sysroff_swap_ob_out (file, &ob /*, i + todo < section->size */ ); i += todo; } - /* Now fill the rest with blanks */ + + /* Now fill the rest with blanks. */ while (i < (bfd_size_type) section->size) { struct IT_ob ob; - int todo = 200; /* Copy in 200 byte lumps */ + int todo = 200; /* Copy in 200 byte lumps. */ + ob.spare = 0; if (i + todo > (bfd_size_type) section->size) todo = section->size - i; ob.saf = 0; - ob.cpf = 0; /* Never compress */ + ob.cpf = 0; /* Never compress. */ ob.data.len = todo; memset (stuff, 0, todo); ob.data.data = stuff; sysroff_swap_ob_out (file, &ob); i += todo; } - /* Now fill the rest with blanks */ - + /* Now fill the rest with blanks. */ } static void @@ -520,11 +559,13 @@ wr_rl (ptr, sec) { int nr = sec->nrelocs; int i; + for (i = 0; i < nr; i++) { struct coff_reloc *r = sec->relocs + i; struct coff_symbol *ref; struct IT_rl rl; + rl.apol = 0; rl.boundary = 0; rl.segment = 1; @@ -532,18 +573,19 @@ wr_rl (ptr, sec) rl.check = 0; rl.addr = r->offset; rl.bitloc = 0; - rl.flen = 32; /* SH Specific */ - /* What sort of reloc ? Look in the section to find out */ + rl.flen = 32; /* SH Specific. */ + + /* What sort of reloc ? Look in the section to find out. */ ref = r->symbol; if (ref->visible->type == coff_vis_ext_ref) { - rl.bcount = 4; /* Always 4 for us */ + rl.bcount = 4; /* Always 4 for us. */ rl.op = OP_EXT_REF; rl.symn = ref->er_number; } else if (ref->visible->type == coff_vis_common) { - rl.bcount = 11; /* Always 11 for us */ + rl.bcount = 11; /* Always 11 for us. */ rl.op = OP_SEC_REF; rl.secn = ref->where->section->number; rl.copcode_is_3 = 3; @@ -551,10 +593,9 @@ wr_rl (ptr, sec) rl.addend = ref->where->offset - ref->where->section->address; rl.aopcode_is_0x20 = 0x20; } - else { - rl.bcount = 11; /* Always 11 for us */ + rl.bcount = 11; /* Always 11 for us. */ rl.op = OP_SEC_REF; rl.secn = ref->where->section->number; rl.copcode_is_3 = 3; @@ -562,12 +603,12 @@ wr_rl (ptr, sec) rl.addend = -ref->where->section->address; rl.aopcode_is_0x20 = 0x20; } + rl.end = 0xff; - if (rl.op == OP_SEC_REF + + if ( rl.op == OP_SEC_REF || rl.op == OP_EXT_REF) - { - sysroff_swap_rl_out (file, &rl); - } + sysroff_swap_rl_out (file, &rl); } } @@ -576,6 +617,7 @@ wr_object_body (p) struct coff_ofile *p; { int i; + for (i = 1; i < p->nsections; i++) { wr_sh (p, p->sections + i); @@ -593,21 +635,23 @@ wr_dps_start (sfile, section, scope, type, nest) int nest; { struct IT_dps dps; + dps.end = 0; dps.opt = 0; dps.type = type; + if (scope->sec) { dps.san = scope->sec->number; dps.address = scope->offset - find_base (sfile, scope->sec); dps.block_size = scope->size; + if (debug) { printf ("DPS %s %d %x\n", sfile->name, nest, dps.address); - } } else @@ -629,6 +673,7 @@ wr_dps_end (section, scope, type) int type; { struct IT_dps dps; + dps.end = 1; dps.type = type; sysroff_swap_dps_out (file, &dps); @@ -641,7 +686,6 @@ nints (x) return (int *) (xcalloc (sizeof (int), x)); } -static void walk_tree_symbol (); static void walk_tree_type_1 (sfile, symbol, type, nest) struct coff_sfile *sfile; @@ -664,11 +708,13 @@ walk_tree_type_1 (sfile, symbol, type, nest) dbt.sign = BTYPE_UNSPEC; dbt.fptype = FPTYPE_NOTSPEC; break; + case T_CHAR: dbt.btype = BTYPE_CHAR; dbt.sign = BTYPE_UNSPEC; dbt.fptype = FPTYPE_NOTSPEC; break; + case T_SHORT: case T_INT: case T_LONG: @@ -676,23 +722,28 @@ walk_tree_type_1 (sfile, symbol, type, nest) dbt.sign = SIGN_SIGNED; dbt.fptype = FPTYPE_NOTSPEC; break; + case T_FLOAT: dbt.btype = BTYPE_FLOAT; dbt.fptype = FPTYPE_SINGLE; break; + case T_DOUBLE: dbt.btype = BTYPE_FLOAT; dbt.fptype = FPTYPE_DOUBLE; break; + case T_LNGDBL: dbt.btype = BTYPE_FLOAT; dbt.fptype = FPTYPE_EXTENDED; break; + case T_UCHAR: dbt.btype = BTYPE_CHAR; dbt.sign = SIGN_UNSIGNED; dbt.fptype = FPTYPE_NOTSPEC; break; + case T_USHORT: case T_UINT: case T_ULONG: @@ -701,14 +752,17 @@ walk_tree_type_1 (sfile, symbol, type, nest) dbt.fptype = FPTYPE_NOTSPEC; break; } + dbt.bitsize = type->size; dbt.neg = 0x1001; sysroff_swap_dbt_out (file, &dbt); break; } + case coff_pointer_type: { struct IT_dpt dpt; + walk_tree_type_1 (sfile, symbol, type->u.pointer.points_to, nest + 1); dpt.neg = 0x1001; sysroff_swap_dpt_out (file, &dpt); @@ -719,6 +773,7 @@ walk_tree_type_1 (sfile, symbol, type, nest) { struct IT_dfp dfp; struct coff_symbol *param; + dfp.end = 0; dfp.spare = 0; dfp.nparams = type->u.function.parameters->nvars; @@ -731,9 +786,8 @@ walk_tree_type_1 (sfile, symbol, type, nest) for (param = type->u.function.parameters->vars_head; param; param = param->next) - { - walk_tree_symbol (sfile, 0, param, nest); - } + walk_tree_symbol (sfile, 0, param, nest); + dfp.end = 1; sysroff_swap_dfp_out (file, &dfp); break; @@ -744,6 +798,7 @@ walk_tree_type_1 (sfile, symbol, type, nest) struct IT_dbt dbt; struct IT_dds dds; struct coff_symbol *member; + dds.spare = 0; dbt.btype = BTYPE_STRUCT; dbt.bitsize = type->size; @@ -755,43 +810,43 @@ walk_tree_type_1 (sfile, symbol, type, nest) dds.end = 0; dds.neg = 0x1001; sysroff_swap_dds_out (file, &dds); + for (member = type->u.astructdef.elements->vars_head; member; member = member->next) - { - walk_tree_symbol (sfile, 0, member, nest + 1); - } + walk_tree_symbol (sfile, 0, member, nest + 1); dds.end = 1; sysroff_swap_dds_out (file, &dds); } break; + case coff_structref_type: { struct IT_dbt dbt; + dbt.btype = BTYPE_TAG; dbt.bitsize = type->size; dbt.sign = SIGN_UNSPEC; dbt.fptype = FPTYPE_NOTSPEC; + if (type->u.astructref.ref) - { - dbt.sid = get_member_id (type->u.astructref.ref->number); - } + dbt.sid = get_member_id (type->u.astructref.ref->number); else - { - dbt.sid = 0; - } + dbt.sid = 0; dbt.neg = 0x1001; sysroff_swap_dbt_out (file, &dbt); } break; + case coff_array_type: { struct IT_dar dar; int j; - int dims = 1; /* Only output one dimension at a time */ + int dims = 1; /* Only output one dimension at a time. */ + dar.dims = dims; dar.variable = nints (dims); dar.subtype = nints (dims); @@ -804,6 +859,7 @@ walk_tree_type_1 (sfile, symbol, type, nest) dar.minspare = nints (dims); dar.neg = 0x1001; dar.length = type->size / type->u.array.dim; + for (j = 0; j < dims; j++) { dar.variable[j] = VARIABLE_FIXED; @@ -818,11 +874,13 @@ walk_tree_type_1 (sfile, symbol, type, nest) sysroff_swap_dar_out (file, &dar); } break; + case coff_enumdef_type: { struct IT_dbt dbt; struct IT_den den; struct coff_symbol *member; + dbt.btype = BTYPE_ENUM; dbt.bitsize = type->size; dbt.sign = SIGN_UNSPEC; @@ -835,22 +893,21 @@ walk_tree_type_1 (sfile, symbol, type, nest) den.neg = 0x1001; den.spare = 0; sysroff_swap_den_out (file, &den); + for (member = type->u.aenumdef.elements->vars_head; member; member = member->next) - { - walk_tree_symbol (sfile, 0, member, nest + 1); - } + walk_tree_symbol (sfile, 0, member, nest + 1); den.end = 1; sysroff_swap_den_out (file, &den); } break; - break; case coff_enumref_type: { struct IT_dbt dbt; + dbt.btype = BTYPE_TAG; dbt.bitsize = type->size; dbt.sign = SIGN_UNSPEC; @@ -860,6 +917,7 @@ walk_tree_type_1 (sfile, symbol, type, nest) sysroff_swap_dbt_out (file, &dbt); } break; + default: abort (); } @@ -905,17 +963,15 @@ walk_tree_type_1 (sfile, symbol, type, nest) static void walk_tree_type (sfile, symbol, type, nest) - - struct - coff_sfile *sfile; + struct coff_sfile *sfile; struct coff_symbol *symbol; struct coff_type *type; int nest; { if (symbol->type->type == coff_function_type) { - struct IT_dty dty; + dty.end = 0; dty.neg = 0x1001; @@ -941,11 +997,11 @@ walk_tree_type (sfile, symbol, type, nest) BLOCK_TYPE_BLOCK); wr_dps_end (symbol->where->section, symbol->type->u.function.code, BLOCK_TYPE_FUNCTION); - } else { struct IT_dty dty; + dty.end = 0; dty.neg = 0x1001; sysroff_swap_dty_out (file, &dty); @@ -953,11 +1009,8 @@ walk_tree_type (sfile, symbol, type, nest) dty.end = 1; sysroff_swap_dty_out (file, &dty); } - } - - static void walk_tree_symbol (sfile, section, symbol, nest) struct coff_sfile *sfile; @@ -967,7 +1020,7 @@ walk_tree_symbol (sfile, section, symbol, nest) { struct IT_dsy dsy; - memset(&dsy, 0, sizeof(dsy)); + memset (&dsy, 0, sizeof(dsy)); dsy.nesting = nest; switch (symbol->type->type) @@ -976,6 +1029,7 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.type = STYPE_FUNC; dsy.assign = 1; break; + case coff_structref_type: case coff_pointer_type: case coff_array_type: @@ -984,18 +1038,22 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.type = STYPE_VAR; dsy.assign = 1; break; + case coff_enumdef_type: dsy.type = STYPE_TAG; dsy.assign = 0; dsy.magic = 2; break; + case coff_structdef_type: dsy.type = STYPE_TAG; dsy.assign = 0; dsy.magic = symbol->type->u.astructdef.isstruct ? 0 : 1; break; + case coff_secdef_type: return; + default: abort (); } @@ -1005,6 +1063,7 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.assign = 0; dsy.type = STYPE_MEMBER; } + if (symbol->where->where == coff_where_member_of_enum) { dsy.type = STYPE_ENUM; @@ -1024,7 +1083,6 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.snumber = get_ordinary_id (symbol->number); } - dsy.sname = symbol->name[0] == '_' ? symbol->name + 1 : symbol->name; switch (symbol->visible->type) @@ -1033,30 +1091,37 @@ walk_tree_symbol (sfile, section, symbol, nest) case coff_vis_ext_def: dsy.ainfo = AINFO_STATIC_EXT_DEF; break; + case coff_vis_ext_ref: dsy.ainfo = AINFO_STATIC_EXT_REF; break; + case coff_vis_int_def: dsy.ainfo = AINFO_STATIC_INT; break; + case coff_vis_auto: case coff_vis_autoparam: dsy.ainfo = AINFO_AUTO; break; + case coff_vis_register: case coff_vis_regparam: dsy.ainfo = AINFO_REG; break; break; + case coff_vis_tag: case coff_vis_member_of_struct: case coff_vis_member_of_enum: break; + default: abort (); } dsy.dlength = symbol->type->size; + switch (symbol->where->where) { case coff_where_memory: @@ -1066,16 +1131,17 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.section = 0; #endif break; + case coff_where_member_of_struct: case coff_where_member_of_enum: case coff_where_stack: case coff_where_register: case coff_where_unknown: case coff_where_strtag: - case coff_where_entag: case coff_where_typedef: break; + default: abort (); } @@ -1085,12 +1151,12 @@ walk_tree_symbol (sfile, section, symbol, nest) case coff_where_memory: dsy.address = symbol->where->offset - find_base (sfile, symbol->where->section); break; + case coff_where_stack: dsy.address = symbol->where->offset; break; - case coff_where_member_of_struct: - + case coff_where_member_of_struct: if (symbol->where->bitsize) { int bits = (symbol->where->offset * 8 + symbol->where->bitoffset); @@ -1107,18 +1173,20 @@ walk_tree_symbol (sfile, section, symbol, nest) dsy.field_off = symbol->where->offset; } break; + case coff_where_member_of_enum: /* dsy.bitunit = 0; dsy.field_len = symbol->type->size; dsy.field_off = symbol->where->offset; */ break; + case coff_where_register: case coff_where_unknown: case coff_where_strtag: - case coff_where_entag: case coff_where_typedef: break; + default: abort (); } @@ -1129,10 +1197,9 @@ walk_tree_symbol (sfile, section, symbol, nest) switch (symbol->visible->type) { case coff_vis_common: - /* We do this 'cause common C symbols are treated as extdefs */ + /* We do this 'cause common C symbols are treated as extdefs. */ case coff_vis_ext_def: case coff_vis_ext_ref: - dsy.ename = symbol->name; break; @@ -1142,29 +1209,26 @@ walk_tree_symbol (sfile, section, symbol, nest) break; case coff_vis_int_def: - case coff_vis_auto: case coff_vis_register: case coff_vis_tag: case coff_vis_member_of_struct: case coff_vis_member_of_enum: break; + default: abort (); } dsy.sfn = 0; dsy.sln = 2; - dsy.neg = 0x1001; - sysroff_swap_dsy_out (file, &dsy); walk_tree_type (sfile, symbol, symbol->type, nest); } - static void walk_tree_scope (section, sfile, scope, nest, type) struct coff_section *section; @@ -1185,25 +1249,21 @@ walk_tree_scope (section, sfile, scope, nest, type) wr_globals (tree, sfile, nest + 1); for (vars = scope->vars_head; vars; vars = vars->next) - { - walk_tree_symbol (sfile, section, vars, nest); - } + walk_tree_symbol (sfile, section, vars, nest); for (child = scope->list_head; child; child = child->next) - { - walk_tree_scope (section, sfile, child, nest + 1, BLOCK_TYPE_BLOCK); - } + walk_tree_scope (section, sfile, child, nest + 1, BLOCK_TYPE_BLOCK); wr_dps_end (section, scope, type); } } + static void walk_tree_sfile (section, sfile) struct coff_section *section; struct coff_sfile *sfile; { walk_tree_scope (section, sfile, sfile->scope, 0, BLOCK_TYPE_COMPUNIT); - } static void @@ -1211,9 +1271,7 @@ wr_program_structure (p, sfile) struct coff_ofile *p; struct coff_sfile *sfile; { - walk_tree_sfile (p->sections + 4, sfile); - } static void @@ -1233,6 +1291,7 @@ wr_du (p, sfile, n) int j; unsigned int *lowest = (unsigned *) nints (p->nsections); unsigned int *highest = (unsigned *) nints (p->nsections); + du.format = bfd_get_file_flags (abfd) & EXEC_P ? 0 : 1; du.optimized = 0; du.stackfrmt = 0; @@ -1250,7 +1309,7 @@ wr_du (p, sfile, n) } /* Look through all the symbols and try and work out the extents in this - source file */ + source file. */ #if 0 for (symbol = sfile->scope->vars_head; symbol; @@ -1270,16 +1329,15 @@ wr_du (p, sfile, n) } } - for (i = 0; i < du.sections; i++) { if (highest[i] == 0) - { - lowest[i] = highest[i] = incit; - } + lowest[i] = highest[i] = incit; + du.san[used] = i; du.length[used] = highest[i] - lowest[i]; du.address[used] = bfd_get_file_flags (abfd) & EXEC_P ? lowest[i] : 0; + if (debug) { printf (" section %6s 0x%08x..0x%08x\n", @@ -1289,14 +1347,16 @@ wr_du (p, sfile, n) } used++; } - #endif + lim = du.sections; for (j = 0; j < lim; j++) { int src = j; int dst = j; + du.san[dst] = dst; + if (sfile->section[src].init) { du.length[dst] @@ -1309,6 +1369,7 @@ wr_du (p, sfile, n) du.length[dst] = 0; du.address[dst] = 0; } + if (debug) { if (sfile->section[src].parent) @@ -1319,6 +1380,7 @@ wr_du (p, sfile, n) du.address[dst] + du.length[dst] - 1); } } + du.sections = dst + 1; } @@ -1333,7 +1395,6 @@ wr_dus (p, sfile) struct coff_ofile *p ATTRIBUTE_UNUSED; struct coff_sfile *sfile; { - struct IT_dus dus; dus.efn = 0x1001; @@ -1342,7 +1403,7 @@ wr_dus (p, sfile) dus.fname = (char **) xcalloc (sizeof (char *), dus.ns); dus.spare = nints (dus.ns); dus.ndir = 0; - /* Find the filenames */ + /* Find the filenames. */ #if 0 i = 0; @@ -1365,7 +1426,7 @@ wr_dus (p, sfile) } /* Find the offset of the .text section for this sfile in the - .text section for the output file */ + .text section for the output file. */ static int find_base (sfile, section) @@ -1514,7 +1575,8 @@ wr_dln (p, sfile, n) #endif } -/* Write the global symbols out to the debug info */ +/* Write the global symbols out to the debug info. */ + static void wr_globals (p, sfile, n) struct coff_ofile *p; @@ -1522,6 +1584,7 @@ wr_globals (p, sfile, n) int n ATTRIBUTE_UNUSED; { struct coff_symbol *sy; + for (sy = p->symbol_list_head; sy; sy = sy->next_in_ofile_list) @@ -1530,10 +1593,9 @@ wr_globals (p, sfile, n) || sy->visible->type == coff_vis_ext_ref) { /* Only write out symbols if they belong to - the current source file */ + the current source file. */ if (sy->sfile == sfile) walk_tree_symbol (sfile, 0, sy, 0); - } } } @@ -1544,15 +1606,14 @@ wr_debug (p) { struct coff_sfile *sfile; int n = 0; + for (sfile = p->source_head; sfile; sfile = sfile->next) - { if (debug) - { - printf ("%s\n", sfile->name); - } + printf ("%s\n", sfile->name); + wr_du (p, sfile, n); wr_dus (p, sfile); wr_program_structure (p, sfile); @@ -1565,8 +1626,9 @@ static void wr_cs () { /* It seems that the CS struct is not normal - the size is wrong - heres one I prepared earlier.. */ - static char b[] = { + heres one I prepared earlier. */ + static char b[] = + { 0x80, /* IT */ 0x21, /* RL */ 0x00, /* number of chars in variable length part */ @@ -1606,7 +1668,7 @@ wr_cs () /* Write out the SC records for a unit. Create an SC for all the sections which appear in the output file, even - if there isn't an equivalent one on the input */ + if there isn't an equivalent one on the input. */ static int wr_sc (ptr, sfile) @@ -1614,23 +1676,19 @@ wr_sc (ptr, sfile) struct coff_sfile *sfile; { int i; -int scount = 0; - /* First work out the total number of sections */ - + int scount = 0; + /* First work out the total number of sections. */ int total_sec = ptr->nsections; - struct myinfo { struct coff_section *sec; struct coff_symbol *symbol; }; struct coff_symbol *symbol; - struct myinfo *info = (struct myinfo *) calloc (total_sec, sizeof (struct myinfo)); - for (i = 0; i < total_sec; i++) { info[i].sec = ptr->sections + i; @@ -1656,19 +1714,20 @@ int scount = 0; } /* Now output all the section info, and fake up some stuff for sections - we don't have */ - + we don't have. */ for (i = 1; i < total_sec; i++) { struct IT_sc sc; char *name; + symbol = info[i].symbol; sc.spare = 0; sc.spare1 = 0; + if (!symbol) { - /* Don't have a symbol set aside for this section, which means that nothing - in this file does anything for the section. */ + /* Don't have a symbol set aside for this section, which means + that nothing in this file does anything for the section. */ sc.format = !(bfd_get_file_flags (abfd) & EXEC_P); sc.addr = 0; sc.length = 0; @@ -1691,7 +1750,6 @@ int scount = 0; } sc.align = 4; - sc.concat = CONCAT_SIMPLE; sc.read = 3; sc.write = 3; @@ -1700,8 +1758,9 @@ int scount = 0; sc.mode = 3; sc.spare = 0; sc.segadd = 0; - sc.spare1 = 0; /* If not zero, then it doesn't work */ + sc.spare1 = 0; /* If not zero, then it doesn't work. */ sc.name = section_translate (name); + if (strlen (sc.name) == 1) { switch (sc.name[0]) @@ -1710,6 +1769,7 @@ int scount = 0; case 'B': sc.contents = CONTENTS_DATA; break; + default: sc.contents = CONTENTS_CODE; } @@ -1720,19 +1780,20 @@ int scount = 0; } #if 0 /* NEW */ - if (sc.length) { + if (sc.length) + { #endif - sysroff_swap_sc_out (file, &sc); - scount++; + sysroff_swap_sc_out (file, &sc); + scount++; #if 0 - } + } #endif } -return scount; + return scount; } +/* Write out the ER records for a unit. */ -/* Write out the ER records for a unit. */ static void wr_er (ptr, sfile, first) struct coff_ofile *ptr; @@ -1741,6 +1802,7 @@ wr_er (ptr, sfile, first) { int idx = 0; struct coff_symbol *sym; + if (first) { for (sym = ptr->symbol_list_head; sym; sym = sym->next_in_ofile_list) @@ -1748,6 +1810,7 @@ wr_er (ptr, sfile, first) if (sym->visible->type == coff_vis_ext_ref) { struct IT_er er; + er.spare = 0; er.type = ER_NOTSPEC; er.name = sym->name; @@ -1758,7 +1821,8 @@ wr_er (ptr, sfile, first) } } -/* Write out the ED records for a unit. */ +/* Write out the ED records for a unit. */ + static void wr_ed (ptr, sfile, first) struct coff_ofile *ptr; @@ -1766,6 +1830,7 @@ wr_ed (ptr, sfile, first) int first; { struct coff_symbol *s; + if (first) { for (s = ptr->symbol_list_head; s; s = s->next_in_ofile_list) @@ -1777,6 +1842,7 @@ wr_ed (ptr, sfile, first) ed.section = s->where->section->number; ed.spare = 0; + if (s->where->section->data) { ed.type = ED_TYPE_DATA; @@ -1790,6 +1856,7 @@ wr_ed (ptr, sfile, first) ed.type = ED_TYPE_NOTSPEC; ed.type = ED_TYPE_DATA; } + ed.address = s->where->offset - s->where->section->address; ed.name = s->name; sysroff_swap_ed_out (file, &ed); @@ -1804,6 +1871,7 @@ wr_unit_info (ptr) { struct coff_sfile *sfile; int first = 1; + for (sfile = ptr->source_head; sfile; sfile = sfile->next) @@ -1811,6 +1879,7 @@ wr_unit_info (ptr) long p1; long p2; int nsecs; + p1 = ftell (file); wr_un (ptr, sfile, first, 0); nsecs = wr_sc (ptr, sfile); @@ -1844,7 +1913,7 @@ align (x) } /* Find all the common variables and turn them into - ordinary defs - dunno why, but thats what hitachi does with 'em */ + ordinary defs - dunno why, but thats what hitachi does with 'em. */ static void prescan (tree) @@ -1852,8 +1921,10 @@ prescan (tree) { struct coff_symbol *s; struct coff_section *common_section; - /* Find the common section - always section 3 */ + + /* Find the common section - always section 3. */ common_section = tree->sections + 3; + for (s = tree->symbol_list_head; s; s = s->next_in_ofile_list) @@ -1878,20 +1949,20 @@ show_usage (file, status) FILE *file; int status; { - fprintf (file, _("Usage: %s [-dhVq] in-file [out-file]\n"), program_name); + fprintf (file, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name); + fprintf (file, _("Convert a COFF object file into a SYSROFF object file\n")); + fprintf (file, _(" The options are:\n\ + -q --quick (Obsolete - ignoerd)\n\ + -n --noprescan Do not perform a scan to convert commons into defs\n\ + -d --debug Display information about what is being done\n\ + -h --help Display this information\n\ + -v --version Print the program's version number\n")); + + if (status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } -static void -show_help () -{ - printf (_("%s: Convert a COFF object file into a SYSROFF object file\n"), - program_name); - show_usage (stdout, 0); -} - - - int main (ac, av) int ac; @@ -1914,13 +1985,16 @@ main (ac, av) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); program_name = av[0]; xmalloc_set_program_name (program_name); - while ((opt = getopt_long (ac, av, "dhVqn", long_options, + while ((opt = getopt_long (ac, av, "dHhVvqn", long_options, (int *) NULL)) != EOF) { @@ -1935,11 +2009,13 @@ main (ac, av) case 'd': debug = 1; break; + case 'H': case 'h': - show_help (); + show_usage (stdout, 0); /*NOTREACHED */ + case 'v': case 'V': - printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION); + print_version ("srconv"); exit (0); /*NOTREACHED */ case 0: @@ -1982,8 +2058,10 @@ main (ac, av) it doesn't end in .o, then stick a .obj on anyway */ int len = strlen (input_file); + output_file = xmalloc (len + 5); strcpy (output_file, input_file); + if (len > 3 && output_file[len - 2] == '.' && output_file[len - 1] == 'o') @@ -2006,6 +2084,7 @@ main (ac, av) if (!bfd_check_format_matches (abfd, bfd_object, &matching)) { bfd_nonfatal (input_file); + if (bfd_get_error () == bfd_error_file_ambiguously_recognized) { list_matching_formats (matching); @@ -2017,15 +2096,16 @@ main (ac, av) file = fopen (output_file, FOPEN_WB); if (!file) - { - fatal (_("unable to open output file %s"), output_file); - } + fatal (_("unable to open output file %s"), output_file); if (debug) printf ("ids %d %d\n", base1, base2); + tree = coff_grok (abfd); + if (!noprescan) prescan (tree); + wr_module (tree); return 0; } diff --git a/contrib/binutils/binutils/stabs.c b/contrib/binutils/binutils/stabs.c index daea301..bbc0632 100644 --- a/contrib/binutils/binutils/stabs.c +++ b/contrib/binutils/binutils/stabs.c @@ -26,11 +26,11 @@ trying to identify the correct address for anything. */ #include -#include #include "bfd.h" #include "bucomm.h" #include "libiberty.h" +#include "safe-ctype.h" #include "demangle.h" #include "debug.h" #include "budbg.h" @@ -307,11 +307,11 @@ parse_number (pp, poverflow) int d; d = *p++; - if (isdigit ((unsigned char) d)) + if (ISDIGIT (d)) d -= '0'; - else if (isupper ((unsigned char) d)) + else if (ISUPPER (d)) d -= 'A'; - else if (islower ((unsigned char) d)) + else if (ISLOWER (d)) d -= 'a'; else break; @@ -781,7 +781,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) } ++p; - if (isdigit ((unsigned char) *p) || *p == '(' || *p == '-') + if (ISDIGIT (*p) || *p == '(' || *p == '-') type = 'l'; else type = *p++; @@ -1185,7 +1185,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) /* Read type number if present. The type number may be omitted. for instance in a two-dimensional array declared with type "ar1;1;10;ar1;1;10;4". */ - if (! isdigit ((unsigned char) **pp) && **pp != '(' && **pp != '-') + if (! ISDIGIT (**pp) && **pp != '(' && **pp != '-') { /* 'typenums=' not present, type is anonymous. Read and return the definition, but don't put it in the type vector. */ @@ -1228,7 +1228,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) const char *p = *pp + 1; const char *attr; - if (isdigit ((unsigned char) *p) || *p == '(' || *p == '-') + if (ISDIGIT (*p) || *p == '(' || *p == '-') { /* Member type. */ break; @@ -2913,7 +2913,7 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, /* Constructors are sometimes handled specially. */ is_full_physname_constructor = ((argtypes[0] == '_' && argtypes[1] == '_' - && (isdigit ((unsigned char) argtypes[2]) + && (ISDIGIT (argtypes[2]) || argtypes[2] == 'Q' || argtypes[2] == 't')) || strncmp (argtypes, "__ct", 4) == 0); @@ -3149,7 +3149,7 @@ parse_stab_array_type (dhandle, info, pp, stringp) adjustable = false; - if (! isdigit ((unsigned char) **pp) && **pp != '-') + if (! ISDIGIT (**pp) && **pp != '-') { ++*pp; adjustable = true; @@ -3163,7 +3163,7 @@ parse_stab_array_type (dhandle, info, pp, stringp) } ++*pp; - if (! isdigit ((unsigned char) **pp) && **pp != '-') + if (! ISDIGIT (**pp) && **pp != '-') { ++*pp; adjustable = true; @@ -3772,7 +3772,7 @@ stab_demangle_count (pp) unsigned int count; count = 0; - while (isdigit ((unsigned char) **pp)) + while (ISDIGIT (**pp)) { count *= 10; count += **pp - '0'; @@ -3789,12 +3789,12 @@ stab_demangle_get_count (pp, pi) const char **pp; unsigned int *pi; { - if (! isdigit ((unsigned char) **pp)) + if (! ISDIGIT (**pp)) return false; *pi = **pp - '0'; ++*pp; - if (isdigit ((unsigned char) **pp)) + if (ISDIGIT (**pp)) { unsigned int count; const char *p; @@ -3807,7 +3807,7 @@ stab_demangle_get_count (pp, pi) count += *p - '0'; ++p; } - while (isdigit ((unsigned char) *p)); + while (ISDIGIT (*p)); if (*p == '_') { *pp = p + 1; @@ -3902,7 +3902,7 @@ stab_demangle_prefix (minfo, pp) scan += i - 2; if (scan == *pp - && (isdigit ((unsigned char) scan[2]) + && (ISDIGIT (scan[2]) || scan[2] == 'Q' || scan[2] == 't')) { @@ -3911,7 +3911,7 @@ stab_demangle_prefix (minfo, pp) return true; } else if (scan == *pp - && ! isdigit ((unsigned char) scan[2]) + && ! ISDIGIT (scan[2]) && scan[2] != 't') { /* Look for the `__' that separates the prefix from the @@ -4126,13 +4126,13 @@ stab_demangle_qualified (minfo, pp, ptype) preceded by an underscore (to distinguish it from the <= 9 case) and followed by an underscore. */ p = *pp + 2; - if (! isdigit ((unsigned char) *p) || *p == '0') + if (! ISDIGIT (*p) || *p == '0') { stab_bad_demangle (orig); return false; } qualifiers = atoi (p); - while (isdigit ((unsigned char) *p)) + while (ISDIGIT (*p)) ++p; if (*p != '_') { @@ -4397,7 +4397,7 @@ stab_demangle_template (minfo, pp, pname) { if (**pp == 'm') ++*pp; - while (isdigit ((unsigned char) **pp)) + while (ISDIGIT (**pp)) ++*pp; } else if (charp) @@ -4428,18 +4428,18 @@ stab_demangle_template (minfo, pp, pname) { if (**pp == 'm') ++*pp; - while (isdigit ((unsigned char) **pp)) + while (ISDIGIT (**pp)) ++*pp; if (**pp == '.') { ++*pp; - while (isdigit ((unsigned char) **pp)) + while (ISDIGIT (**pp)) ++*pp; } if (**pp == 'e') { ++*pp; - while (isdigit ((unsigned char) **pp)) + while (ISDIGIT (**pp)) ++*pp; } } @@ -4461,7 +4461,7 @@ stab_demangle_template (minfo, pp, pname) regular demangling routine. */ if (pname != NULL) { - char *s1, *s2, *s3, *s4; + char *s1, *s2, *s3, *s4 = NULL; char *from, *to; s1 = savestring (orig, *pp - orig); @@ -4692,7 +4692,7 @@ stab_demangle_type (minfo, pp, ptype) high = 0; while (**pp != '\0' && **pp != '_') { - if (! isdigit ((unsigned char) **pp)) + if (! ISDIGIT (**pp)) { stab_bad_demangle (orig); return false; @@ -4796,7 +4796,7 @@ stab_demangle_type (minfo, pp, ptype) varargs = false; ++*pp; - if (isdigit ((unsigned char) **pp)) + if (ISDIGIT (**pp)) { n = stab_demangle_count (pp); if (strlen (*pp) < n) @@ -5106,7 +5106,7 @@ stab_demangle_fund_type (minfo, pp, ptype) case 'G': ++*pp; - if (! isdigit ((unsigned char) **pp)) + if (! ISDIGIT (**pp)) { stab_bad_demangle (orig); return false; diff --git a/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c index 5d3aa6d..3507831 100644 --- a/contrib/binutils/binutils/strings.c +++ b/contrib/binutils/binutils/strings.c @@ -1,6 +1,6 @@ /* strings -- print the strings of printable characters in files - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,6 +39,11 @@ -o Like -to. (Some other implementations have -o like -to, others like -td. We chose one arbitrarily.) + --encoding={s,b,l,B,L} + -e {s,b,l,B,L} + Select character encoding: single-byte, bigendian 16-bit, + littleendian 16-bit, bigendian 32-bit, littleendian 32-bit + --target=BFDNAME Specify a non-default object file format. @@ -51,13 +56,16 @@ Written by Richard Stallman and David MacKenzie . */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "bfd.h" #include #include -#include #include #include "bucomm.h" #include "libiberty.h" +#include "safe-ctype.h" /* Some platforms need to put stdin into binary mode, to read binary files. */ @@ -76,14 +84,7 @@ #endif #endif -/* Not all printable characters have ASCII codes (depending upon the - LOCALE set) but on some older systems it is not safe to test isprint - without first testing isascii... */ -#if defined isascii && !defined HAVE_LOCALE_H -#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t')) -#else -#define isgraphic(c) (isprint (c) || (c) == '\t') -#endif +#define isgraphic(c) (ISPRINT (c) || (c) == '\t') #ifndef errno extern int errno; @@ -92,6 +93,14 @@ extern int errno; /* The BFD section flags that identify an initialized data section. */ #define DATA_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS) +#ifdef HAVE_FOPEN64 +typedef off64_t file_off; +#define file_open(s,m) fopen64(s,m) +#else +typedef off_t file_off; +#define file_open(s,m) fopen(s,m) +#endif + /* Radix for printing addresses (must be 8, 10 or 16). */ static int address_radix; @@ -113,12 +122,17 @@ static boolean got_a_section; /* The BFD object file format. */ static char *target; +/* The character encoding format. */ +static char encoding; +static int encoding_bytes; + static struct option long_options[] = { {"all", no_argument, NULL, 'a'}, {"print-file-name", no_argument, NULL, 'f'}, {"bytes", required_argument, NULL, 'n'}, {"radix", required_argument, NULL, 't'}, + {"encoding", required_argument, NULL, 'e'}, {"target", required_argument, NULL, 'T'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, @@ -130,10 +144,14 @@ static boolean strings_object_file PARAMS ((const char *)); static boolean strings_file PARAMS ((char *file)); static int integer_arg PARAMS ((char *s)); static void print_strings PARAMS ((const char *filename, FILE *stream, - file_ptr address, int stop_point, + file_off address, int stop_point, int magiccount, char *magic)); static void usage PARAMS ((FILE *stream, int status)); +static long get_char PARAMS ((FILE *stream, file_off *address, + int *magiccount, char **magic)); +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -143,7 +161,7 @@ main (argc, argv) int exit_status = 0; boolean files_given = false; -#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) +#if defined (HAVE_SETLOCALE) setlocale (LC_ALL, ""); #endif bindtextdomain (PACKAGE, LOCALEDIR); @@ -156,8 +174,9 @@ main (argc, argv) print_filenames = false; datasection_only = true; target = NULL; + encoding = 's'; - while ((optc = getopt_long (argc, argv, "afn:ot:v0123456789", + while ((optc = getopt_long (argc, argv, "afhHn:ot:e:Vv0123456789", long_options, (int *) 0)) != EOF) { switch (optc) @@ -170,6 +189,7 @@ main (argc, argv) print_filenames = true; break; + case 'H': case 'h': usage (stdout, 0); @@ -213,6 +233,13 @@ main (argc, argv) target = optarg; break; + case 'e': + if (optarg[1] != '\0') + usage (stderr, 1); + encoding = optarg[0]; + break; + + case 'V': case 'v': print_version ("strings"); break; @@ -232,6 +259,23 @@ main (argc, argv) if (string_min < 0) string_min = 4; + switch (encoding) + { + case 's': + encoding_bytes = 1; + break; + case 'b': + case 'l': + encoding_bytes = 2; + break; + case 'B': + case 'L': + encoding_bytes = 4; + break; + default: + usage (stderr, 1); + } + bfd_init (); set_default_bfd_target (); @@ -342,10 +386,7 @@ strings_file (file) { FILE *stream; - stream = fopen (file, "rb"); - /* Not all systems permit "rb", so try "r" if it failed. */ - if (stream == NULL) - stream = fopen (file, "r"); + stream = file_open (file, FOPEN_RB); if (stream == NULL) { fprintf (stderr, "%s: ", program_name); @@ -353,7 +394,7 @@ strings_file (file) return false; } - print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0); + print_strings (file, stream, (file_off) 0, 0, 0, (char *) 0); if (fclose (stream) == EOF) { @@ -366,6 +407,78 @@ strings_file (file) return true; } +/* Read the next character, return EOF if none available. + Assume that STREAM is positioned so that the next byte read + is at address ADDRESS in the file. + + If STREAM is NULL, do not read from it. + The caller can supply a buffer of characters + to be processed before the data in STREAM. + MAGIC is the address of the buffer and + MAGICCOUNT is how many characters are in it. */ + +static long +get_char (stream, address, magiccount, magic) + FILE *stream; + file_off *address; + int *magiccount; + char **magic; +{ + int c, i; + long r = EOF; + unsigned char buf[4]; + + for (i = 0; i < encoding_bytes; i++) + { + if (*magiccount) + { + (*magiccount)--; + c = *(*magic)++; + } + else + { + if (stream == NULL) + return EOF; +#ifdef HAVE_GETC_UNLOCKED + c = getc_unlocked (stream); +#else + c = getc (stream); +#endif + if (c == EOF) + return EOF; + } + + (*address)++; + buf[i] = c; + } + + switch (encoding) + { + case 's': + r = buf[0]; + break; + case 'b': + r = (buf[0] << 8) | buf[1]; + break; + case 'l': + r = buf[0] | (buf[1] << 8); + break; + case 'B': + r = ((long) buf[0] << 24) | ((long) buf[1] << 16) | + ((long) buf[2] << 8) | buf[3]; + break; + case 'L': + r = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) | + ((long) buf[3] << 24); + break; + } + + if (r == EOF) + return 0; + + return r; +} + /* Find the strings in file FILENAME, read from STREAM. Assume that STREAM is positioned so that the next byte read is at address ADDRESS in the file. @@ -382,18 +495,18 @@ static void print_strings (filename, stream, address, stop_point, magiccount, magic) const char *filename; FILE *stream; - file_ptr address; + file_off address; int stop_point; int magiccount; char *magic; { - char *buf = (char *) xmalloc (string_min + 1); + char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); while (1) { - file_ptr start; + file_off start; int i; - int c; + long c; /* See if the next `string_min' chars are all graphic chars. */ tryline: @@ -402,21 +515,10 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) start = address; for (i = 0; i < string_min; i++) { - if (magiccount) - { - magiccount--; - c = *magic++; - } - else - { - if (stream == NULL) - return; - c = getc (stream); - if (c == EOF) - return; - } - address++; - if (!isgraphic (c)) + c = get_char (stream, &address, &magiccount, &magic); + if (c == EOF) + return; + if (c > 255 || c < 0 || !isgraphic (c)) /* Found a non-graphic. Try again starting with next char. */ goto tryline; buf[i] = c; @@ -431,15 +533,48 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) switch (address_radix) { case 8: - printf ("%7lo ", (unsigned long) start); +#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) + if (sizeof (start) > sizeof (long)) + printf ("%7Lo ", (unsigned long long) start); + else +#else +# if !BFD_HOST_64BIT_LONG + if (start != (unsigned long) start) + printf ("++%7lo ", (unsigned long) start); + else +# endif +#endif + printf ("%7lo ", (unsigned long) start); break; case 10: - printf ("%7ld ", (long) start); +#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) + if (sizeof (start) > sizeof (long)) + printf ("%7Ld ", (unsigned long long) start); + else +#else +# if !BFD_HOST_64BIT_LONG + if (start != (unsigned long) start) + printf ("++%7ld ", (unsigned long) start); + else +# endif +#endif + printf ("%7ld ", (long) start); break; case 16: - printf ("%7lx ", (unsigned long) start); +#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) + if (sizeof (start) > sizeof (long)) + printf ("%7Lx ", (unsigned long long) start); + else +#else +# if !BFD_HOST_64BIT_LONG + if (start != (unsigned long) start) + printf ("%lx%8.8lx ", start >> 32, start & 0xffffffff); + else +# endif +#endif + printf ("%7lx ", (unsigned long) start); break; } @@ -448,21 +583,10 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) while (1) { - if (magiccount) - { - magiccount--; - c = *magic++; - } - else - { - if (stream == NULL) - break; - c = getc (stream); - if (c == EOF) - break; - } - address++; - if (! isgraphic (c)) + c = get_char (stream, &address, &magiccount, &magic); + if (c == EOF) + break; + if (c > 255 || c < 0 || !isgraphic (c)) break; putchar (c); } @@ -523,11 +647,20 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("\ -Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n\ - [--all] [--print-file-name] [--bytes=min-len] [--radix={o,x,d}]\n\ - [--target=bfdname] [--help] [--version] file...\n"), - program_name); + fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); + fprintf (stream, _(" Display printable strings in [file(s)] (stdin by default)\n")); + fprintf (stream, _(" The options are:\n\ + -a - --all Scan the entire file, not just the data section\n\ + -f --print-file-name Print the name of the file before each string\n\ + -n --bytes=[number] Locate & print any NUL-terminated sequence of at\n\ + - least [number] characters (default 4).\n\ + -t --radix={o,x,d} Print the location of the string in base 8, 10 or 16\n\ + -o An alias for --radix=o\n\ + -T --target= Specify the binary file format\n\ + -e --encoding={s,b,l,B,L} Select character size and endianness:\n\ + s = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ + -h --help Display this information\n\ + -v --version Print the program's version number\n")); list_supported_targets (program_name, stream); if (status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); diff --git a/contrib/binutils/binutils/sysdump.c b/contrib/binutils/binutils/sysdump.c index 65d2ca6..8ac0f27 100644 --- a/contrib/binutils/binutils/sysdump.c +++ b/contrib/binutils/binutils/sysdump.c @@ -1,5 +1,6 @@ /* Sysroff object format dumper. - Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -22,25 +23,46 @@ /* Written by Steve Chamberlain . This program reads a SYSROFF object file and prints it in an - almost human readable form to stdout. */ + almost human readable form to stdout. */ #include "bfd.h" #include "bucomm.h" +#include "safe-ctype.h" #include -#include #include #include #include "sysroff.h" -#define PROGRAM_VERSION "1.0" - static int dump = 1; static int segmented_p; static int code; static int addrsize = 4; static FILE *file; +static void dh PARAMS ((unsigned char *, int)); +static void itheader PARAMS ((char *, int)); +static void p PARAMS ((void)); +static void tabout PARAMS ((void)); +static void pbarray PARAMS ((barray *)); +static int getone PARAMS ((int)); +static int opt PARAMS ((int)); +static void must PARAMS ((int)); +static void tab PARAMS ((int, char *)); +static void dump_symbol_info PARAMS ((void)); +static void derived_type PARAMS ((void)); +static void module PARAMS ((void)); +static void show_usage PARAMS ((FILE *, int)); + +extern char *getCHARS PARAMS ((unsigned char *, int *, int, int)); +extern int fillup PARAMS ((char *)); +extern barray getBARRAY PARAMS ((unsigned char *, int *, int, int)); +extern int getINT PARAMS ((unsigned char *, int *, int, int)); +extern int getBITS PARAMS ((char *, int *, int, int)); +extern void sysroff_swap_tr_in PARAMS ((void)); +extern void sysroff_print_tr_out PARAMS ((void)); +extern int main PARAMS ((int, char **)); + char * getCHARS (ptr, idx, size, max) unsigned char *ptr; @@ -51,14 +73,13 @@ getCHARS (ptr, idx, size, max) int oc = *idx / 8; char *r; int b = size; + if (b >= max) - { - return "*undefined*"; - } + return "*undefined*"; if (b == 0) { - /* Got to work out the length of the string from self */ + /* Got to work out the length of the string from self. */ b = ptr[oc++]; (*idx) += 8; } @@ -67,6 +88,7 @@ getCHARS (ptr, idx, size, max) r = xcalloc (b + 1, 1); memcpy (r, ptr + oc, b); r[b] = 0; + return r; } @@ -94,10 +116,12 @@ dh (ptr, size) for (j = 0; j < span && j + i < size; j++) { int c = ptr[i + j]; + if (c < 32 || c > 127) c = '.'; printf ("%c", c); } + printf ("\n"); } } @@ -109,18 +133,17 @@ fillup (ptr) int size; int sum; int i; + size = getc (file) - 2; fread (ptr, 1, size, file); sum = code + size + 2; + for (i = 0; i < size; i++) - { - sum += ptr[i]; - } + sum += ptr[i]; if ((sum & 0xff) != 0xff) - { - printf ("SUM IS %x\n", sum); - } + printf ("SUM IS %x\n", sum); + if (dump) dh (ptr, size); @@ -138,12 +161,13 @@ getBARRAY (ptr, idx, dsize, max) int i; int byte = *idx / 8; int size = ptr[byte++]; + res.len = size; res.data = (unsigned char *) xmalloc (size); + for (i = 0; i < size; i++) - { - res.data[i] = ptr[byte++]; - } + res.data[i] = ptr[byte++]; + return res; } @@ -158,13 +182,14 @@ getINT (ptr, idx, size, max) int byte = *idx / 8; if (byte >= max) - { - return 0; - } + return 0; + if (size == -2) size = addrsize; + if (size == -1) size = 0; + switch (size) { case 0: @@ -181,6 +206,7 @@ getINT (ptr, idx, size, max) default: abort (); } + *idx += size * 8; return n; } @@ -211,14 +237,15 @@ itheader (name, code) } static int indent; + static void p () { int i; + for (i = 0; i < indent; i++) - { - printf ("| "); - } + printf ("| "); + printf ("> "); } @@ -233,11 +260,13 @@ pbarray (y) barray *y; { int x; + printf ("%d (", y->len); + for (x = 0; x < y->len; x++) - { - printf ("(%02x %c)", y->data[x], isprint (y->data[x]) ? y->data[x] : '.'); - } + printf ("(%02x %c)", y->data[x], + ISPRINT (y->data[x]) ? y->data[x] : '.'); + printf (")\n"); } @@ -246,27 +275,26 @@ pbarray (y) #include "sysroff.c" -/* - * FIXME: sysinfo, which generates sysroff.[ch] from sysroff.info, can't - * hack the special case of the tr block, which has no contents. So we - * implement our own functions for reading in and printing out the tr - * block. - */ +/* FIXME: sysinfo, which generates sysroff.[ch] from sysroff.info, can't + hack the special case of the tr block, which has no contents. So we + implement our own functions for reading in and printing out the tr + block. */ #define IT_tr_CODE 0x7f + void sysroff_swap_tr_in() { - char raw[255]; + char raw[255]; - memset(raw, 0, 255); - fillup(raw); + memset (raw, 0, 255); + fillup (raw); } void sysroff_print_tr_out() { - itheader("tr", IT_tr_CODE); + itheader ("tr", IT_tr_CODE); } static int @@ -274,6 +302,7 @@ getone (type) int type; { int c = getc (file); + code = c; if ((c & 0x7f) != type) @@ -291,6 +320,7 @@ getone (type) sysroff_print_cs_out (&dummy); } break; + case IT_dln_CODE: { struct IT_dln dummy; @@ -298,6 +328,7 @@ getone (type) sysroff_print_dln_out (&dummy); } break; + case IT_hd_CODE: { struct IT_hd dummy; @@ -306,6 +337,7 @@ getone (type) sysroff_print_hd_out (&dummy); } break; + case IT_dar_CODE: { struct IT_dar dummy; @@ -313,6 +345,7 @@ getone (type) sysroff_print_dar_out (&dummy); } break; + case IT_dsy_CODE: { struct IT_dsy dummy; @@ -320,6 +353,7 @@ getone (type) sysroff_print_dsy_out (&dummy); } break; + case IT_dfp_CODE: { struct IT_dfp dummy; @@ -327,6 +361,7 @@ getone (type) sysroff_print_dfp_out (&dummy); } break; + case IT_dso_CODE: { struct IT_dso dummy; @@ -334,6 +369,7 @@ getone (type) sysroff_print_dso_out (&dummy); } break; + case IT_dpt_CODE: { struct IT_dpt dummy; @@ -341,6 +377,7 @@ getone (type) sysroff_print_dpt_out (&dummy); } break; + case IT_den_CODE: { struct IT_den dummy; @@ -348,6 +385,7 @@ getone (type) sysroff_print_den_out (&dummy); } break; + case IT_dbt_CODE: { struct IT_dbt dummy; @@ -355,6 +393,7 @@ getone (type) sysroff_print_dbt_out (&dummy); } break; + case IT_dty_CODE: { struct IT_dty dummy; @@ -362,6 +401,7 @@ getone (type) sysroff_print_dty_out (&dummy); } break; + case IT_un_CODE: { struct IT_un dummy; @@ -369,6 +409,7 @@ getone (type) sysroff_print_un_out (&dummy); } break; + case IT_sc_CODE: { struct IT_sc dummy; @@ -376,6 +417,7 @@ getone (type) sysroff_print_sc_out (&dummy); } break; + case IT_er_CODE: { struct IT_er dummy; @@ -383,6 +425,7 @@ getone (type) sysroff_print_er_out (&dummy); } break; + case IT_ed_CODE: { struct IT_ed dummy; @@ -390,6 +433,7 @@ getone (type) sysroff_print_ed_out (&dummy); } break; + case IT_sh_CODE: { struct IT_sh dummy; @@ -397,6 +441,7 @@ getone (type) sysroff_print_sh_out (&dummy); } break; + case IT_ob_CODE: { struct IT_ob dummy; @@ -404,6 +449,7 @@ getone (type) sysroff_print_ob_out (&dummy); } break; + case IT_rl_CODE: { struct IT_rl dummy; @@ -411,6 +457,7 @@ getone (type) sysroff_print_rl_out (&dummy); } break; + case IT_du_CODE: { struct IT_du dummy; @@ -419,6 +466,7 @@ getone (type) sysroff_print_du_out (&dummy); } break; + case IT_dus_CODE: { struct IT_dus dummy; @@ -426,6 +474,7 @@ getone (type) sysroff_print_dus_out (&dummy); } break; + case IT_dul_CODE: { struct IT_dul dummy; @@ -433,6 +482,7 @@ getone (type) sysroff_print_dul_out (&dummy); } break; + case IT_dss_CODE: { struct IT_dss dummy; @@ -440,6 +490,7 @@ getone (type) sysroff_print_dss_out (&dummy); } break; + case IT_hs_CODE: { struct IT_hs dummy; @@ -447,6 +498,7 @@ getone (type) sysroff_print_hs_out (&dummy); } break; + case IT_dps_CODE: { struct IT_dps dummy; @@ -454,24 +506,27 @@ getone (type) sysroff_print_dps_out (&dummy); } break; + case IT_tr_CODE: - { - sysroff_swap_tr_in (); - sysroff_print_tr_out (); - } + sysroff_swap_tr_in (); + sysroff_print_tr_out (); break; + case IT_dds_CODE: { struct IT_dds dummy; + sysroff_swap_dds_in (&dummy); sysroff_print_dds_out (&dummy); } break; + default: printf ("GOT A %x\n", c); return 0; break; } + return 1; } @@ -529,9 +584,7 @@ must (x) int x; { if (!getone (x)) - { - printf ("WANTED %x!!\n", x); - } + printf ("WANTED %x!!\n", x); } static void @@ -540,6 +593,7 @@ tab (i, s) char *s; { indent += i; + if (s) { p (); @@ -548,12 +602,11 @@ tab (i, s) } } -static void derived_type (); - static void dump_symbol_info () { tab (1, "SYMBOL INFO"); + while (opt (IT_dsy_CODE)) { if (opt (IT_dty_CODE)) @@ -563,6 +616,7 @@ dump_symbol_info () must (IT_dty_CODE); } } + tab (-1, ""); } @@ -570,6 +624,7 @@ static void derived_type () { tab (1, "DERIVED TYPE"); + while (1) { if (opt (IT_dpp_CODE)) @@ -709,18 +764,17 @@ show_usage (file, status) FILE *file; int status; { - fprintf (file, _("Usage: %s [-hV] in-file\n"), program_name); + fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name); + fprintf (file, _("Print a human readable interpretation of a SYSROFF object file\n")); + fprintf (file, _(" The options are:\n\ + -h --help Display this information\n\ + -v --version Print the program's version number\n")); + + if (status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } -static void -show_help () -{ - printf (_("%s: Print a human readable interpretation of a SYSROFF object file\n"), - program_name); - show_usage (stdout, 0); -} - int main (ac, av) int ac; @@ -738,21 +792,26 @@ main (ac, av) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); program_name = av[0]; xmalloc_set_program_name (program_name); - while ((opt = getopt_long (ac, av, "hV", long_options, (int *) NULL)) != EOF) + while ((opt = getopt_long (ac, av, "HhVv", long_options, (int *) NULL)) != EOF) { switch (opt) { + case 'H': case 'h': - show_help (); + show_usage (stdout, 0); /*NOTREACHED*/ + case 'v': case 'V': - printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION); + print_version ("sysdump"); exit (0); /*NOTREACHED*/ case 0: @@ -766,20 +825,15 @@ main (ac, av) /* The input and output files may be named on the command line. */ if (optind < ac) - { - input_file = av[optind]; - } + input_file = av[optind]; if (!input_file) - { - fatal (_("no input file specified")); - } + fatal (_("no input file specified")); file = fopen (input_file, FOPEN_RB); + if (!file) - { - fatal (_("cannot open input file %s"), input_file); - } + fatal (_("cannot open input file %s"), input_file); module (); return 0; diff --git a/contrib/binutils/binutils/sysinfo.y b/contrib/binutils/binutils/sysinfo.y index fef16cb..4aa4607 100644 --- a/contrib/binutils/binutils/sysinfo.y +++ b/contrib/binutils/binutils/sysinfo.y @@ -72,6 +72,7 @@ top: { printf("#ifdef SYSROFF_PRINT\n"); printf("#include \n"); printf("#include \n"); + printf("#include \n"); break; } } @@ -103,6 +104,13 @@ it: { case 'd': printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); + printf("struct IT_%s;\n", it); + printf("extern void sysroff_swap_%s_in PARAMS ((struct IT_%s *));\n", + $2, it); + printf("extern void sysroff_swap_%s_out PARAMS ((FILE *, struct IT_%s *));\n", + $2, it); + printf("extern void sysroff_print_%s_out PARAMS ((struct IT_%s *));\n", + $2, it); printf("struct IT_%s { \n", it); break; case 'i': diff --git a/contrib/binutils/binutils/unwind-ia64.c b/contrib/binutils/binutils/unwind-ia64.c index 3b05c77..d3f4b61 100644 --- a/contrib/binutils/binutils/unwind-ia64.c +++ b/contrib/binutils/binutils/unwind-ia64.c @@ -33,10 +33,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static bfd_vma unw_rlen = 0; +static void unw_print_brmask PARAMS ((char *, unsigned int)); +static void unw_print_grmask PARAMS ((char *, unsigned int)); +static void unw_print_frmask PARAMS ((char *, unsigned int)); +static void unw_print_abreg PARAMS ((char *, unsigned int)); +static void unw_print_xyreg PARAMS ((char *, unsigned int, unsigned int)); + static void unw_print_brmask (cp, mask) char * cp; - unsigned char mask; + unsigned int mask; { char *sep = ""; int i; @@ -56,7 +62,7 @@ unw_print_brmask (cp, mask) static void unw_print_grmask (cp, mask) char * cp; - unsigned char mask; + unsigned int mask; { char *sep = ""; int i; @@ -76,7 +82,7 @@ unw_print_grmask (cp, mask) static void unw_print_frmask (cp, mask) char * cp; - unsigned long mask; + unsigned int mask; { char *sep = ""; int i; @@ -96,7 +102,7 @@ unw_print_frmask (cp, mask) static void unw_print_abreg (cp, abreg) char * cp; - unsigned char abreg; + unsigned int abreg; { static const char *special_reg[16] = { @@ -128,8 +134,8 @@ unw_print_abreg (cp, abreg) static void unw_print_xyreg (cp, x, ytreg) char * cp; - unsigned char x; - unsigned char ytreg; + unsigned int x; + unsigned int ytreg; { switch ((x << 1) | ((ytreg >> 7) & 1)) { @@ -522,33 +528,33 @@ typedef bfd_vma unw_word; static unw_word unw_decode_uleb128 PARAMS ((const unsigned char **)); static const unsigned char *unw_decode_x1 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_x2 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_x3 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_x4 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_r1 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_r2 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_r3 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_p1 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_p2_p5 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_p6 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_p7_p10 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_b1 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_b2 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static const unsigned char *unw_decode_b3_x4 PARAMS ((const unsigned char *, - unsigned char, void *)); + unsigned int, void *)); static unw_word unw_decode_uleb128 (dpp) @@ -577,7 +583,7 @@ unw_decode_uleb128 (dpp) static const unsigned char * unw_decode_x1 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code ATTRIBUTE_UNUSED; void * arg ATTRIBUTE_UNUSED; { unsigned char byte1, abreg; @@ -597,7 +603,7 @@ unw_decode_x1 (dp, code, arg) static const unsigned char * unw_decode_x2 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code ATTRIBUTE_UNUSED; void * arg ATTRIBUTE_UNUSED; { unsigned char byte1, byte2, abreg, x, ytreg; @@ -619,7 +625,7 @@ unw_decode_x2 (dp, code, arg) static const unsigned char * unw_decode_x3 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code ATTRIBUTE_UNUSED; void * arg ATTRIBUTE_UNUSED; { unsigned char byte1, byte2, abreg, qp; @@ -643,7 +649,7 @@ unw_decode_x3 (dp, code, arg) static const unsigned char * unw_decode_x4 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code ATTRIBUTE_UNUSED; void * arg ATTRIBUTE_UNUSED; { unsigned char byte1, byte2, byte3, qp, abreg, x, ytreg; @@ -669,7 +675,7 @@ unw_decode_x4 (dp, code, arg) static const unsigned char * unw_decode_r1 (dp, code, arg) const unsigned char *dp; - unsigned char code; + unsigned int code; void *arg; { int body = (code & 0x20) != 0; @@ -683,7 +689,7 @@ unw_decode_r1 (dp, code, arg) static const unsigned char * unw_decode_r2 (dp, code, arg) const unsigned char *dp; - unsigned char code; + unsigned int code; void *arg; { unsigned char byte1, mask, grsave; @@ -701,7 +707,7 @@ unw_decode_r2 (dp, code, arg) static const unsigned char * unw_decode_r3 (dp, code, arg) const unsigned char *dp; - unsigned char code; + unsigned int code; void *arg; { unw_word rlen; @@ -714,7 +720,7 @@ unw_decode_r3 (dp, code, arg) static const unsigned char * unw_decode_p1 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code; void * arg ATTRIBUTE_UNUSED; { unsigned char brmask = (code & 0x1f); @@ -726,7 +732,7 @@ unw_decode_p1 (dp, code, arg) static const unsigned char * unw_decode_p2_p5 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code; void * arg ATTRIBUTE_UNUSED; { if ((code & 0x10) == 0) @@ -807,7 +813,7 @@ unw_decode_p2_p5 (dp, code, arg) static const unsigned char * unw_decode_p6 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code; void * arg ATTRIBUTE_UNUSED; { int gregs = (code & 0x10) != 0; @@ -823,7 +829,7 @@ unw_decode_p6 (dp, code, arg) static const unsigned char * unw_decode_p7_p10 (dp, code, arg) const unsigned char *dp; - unsigned char code; + unsigned int code; void *arg; { unsigned char r, byte1, byte2; @@ -999,7 +1005,7 @@ unw_decode_p7_p10 (dp, code, arg) static const unsigned char * unw_decode_b1 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code; void * arg ATTRIBUTE_UNUSED; { unw_word label = (code & 0x1f); @@ -1014,7 +1020,7 @@ unw_decode_b1 (dp, code, arg) static const unsigned char * unw_decode_b2 (dp, code, arg) const unsigned char * dp; - unsigned char code; + unsigned int code; void * arg ATTRIBUTE_UNUSED; { unw_word t; @@ -1027,7 +1033,7 @@ unw_decode_b2 (dp, code, arg) static const unsigned char * unw_decode_b3_x4 (dp, code, arg) const unsigned char *dp; - unsigned char code; + unsigned int code; void *arg; { unw_word t, ecount, label; diff --git a/contrib/binutils/binutils/version.c b/contrib/binutils/binutils/version.c index 5a4aefe..edaa065 100644 --- a/contrib/binutils/binutils/version.c +++ b/contrib/binutils/binutils/version.c @@ -1,5 +1,5 @@ /* version.c -- binutils version information - Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -22,11 +22,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "bucomm.h" -/* This is the version numbers for the binutils. They all change in - lockstep -- it's easier that way. */ - -const char *program_version = VERSION; - /* Print the version number and copyright information, and exit. This implements the --version option for the various programs. */ @@ -36,8 +31,8 @@ print_version (name) { /* This output is intended to follow the GNU standards document. */ /* xgettext:c-format */ - printf ("GNU %s %s\n", name, program_version); - printf (_("Copyright 1997, 98, 99, 2000, 2001 Free Software Foundation, Inc.\n")); + printf ("GNU %s %s\n", name, BFD_VERSION_STRING); + printf (_("Copyright 2002 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); diff --git a/contrib/binutils/binutils/wrstabs.c b/contrib/binutils/binutils/wrstabs.c index 0b29511..4f10e0d 100644 --- a/contrib/binutils/binutils/wrstabs.c +++ b/contrib/binutils/binutils/wrstabs.c @@ -1,5 +1,5 @@ /* wrstabs.c -- Output stabs debugging information - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -23,12 +23,12 @@ information. */ #include -#include #include #include "bfd.h" #include "bucomm.h" #include "libiberty.h" +#include "safe-ctype.h" #include "debug.h" #include "budbg.h" @@ -2172,7 +2172,7 @@ stab_variable (p, name, kind, val) kindstr = ""; /* Make sure that this is a type reference or definition. */ - if (! isdigit ((unsigned char) *s)) + if (! ISDIGIT (*s)) { char *n; long index; diff --git a/contrib/binutils/config.guess b/contrib/binutils/config.guess index 71de137..aa6ea3f 100755 --- a/contrib/binutils/config.guess +++ b/contrib/binutils/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-16' +timestamp='2002-01-10' # 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 @@ -24,8 +24,9 @@ timestamp='2001-03-16' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . -# Please send patches to . +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -52,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -95,25 +96,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then - CC_FOR_BUILD="$c"; break - fi - done - rm -f $dummy.c $dummy.o $dummy.rel + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found + CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac +esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -127,29 +128,29 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \ + UNAME_MACHINE_ARCH=unknown + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. - case "${UNAME_MACHINE}" in - i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then @@ -171,6 +172,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -204,6 +244,7 @@ main: jsr \$26,exit .end main EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in @@ -225,6 +266,9 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; esac fi rm -f $dummy.s $dummy @@ -242,29 +286,11 @@ EOF Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -328,9 +354,6 @@ EOF aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -357,18 +380,6 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -385,6 +396,7 @@ EOF echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ @@ -412,6 +424,9 @@ EOF rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -459,7 +474,7 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) @@ -472,6 +487,7 @@ EOF exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include @@ -533,10 +549,8 @@ EOF 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - case "${HPUX_REV}" in - 11.[0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 @@ -545,12 +559,13 @@ EOF case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac - fi ;; - esac - if [ "${HP_ARCH}" = "" ]; then - sed 's/^ //' << EOF >$dummy.c + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include @@ -583,10 +598,10 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; @@ -595,6 +610,7 @@ EOF echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int @@ -630,7 +646,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -639,7 +655,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -649,9 +665,6 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -674,12 +687,13 @@ EOF echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' @@ -702,10 +716,7 @@ EOF FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -717,9 +728,6 @@ EOF *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; @@ -729,6 +737,9 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -760,97 +771,43 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - cat >$dummy.c < /* for printf() prototype */ -int main (int argc, char *argv[]) { -#else -int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) - # Determine Lib Version - cat >$dummy.c < -#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("unknown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $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} + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) UNAME_MACHINE="alpha" ;; - 1-0) UNAME_MACHINE="alphaev5" ;; - 1-1) UNAME_MACHINE="alphaev56" ;; - 1-101) UNAME_MACHINE="alphapca56" ;; - 2-303) UNAME_MACHINE="alphaev6" ;; - 2-307) UNAME_MACHINE="alphaev67" ;; - esac - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) @@ -876,78 +833,62 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; - i?86:Linux:*:*) + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_supported_emulations=`cd /; ld --help 2>&1 \ - | sed -ne '/supported emulations:/!d + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) + case "$ld_supported_targets" in + elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86coff) + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - esac - # 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. - test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# 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-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + LIBC=gnuaout + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + 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, @@ -955,7 +896,7 @@ EOF # 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.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -963,16 +904,15 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -1044,7 +984,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) @@ -1064,8 +1004,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1077,6 +1017,10 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; @@ -1123,7 +1067,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[KW]:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1146,7 +1090,7 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i?86:OS/2:*:*) + i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx @@ -1169,11 +1113,18 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +eval $set_cc_for_build cat >$dummy.c < diff --git a/contrib/binutils/config.if b/contrib/binutils/config.if index 625a407..3958928 100644 --- a/contrib/binutils/config.if +++ b/contrib/binutils/config.if @@ -82,8 +82,8 @@ EOF exit 1 fi else - # Cross compiling. Assume glibc 2.1. - libc_interface=-libc6.1- + # Cross compiling. Assume glibc 2.2. + libc_interface=-libc6.2- fi ;; *) diff --git a/contrib/binutils/config.sub b/contrib/binutils/config.sub index 7146a2f..1657334 100755 --- a/contrib/binutils/config.sub +++ b/contrib/binutils/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-19' +timestamp='2002-01-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -29,7 +29,8 @@ timestamp='2001-03-19' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Please send patches to . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -117,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -157,6 +158,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -215,25 +224,36 @@ 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 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ - | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ - | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp10 | pdp11 \ - | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ - | pj | pjl | h8500) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -241,13 +261,13 @@ case $basic_machine in basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86 | x86_64) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -256,30 +276,45 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ - | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ - | [cjt]90-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -386,6 +421,14 @@ case $basic_machine in decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -506,19 +549,19 @@ case $basic_machine in basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -588,6 +631,10 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) basic_machine=i386-pc os=-msdos @@ -692,7 +739,7 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexgen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) @@ -701,7 +748,7 @@ case $basic_machine in pentiumii | pentium2) basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) @@ -725,6 +772,16 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; @@ -742,6 +799,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -753,7 +816,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -833,6 +896,10 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -879,6 +946,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; xmp) basic_machine=xmp-cray os=-unicos @@ -932,10 +1003,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4) + sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; - sparc | sparcv9) + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -957,6 +1028,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -1013,16 +1087,18 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* | -morphos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1069,6 +1145,9 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; @@ -1149,6 +1228,7 @@ case $basic_machine in arm*-semi) os=-aout ;; + # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; @@ -1341,6 +1421,9 @@ case $basic_machine in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/contrib/binutils/config/ChangeLog b/contrib/binutils/config/ChangeLog index 920ab32..5a398ec 100644 --- a/contrib/binutils/config/ChangeLog +++ b/contrib/binutils/config/ChangeLog @@ -1,4 +1,9 @@ -Fri Jul 14 18:13:23 2000 Mark P Mitchell +2001-02-09 Martin Schwidefsky + + * mh-s390pic: New file. + * mt-s390pic: New file. + +2000-07-14 Mark P Mitchell * mh-irix6 (CC): Don't set it. diff --git a/contrib/binutils/configure b/contrib/binutils/configure index 57e22d8..e55339f 100755 --- a/contrib/binutils/configure +++ b/contrib/binutils/configure @@ -3,7 +3,7 @@ ### WARNING: this file contains embedded tabs. Do not run untabify on this file. # Configuration script -# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 +# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ subdirs= target_alias=NOTARGET target_makefile_frag= undefs=NOUNDEFS -version="$Revision: 1.11 $" +version="$Revision: 1.13 $" x11=default bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' @@ -450,7 +450,7 @@ case "${fatal}" in fi ;; esac - echo "Configuring for a ${host_alias} host." 1>&2 + echo "Configuring for a ${host_alias} host." arguments="--host=$host_alias $arguments" else echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2 @@ -804,46 +804,57 @@ fi # If CC and CXX are not set in the environment, and the Makefile # exists, try to extract them from it. This is to handle running -# ./config.status by hand. -if [ -z "${CC}" ] && [ -r Makefile ]; then - sed -n -e ':loop +# ./config.status by hand. Do the same for various Makefile fragments +# so that they can specify these vars. +for file in Mafefile ${package_makefile_rules_frag} \ + ${site:+config/ms-${site}} ${host_makefile_frag} \ + ${target_makefile_frag} ${package_makefile_frag} +do + if ! test -r $file; then + file=${srcdir}/${file} + if ! test -r $file; then continue; fi + fi + + if [ -z "${CC}" ]; then + sed -n -e ':loop /\\$/ N s/\\\n//g t loop -/^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CC=`tail -1 Makefile.cc` - rm -f Makefile.cc -fi +/^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < $file > Makefile.cc + CC=`tail -1 Makefile.cc` + rm -f Makefile.cc + fi -if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then - sed -n -e ':loop + if [ -z "${CFLAGS}" ]; 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 +/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < $file > Makefile.cc + CFLAGS=`tail -1 Makefile.cc` + rm -f Makefile.cc + fi -if [ -z "${CXX}" ] && [ -r Makefile ]; then - sed -n -e ':loop + if [ -z "${CXX}" ]; then + sed -n -e ':loop /\\$/ N s/\\\n//g t loop -/^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CXX=`tail -1 Makefile.cc` - rm -f Makefile.cc -fi +/^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < $file > Makefile.cc + CXX=`tail -1 Makefile.cc` + rm -f Makefile.cc + fi -if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then - sed -n -e ':loop + if [ -z "${CXXFLAGS}" ]; 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 +/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < $file > Makefile.cc + CXXFLAGS=`tail -1 Makefile.cc` + rm -f Makefile.cc + fi +done # Generate a default definition for YACC. This is used if the makefile can't # locate bison or byacc in objdir. @@ -1078,6 +1089,12 @@ else GDB_TK="" fi +all_build_modules= +if test x"${build_alias}" != x"${host_alias}" +then + all_build_modules='$(ALL_BUILD_MODULES_LIST)' +fi + for subdir in . ${subdirs} ; do # ${subdir} is relative path from . to the directory we're currently @@ -1378,6 +1395,7 @@ EOF -e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \ -e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \ -e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \ + -e "s|^ALL_BUILD_MODULES =.*|ALL_BUILD_MODULES =${all_build_modules}|" \ -e "/^CC[ ]*=/{ :loop1 /\\\\$/ N diff --git a/contrib/binutils/configure.in b/contrib/binutils/configure.in index 1284aa6..a9219bb 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-99, 2000 Free Software Foundation, Inc. +# Copyright (C) 1992-99, 2000, 2001 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 @@ -321,6 +321,9 @@ if [ x${shared} = xyes ]; then powerpc*-*-*) host_makefile_frag="${host_makefile_frag} config/mh-ppcpic" ;; + s390-* | s390x-*) + host_makefile_frag="${host_makefile_frag} config/mh-s390pic" + ;; *-*-*) if test -f ${srcdir}/config/mh-${host_cpu}pic; then host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic" @@ -431,6 +434,18 @@ if [ ! -d ${target_subdir} ] ; then fi fi +build_subdir=${build_alias} + +if [ x"${build_alias}" != x"${host}" ] ; then + if [ ! -d ${build_subdir} ] ; then + if mkdir ${build_subdir} ; then true + else + echo "'*** could not make ${PWD=`pwd`}/${build_subdir}" 1>&2 + exit 1 + fi + fi +fi + copy_dirs= # Handle --with-headers=XXX. The contents of the named directory are @@ -555,7 +570,7 @@ case "${host}" in noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" ;; *-*-cygwin*) - noconfigdirs="autoconf automake send-pr rcs guile perl texinfo apache inet" + noconfigdirs="autoconf automake send-pr rcs guile perl apache inet" ;; *-*-netbsd*) noconfigdirs="rcs" @@ -569,7 +584,34 @@ case "${host}" in esac +# Save it here so that, even in case of --enable-libgcj, if the Java +# front-end isn't enabled, we still get libgcj disabled. +libgcj_saved=$libgcj +case $enable_libgcj in +yes) + # If we reset it here, it won't get added to noconfigdirs in the + # target-specific build rules, so it will be forcibly enabled + # (unless the Java language itself isn't enabled). + libgcj= + ;; +no) + # Make sure we get it printed in the list of not supported target libs. + noconfigdirs="$noconfigdirs ${libgcj}" + ;; +esac + case "${target}" in + *-*-netbsd*) + # Skip some stuff on all NetBSD configurations. + skipdirs="$skipdirs target-newlib target-libiberty target-libgloss" + + # Skip some stuff that's unsupported on some NetBSD configurations. + case "${target}" in + *) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + esac + ;; *-*-netware) noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss target-libffi" ;; @@ -613,18 +655,6 @@ case "${target}" in arm-*-pe*) noconfigdirs="$noconfigdirs target-libgloss" ;; - arm-*-coff*) - noconfigdirs="$noconfigdirs target-libgloss" - if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-bsp target-cygmon" - fi - ;; - arm-*-elf*) - noconfigdirs="$noconfigdirs target-libgloss" - if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-bsp target-cygmon" - fi - ;; arm-*-oabi*) noconfigdirs="$noconfigdirs target-libgloss target-libffi" ;; @@ -638,25 +668,25 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libgloss target-libffi" ;; strongarm-*-elf) - noconfigdirs="$noconfigdirs target-libgloss target-libffi" + noconfigdirs="$noconfigdirs target-libffi" if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi ;; strongarm-*-coff) - noconfigdirs="$noconfigdirs target-libgloss target-libffi" + noconfigdirs="$noconfigdirs target-libffi" if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi ;; xscale-*-elf) - noconfigdirs="$noconfigdirs target-libgloss target-libffi" + noconfigdirs="$noconfigdirs target-libffi" if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi ;; xscale-*-coff) - noconfigdirs="$noconfigdirs target-libgloss target-libffi" + noconfigdirs="$noconfigdirs target-libffi" if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi @@ -683,7 +713,9 @@ case "${target}" in target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" fi ;; - h8300*-*-* | \ + h8300*-*-*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; h8500-*-*) noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi" ;; @@ -701,12 +733,18 @@ case "${target}" in "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;; *) ;; esac - noconfigdirs="$noconfigdirs ld shellutils" + # According to Alexandre Oliva , libjava won't + # build on HP-UX 10.20. + noconfigdirs="$noconfigdirs ld shellutils ${libgcj}" ;; ia64*-*-elf*) # No gdb support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" ;; + ia64*-**-hpux*) + # No gdb or ld support yet. + noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld" + ;; i[3456]86-*-coff | i[3456]86-*-elf) if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-libstub target-cygmon" @@ -718,7 +756,7 @@ case "${target}" in ;; i[3456]86-*-mingw32*) target_configdirs="$target_configdirs target-mingw" - noconfigdirs="$noconfigdirs expect target-libgloss target-libffi" + noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" # Can't build gdb for mingw32 if not native. case "${host}" in @@ -729,7 +767,7 @@ case "${target}" in ;; *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" - noconfigdirs="$noconfigdirs target-gperf target-libgloss target-libffi" + noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` @@ -764,7 +802,7 @@ case "${target}" in noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss target-libffi" ;; i[3456]86-*-beos*) - noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss" + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) noconfigdirs="$noconfigdirs target-libiberty target-librx target-libg++ target-libstdc++ target-libio target-libf2c target-libchill target-zlib target-libobjc" @@ -793,12 +831,7 @@ case "${target}" in ;; powerpc-*-aix*) # copied from rs6000-*-* entry - # The configure and build of ld are currently disabled because - # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least) - # The symptom is that GDBtk 4.18 fails at startup with a segfault - # if linked by GNU ld, but not if linked by the native ld. - noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss target-libffi ld" - use_gnu_ld=no + use_gnu_ld=yes ;; powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) target_configdirs="$target_configdirs target-winsup" @@ -823,12 +856,8 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib gprof cvssrc target-libffi" ;; rs6000-*-aix*) - # The configure and build of ld are currently disabled because - # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least) - # The symptom is that GDBtk 4.18 fails at startup with a segfault - # if linked by GNU ld, but not if linked by the native ld. - noconfigdirs="$noconfigdirs gprof target-libffi ld" - use_gnu_ld=no + noconfigdirs="$noconfigdirs gprof target-libffi" + use_gnu_ld=yes ;; rs6000-*-*) noconfigdirs="$noconfigdirs gprof target-libffi" @@ -844,7 +873,11 @@ case "${target}" in mips*-*-irix6*) # The GNU assembler does not support IRIX 6. # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work) - noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss" + # Linking libjava exceeds command-line length limits on at least + # IRIX 6.2, but not on IRIX 6.5. + # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham + # + noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss ${libgcj}" ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi" @@ -880,13 +913,13 @@ case "${target}" in if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-libstub target-cygmon" fi - noconfigdirs="target-libffi" + noconfigdirs="$noconfigdirs target-libffi" ;; sparclite-*-*) if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" fi - noconfigdirs="target-libffi" + noconfigdirs="$noconfigdirs target-libffi" ;; sparc-*-sunos4*) if [ x${is_cross_compiler} != xno ] ; then @@ -895,6 +928,17 @@ case "${target}" in use_gnu_ld=no fi ;; + sparc-*-solaris*) + case "${host}" in + sparc-*-solaris2.8) + # According to Gerald Pfeifer , libjava + # won't build correctly on Solaris 8 if there's a + # previously-installed version of GCC in the configured prefix. + # This problem does not show up on earlier versions of Solaris. + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + esac + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss target-libffi" ;; @@ -920,7 +964,7 @@ case "${target}" in *-*-mpw*) # Macs want a resource compiler. configdirs="$configdirs grez" - noconfigdirs="target-libffi" + noconfigdirs="$noconfigdirs target-libffi" ;; esac @@ -947,18 +991,24 @@ fi # Look if the user specified --enable-languages="..."; if not, use # the environment variable $LANGUAGES if defined. $LANGUAGES might # go away some day. +# NB: embedded tabs in this IF block -- do not untabify if test x"${enable_languages+set}" != xset; then if test x"${LANGUAGES+set}" = xset; then - enable_languages="`echo ${LANGUAGES} | tr ' ' ','`" + enable_languages="${LANGUAGES}" + echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 else enable_languages=all fi else - if test x"${enable_languages}" = x; then - echo configure.in: --enable-languages needs at least one argument 1>&2 + if test x"${enable_languages}" = x || + test x"${enable_languages}" = xyes; + then + echo configure.in: --enable-languages needs at least one language argument 1>&2 exit 1 fi fi +enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` + subdirs= for lang in ${srcdir}/gcc/*/config-lang.in .. do @@ -1183,7 +1233,7 @@ rm -f conftest* case "${host}" in sparc-sun-solaris2*) CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`" - if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then + if [ "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ] ; then could_use= [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin" if [ -d /opt/cygnus/bin ] ; then @@ -1225,7 +1275,8 @@ if [ "${shared}" = "yes" ]; then esac fi -# Record target_configdirs and the configure arguments in Makefile. +# Record target_configdirs and the configure arguments for target and +# build configuration in Makefile. target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` targargs=`echo "${arguments}" | \ sed -e 's/--no[^ ]*//' \ @@ -1234,6 +1285,11 @@ targargs=`echo "${arguments}" | \ -e 's/--bu[a-z-]*=[^ ]*//' \ -e 's/--ta[a-z-]*=[^ ]*//'` +# For the build-side libraries, we just need to pretend we're native, +# and not use the same cache file. Multilibs are neither needed nor +# desired. +buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${targargs}" + # Passing a --with-cross-host argument lets the target libraries know # whether they are being built with a cross-compiler or being built # native. However, it would be better to use other mechanisms to make the @@ -1254,6 +1310,9 @@ if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " targargs="--with-newlib ${targargs}" fi +# Pass the appropriate --host, --build, and --cache-file arguments. +targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}" + # provide a proper gxx_include_dir. # Note, if you change the default, make sure to fix both here and in # the gcc, libio, and libstdc++ subdirectories. @@ -1315,10 +1374,20 @@ case " $skipdirs " in fi fi - # If we're building newlib, use its generic headers last, but search - # for any libc-related directories first (so make it the last -B - # switch). - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include' + case "${target}-${is_cross_compiler}" in + i[3456]86-pc-linux*-no) + # Here host == target, so we don't need to build gcc, + # so we don't want to discard standard headers. + FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'` + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/' + ;; + *) + # If we're building newlib, use its generic headers last, but search + # for any libc-related directories first (so make it the last -B + # switch). + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include' + ;; + esac ;; esac @@ -1371,7 +1440,7 @@ esac if test "x${CXX_FOR_TARGET+set}" = xset; then : elif test -d ${topsrcdir}/gcc; then - CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags + CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3) echo xgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags elif test "$host" = "$target"; then CXX_FOR_TARGET='$(CXX)' else @@ -1381,16 +1450,26 @@ case $CXX_FOR_TARGET in *' $(FLAGS_FOR_TARGET)') ;; *) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;; esac -qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,&,\\\&,g'` +qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'` + +# We want to defer the evaluation of `cmd`s and shell variables in +# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for +# bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single +# quotes, but we still have to duplicate `$'s so that shell variables +# can be expanded by the nested make as shell variables, not as make +# macros. +qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` -targargs="--cache-file=../config.cache --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_CONFIGARGS[ ]*=.*$%TARGET_CONFIGARGS = ${targargs}%" \ -e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \ -e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \ -e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \ -e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \ + -e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \ -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \ + -e "s%^BUILD_SUBDIR[ ]*=.*$%BUILD_SUBDIR = ${build_subdir}%" \ + -e "s%^BUILD_CONFIGARGS[ ]*=.*$%BUILD_CONFIGARGS = ${buildargs}%" \ -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \ Makefile > Makefile.tem rm -f Makefile diff --git a/contrib/binutils/gas/CONTRIBUTORS b/contrib/binutils/gas/CONTRIBUTORS index b3fd03e..68d11dc 100644 --- a/contrib/binutils/gas/CONTRIBUTORS +++ b/contrib/binutils/gas/CONTRIBUTORS @@ -2,7 +2,7 @@ If you've contributed to gas and your name isn't listed here, it is not meant as a slight. I just don't know about it. Email me, -raeburn@cygnus.com and I'll correct the situation. +nickc@redhat.com and I'll correct the situation. This file will eventually be deleted: The general info will go into the documentation, and info on specific files will go into an AUTHORS diff --git a/contrib/binutils/gas/ChangeLog b/contrib/binutils/gas/ChangeLog index 03a8210..10a0688 100644 --- a/contrib/binutils/gas/ChangeLog +++ b/contrib/binutils/gas/ChangeLog @@ -1,5199 +1,332 @@ -2001-10-16 Alan Modra +2002-01-26 Nick Clifton - From Andrew Pines - * config/tc-m68k.c (m68k_ip): Correct absolute jmp opcodes. + * po/fr.po: Updated version -2001-10-05 Alan Modra +2002-01-24 Kazu Hirata - * config/tc-i386.c (parse_register): If not producing code for - x86_64, reject x86_64 register name matches. - (md_assemble): Remove now redundant check for x86_64 regs. + * config/tc-h8300.c (check_operand): Don't print a warning + when a valid 24-bit address is given to a 16-bit address + operand. -2001-09-30 Stephane Carrez +2002-01-24 Alexandre Oliva - * config/tc-m68hc11.c (cmp_opcode): Define prototype. - (print_opcode_format, skip_whites): Likewise. - (convert_branch, m68hc11_new_insn): Likewise. - (build_dbranch_insn, build_indexed_byte): Likewise. - (build_reg_mode, find, find_opcode): Likewise. - (print_insn_format): Fix call to print_opcode_format. - (md_assemble): Fix call to build_dbranch_insn. + * config/tc-sh.c (sh_elf_suffix): Removed. + (sh_PIC_related_p, sh_check_fixup, sh_cons_fix_new, + sh_end_of_match, sh_parse_name): New functions. + (sh_elf_cons): Simplify. + (parse_exp): Reject misplaced PIC operands. + (md_undefined_symbol): Simplify. + (sh_fix_adjustable): Let @GOTOFF be adjusted. + (md_apply_fix3): Write @PLT and @GOTOFF addends in place. + (tc_gen_reloc): Move fixp subsy absolute value into addnumber. + Complain if subsy remains at the end. + * config/tc-sh.h (sh_parse_name, sh_cons_fix_new): Declare. + (md_parse_name, TC_CONS_FIX_NEW, O_PIC_reloc): Define. -2001-09-19 Andreas Schwab +2002-01-22 Alexandre Oliva - * config/tc-m68k.c: Include "dwarf2dbg.h". + * config/tc-mn10300.c (xr_registers): Move `pc'... + (other_registers): ... here. -2001-08-29 Joel Sherrill +2002-01-22 Alan Modra - * configure.in (i[3456]86-*-rtems*, m68*-*-rtems*): Change - default from coff to elf. - * configure: Regenerate. - -2001-08-28 Philip Blundell - - * configure.in (sh-*-coff*, sh-*-rtems*): Set bfd_gas to yes. - Patch from Joel Sherril - * configure: Regenerate. - -2001-07-21 Andreas Schwab - - * config/tc-m68k.c (md_pseudo_table) [OBJ_ELF]: Add .file and - .loc. - (md_assemble) [OBJ_ELF]: Call dwarf2_emit_insn before emitting - insn. - * config/tc-m68k.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. - -2001-07-14 matthew green - - * configure.in (i386-*-netbsdelf*): New target. - * configure: Regenerate. - -2001-07-07 Nick Clifton - - * ecoff.c (add_file): Only set debug_type to DEBUG_NONE if it is - DEBUG_UNSPECIFIED. - -2001-06-27 Nick Clifton - - * config/tc-arm.c (do_ldst): Use MVN to build simple inverted - constants. - -2000-06-20 Tom Rix - - * config/tc-ppc.c (ppc_comm): Change default alignment to 4 bytes. - -2001-06-18 Philip Blundell - - * config/tc-arm.c (do_msr): Remove restriction on usage of - immediate operands. - -2001-06-13 Philip Blundell - - * config/tc-arm.c (thumb_shift): Improve wording of error message. - (do_t_arit): Likewise. - -2001-06-13 Nick Clifton - - * config/tc-sh.c (md_pseudo_table): Only intercept the .file and - .loc pseudos if the dfwarf2 functions are available. - (md_assemble): Only call dwarf2_emit_insn if it is available. - -2001-06-13 Nick Clifton - - Merge from mainline: - 2001-05-11 Nick Clifton - * config/tc-arm.c (arm_handle_align): When truncating an aligned - block, ensure that the low order bits of the alignment are - preserved. - 2001-05-06 Nick Clifton - * config/tc-arm.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define. - * config/tc-arm.c (arm_handle_align): Do not insert more than - MAX_MEM_FOR_RS_ALIGN_CODE bytes. - (arm_frag_align_code): Use MAX_MEM_FOR_RS_ALIGN_CODE. - 2001-04-26 Nick Clifton - * config/tc-arm.c (arm_handle_align): New Function: Generate - no-op filled alignment frags. - (arm_frag_align_code): New Function: Create a code alignment frag. - (arm_init_frag): New Function: Initialse the target dependent - parts of a frag. - * config/tc-arm.h (TC_FRAG_TYPE): Define. - (TC_FRAG_INIT): Define. - (HANDLE_ALIGN): Define. - (md_do_align): Define. - 2001-03-12 Nick Clifton - * config/tc-arm.c (md_begin): Always set machine type based on - cpu_variant. - 2001-03-06 Nick Clifton - * config/tc-arm.c (md_apply_fix3): Clear bit zero of offset in - BLX(1) instruction. - -2001-06-12 Nick Clifton - - * doc/as.texinfo (Infix Ops): Document that comparison and - combiner operators can be used as infix operators. - -2001-06-12 Nick Clifton - - * config/tc-arm.c: Fix test for overlow of literal pool. - -2001-06-11 Alan Modra - - Merge from mainline. - 2001-06-08 Alan Modra - * config/tc-mips.c (mips16_mark_labels): Reduce number of calls to - S_GET_VALUE by using a temp. - (append_insn): Likewise, and for S_SET_VALUE too. - (mips_emit_delays): Likewise. - (my_getExpression): Likewise. - (md_apply_fix): Likewise. Use "valueT" rather than "long" for "value". - (mips16_extended_frag): Cater for first relaxation pass having - bogus addresses. Use relax_marker to reliably determine whether a - symbol frag has been reached on the current pass. - - 2001-06-07 H.J. Lu - * configure.in: Use MIPS_STABS_ELF for Linux/mips. - * configure: Regenerate. - - 2001-06-07 H.J. Lu - * config/tc-mips.c (mips_pseudo_table): Add "extern" if - MIPS_STABS_ELF is defined. - - 2001-06-06 Christian Groessler - * config/tc-z8k.c: Removed many warnings by removing unused - variables and tagging unused parameters as such. - (md_begin): Fixed a typo (","instead of ";"). - (struct ctrl_table): Add parentheses to initialize array - correctly. - (struct flag_table): Likewise. - (struct intr_table): Likewise. - (struct table): Likewise. - (check_operand): "#if 0"'ed since it doesn't seem to be used. - - 2001-06-06 Peter Jakubek - * gas/config/tc-m68k.c (md_show_usage): Add all supported ColdFire - options to list (e.g. m5206e, m5307, m5407). - - 2001-06-06 Alan Modra - * config/tc-i386.c (md_assemble): Handle Pentium4 branch hints. - : Remove dead code. - - 2001-06-05 Nick Clifton - * symbols.c (S_SET_EXTERNAL): Do not override a section symbol's - status. - - 2001-05-27 Alan Modra - * config/tc-m68k.c (md_assemble): Ensure variable part of frag is - allocated in the same chunk as the fixed part. - - 2001-05-25 Alan Modra - * configure.in: Replace linuxoldld with linux*oldld. - * configure: Regenerate. - - 2000-05-24 Tom Rix - * config/obj-coff.c (add_lineno): xcoff allows negative line - numbers - * config/tc-ppc.c (ppc_stabx): fix generated symbol - - 2001-05-23 Thiemo Seufer - * config/tc-mips.c (ISA_HAS_64BIT_REGS): Add ISA_MIPS64 as 64 bit - architecture, remove erraneous ISA_MIPS32. - (md_show_usage): Add MIPS r12k support. - (mips_cpu_info_table): Add MIPS r12k support. - - 2001-05-22 Alan Modra - * config/tc-m68k.c (relaxable_symbol): Only treat external symbols - as relaxable if embedded system, make weak syms non-relaxable. - Move definition.. - (tc_m68k_fix_adjustable): ..so it can be used here. - (md_apply_fix_2): Sign extend without conditional. - - 2001-05-16 Jeff Johnston - * cgen.c (gas_cgen_tc_gen_reloc): Changed error message when - howto entry is not found. - - 2001-05-10 Alan Modra - * config/obj-vms.c (obj_crawl_symbol_chain): Don't take address of - symbol_next. - * config/tc-fr30.c (md_estimate_size_before_relax): Return size of - current variable part of frag. - * config/tc-m32r.c (md_estimate_size_before_relax): Likewise. - * config/tc-m68hc11.c (RELAX_STATE): Define. - (RELAX_LENGTH): Define. - (md_estimate_size_before_relax): Handle non-relaxable cases - separately from relaxable cases for clarity, and return correct - size for multi-pass relaxation. - * config/tc-tahoe.c (RELAX_LENGTH): Correct. - (md_estimate_size_before_relax): As for tc-m68hc11.c. - (md_convert_frag): Remove "length_code". - * config/tc-vax.c (RELAX_STATE): Define. - (RELAX_LENGTH): Define. - (md_relax_table): Add missing entry. - (md_estimate_size_before_relax): As for tc-m68hc11.c. - (md_convert_frag): Remove "length_code". - * config/tc-ns32k.c (md_estimate_size_before_relax): Simplify and - don't bother setting fr_var. Return correct size for multi-pass - relaxation. - * config/tc-h8500.c (md_convert_frag): Don't bother clearing fr_var. - (md_estimate_size_before_relax): No need to set fr_var. - * config/tc-mcore.c (md_convert_frag): Don't bother clearing fr_var. - (md_estimate_size_before_relax): No need to set fr_var. - - 2001-05-08 Andreas Schwab - * config/tc-m68k.c: Instead of replacing -1 by 64 in assignment to - fx_pcrel_adjust explicitly sign extend when reading it. - - 2001-05-03 Thiemo Seufer - * Makefile.am (TARG_ENV_HFILES): Add te-hppa64.h and te-hppalinux64.h. - Run "make dep-am". - * Makefile.in: Regenerate. - * configure.in: Remove duplicate mips-*-ecoff* entry. - * configure: Regenerate. - * config/obj-ecoff.c (obj_pseudo_table): Fix terminating entry. - (n_names): Cast away type mismatch. - (ecoff_sec_sym_ok_for_reloc): Add unused attribute. - (obj_ecoff_frob_symbol): Likewise. - * ecoff.c: (add_file): Add unused attribute. - (ecoff_directive_begin): Likewise. - (ecoff_directive_bend): Likewise. - (ecoff_directive_def): Likewise. - (ecoff_directive_dim): Likewise. - (ecoff_directive_scl): Likewise. - (ecoff_directive_size): Likewise. - (ecoff_directive_type): Likewise. - (ecoff_directive_tag): Likewise. - (ecoff_directive_val): Likewise. - (ecoff_directive_endef): Likewise. - (ecoff_directive_end): Likewise. - (ecoff_directive_ent): Likewise. - (ecoff_directive_extern): Likewise. - (ecoff_directive_file): Likewise. - (ecoff_directive_fmask): Likewise. - (ecoff_directive_frame): Likewise. - (ecoff_directive_mask): Likewise. - (ecoff_directive_loc): Likewise. - (mark_stabs): Likewise. - (ecoff_stab): Likewise. - (ecoff_frob_symbol): Cast away type mismatch. - (ecoff_padding_adjust): Likewise. - (ecoff_build_symbols): Likewise. - (ecoff_build_procs): Likewise. - (ecoff_build_aux): Likewise. - (ecoff_build_strings): Likewise. - (ecoff_build_fdr): Likewise. - (ecoff_build_debug): Likewise. - * itbl-ops.c (itbl_assemble): Variable initialization. - - 2001-04-29 Keith M Wesolowski - * config/tc-mips.c (md_parse_option): Also accept - elf64-tradbigmips and elf64-tradlittlemips for OPTION_64. - - 2001-04-27 Sean McNeil - * configure.in: Add arm-vxworks. - * configure: Regenerate. - - 2001-04-25 Nick Clifton - * config/obj-coff.c (do_linenos_for): Check to see if the filename - symbol has been initialised before extracting its symbol index. - - 2001-04-24 Christian Groessler - * config/tc-z8k.c (build_bytes): 12 and 16 bit displacements now - generate R_CALLR and R_REL16 relocations - - 2000-04-20 Jason Eckhardt - * config/tc-d10v.h (tc_frob_label): Update the symbol's frag - since frag_now can change after d10v_cleanup is called. - - 2001-04-12 Jason Merrill - * dwarf2dbg.c (process_entries): Don't optimize redundant line notes. - - 2001-04-07 Steven J. Hill - * config/tc-mips.c: Support ELF64 for traditional MIPS targets. - * Makefile.am: (TARG_ENV_HFILES): Add tc-mips.h. - * Makefile.in: Regenerated. - * configure.in: Use traditional MIPS targets for Linux/MIPS. - * configure: Regenerated. - - 2001-04-05 Alan Modra - * configure.in: Add h8500-*-coff and h8500-*-rtems targets. - * configure: Regenerate. - * config/tc-h8500.c (md_estimate_size_before_relax): Add missing - cases, and always return size based on current fr_subtype. - (md_begin): Move initialization of md_relax_table.. - (md_relax_table): ..to static initializer. Set rlx_length for - UNDEF_WORD_DISP cases. - * config/tc-w65.c (md_estimate_size_before_relax): Likewise. - (md_begin): Likewise. - (md_relax_table): Likewise. - * config/tc-mcore.c (md_estimate_size_before_relax): Likewise. - (md_relax_table): Set rlx_length for UNDEF_WORD_DISP cases. - Set rlx_backward and rlx_forward to zero for unused states. - * config/tc-sh.c (md_estimate_size_before_relax): Likewise. - (md_relax_table): Set rlx_length for UNDEF_WORD_DISP cases. - (UNCOND12, UNCOND32): Remove duplicate defines. - - 2001-03-30 Alan Modra - * dwarf2dbg.c (dwarf2_directive_file): Fix warnings. - - 2001-03-30 Alan Modra - * config/tc-sh.c (md_estimate_size_before_relax): Add extra - do-nothing cases to switch to avoid abort on a second relaxation - pass, and tidy code a little. - * config/tc-h8500.c (md_estimate_size_before_relax): Likewise. - * config/tc-w65.c (md_estimate_size_before_relax): Likewise. - * config/tc-mcore.c (COND12, UNCD12): Rename to DISP12 throughout. - (COND32, UNCD32): Rename to DISP32 throughout. - (UNDEF_WORD_DISP): Renumber to 3. - (md_estimate_size_before_relax): Add extra do-nothing cases. - * config/tc-mn10200.c (md_estimate_size_before_relax): Rewrite. - * config/tc-ns32k.c (md_estimate_size_before_relax): Add cases to - handle word and dword branches. - - 2001-03-17 Alan Modra - * read.c (do_org): Handle complex expressions. - * cgen.c (gas_cgen_finish_insn): Likewise. - - 2001-03-15 Alexandre Oliva - * config/tc-sh.c (parse_reg): Match capital MACH and MACL. - - 2001-03-06 Igor Shevlyakov - * config/tc-m68k.c : Add 5407 to archs[] table. - (HAVE_LONG_BRANCH): Add mcf5407. - (select_control_regs): Recognize 5407. - - 2001-03-02 Richard Sandiford - * config/atof-ieee.c (TC_LARGEST_EXPONENT_IS_NORMAL): New macro. - (gen_to_words): Print warnings if NaNs are found and the target CPU - does not support them. Allow largest exponent to be used in normal - numbers if TC_LARGEST_EXPONENT_IS_NORMAL evaluates to true. - - 2001-02-27 Alan Modra - * configure.in (BFD_VERSION): New. - (AM_INIT_AUTOMAKE): Use $BFD_VERSION. - * configure: Regenerate. - - 2001-02-26 Mark Elbrecht - * config/obj-coff.c [BFD_ASSEMBLER] (obj_coff_section): Set - SEC_NEVER_LOAD when the 'n' flag is used. - Add SEC_NEVER_LOAD to matchflags. - - 2001-02-24 Stephane Carrez - * symbols.c (decode_local_label_name): Initialize message_format - only when an error is reported (perf pb due to I18N). - - 2001-02-23 H.J. Lu - * dwarf2dbg.c (dwarf2_directive_file): Call s_app_file (0) if - BFD_ASSEMBLER is not defined. - - 2001-02-16 matthew green - * cgen.c (gas_cgen_md_apply_fix3): Support BFD_RELOC_64. - - 2001-02-11 Maciej W. Rozycki - * config/tc-mips.c (macro): For M_LA_AB emit a - BFD_RELOC_MIPS_CALL16 relocation or a - BFD_RELOC_MIPS_CALL_HI16/BFD_RELOC_MIPS_CALL_LO16 pair instead of - BFD_RELOC_MIPS_GOT16 and - BFD_RELOC_MIPS_GOT_HI16/BFD_RELOC_MIPS_GOT_LO16, respectively for - loading the jump register when generating SVR4_PIC code. - - 2001-02-10 Chris Demetriou - * configure.in: Make 'mipself' and 'mipsecoff' emulations - map to MIPS-specific files, as they used to do before the - change on 2000-05-21. - * configure: Regerate. - - 2001-02-10 Chris Demetriou - * config/tc-mips.c (md_parse_option): Don't try to compile - ELF-only option code if not ELF. - -2001-06-10 Philip Blundell - - * configure.in: Set version to 2.11.1. - * configure: Regenerate. - -2001-06-07 Alan Modra - - * Most files: Update copyright notices. - -2001-06-06 Hans-Peter Nilsson - - * config/tc-cris.c (cris_insn_first_word_frag): New. - (md_assemble): Call cris_insn_first_word_frag to get the first - frag in an insn, not frag_more. Don't call dwarf2_emit_insn at - end. Drop variable insn_size. - (gen_bdap): Call cris_insn_first_word_frag, not frag_more. - -2001-06-06 Nick Clifton - - * as.c (show_usage): Remove L from listing options. It is not a - generic option. - -2001-06-06 Tracy Kuhrt - - * as.c (parse_args): Correct option name "listing-lhs-width2". - -2001-05-30 Richard Henderson - - * read.c (emit_leb128_expr): Call md_cons_align. - -2001-05-28 Jeff Sturm - - * config/tc-sparc.c (md_apply_fix3): Handle BFD_RELOC_SPARC_UA16, - BFD_RELOC_SPARC_UA32 and BFD_RELOC_SPARC_UA64. - (tc_gen_reloc): Likewise. - (sparc_cons_align): Don't clear sparc_no_align_cons. - (cons_fix_new_sparc): Substitute BFD_RELOC_SPARC_UA{16|32|64} for - BFD_RELOC_{16|32|64} iff sparc_no_align_cons is set. - -2001-05-23 Alan Modra - - Merge from mainline. - 2001-05-22 Alan Modra - * config/tc-arc.c (md_assemble): Use is_end_of_line instead of - testing for NULs. - - 2001-05-16 Alan Modra - * config/tc-arc.c (md_assemble): Correct dwarf2_emit_insn param - for 8 byte insns. - * config/tc-i386.c (md_assemble): Call dwarf2_emit_insn before - opcodes are output rather than after. Delete insn_size. - * config/tc-v850.c (md_assemble): Similarly, but delete - total_insn_size. Update copyright. - - 2001-05-03 Alan Modra - * config/tc-i386.c (i386_displacement): Call as_bad for bad GOTOFF - expressions rather than triggering an assert. - - 2001-03-30 Alan Modra - * config/tc-i386.c (UNCOND_JUMP, COND_JUMP, COND_JUMP86): Decrement. - (md_relax_table): Remove first four unused entries. Increment - rlx_length by one throughout table, and update comments to suit. - (md_estimate_size_before_relax): Return size of current variable - part of frag to reflect reality when relaxing more than once. - - 2001-03-25 Alan Modra - * config/tc-i386.c (i386_scale): Accept an absolute expression for - scale factor, and return the end of the expression. - (i386_operand): Modify for above. - - 2001-03-13 Alan Modra - * config/tc-i386.c (RELOC_ENUM): Define. Use throughout file. - (NUM_FLAG_CODE): Define. - (lex_got): New function. - (got_reloc): New global var. - (x86_cons_fix_new): New function. - (x86_cons): New function. - (i386_immediate): Use lex_got here, replacing inline code. Change - "ignoring junk.." error message to "junk.." - (i386_displacement): Likewise. - * config/tc-i386.h (TC_PARSE_CONS_EXPRESSION): Define. - (x86_cons): Declare. - (TC_CONS_FIX_NEW): Define. - (x86_cons_fix_new): Declare. - - 2001-03-07 Alan Modra - * config/tc-i386.c (struct _i386_insn): Rename disp_reloc to reloc. - (md_assemble) : Use correct field of i.op[] - union. - : Use correct i.disp_reloc[]. - : Likewise. - - 2001-02-13 Alan Modra - * doc/c-i386.texi (i386-Arch): Add "jumps"/"nojumps" blurb. - Mention effect of < 386 architectures on jump promotion. - (i386-Jumps): xref above. Don't assume long disp is 32 bits. - - * config/tc-i386.c (no_cond_jump_promotion): New. - (set_cpu_arch): Parse "jumps" arch modifier. - (insn_size): Modify usage comment. - (ENCODE_RELAX_STATE): Reformat and protect macro arg. - (SIZE_FROM_RELAX_STATE): Rename to DISP_SIZE_FROM_RELAX_STATE. - (TYPE_FROM_RELAX_STATE): New define. - (UNCOND_JUMP, COND_JUMP): Renumber. - (md_relax_table): Reorder to suit. - (COND_JUMP86): New define. - (md_relax_table): Handle COND_JUMP86 cases. Add a few comments. - (md_assemble): Create frag var for jumps of max size, encode relax - state for COND_JUMP86. - (md_estimate_size_before_relax): Handle COND_JUMP86 cases, and - leave conditional jumps small if no_cond_jump_promotion. - (md_convert_frag): Likewise. - - 2001-05-10 Alan Modra - * config/tc-v850.c (md_estimate_size_before_relax): Rewrite. - (md_convert_frag): Don't bother clearing fr_var. - (md_pseudo_table): Correct initialization. - - 2001-05-12 Peter Targett - * config/tc-arc.c: Update copyright and tidy source comments. - (md_pseudo_table): Add directive .cpu back as an alias for - .option. Add .file and .line for dwarf2 support. - (arc_mach_type): Make bfd_mach_arc_6 default. - (md_longopts): Add entry 'pre-v6' representing old command line - option when assembling for 'arc5' core versions. - (md_parse_option): Make OPTION_ARC same as OPTION_ARC6, for new - default behaviour. - (arc_code_symbol): Make symbol value for @h30 fixup expression - equal to O_constant. - (md_assemble): Call dwarf2_emit_insn. - Include "dwarf2dbg2.h". Formatting fixes throughout file. - * config/tc-arc.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. - * doc/c-arc.texi (ARC_CORE_DEFAULT): Update to new default. - - 2001-05-15 Alexandre Oliva - * config/tc-mn10300.c (mn10300_force_relocation): Don't - optimize differences between symbols in code sections to - constants. - (mn10300_fix_adjustable): Don't adjust to section+offset - relocations pointing at symbols in code sections. - - 2001-05-14 Alexandre Oliva - * config/tc-mn10300.c (md_assemble): Anchor dwarf2 line info - before a relaxable insns. - - 2001-05-13 Alexandre Oliva - * config/tc-mn10300.c (tc_gen_reloc): Don't reject differences - between symbols if the base symbol is in the current section; - emit a PC-relative relocation instead. - - 2001-05-09 Alexandre Oliva - * config/tc-mn10300.c (md_apply_fix3): Accept PC-relative relocs. - - 2001-05-06 Alexandre Oliva - * config/tc-mn10300.c (md_assemble): Subtract operand->shift - from offset in non-pcrel operands too. - - 2001-04-14 Alexandre Oliva - * config/tc-mn10300.c (md_assemble): Simplify offset adjustment of - pc-relative relocations not placed at the end of the instruction. - - 2001-04-06 Alexandre Oliva - * config/tc-mn10300.c (xr_registers): Added `pc'. - - 2001-03-30 Alan Modra - * config/tc-mn10300.c (md_estimate_size_before_relax): Rewrite. - - 2001-02-23 Richard Sandiford - * config/tc-mn10300.c (md_apply_fix3): Don't mark a fixup as - done if it's against a symbol. - - 2001-03-28 H.J. Lu - * read.c (equals): Set to local for COFF only if it hasn't been - defined before. - - 2001-03-27 Nick Papadonis - * read.c (equals): (for COFF) default symbols to being local. - - 2001-03-23 Richard Sandiford - * write.c (fix_new_exp): Print an error if passed a register. - - 2001-03-20 Alan Modra - * frags.h (struct frag): Add relax_marker. - * write.c (is_dnrange): Delete. - (relax_frag): Use correct types for `aim', `target', `address'. - Delete `offset', `was_address'. Test `relax_marker' instead of - using fragile (and slow) address test. - (relax_segment): Init and flip `relax_marker'. - - 2001-02-13 Ian Lance Taylor - * write.c (is_dnrange): Stop as soon as the address becomes - larger. - (relax_frag): Add segment parameter. Only call symbol_get_frag - once. Only call is_dnrange if the symbol is in the same segment, - and the symbol address is larger. - (relax_segment): Pass segment to md_relax_frag and relax_frag. - * write.h (relax_frag): Update declaration. - * config/tc-fr30.c (fr30_relax_frag): Add segment parameter. Pass - it to relax_frag. - * config/tc-m32r.c (m32r_relax_frag): Likewise. - * config/tc-m32r.h (md_relax_frag): Add segment parameter. - (m32r_relax_frag): Update declaration. - * config/tc-mips.h (md_relax_frag): Add segment parameter. - * config/tc-tic54x.h (md_relax_frag): Likewise. - * doc/internals.texi (CPU backend): Update documentation for - md_relax_frag. - - 2001-03-15 DJ Delorie - * stabs.c (s_stab_generic): Don't corrupt the notes obstack by - blindly freeing string if it isn't at the top of the obstack. - -2001-05-14 Richard Henderson - - * ehopt.c (eh_frame_convert_frag): Fix missed subtype adjustment - last change. - -2001-05-14 Richard Henderson - - * ehopt.c (get_cie_info): Rename from eh_frame_code_alignment; - also collect whether to expect an FDE augmentation. - (check_eh_frame): Rewrite as a state machine. Track where in - an FDE we are located, skip any augmentation. - (eh_frame_estimate_size_before_relax): Get code alignment from - the fragment subtype. - (eh_frame_relax_frag, eh_frame_convert_frag): Likewise. - * read.c (emit_leb128_expr): Call check_eh_frame. - -2001-05-09 Richard Henderson - - * config/tc-ia64.c (generate_unwind_image): Align the fragment - beginning a function's unwind info block. - -2001-04-27 David Mosberger - - * config/tc-ia64.c (dot_spillmem_p): Fix output_spill_?sprel_p() - argument passing order: predicate goes last, not first. - -2001-04-16 David O'Brien - - * configure.in: Add the em type for FreeBSD targets. - * configure: Regenerate. - -2001-04-13 Jim Wilson - - * tc-ia64.c (is_conditional_branch): Return true for br, brl, and br. - excluding br.i. - -2001-04-02 Philip Blundell - - From 2001-03-17 Richard Henderson - * dwarf2dbg.c (user_filenum, user_filenum_allocated): Remove. - (dwarf2_directive_loc): Don't use them. - (dwarf2_directive_file): Reject duplicate file definitions. - (get_filenum): Zero allocated memory. - (out_file_list): Complain about missing file definitions. - -2001-03-31 Alan Modra - - * listing.c (listing_listing): Enable listing on EDICT_NOLIST_NEXT - for one line if not already enabled. - * cond.c (s_elseif): Correct conditional assembly listing. - (s_else): Likewise. - - * cond.c (s_endif): Correct handling of "if .. elseif .." trees. - Don't abort on NULL current_cframe. - -2001-03-30 Richard Henderson - - * write.c (relax_seg, size_seg): Split from relax_and_size_seg. - (write_object_file): Relax code then data, then size sections. - - * config/tc-i386.c (md_convert_frag): Don't die on local symbols - that have been finalized. - -2001-03-28 Alan Modra - - * config/tc-hppa.c (DEFAULT_LEVEL): Define. - (md_begin): Use it when setting default architecture. - -2001-03-27 Hans-Peter Nilsson - - * configure.in (cris-*-*): Change default emulation to criself. - (cris-*-*aout*): New rule. - * configure: Regenerate. - -2001-03-19 Alan Modra - - * config/tc-i386.c (md_assemble ): Correct - used register name. - -2001-03-18 Stephane Carrez - - * config/tc-m68hc11.c (md_pseudo_table): Recognize xrefb to comply - with 'Motorola specification for assembly language input standard'. - -2001-03-18 Dave Brolley - - * config/tc-m32r.c (expand_debug_syms): Call frag_align_code rather - than m32r_do_align. - -2001-03-16 Philip Blundell - - * configure: Regenerate. - -2001-03-15 David Mosberger - - * config/tc-ia64.c (md): New member keep_pending_output. - (ia64_flush_pending_output): Flush only if md.keep_pending_output - is not set. - (dot_xdata): Turn on md.keep_pending_output for the duration of - this function. - (dot_xfloat_cons): Ditto. - (dot_xstringer): Ditto. - (dot_xdata_ua): Ditto. - (dot_xfloat_cons_ua): Ditto. - -2001-03-15 Jim Wilson - - * config/tc-ia64.c (ia64_unrecognized_line, case '['): Add local - label support. - -2001-03-11 Philip Blundell - - * configure.in: Set version to 2.11. - -2001-02-28 Andreas Jaeger , Bo Thorsen - - * config/tc-i386.c (tc_gen_reloc): Remove ugly hack which is not needed - anymore since we use bfd_elf_generic_reloc now. - (md_apply_fix3): Only apply hack for partial_inplace if not using RELA. - -2001-02-21 David Mosberger - - * config/tc-ia64.c (enum operand_match_result): New type. - (operand_match): Change return type to operand_match_result. - Fix all returns appropriately, adding support for returning the - out-of-range result. - (parse_operands): New locals result, error_pos, out_of_range_pos, - curr_out_of_range_pos. Rewrite operand matching loop to give better - error messages. - -2001-02-21 David Mosberger - - * config/tc-ia64.c (struct unwind): Add member "prologue_count". - (dot_proc): Clear unwind.prologue_count to zero. - (dot_prologue): Increment unwind.prologue_count. - (dot_restore): If second operand is omitted, use - unwind.prologue_count -1 for "ecount" (# of additional regions to - pop). Decrement unwind.prologue_count by number of regions - popped. - -2001-02-20 Bo Thorsen - - * config/tc-i386.c (tc_i386_fix_adjustable): Fix GOTPCREL GOT - entry. - -2001-02-18 David O'Brien - - * configure.in (cpu_type, arch): Add a generic FreeBSD specification as - all FreeBSD platforms should look the same at this level. - * configure: Rebuilt. - * config/tc-i386.c: Add support for old FreeBSD a.out hosts. - -2001-02-14 Philip Blundell - - From 2001-02-06 H.J. Lu - * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): Do fixup if - there is no relocation. - - From 2001-02-06 H.J. Lu - * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): New. Defined. - * config/tc-ia64.c (md_parse_option): Only accept the valid - ia64 options on "-axxx". - -2001-02-13 Alan Modra - - * expr.c (operator): Don't bump input_line_pointer for two char - operators. Instead return operator size via new param num_chars. - (expr): Use above to parse multi-char operators correctly. - -2001-02-12 Philip Blundell - - * config/tc-arm.c (do_ldst): Improve warnings for unpredictable - ldrt/strt instructions. - -Mon Feb 12 17:44:08 CET 2001 Jan Hubicka - - * tc-i386.c (i386_displacement): Fix handling of - BFD_RELOC_X86_64_GOTPCREL. - (i386_validate_fix): Likewise. - -2001-02-09 David Mosberger - - * config/tc-ia64.h (md_elf_section_type): New macro. - (ELF_TC_SPECIAL_SECTIONS): Drop .IA_64.unwind and .IA_64.unwind_info - (they're now handled via ia64_elf_section_type. - - * config/tc-ia64.c (unwind): New members saved_text_seg, - saved_text_subseg, and force_unwind_entry. - (optimize_unw_records): New function to optimize away unnecessary - unwind directives. - (ia64_elf_section_type): New function. - (output_unw_records): Generate unwind info only if the size is - non-zero or if it's forced for some other reason (e.g., - handlerdata or a personality routine). - (generate_unwind_image): Don't switch back to previous - section---stay inside the unwind info section instead so that - handlerdata that may follow goes into the right place. - (dot_handlerdata): Force generation of unwind entry and save the - current active text segment before generating unwind image. - (dot_unwentry): Force generation of unwind entry. - (dot_personality): Ditto. - (dot_endp): Generate unwind table entry only if there is - some unwind info or the unwind entry was forced. - - * config/tc-ia64.c (make_unw_section_name): New macro to form - unwind section name. - (generate_unwind_image): Add "text_name" argument. Use it to - form unwind section name. - (dot_handlerdata): Determine current segment (section) name and - pass it to generate_unwind_image(). - (dot_endp): Determine current segment (section) name and use - it to determine the appropriate unwind section name. - (ia64_md_do_align): Add missing ATTRIBUTE_UNUSED declarations to - n, fill, and max arguments. - -2001-02-09 Alexandre Oliva - - * config/tc-sh.c (md_pseudo_table): Add uaquad. Use s_uacons for - 2byte, 4byte and 8byte. - -2001-02-08 Alan Modra - - * config/tc-hppa.c (pa_build_unwind_subspace): Don't call - md_number_to_chars with size > sizeof (valueT). - -2001-02-05 Jim Wilson - - * config/tc-ia64.c (errata_nop_necessary_p): Return 0 instead of - aborting for invalid operands. - -2001-02-06 Alan Modra - - * config/tc-hppa.c (fix_new_hppa): Pass in unwind directly rather - than via pointer. Update all callers. - (UNWIND_LOW32): Define. - (UNWIND_HIGH32): Define. - (pa_build_unwind_subspace): Use the above macros instead of dumping - bitfields directly. Call frag_more once rather than multiple times. - (md_assemble): Use UNWIND_LOW32. - (pa_entry): Likewise - (pa_procend): Likewise. - (process_exit): Use UNWIND_HIGH32. - -2001-02-04 Stephane Carrez - - * config/tc-m68hc11.h (LISTING_HEADER): Use m68hc11_listing_header - function to select the header according to the cpu. - (md_after_pass_hook, md_do_align): Remove. - (md_cleanup, m68hc11_cleanup): Remove. - (md_pcrel_from_section): Declare. - * config/tc-m68hc11.c (build_dbranch_insn): Remove insn_size. - (build_jump_insn, build_insn): Likewise. - (m68hc11_listing_header): New function. - (m68hc11_cleanup): Remove. - -2001-02-02 Stephane Carrez - - * config/tc-m68hc11.c (relaxable_symbol): Relax externally visible - symbols because there is no support for shared libraries and these - symbols can't be overridden (unless they are weak). - -2001-02-01 Momchil Velikov - - * dwarf2dbg.c (out_debug_abbrev): Terminate the abbreviations - for the compilation unit with a zero byte. - -2001-01-30 Alan Modra - - * config/tc-hppa.c (pa_ip): Support 12 bit branches to absolute - destinations. Correct range check for 17 and 22 bit branches. - -2001-01-25 Nick Clifton - - * config/tc-m68k.c (tc_gen_reloc): Do not abort if tcbit is - still set. Issue an error message instead. - (md_estimate_size_before_relax): Delete unused variable - 'buffer_address'. Fixup parentheses around if statement. - -2001-01-23 Kazu Hirata - - * as.c: Fix formatting. - * ehopt.c: Likewise. - * messages.c: Likewise. - * stabs.c: Likewise. - * symbols.c: Likewise. - -2001-01-23 Ben Elliston - - * config/tc-m32r.c (m32r_handle_align): Declare type of fragp. - -2001-01-22 Kazu Hirata - - * config/tc-alpha.c: Fix formatting. - -2001-01-19 Kazu Hirata - - * config/tc-alpha.c: Fix formatting. - -2001-01-18 Kazu Hirata - - * config/tc-alpha.c: Fix formatting. - -2001-01-18 Nick Clifton - - * config/tc-arm.c (ldm_flags): Remove redundant bit from "fa" and - "da" flags. - (stm_flags): Remove redundant bit from "ed" and "da" flags. - -2001-01-18 Alexandre Oliva - - * configure.in (cpu_type, arch): Match i386 too. - * configure: Rebuilt. - -2001-01-16 Kazu Hirata - - * config/tc-i386.c: Fix formatting. - -2001-01-16 Alan Modra - - * config/tc-hppa.c (tc_gen_reloc): Use SEGREL32 instead of DIR32 - relocs for .PARISC.unwind section. - - * config/tc-hppa.c (pa_build_unwind_subspace): Build unwind - depending on section flags, not just for .text. - -2001-01-15 Jim Wilson - - * config/tc-ia64.c (ia64_flush_insns): Handle unwind directives - not immediately followed by an instruction. - -2001-01-15 Kazu Hirata - - * config/tc-m68hc11.c: Fix formatting. - -2001-01-15 Nick Clifton - - * symbols.c (colon): Change 'already defined symbol' from a - fatal error to an ordinary error. There is no reason why this - error should be fatal. - - * message.c (as_fatal): Delete output file, if one has been - created. - -2001-01-14 Alan Modra - - * config/tc-hppa.h (TARGET_FORMAT): Add hppa-linux variants. - -2001-01-14 Kazu Hirata - - * config/tc-alpha.c: Fix formatting. - * config/tc-arc.c: Likewise. - * config/tc-arc.h: Likewise. - * config/tc-d10v.c: Likewise. - * config/tc-i370.c: Likewise. - * config/tc-i386.c: Likewise. - * config/tc-i960.c: Likewise. - * config/tc-m68k.c: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-sparc.c: Likewise. - * config/tc-tahoe.c: Likewise. - * config/tc-vax.c: Likewise. - - * config/tc-arc.c: Fix formatting. - - * config/tc-arc.c: Fix formatting. - -2001-01-14 Alan Modra - - * config/tc-hppa.c (pa_build_unwind_subspace): Use SEGREL32 for - both 32 and 64 bit ELF. - - * config/tc-hppa.c (pa_ip): Store `a' flag in bit zero of operand - and don't bother storing `m' for "ce" completer. Tidy handling of - 'J' and 'K' operands to suit. Handle '<' and '>' operands. - -Sun Jan 14 00:36:42 MET 2001 Jan Hubicka - - * tc-i386.h (TARGET_MACH): New macro. - (i386_mach): Declare. - * tc-i386.c (i386_mach): New function. - -2001-01-13 Philip Blundell - - * doc/as.texinfo: Fix spelling and cross-references. - - * doc/c-arm.texi: Fix typos. Say that `;' is a line separator - character for all systems, not just GNU/Linux. Make it explicit - that `-k' doesn't affect code generation, just ELF flags. - -Sat Jan 13 01:47:35 MET 2001 Jan Hubicka - - * config/tc-i386.c (md_assemble): Check cpu_flags even for nullary - instructions. - -2001-01-12 Frank Ch. Eigler - - * cgen.c (gas_cgen_finish_insn): Call dwarf2_emit_insn. - -2001-01-12 Nick Clifton - - * as.c (print_args): Update copyright date to 2001. - -2001-01-12 Peter Targett - - * doc/c-arc.texi: New file. - Some sections to be expanded. - -2001-01-12 Alan Modra - - * config/tc-i386.c (md_longopts): Recognize "--64" only for ELF. - (md_parse_option): Always accept "--32". - -2001-01-11 Peter Targett - - * as.h (TC_ARC): Ensure struc-symbol.h included. - * as.c (dwarf2dbg.h): Include to remove implicit declaration - warnings. - * struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Define. - (TARGET_SYMBOL_FIELDS) added. - - * doc/Makefile.am (CPU_DOCS): Added c-arc.texi. - * doc/c-arc.texi: New file. - Some sections to be expanded. - * doc/as.texinfo: Update command-line options. - Removed outdated text for ARC dependant features, instead include - text from above file. - - * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Define local flag. - (TARGET_SYMBOL_FIELDS): Alias to previous definition. - (targ-cpu.h) header. - * config/tc-arc.h: - * config/tc-arc.c: New updated configuration for - ARC, including selection of core variants, and extensibility of - instructions, registers etc. through directives. - - * config/tc-arc.c (arc_extinst): Minor corrections for - error messages. - (arc_common) Likewise. Make alignment argument optional for local - symbols also, with default of zero. - -2001-01-11 Stephane Carrez - - * config/tc-m68hc11.c (md_estimate_size_before_relax): Fix - STATE_INDEXED_OFFSET when the symbol is undefined (16-bit offset). - (build_indexed_byte): Don't relax indexed byte, use 16-bit offset - and fix_new_exp() instead. - (md_convert_frag): For indexed post byte use the symbol value - rather than the displacement. - (md_relax_table): Fix indexed offset relax. - -2001-01-11 Stephane Carrez - - * config/tc-m68hc11.c (md_estimate_size_before_relax):Don't - relax weak symbols. - (relaxable_symbol): New function. - -2001-01-11 Andreas Jaeger - - * config/tc-i386.h (TC_RELOC_GLOBAL_OFFSET_TABLE): Removed, it's - not used anywhere. - -2001-01-10 Nick Clifton - - * config/tc-arm.c (arm_fix_adjustable): Define for OBJ_COFF. - * config/tc-arm.h (obj_fix_adjustable): Define for OBJ_COFF - -2001-01-10 Nick Clifton - - * symbols.c (DOLLAR_LABEL_CHAR): New constant - the magic - character used to dollar local symbols. - (LOCAL_LABEL_CHAR): New constant - the magic character used to - local label symbols. - (dollar_label_name): Use DOLLAR_LABEL_CHAR. - (fb_label_name): Prefix local labels with LOCAL_LABEL_PREFIX, - if defined. - Use LOCAL_LABEL_CHAR. - (decode_local_label_name): Skip LOCAL_LABEL_PREFIX. - Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR. - (S_IS_LOCAL): Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR. - -2001-01-08 Bo Thorsen - - * config/tc-i386.c (i386_immediate, i386_displacement): - GOTPCREL check fix. - -2001-01-07 Ian Lance Taylor - - * doc/c-i386.texi (i386-Arch): Remove spaces incorrectly inserted - in last change. - -2001-01-07 Philip Blundell - - * doc/as.texinfo (Bug Reporting): Update email address for - reports. - * README: Likewise. - -Sat Jan 6 13:33:10 MET 2001 Jan Hubicka - - * configure.in: Define DEFAULT_ARCH for i386. - * tc-i386.c (md_assemble): Return after the error message; - move testing for 64bit operands to proper place. - -2001-01-06 Jan Hubicka , Andreas Jaeger - - * doc/as.texinfo: Document '#' as comment character for i386 and - x86_64. Add AMD x86-64 into menu of machine dependent information. - - * doc/c-i386.texi: Document x86_64 extensions. - -Fri Jan 5 13:26:42 MET 2001 Jan Hubicka - - * tc-i386.c (md_assemble): Handle third byte of the opcode as prefix. - -Thu Jan 4 22:25:26 MET 2001 Jan Hubicka - - * tc-i386.c (cpu_arch): Add Pentium4 and modify sledgehammer entry. - * NEWS: Add note about Pentium4 support. - -Wed Jan 3 17:26:32 MET 2001 Jan Hubicka - - * tc-i387.c (pi, pte, pt): Update. - (type_names): Add new types. - -Wed Jan 3 16:26:52 MET 2001 Jan Hubicka - - * tc-i386.h (CpuK6, CpuAthlon, CpuSledgehammer, CpuMMX, Cpu3dnow, - CpuUnknown): Renumber - (CpuP4, CpuSSE2): New. - (CpuUnknownFlags): Add CpuP4 and CpuSSE2 - -2001-01-03 Philip Blundell - - * config/tc-alpha.c (alpha_force_relocation): Handle vtable - relocs. - (alpha_fix_adjustable): Likewise. - (md_apply_fix): Likewise. - -2000-12-31 H.J. Lu - - * listing.c (listing_message): Allocate string only if it is - used. - - * configure: Rebuild. - -2000-12-31 Hans-Peter Nilsson - - * doc/internals.texi (Relaxing with a table) : - Point out caveats with generating fixups for the opcode in a frag. - -Sat Dec 30 19:02:48 MET 2000 Jan Hubicka - - * configure.in: Add support for x86_64 and x86_64-*-linux-gnu* - * NEWS: Add x86_64. - -2000-12-29 H.J. Lu - - * listing.c (calc_hex): Print the variable part only if the - fragment type is rs_fill. - -2000-12-29 Hans-Peter Nilsson - - * doc/internals.texi (tc_conditional_pseudoop, - TC_LINKRELAX_FIXUP): Fix typos. - -2000-12-28 Richard Henderson - - * write.c (subsegs_finish): Fix thinko last change -- don't - "optimize" the alignment == 0 case. - -2000-12-28 Richard Henderson - - * as.h (rs_align_test): New. - * frags.c (NOP_OPCODE): Move default from read.c. - (MAX_MEM_FOR_RS_ALIGN_CODE): New default. - (frag_align_code): New. - * frags.h (frag_align_code): Declare. - * read.c (NOP_OPCODE): Remove. - (do_align): Use frag_align_code. - * write.c (NOP_OPCODE): Remove. - (get_recorded_alignment): New. - (cvt_frag_to_fill): Handle rs_align_test. - (relax_segment): Likewise. - (subsegs_finish): Align last subseg in section to the - section alignment. Use frag_align_code. - * write.h (get_recorded_alignment): Declare. - * config/obj-coff.c (size_section): Handle rs_align_test. - (fill_section, fixup_mdeps): Likewise. - (write_object_file): Use frag_align_code. - - * config/tc-alpha.c (alpha_align): Use frag_align_code. - (alpha_handle_align): New. - * config/tc-alpha.h (HANDLE_ALIGN): New. - (MAX_MEM_FOR_RS_ALIGN_CODE): New. - - * config/tc-i386.h (md_do_align): Use frag_align_code. - (MAX_MEM_FOR_RS_ALIGN_CODE): New. - - * config/tc-ia64.c (ia64_md_do_align): Don't do code alignment. - (ia64_handle_align): New. - * config/tc-ia64.h (HANDLE_ALIGN): New. - (MAX_MEM_FOR_RS_ALIGN_CODE): New. - - * config/tc-m32r.c (m32r_do_align): Remove. - (m32r_handle_align): New. - (fill_insn): Use frag_align_code. - * config/tc-m32r.h (md_do_align): Remove. - (HANDLE_ALIGN, MAX_MEM_FOR_RS_ALIGN_CODE): New. - * config/tc-m88k.c, config/tc-m88k.h: Similarly. - * config/tc-mips.c, config/tc-mips.h: Similarly. - - * config/tc-sh.c (sh_cons_align): Use rs_align_test. - (sh_handle_align): Likewise. Handle rs_align_code. - (sh_do_align): Remove. - * config/tc-sh.h (md_do_align): Remove. - (MAX_MEM_FOR_RS_ALIGN_CODE): New. - - * config/tc-sparc.c (sparc_cons_align): Use rs_align_test. - (sparc_handle_align): Likewise. Handle rs_align_code. - * config/tc-sparc.h (md_do_align): Remove. - (MAX_MEM_FOR_RS_ALIGN_CODE): New. - -2000-12-22 DJ Delorie - - * config/tc-d10v.c (md_assemble): set prev_seg and prev_subseg - when we assemble the first half of a pair. - -2000-12-22 H.J. Lu - - * config/tc-i386.c (reloc): Update the macro for non-bfd - assembler. - (BFD_RELOC_X86_64_GOTPCREL): Set to 0 for non-bfd assembler. - -2000-12-22 H.J. Lu - - * dwarf2dbg.c (dwarf2_finish): Remove #if BFD_ASSEMBLER. - -Wed Dec 20 14:21:22 MET 2000 Jan Hubicka - - * tc-i386.h (i386_target_format): Define even for ELFs. - (QWORD_MNEM_SUFFIX): New macro. - (CpuK6,CpuAthlon,CpuSledgehammer, Cpu64, CpuNo64, CpuUnknownFlags): - New macros - (CpuMMX,CpuSSE,Cpu3dnow, CpuUnknown): Renumber. - (IgnoreSize, DefaultSize, No_?Suf, FWait, IsString, regKludge, IsPrefix, - ImmExt): Renumber. - (Size64, No_qSuf, NoRex64, Rex64): New macros. - (Reg64, Imm32S, Imm64, Disp32S, Disp64): New macros. - (Imm8, Imm8S, Imm16, Imm32, Imm1, BaseIndex, Disp8, Disp16, Disp32, - InOutPortReg,ShiftCount, Control, Debug, Test, FloatReg, FloatAcc, - SReg2, SReg3, Acc, JumpAbsolute, RegMMX, RegXMM, EsSeg, InvMem): - Renumber. - (Reg, WordReg): Add Reg64. - (Imm): Add Imm32S and Imm64. - (EncImm): New. - (Disp): Add Disp64 and Disp32S. - (AnyMem): Add Disp32S. - (RegRex, RegRex64): New macros. - (rex_byte): New type. - * tc-i386.c (set_16bit_code_flag): Kill. - (fits_in_unsigned_long, fits_in_signed_long): New functions. - (reloc): New parameter "signed"; support x86_64. - (set_code_flag): New. - (DEFAULT_ARCH): New macro; default to "i386". - (default_arch): New static variable. - (struct _i386_insn): New fields Operand_PCrel; rex. - (flag_16bit_code): Kill; All tests replaced to "flag_code == CODE_64BIT" - (flag_code): New enum and static variable. - (use_rela_relocations): New static variable. - (flag_code_names): New static variable. - (cpu_arch_flags): Default to CpuUnknownFlags|CpuNo64. - (cpu_arch): Add "sledgehammer"; Add CPUAthlon to Athlon and CpuK6 to - K6 and Athlon. - (i386_align_code): Return plain "nop" for x86_64. - (mode_from_disp_size): Support Disp32S. - (smallest_imm_type): Support Imm32S and Imm64. - (offset_in_range): Support size of 8. - (set_cpu_arch): Do not clobber to Cpu64/CpuNo64. - (md_pseudo_table): Add "code64"; use set_code_flat. - (md_begin): Emit sane error message on hash failure. - (tc_i386_fix_adjustable): Support x86_64 relocations. - (md_assemble): Support QWORD_MNEM_SUFFIX, REX registers, - instructions supported on particular arch just partially, - output of 64bit immediates, handling of Imm32S and Disp32S type. - (i386_immedaite): Support x86_64 relocations; support 64bit constants. - (i386_displacement): Likewise. - (i386_index_check): Cleanup; support 64bit addresses. - (md_apply_fix3): Support x86_64 relocation and rela. - (md_longopts): Add "32" and "64". - (md_parse_option): Add OPTION_32 and OPTION_64. - (i386_target_format): Call even for ELFs; choose between - elf64-x86-64 and elf32-i386. - (i386_validate_fix): Refuse GOTOFF in 64bit mode. - (tc_gen_reloc): Support rela relocations and x86_64. - (intel_e09_1): Support QWORD. - -2000-12-15 Diego Novillo - - * config/tc-i386.c (intel_e09_1): Only flag as a memory operand if - it's not an offset expression. - (intel_e10_1): Ditto. Also, if the operand is an offset expression, - keep the braces '[' and ']' in the output string. - (intel_e11): Ditto. Also remove comparison intel_parser.op_modifier - != FLAT. There is no such op_modifier. - -2000-12-14 Michael Sokolov - - * dwarf2dbg.c: If we don't have , try including - if we have it. - -2000-12-13 Kazu Hirata - - * as.h: Fix formatting. - * cgen.h: Likewise. - * dwarf2dbg.c: Likewise. - * input-scrub.c: Likewise. - * read.h: Likewise. - -2000-12-13 Mark Elbrecht - - * configure.in (i386-*-msdosdjgpp): Set bfd_gas to yes. - configure: Regenerate. - -2000-12-13 Michael Sokolov - - * dwarf2dbg.c: #include only if it exists. - -2000-12-13 Rodney Brown - - * config/tc-hppa.c (pa_ip): Correct CHECK_FIELD typo. - (md_apply_fix): Here too. - -2000-12-12 Jim Wilson - - * config/tc-ia64.h (ia64_init): Add prototype. - -2000-12-12 H.J. Lu - - * dwarf2dbg.c: Enabled only if BFD_ASSEMBLER is defined. - - * read.h (outputting_stabs_line_debug): Change it to int. - * stabs.c (outputting_stabs_line_debug): Likewise. - -2000-12-12 Geoffrey Keating - - * config/obj-bout.c (obj_crawl_symbol_chain): Don't take - the address of a function result. - -2000-12-12 Franz Sirl - - * config/tc-ppc.c (md_pseudo_table): Add .file and .loc. - (md_assemble): Call dwarf2_emit_insn. - (shlib): Fix typo SHILB -> SHLIB. - (md_parse_option): Likewise. - (ppc_elf_validate_fix): Likewise: - * config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): New. - -2000-12-12 Nick Clifton - - * cgen.h: Fix formatting. - * input-scrub.c: Fix formatting. - * macro.c: Fix formatting. - * config/tc-mips.c: Fix formatting. - * doc/c-mips.texi: Fix formatting. - -Mon Dec 11 14:35:42 MET 2000 Jan hubicka - - * tc-i386.c (md_assemble): Refuse 's' and 'l' suffixes in the intel - mode; convert 'd' suffix to 's' or 'l'; remove all DWORD_MNEM_SUFFIX - references. - (intel_e09_1): Convert QWORD to 'l' suffix for FP operations; refuse - otherwise. - * tc-i386.h (DWORD_MNEM_SUFFIX): Kill. - (No_dSuf): Kill. - - * i386.h (*_Suf): Remove No_dSuf. - (d_suf, wld_Suf,sld_Suf, sldx_Suf, bwld_Suf, d_FP, sld_FP, sldx_FP) - Remove. - (i386_optab): Remove 'd' in the suffixes. - -2000-12-06 Mark Elbrecht - - * config/tc-i386.c (T_SHORT): Undefine before defining. - -2000-12-05 Kazu Hirata - - * config/tc-mips.c: Fix formatting. - -2000-12-04 Matthew Hiller - - * config/tc-d10v.c (flag_allow_gstabs_packing): New variable. - (md_longopts): New options --gstabs-packing, --no-gstabs-packing. - (md_show_usage): Ditto. - (md_parse_option): Ditto. - (d10v_cleanup): Writes pending instruction only if - ! outputting_stabs_line_debug || ! flag_allow_gstabs_packing. - Fix compile time warning messages. - - * doc/c-d10v.texi: Documents new options. - -2000-12-04 Matthew Hiller - - * stabs.c (outputting_stabs_line_debug): New variable. - (stabs_generate_asm_lineno): Set outputting_stabs_line_debug at - function entry and unset at function exit. - - * read.h (outputting_stabs_line_debug): New extern declaration. - - * as.c: Include dwarf2dbg.h for definition of dwarf2_finish. - - * dwarf2dbg.c: Fix compile time warning messages. - -2000-12-03 Kazu Hirata - - * config/tc-a29k.c: Fix formatting. - * config/tc-alpha.c: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-cris.c: Likewise. - * config/tc-hppa.c: Likewise. - * config/tc-i370.c: Likewise. - * config/tc-i386.c: Likewise. - * config/tc-i860.c: Likewise. - * config/tc-i960.c: Likewise. - * config/tc-ia64.c: Likewise. - * config/tc-m68hc11.c: Likewise. - * config/tc-m68k.c: Likewise. - * config/tc-m88k.c: Likewise. - * config/tc-pj.c: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-sh.c: Likewise. - * config/tc-sparc.c: Likewise. - * config/tc-tahoe.c: Likewise. - * config/tc-vax.c: Likewise. - -2000-12-01 Chris Demetriou - - * config/tc-mips.c (mips_ip): When calculating offsets, - don't accept as constant the difference between the - addresses of symbols in two different sections. - - * config/tc-mips.c (macro_build): Add new 'U' and 'J' operand - specifiers. - (validate_mips_insn): Likewise. Also, update 'B' operand - specifier to use OP_*_CODE20 constants and delete 'm' operand - specifier. - (mips_ip): Remove 'm' operand specifier, add 'U' and 'J' - operand specifiers. Change warning generated by 'B' operand - specifier to reflect its new multi-purpose usage. - - * config/tc-mips.c (mips_set_options): Use ISA_UNKNOWN rather than - -1, and update comment. - (file_mips_isa): Likewise. - (mips_cpu): Use CPU_UNKNOWN rather than -1, and update comment. - (ISA_HAS_COPROC_DELAYS, ISA_HAS_64BIT_REGS, gpr_interlocks): Use - ISA_* constants rather than hard-coded numbers. - (mips_cpu_info): New structure. - (mips_cpu_info_table): New table describing CPU and ISA names - and numbers. - (mips_cpu_info_from_name, mips_cpu_info_from_isa, - mips_cpu_info_from_cpu): New functions. - (mips_isa_to_str): New function to get string for ISA name. - (mips_cpu_to_str): Convert to use mips_cpu_info_from_cpu, and - return const char *. - (md_begin): Redo CPU and ISA selection logic, using - mips_cpu_info_from_*. Convert to use ISA_* constants rather - than hard-coded numbers. - (append_insn, mips_emit_delays, macro, macro2): Convert to use - ISA_* constants rather than hard-coded numbers. - (mips_ip): Convert to use mips_isa_to_str to get ISA name. - (md_longopts): Delete OPTION_NO_MIPS32. - (md_parse_option): Convert to use ISA_* constants rather than - hard-coded numbers. Make OPTIONS_MIPS32 case treat MIPS32 - as an ISA. Delete OPTION_NO_MIPS32 case. Convert OPTION_MCPU - to use strcasecmp to recognize "default" and to use - mips_cpu_info_from_name to get CPU numbers from argument. - (md_show_usage): Move -mips32 so it's with the rest of the ISA - flags. Change 4Kc, 4Kp and 4Km CPU entries to just be - mips32-4k. - (s_mipsset): Accept ISA value 32. - * doc/as.texinfo: Clean up MIPS options summary slightly, - remove -no-mips32. Add note about -mips4 and -mips32 - specifying those ISA levels. Delete -mips32 and -no-mips32 - cpu flag descriptions. - * doc/c-mips.texi: Add -mips32 to list of ISA switches. Clean - up the supported CPU switch list, and replace 4Kc, 4Km, and - 4Kp entries with a single mips32-4k entry. Note that you can - use ".set mips32". - - * tc-mips.c (ISA_HAS_64BIT_REGS): Add checks for ISA_MIPS5 and - ISA_MIPS64. - (md_longopts, OPTION_MIPS5, OPTION_MIPS64): Add options for - -mips5 and -mips64. - (md_parse_option): Add cases for OPTION_MIPS5 and - OPTION_MIPS64. - (md_show_usage): Mention -mips5 and -mips64 arguments. - (s_mipsset): Add cases for MIPS5 and MIPS64. - (mips_cpu_info_table): Add entries for MIPS5 and MIPS64 ISAs - and pseudo-CPUs. - * doc/as.texinfo: Mention -mips5 and -mips64 options - and their meanings. - * doc/c-mips.texi: Likewise. Also update introduction - and ".set" usage information. - - * config/tc-mips.c (md_show_usage): Add "sb1" to the - CPU list. - (mips_cpu_info_table): Add SB-1 entries. - * doc/c-mips.texi: Add "sb1" to the list of CPUs - known to the -mcpu option. - - * doc/as.texinfo: Correct description of MIPS -mcpu - option, by copying some of the text from doc/c-mips.texi. - -2000-12-01 Joel Sherrill - - * configure.in (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*): - New targets. - (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. - (sparc*-*-rtems*): Switched from a.out to ELF. - * configure: Regenerate. - * config.in: Regenerate. - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * po/gas.pot: Regenerate. - -2000-11-30 Philip Blundell - - * config/obj-coff.c (obj_coff_weak): Use S_SET_WEAK if it exists, - even in non BFD_ASSEMBLER case. - -2000-11-30 Diego Novillo - - * tc-i386.c (md_assemble): Swap i.disp_relocs when using intel - syntax. - -2000-11-29 Richard Henderson - - * dwarf2dbg.c: Rewrite from scratch. Queue all debugging output - until dwarf2_finish; use relaxation to get cross-fragment offsets; - thread multiple subsegments properly; handle multiple code - sections properly; emit proper compilation unit info for assembler - generated debugging. - - * as.h (enum _relax_state): Add rs_dwarf2dbg. - * dwarf2dbg.h (struct dwarf2_line_info): Remove filename. - (dwarf2dbg_estimate_size_before_relax): Declare. - (dwarf2dbg_relax_frag, dwarf2dbg_convert_frag): Declare. - * write.c: Include dwarf2dbg.h. - (cvt_frag_to_fill): Handle rs_dwarf2dbg. - (relax_segment): Likewise. - -2000-11-28 Hans-Peter Nilsson - - * config/tc-sh.c (md_convert_frag) : Use as_bad_where instead of as_bad. Tweak error message - accordingly. Stabilize frag by updating fix part and resetting - variant part. - : Ditto. - (sh_elf_cons): Cast *input_line_pointer to unsigned char when - indexing is_end_of_line[]. - (md_assemble): Initialize size to 0. - (md_section_align): Mark parameter seg as unused. - (parse_reg): Parse names case-insensitively. - -2000-11-28 Kazu Hirata - - * config/obj-aout.h: Fix formatting. - * config/obj-bout.h: Likewise. - * config/obj-coff.c: Likewise. - * config/obj-coff.h: Likewise. - * config/obj-elf.h: Likewise. - * config/obj-som.h: Likewise. - * config/obj-vms.c: Likewise. - * config/obj-vms.h: Likewise. - * config/tc-h8300.h: Likewise. - * config/tc-ns32k.h: Likewise. - * config/tc-sparc.h: Likewise. - * config/tc-tic54x.h: Likewise. - * config/tc-z8k.h: Likewise. - -2000-11-28 Nick Clifton - - * doc/as.1 (COPYING): Mention that the GNU Free Documentation - License is present in the sources, but not the output, and - also available from the GNU website. - (GNU Free Documentation License): Comment out this section. - -2000-11-28 Hans-Peter Nilsson - - * Makefile.am (CPU_OBJ_VALID): Add case to filter out invalid coff - targets. Remove i860 from valid a.out targets. - * Makefile.in: Regenerate. - - * config/tc-cris.c: Include dwarf2dbg.h. - (md_pseudo_table): Add .file and .loc. - (md_assemble): Call dwarf2_emit_insn if generating ELF. - (s_cris_file, s_cris_loc): New. - * config/tc-cris.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. - * Makefile.am: Regenerate dependencies. - * Makefile.in: Regenerate. - -2000-11-28 Alan Modra - - * expr.c (STANDARD_MUL_PRECEDENCE): Correct value. - (MRI_MUL_PRECEDENCE): Likewise. - (op_rank): Fix a comment typo. - -2000-11-26 Stephane Carrez - - * config/tc-m68hc11.c (build_indexed_byte): Print the offset in - the error message. - (get_operand): Fix analysis for movw/movb instructions. - -2000-11-24 Nick Clifton - - * configure.in (xscale-elf): Add target. - (xscale-coff): Add target. - * configure: Regenerate. - - * config/tc-arm.c (ARM_EXT_V5E): New ARM architecture - extenstion. - (ARM_EXT_XSCALE): New ARM architecture extension. - (ARM_LONGMUL): Rename to ARM_EXT_LONGMUL. - (ARM_HALFWORD): Rename to ARM_EXT_HALFWORD. - (ARM_THUMB): Rename to ARM_EXT_THUMB. - (ARM_ARCH_V4): Remove processor from architecture. - (ARM_ARCH_3M): New architecutre definition. - (ARM_ARCH_V5TE): New architecutre definition. - (ARM_ARCH_XSCALE): New architecutre definition. - (CPU_DEFAULT): Allow to be defaulted to XScale. - (atpcs): New boolean variable. - (ldr_flags): Support 'd' flag for double word loads. - (str_flags): Support 'd' flag for double word stored. - (do_mia): New function. - (do_mar): New function. - (do_mra): New function. - (do_pld): New function. - (do_ldrd): New function. - (do_blx): New function. - (do_bkpt): New function. - (do_clz): New function. - (do_lstc2): New function. - (do_cdp2): New function. - (do_t_blx): New function. - (do_t_bkpt): New function. - (do_smla): New function. - (do_smlal): New function. - (do_smul): New function. - (do_qadd): New function. - (do_co_reg2c): New function. - (LONGEST_INSN): Redefine to 7. - - * doc/c-arm.texi: Document -mxscale, -mmarmv5te and -matpcs - command line switches. - -2000-11-22 Jim Wilson - - * config/tc-ia64.c (pseudo_func): Add missing initializers. - (struct rsrc): Make line unsigned. - (gr_values): Add missing initializer. - (SLOT_NUM_NOT_SET): Add unsigned cast. - (ia64_elf_section_flags, output_vbyte_mem, count_output, dot_radix, - dot_fframe, dot_vframe, dot_vframesp, dot_vframepsp, dot_save, - dot_restore, dot_restorereg, dot_restorereg_p, dot_handlerdata, - dot_unwentry, dot_altrp, dot_saveg, dot_savef, dot_saveb, dot_savegf, - dot_spill, dot_spillreg, dot_spillreg_p, dot_label_state, - dot_copy_state, dot_unwabi, dot_personality, dot_proc, dot_body, - dot_prologue, dot_endp, dot_regstk, dot_psr, dot_alias, dot_ln, - dot_reg_val, dot_entry, dot_mem_offset, ia64_init, mark_resource, - md_undefined_symbol, md_apply_fix3, tc_gen_reloc, ia64_md_do_align): - Add ATTRIBUTE_UNUSED to unused parameters. - (convert_expr_to_ab_reg): Add parens. - (convert_expr_to_xy_reg): Add parens. Comment out >= REG_GR test. - (dot_prologue): Initialize grsave when declared. - (md_pseudo_table): Add missing initializers. - (operand_match): Add casts to bfd_vma. - (emit_one_bundle): Delete unused local prev. Make required_template - unsigned. - (specify_resource): Cast i to unsigned. - (note_register_values): Use fprintf_vma. - (print_dependency): Likewise. - -2000-11-21 Jim Wilson - - * config/tc-ia64.c (generate_unwind_image): Call record_alignment - for unwind info section. - (dot_endp): Likewise for unwind section. - - * config/tc-ia64.c (emit_one_bundle): Pass size of 8 not 4 to - fix_new_exp. - -2000-11-21 Jakub Jelinek - - * config/tc-sparc.c (md_pseudo_table): Add .file and .loc. - (output_insn): Call dwarf2_emit_insn. - * config/tc-sparc.h (DWARF2_LINE_MIN_INSN_LENGTH): New. - -2000-11-17 Richard Henderson - - * ehopt.c (eh_frame_code_alignment): New arg `in_seg', update all - callers. Don't switch segments. Expect CIE == -1 in .debug_frame. - (check_eh_frame): Handle .eh_frame and .debug_frame concurrently. - -2000-11-17 Nick Clifton - - * config/tc-arm.c (md_pseudo_table): Add support for .line and - .file pseudo ops. - -2000-11-17 Richard Henderson - - * config/tc-i386.c (md_pseudo_table): Add .file and .loc. - -2000-11-17 Richard Henderson - - * dwarf2dbg.c (dwarf2_gen_line_info): Early out for no line number. - * config/obj-elf.h (ECOFF_DEBUGGING) [TC_ALPHA]: Adjust for - tri-state definition of alpha_flag_mdebug. - * config/tc-alpha.c (alpha_flag_mdebug): Init to -1. - (s_alpha_file): Store first .file directive. - (s_alpha_stab): New. - (md_pseudo_table): Add stabs and stabn. - -2000-11-17 Richard Henderson - - * config/tc-i386.c (md_assemble): Call dwarf2_emit_insn. - -2000-11-17 Richard Henderson - - * as.c (debug_type): Init to DEBUG_UNSPECIFIED. - (main): Call dwarf2_finish. - * as.h (debug_type): Clarify documentation of the meaning - of this variable. - * dwarf2dbg.c (DWARF2_LINE_MIN_INSN_LENGTH): Default to 1. - (print_stats): Fix parenthesis problem. - (now_subseg_size): New. - (dwarf2_finish): Use it. If DEBUG_DWARF2, emit bits for .debug_info. - (dwarf2_directive_file): Don't set debug_type. - (dwarf2_where): Honor DEBUG_DWARF2 first. - (dwarf2_emit_insn): Renamed from dwarf2_generate_asm_lineno; - do nothing if not emitting dwarf2 debug info, or no work. - * dwarf2dbg.h (dwarf2_emit_insn): Update. - * ecoff.c (add_file): Turn on DEBUG_ECOFF only if DEBUG_UNSPECIFIED. - (ecoff_new_file): Likewise. - * read.c (generate_lineno_debug): Kill ecoff hackery. Update - commentary wrt dwarf2. - - * config/tc-alpha.c (alpha_adjust_symtab_relocs): Add - ATTRIBUTE_UNUSED as needed. - (emit_insn): Call dwarf2_emit_insn. - (s_alpha_file): New. - (s_alpha_loc): New. - (s_alpha_coff_wrapper): Don't handle them. - (md_pseudo_table): Update for .file and .loc. - * config/tc-alpha.h (DWARF2_LINE_MIN_INSN_LENGTH): New. - - * config/tc-arm.c (output_inst): Update for dwarf2_emit_insn; - don't protect with debug_type. - * config/tc-hppa.c (md_assemble): Likewise. - * config/tc-m68hc11.c (m68hc11_new_insn): Likewise. - * config/tc-mn10300.c (md_assemble): Likewise. - * config/tc-sh.c (md_assemble): Likewise. - * config/tc-v850.c (md_assemble): Likewise. - - * config/tc-arm.c (arm_end_of_source): Remove. - * config/tc-hppa.c (pa_end_of_source): Remove. - * config/tc-m68hc11.c (m68hc11_end_of_source): Remove. - * config/tc-mn10300.c (mn10300_finalize): Remove. - * config/tc-sh.c (sh_finalize): Remove. - * config/tc-v850.c (sh_finalize): Remove. - - * config/tc-arm.h (md_end): Remove. - * config/tc-hppa.h (md_end): Remove. - (DWARF2_LINE_MIN_INSN_LENGTH): New. - * config/tc-m68hc11.h (md_end): Remove. - * config/tc-mn10300.h (md_end): Remove. - * config/tc-sh.h (md_end): Remove. - * config/tc-v850.h (md_end): Remove. - - * config/tc-ia64.c (emit_one_bundle): Don't protect - dwarf2 bits with debug_type. - (md_assemble): Likewise. - (ia64_end_of_source): Don't call dwarf2_finish. - -2000-11-16 Jim Wilson - - * config/tc-ia64.c (errata_nop_necessary_p): Abort if general regno - >= 128 instead of > 128. Abort if predicate regno is >= 64 instead of - > 16. - -2000-11-16 H.J. Lu - - * config/obj-elf.c (obj_elf_symver): Don't check the missing - version name. - -2000-11-15 Kazu Hirata - - * config/tc-tic30.c: Fix formatting. - * config/tc-tic80.c: Likewise. - * config/tc-v850.c: Likewise. - * config/tc-vax.c: Likewise. - * config/tc-w65.c: Likewise. - * config/tc-z8k.c: Likewise. - -2000-11-14 DJ Delorie - - * config/tc-v850.c: Support dwarf2. - * config/tc-v850.h: Ditto. - - * config/tc-v850.c (cons_fix_new_v850): Don't rely on - parse_cons_expression_v850 to initialize hold_cons_reloc. - -2000-11-15 Bernd Schmidt - - * tc-ia64.c (struct md): New entries LAST_GROUPS, GROUP_IDX. - (errata_nops_necessary_p): New function. - (emit_one_bundle): Call it. Update the GROUP_IDX field in struct - md. - -2000-11-14 Jim Wilson - - * config/tc-ia64.c (ia64_target_format): If EF_IA_64_BE not set, then - return little endian bfd formats. - -2000-11-14 Kazu Hirata - - * config/aout_gnu.h: Fix formatting. - * config/atof-vax.c: Likewise. - * config/m68k-parse.h: Likewise. - * config/m88k-opcode.h: Likewise. - * config/obj-elf.c: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-cris.c: Likewise. - * config/tc-i386.c: Likewise. - * config/tc-ia64.c: Likewise. - * config/tc-mn10300.c: Likewise. - * config/te-386bsd.h: Likewise. - * config/te-hppa.h: Likewise. - * config/te-nbsd.h: Likewise. - * config/te-ppcnw.h: Likewise. - * config/te-sparcaout.h: Likewise. - * config/te-tmips.h: Likewise. - * config/vax-inst.h: Likewise. - * config/vms-conf.h: Likewise. - -2000-11-14 Jakub Jelinek - - * config/tc-alpha.c (s_alpha_prologue): Preserve visibility bits. - -2000-11-13 H.J. Lu - - * config/obj-elf.c (elf_frob_symbol): Support - ".symver name,name2@@@nodename". - (elf_frob_file_before_adjust): Likewise. - - * doc/as.texinfo: Updated for ".symver name,name2@@@nodename" - and ".symver name,name2@@@nodename". - Fix a typo. - -2000-11-12 H.J. Lu (hjl@gnu.org) - - * config/obj-elf.c (obj_elf_symver): Check missing version - name. - -2000-11-12 H.J. Lu (hjl@gnu.org) - - * dwarf2dbg.c (dwarf2_generate_asm_lineno): Use addressT - instead of bfd_vma for non-bfd assemblers. - -2000-11-09 Kazu Hirata - - * itbl-ops.c: Fix comment typos. - -2000-11-08 Jim Wilson - - * config/tc-ia64.c (struct unw_rec_list): Add slot_frag field. - (struct unwind): Add next_slot_frag field. - (slot_index): New parameters slot_frag and first_frag. Add code - to add in frag sizes when different. Add comments. - (fixup_unw_records): New locals first_frag and last_frag. Pass new - arguments to slot_index. - (emit_one_bundle): Set slot_frag field. Set next_slot_number after - loop end. Set next_slot_frag field. - -2000-11-07 H.J. Lu - - * doc/as.texinfo (.symver): Updated for versioned symbol - reference. - - * obj.h (format_ops): Add the frob_file_before_adjust field. - - * config/obj-aout.c (aout_format_ops): Set the - frob_file_before_adjust field to 0. - * config/obj-coff.c (coff_format_ops): Likewise. - * config/obj-ecoff.c (ecoff_format_ops): Likewise. - - * config/obj-elf.c (obj_elf_symver): Allow duplicated version - name. - (elf_frob_file_before_adjust): New function to remove unneeded - versioned symbols from the symbol table. - (elf_format_ops): Set the frob_file_before_adjust field to - elf_frob_file_before_adjust. - - * config/obj-elf.h (obj_frob_file_before_adjust): Defined if - not defined. - - * config/obj-multi.h (obj_frob_file_before_adjust): Defined. - -2000-11-07 Peter Targett - - * gas/config/tc-arc.h: Avoid warnings for LITTLE_ENDIAN and - BIG_ENDIAN macros. - * gas/config/tc-arc.c: Use S_IS_LOCAL to test local symbols. - Fix compile time warning messages. - -2000-11-07 Nick Clifton - - * stabs.c (generate_asm_file): Increase length of xmalloc'ed - buffer in order to avoid buffer overflows. - -2000-11-06 Steve Ellcey - - * config/tc-ia64.c (md_shortopts, md_parse_option, md_show_usage): - Change M to m for -milp32 or -mlp64 to match gcc. - (dot_endp): Use bytes_per_address instead of 8. - (emit_one_bundle): Use number_to_chars_littleendian instead of - md_number_to_chars. - (fix_insn): Likewise. - (ia64_init): New function. - (ia64_target_format): New function. - (md_begin): Set endianness, arch, and machine as appropriate. - * config/tc-ia64.h: (TARGET_BYTES_BIG_ENDIAN, md_number_to_chars): - Make these macros depend on TE_HPUX macro. - (TARGET_FORMAT): Define. - (HOST_SPECIAL_INIT): Define. - * config/te-hpux.h: New file. - * configure.in: Add "ia64-*-hpux*" target to configure. - * configure: Regenerate. - -2000-11-06 Kazu Hirata - - * as.c: Fix formatting. - * dwarf2dbg.c: Likewise. - * input-file.c: Likewise. - * input-file.h: Likewise. - * input-scrub.c: Likewise. - * itbl-ops.c: Likewise. - * listing.c: Likewise. - * macro.h: Likewise. - * messages.c: Likewise. - * read.c: Likewise. - * subsegs.c: Likewise. - * subsegs.h: Likewise. - * write.c: Likewise. - -2000-11-06 Nick Clifton - - * doc/as.texinfo: Add GNU Free Documentation License. - * doc/gasp.texi: Add GNU Free Documentation License. - * doc/as.1: Add GNU Free Documentation License. - -2000-11-05 Nick Clifton - - * config/tc-arm.c: Add include of "dwarf2dbg.h" - -2000-11-02 Per Lundberg - - * configure.in: Recognise i[3456]86-chaosdev-storm-chaos. - * configure: Regenerate. - -2000-11-01 Nick Clifton - - * read.c (original_case_string): New global variable. - (read_a_source_file): Copy opcode string into - original_case_string if clobbering the case of the opcode. - * read.h: Export the definition of original_case_string. - * config/tc-arm.c (md_assembler): When parsing a .req - directive use the original opcode string, not the case - clobbered version. - -2000-11-02 Nick Clifton - - * config/tc-mn10300.c (debug_line): Remove this static - variable. - (md_assemble): Call dwarf2_generate_asm_lineno instead of - dwarf2_where and dwarf2_gen_line_info. - -2000-11-02 Theo Honohan - - * config/tc-arm.c (do_msr): Improve error message. - -2000-10-31 Eric Christopher - - * config/tc-mn10300.c (md_apply_fix3): Use valuep if fully resolved - or pc-relative, else use fx_offset. - -2000-10-31 Jim Wilson - - * config/tc-ia64.c (struct md): New field tag_fixups. - (ia64_flush_insns): Handle tag_fixups. Error if dangling - qualifying predicate. - (emit_one_bundle): Delete spurious multiplication by one. Handle - tag_fixups. - (ia64_start_line): Error if dangling qualifying predicate. - (defining_tag): New static variable. - (ia64_unrecognized_line, case '['): Parse tags. - (ia64_frob_label): Create tag_fixups. - (md_assemble): Reset md.qp.X_op after using it. - -2000-10-31 Kaz Kojima - - * config/tc-sh.c (md_apply_fix [BFD_RELOC_SH_PCDISP12BY2]): Allow 4094. - -2000-10-31 Bernd Schmidt - - * tc-ia64.c (extra_goodness): Only prefer F in slot 1 and B in slot 2. - -2000-10-30 Kazu Hirata - - * expr.c: Fix formatting. - * flonum-copy.c: Likewise. - * flonum.h: Likewise. - * gasp.c: Likewise. - * hash.c: Likewise. - -2000-10-30 Hans-Peter Nilsson - - * as.h (OPTION_MD_BASE): Bump to 190. - * as.c (parse_args) : Add comment about the need to - check OPTION_MD_BASE in as.h. - - * config/tc-sh.c (md_apply_fix): For ELF, do not "adjust back" VAL - for weak symbols. - -2000-10-27 Nick Clifton - - * configure.in (emulations): Add m68hc12. - * configure: Regenerate. - * po/gas.pot: Regenerate. - -2000-10-27 Aldy Hernandez - - * config/tc-arm.c (psrs): Remove lowercase versions of spsr* and - cpsr*. - (arm_psr_parse): Handle lowercase CPSR and SPSR. - -2000-10-25 Nick Clifton - - * dwarf2out.c (dwarf2_generate_asm_lineno): New function: Generate - a DWARF2 line number information sequence. - - *dwarf2out.h: Add prototype for dwarf2_generate_asm_lineno. - - * read.c (generate_lineno_debug): Update comment describing why - DWARF2 line number debug information is not generated - automatically by this function. - - * doc/as.texinfo: Note that --gdwarf2 only works on some targets, - not all. - - * config/tc-arm.h (md_end): Define. - (DWARF2_LINE_MIN_INSN_LENGTH): Define. - - * config/tc-arm.c (output_inst): Call dwarf2_generate_asm_lineno - if generating DWARF2 line numbers. - (arm_end_of_source): New function. Call dwarf2_finish if - necessary. - - * config/tc-hppa.c (md_assemble): Use dwarf2_generate_asm_lineno. - * config/tc-m68hc11.c (m68hc11_new_insn): Use dwarf2_generate_asm_lineno. - * config/tc-sh.c (md_assemble): Use dwarf2_generate_asm_lineno. - -2000-10-25 Diego Novillo - - * tc-i386.c: Fix prototype declarations for functions taking no - arguments. - -2000-10-24 Diego Novillo - - * tc-i386.c (i386_operand_modifier): Remove. - (build_displacement_string): Remove. - (i386_parse_seg): Remove. - (i386_intel_memory_operand): Remove. - (i386_intel_operand): Re-write using recursive descent parser based - on MASM documentation. - (struct intel_parser_s): New structure. - (intel_parser): New static variable. - (struct intel_token): New structure. - (cur_token, prev_token): New static variables. - (T_NIL): Define. - (T_CONST): Define. - (T_REG): Define. - (T_BYTE): Define. - (T_WORD): Define. - (T_DWORD): Define. - (T_QWORD): Define. - (T_XWORD): Define. - (T_SHORT): Define. - (T_OFFSET): Define. - (T_PTR): Define. - (T_ID): Define. - (intel_match_token): New function. - (intel_get_token): New function. - (intel_putback_token): New function. - (intel_expr): New function. - (intel_e05): New function. - (intel_e05_1): New function. - (intel_e06): New function. - (intel_e06_1): New function. - (intel_e09): New function. - (intel_e09_1): New function. - (intel_e10): New function. - (intel_e10_1): New function. - (intel_e11): New function. - -2000-10-20 Jakub Jelinek - - * config/tc-sparc.c (sparc_ip): Fix a bug which caused v9_arg_p - instructions to loose any special insn->architecture mask. - - * config/tc-sparc.c (v9a_asr_table): Add v9b ASRs. - (sparc_md_end, sparc_arch_types, sparc_arch, - sparc_elf_final_processing): Handle v8plusb and v9b architectures. - (sparc_ip): Handle siam mode operands. Support v9b ASRs (and - request v9b architecture if they are used). - -2000-10-18 Michael Sokolov - - * config/tc-m68k.c: Fix the previous misapplied patch. - -2000-10-18 Michael Sokolov - - * config/tc-m68k.h (RELAX_RELOC_*): New definitions for both - BFD_ASSEMBLER and !BFD_ASSEMBLER. - * config/tc-m68k.c (md_convert_frag_1): Use them instead of - BFD_RELOC_*. - -2000-10-17 Kazu Hirata - - * debug.c: Fix formatting. - * depend.c: Likewise. - * dwarf2dbg.c: Likewise. - * dwarf2dbg.h: Likewise. - * ecoff.c: Likewise. - * expr.c: Likewise. - * expr.h: Likewise. - * flonum-konst.c: Likewise. - * frags.h: Likewise. - -2000-10-17 Chandrakala Chavva - - * as.c: New option OPTION_TARGET_HELP. Prints all target specific - options. - * doc/as.texinfo: Added notes about this new option. - -2000-10-16 Hans-Peter Nilsson - - * config/tc-sh.c (JREG): Remove. - (md_convert_frag): Remove #if 0:d code using JREG. - -2000-10-15 Diego Novillo - - * config/tc-i386.c (i386_operand_modifier): Only match - modifiers SHORT and FLAT if they are followed by a space. - (parse_register): When `allow_naked_reg' is set, do not confuse - identifiers that start with a register name with a register. - -2000-10-12 Kazu Hirata - - * app.c: Fix formatting. - * as.c: Likewise. - * as.h: Likewise. - * bit_fix.h: Likewise. - * cgen.c: Likewise. - * cgen.h: Likewise. - * cond.c: Likewise. - -2000-10-11 Alan Modra - - * config/obj-elf.c (elf_frob_symbol): Revert 2000-10-07 change. - -2000-10-07 Alan Modra - - * config/tc-hppa.c (md_apply_fix): Remove plainly wrong assert. - Re-arrange function a little and improve error message. - - * write.c (write_relocs): Fix a comment. - - * config/obj-elf.c (elf_frob_symbol): Make section syms global on - link-once sections. - -2000-10-05 Jim Wilson - - * config/tc-ia64.c (resources_match): Handle IA64_RS_PRr. - -2000-10-05 Alan Modra - - * config/tc-i386.c: Delete some useless comments, reformat others. - - * config/tc-i386.h (TC_FIX_ADJUSTABLE): Add check to cover - non-global syms in linkonce sections. - -2000-10-04 Ralf Baechle - - * config/tc-ia64.c (operand_match): Don't use // style comments. - * config/tc-i370.c: Likewise. - -2000-09-29 Hans-Peter Nilsson - - Changes to handle varying register prefix and user symbol prefix. - * config/tc-cris.c (SYNTAX_RELAX_REG_PREFIX, - SYNTAX_ENFORCE_REG_PREFIX, SYNTAX_USER_SYM_LEADING_UNDERSCORE, - SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE, REGISTER_PREFIX_CHAR): New. - (s_syntax, cris_force_reg_prefix, cris_relax_reg_prefix, - cris_sym_leading_underscore, cris_sym_no_leading_underscore): New. - (demand_register_prefix): New variable. - (md_pseudo_table): New pseudo ".syntax". - (md_longopts): New options --no-underscore and --underscore. - (cris_target_format): Return elf32-us-cris or elf32-cris depending - on symbols_have_leading_underscore. - (get_gen_reg): Accept or require REGISTER_PREFIX_CHAR. - (get_spec_reg): Ditto. - (cris_number_to_imm) : Remove FIXME. - Fix formatting. - (md_parse_option) : Deprecate; add reference to - --help. - : New. - (md_show_usage): Be brief and reformat to match continuation of - --help. - * po/gas.pot: Regenerate. - -2000-09-28 Alan Modra - - * config/tc-hppa.c (hppa_force_relocation): If OBJ_SOM, don't - force relocs for 12 bit branches. - (md_apply_fix): Similarly, adjust logic here. - -2000-09-28 Alan Modra - - * config/tc-hppa.c (md_apply_fix): Add fmt assertion. Don't - adjust for external and weak syms as we will use a reloc. Allow - for +8 offset when calculating limits of branches. - (hppa_fix_adjustable): Undo 2000-09-23 change. - (hppa_force_relocation): Likewise. Add fx_addsy assertion. - Correct distance calculation. - (tc_gen_reloc): Print the file name and line number if we can't - handle a fixup. - - From John David Anglin - * config/tc-hppa.c (nonzero_dibits): Define. - (arg_reloc_stub_needed): Check each arg and return value - separately for zero case. - (pa_align): Declare argument `bytes'. - -2000-09-25 Kazu Hirata - - * config/tc-cris.c: Fix formatting. - * config/tc-d10v.h: Likewise. - * config/tc-d30v.c: Likewise. - * config/tc-d30v.h: Likewise. - * config/tc-fr30.c: Likewise. - * config/tc-fr30.h: Likewise. - * config/tc-m68k.c: Likewise. - * config/tc-m68k.h: Likewise. - * config/tc-pj.h: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-ppc.h: Likewise. - * config/tc-sh.c: Likewise. - * config/tc-sh.h: Likewise. - * config/tc-sparc.c: Likewise. - * config/tc-v850.h: Likewise. - * config/tc-vax.h: Likewise. - * config/tc-w65.h: Likewise. - * config/tc-z8k.h: Likewise. - -2000-09-23 Alan Modra - - * config/tc-hppa.c (hppa_fix_adjustable): Do the external and weak - checks only for ELF. - (hppa_force_relocation): Likewise. - -2000-09-22 Jim Wilson - - * config/tc-ia64.c (dv_sem): Add "stop". - (specify_resource, case IA64_RS_PR): Only handles regs 1 to 15 now. - (specify_resource, case IA64_RS_PRr): New for regs 16 to 62. - (specify_resource, case IA64_RS_PR63): Reorder (note == 7) test to - match above. - (mark_resources): Check IA64_RS_PRr. - -2000-09-22 Michael Sokolov - - * config/tc-m68k.c (md_relax_table, m68k_ip, md_convert_frag_1, - md_estimate_size_before_relax): Redesign and clean up the - relaxation mechanism. - -2000-09-21 Kazu Hirata - - * config/tc-ns32k.c: Fix formatting. - * config/tc-ns32k.h: Likewise. - -2000-09-20 Kazu Hirata - - * config/tc-m32r.c: Fix formatting. - * config/tc-m32r.h: Likewise. - * config/tc-m68851.h: Likewise. - * config/tc-m68hc11.c: Likewise. - * config/tc-m68hc11.h: Likewise. - * config/tc-m88k.c: Likewise. - * config/tc-mcore.c: Likewise. - * config/tc-mcore.h: Likewise. - * config/tc-mips.c: Likewise. - * config/tc-mips.h: Likewise. - * config/tc-mn10200.h: Likewise. - * config/tc-mn10300.h: Likewise. - * config/tc-tahoe.c: Likewise. - * config/tc-tahoe.h: Likewise. - -2000-09-19 Michael Sokolov - - * config/tc-vax.c (synthetic_votstrs): Remove jbssi and jbcci. - Likewise in relaxation description comments. - -2000-09-18 Alan Modra - - * config/tc-hppa.h (TC_FORCE_RELOCATION_SECTION): Allow - subtraction of two syms without emitting a relocation. - - From David Huggins-Daines - * config/tc-hppa.c (hppa_force_relocation): Force relocations for - global or weak symbols. - -2000-09-15 Kazu Hirata - - * config/tc-h8300.h: Fix formatting. - * config/tc-h8500.c: Likewise. - * config/tc-h8500.h: Likewise. - * config/tc-hppa.h: Likewise. - * config/tc-i370.h: Likewise. - * config/tc-i386.h: Likewise. - * config/tc-i860.c: Likewise. - * config/tc-i860.h: Likewise. - * config/tc-i960.h: Likewise. - * config/tc-ia64.c: Likewise. - * config/tc-ia64.h: Likewise. - -2000-09-14 Kazu Hirata - - * config/tc-a29k.c: Fix formatting. - * config/tc-alpha.c: Likewise. - * config/tc-arc.c: Likewise. - * config/tc-arc.h: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-arm.h: Likewise. - * config/tc-avr.c: Likewise. - * config/tc-avr.h: Likewise. - * config/tc-tic30.c: Likewise. - * config/tc-tic30.h: Likewise. - * config/tc-tic54x.c: Likewise. - * config/tc-tic54x.h: Likewise. - * config/tc-tic80.c: Likewise. - * config/tc-tic80.h: Likewise. - -2000-09-14 Timothy Wall - - * config/tc-ia64.c (specify_resource): For PR%/PR63, note types of - parallel comparisons for later use. - (struct rsrc): Add parallel comparison type. - (resources_match): Skip special cases of PR usage (non-conflicting - parallel compares). - -2000-09-13 Kazu Hirata - - * config/obj-ecoff.c: Fix formatting. - * config/obj-elf.c: Likewise. - * config/obj-elf.h: Likewise. - * config/obj-evax.h: Likewise. - * config/obj-generic.h: Likewise. - * config/obj-hp300.c: Likewise. - * config/obj-hp300.h: Likewise. - * config/obj-ieee.h: Likewise. - * config/obj-vms.c: Likewise. - * config/obj-vms.h: Likewise. - -2000-09-13 Anders Norlander - - * config/tc-mips.c (md_begin): Recognize 4Kc, 4Km and 4Kp processors. - (md_parse_option): Ditto. - (md_longopts): Add -mips32 option. - (md_show_usage): Document new options. - (mips_ip): Assemble sdbbp 20 bit 'm' args for MIPS32. - (mips_ip): Assemble mfc0 with a sub-selection code. - (validate_mips_insn): Handle 'H' (OP_*_SEL) and 'm' (OP_*_CODE20). - (mips_cpu_to_str): New function. - (mips_ip): Use mips_cpu_to_str instead of printing numeric cpu value. - Use CPU_* defines instead of hardcoded numbers. - - * doc/as.texinfo: Document new options. - * doc/c-mips.texi: Ditto. - -2000-09-12 Kazu Hirata - - * as.h: Fix formatting. - * asintl.h: Likewise. - * bit_fix.h: Likewise. - * config/obj-aout.c: Likewise. - * config/obj-aout.h: Likewise. - * config/obj-bout.c: Likewise. - * config/obj-bout.h: Likewise. - * config/obj-coff.c: Likewise. - * config/obj-coff.h: Likewise. - * dwarf2dbg.h: Likewise. - * expr.h: Likewise. - * flonum.h: Likewise. - * frags.h: Likewise. - * itbl-ops.h: Likewise. - * macro.h: Likewise. - * read.h: Likewise. - * sb.h: Likewise. - * struc-symbol.h: Likewise. - * subsegs.h: Likewise. - * symbols.h: Likewise. - * tc.h: Likewise. - * write.h: Likewise. - -2000-09-11 Kazu Hirata - - * bignum-copy.c: Fix formatting. - * config/tc-i370.c: Likewise. - * config/tc-i960.c: Likewise. - * config/tc-m68k.c: Likewise. - * ehopt.c: Likewise. - * flonum-copy.c: Likewise. - * flonum-konst.c: Likewise. - * flonum-mult.c: Likewise. - * literal.c: Likewise. - * read.c: Likewise. - * sb.c: Likewise. - * stabs.c: Likewise. - * subsegs.c: Likewise. - -2000-09-09 Philip Blundell - - * configure.in (arm*-*-uclinux*): New target. - * configure: Regenerate. - -2000-09-09 Kazu Hirata - - * input-file.c: Fix formatting. - * itbl-ops.c: Likewise. - * messages.c: Likewise. - -2000-09-08 Philip Blundell - - * config/tc-arm.c (md_apply_fix3): Correct handling of ADRL when - offset is negative. - -2000-09-07 H.J. Lu - - * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. - * configure: Rebuild. - -2000-09-07 Kazu Hirata - - * atof-generic.c: Fix formatting. - * config/tc-mips.c: Likewise. - * config/tc-vax.c: Likewise. - * input-scrub.c: Likewise. - -2000-09-07 Alexandre Oliva - - * config/tc-sh.h (TARGET_FORMAT): Use sh-linux targets. - * configure.in (sh-*-linux*): Added. - * configure: Rebuilt. - -2000-09-06 Kazu Hirata - - * config/tc-hppa.c: Fix formatting. - - * ecoff.c: Fix formatting. - -2000-09-06 Alexandre Oliva - - * configure: Rebuilt with new libtool.m4. - -2000-09-05 Kazu Hirata - - * cgen.c: Fix formatting. - * config/tc-ia64.c: Likewise. - -2000-09-05 Nick Clifton - - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. - * po/gas.pot: Regenerate. - -2000-09-05 Hans-Peter Nilsson - - * config/tc-cris.c: Correct comment typos. - -2000-09-05 Eric Christopher - - * config/tc-mn10300.c: Cleanup. - (md_pcrel_from): Enable. - -2000-09-05 Alan Modra - - * expr.c (operand): Fix a comment typo. - * write.c (write_relocs): Fix a signed/unsigned warning. - - * config/tc-hppa.c (fudge_reg_expressions): New - (hppa_force_reg_syms_absolute): New. - (pa_equ): Allow reg_section expressions. - * config/tc-hppa.c (md_optimize_expr): Define. - (hppa_force_reg_syms_absolute): Prototype. - - * config/tc-hppa.c (pa_11_fp_reg_struct): Delete. - (pa_parse_number): Pass in arg to select fp reg parsing. - Return 1 to indicate format checks pass. If strict, then only - accept a register or register symbol. Return value in... - (pa_number): New static for pa_parse_number. - (FP_REG_BASE): Define. - (FP_REG_RSEL): Define. - (pre_defined_registers): Apply FP_REG_BASE and FP_REG_RSEL as - appropriate. White space changes. - (need_pa11_opcode): Don't bother passing any params, get them from - globals instead. - (pa_ip): Modify all calls to pa_parse_number and need_pa11_opcode. - Remove extraneous check in case 'Q'. - (pa_equ): Modify call to pa_parse_number to do strict parsing. If - reg, set section of resulting symbol to reg_section. - (pa_parse_space_stmt): Modify call to pa_parse_number. - (pa_space): Likewise. - - * config/tc-hppa.c: (md_apply_fix): Handle vtable relocs. - (hppa_force_relocation): Handle vtable relocs. - (pa_vtable_entry): New. - (pa_vtable_inherit): New. - (md_pseudo_table): Add entries for vtable pseudos. - (hppa_fix_adjustable): Reject reduction of R_PARISC_GNU_VTINHERIT - and R_PARISC_GNU_VTENTRY relocs. Reject reduction of relocs - against weak syms. - (tc_gen_reloc): Remove ELF_ARG_RELOC_INSN code. - (pa_type_args): Don't call symbol_get_bfdsym multiple times. - Set STT_PARISC_MILLICODE for OBJ_ELF when encountering a - millicode import. - * config/obj-elf.c (obj_elf_type): Allow md_elf_symbol_type to - specify a symbol type. - - * config/tc-hppa.h: Reorganize file a little, grouping OBJ_ELF - dependent things together. - (md_elf_symbol_type): Define. - - * config/tc-hppa.c (fix_new_hppa): Elide "$PIC_pcrel$0" pseudo - symbol. - * config/tc-hppa.h (tc_frob_symbol): Elide "$PIC_pcrel$0" here too. - - * config/obj-elf.h (obj_elf_vtable_inherit): Declare. - (obj_elf_vtable_entry): Declare. - - * config/obj-elf.c (obj_elf_vtable_inherit): Return struct fix * - and export function. - (obj_elf_vtable_entry): Similarly. - (elf_pseudo_table): Fix the damage with a cast. - -2000-09-03 Richard Henderson - - * config/tc-ia64.c (emit_one_bundle): Stop collecting insns - for template selection when a label is needed. - -2000-09-02 Kazu Hirata - - * config/tc-ia64.c: Fix formatting. - -2000-09-02 Nick Clifton - - * configure.in: Increase version number to 2.10.91. - * configure: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * po/gas.pot: Regenerate. - * Makefile.in: Regenerate. - -2000-09-01 Alexandre Oliva - - * config/tc-sh.h [OBJ_ELF] (TC_FIX_ADJUSTABLE): Define. - * config/tc-sh.c (md_apply_fix): Map 32-bit relocations that - become PC-relative to BFD_RELOC_32_PCREL. Reject 16- or 8-bit - similar relocs. - (sh_obj_adjustable): Return 1 for PC-relative offsets used in - branches. - -2000-09-01 Niibe Yutaka , Kaz Kojima , Alexandre Oliva - - * config/tc-sh.h (DIFF_EXPR_OK, GLOBAL_OFFSET_TABLE_NAME, - TC_RELOC_GLOBAL_OFFSET_TABLE, TC_RELOC_RTSYM_LOC_FIXUP): Define. - * config/tc-sh.c (sh_elf_cons, sh_elf_suffix): New functions. - [OBJ_ELF] (md_pseudo_table) : Use them. - (GOT_symbol): New variable. - (md_undefined_symbol): Set it. - -2000-09-01 Richard Henderson - - * config/tc-ia64.c (match): Don't inline. - (extra_goodness): New. - (md_begin): Prefer nop.f and nop.b for best_template. - -2000-08-31 Kazu Hirata - - * as.c: Fix formatting. - * cond.c: Likewise. - * frags.c: Likewise. - * macro.c: Likewise. - -2000-08-31 Eric Christopher - - * config/tc-mn10300.c: Cleanup and fix warnings. - (md_pseudo_table): Add initializers. - (md_show_usage): Cleanup. - (md_parse_option): Fix warnings. - (md_undefined_symbol): Fix warnings. - (md_conver_frag): Fix warnings. - (tc_gen_reloc): Fix warnings. - (md_apply_fix3): Fix warnings. - (check_operand): Fix warnings. - -2000-08-31 Alexandre Oliva - - * acinclude.m4: Include libtool and gettext macros from the - top level. - * aclocal.m4, configure: Rebuilt. - -2000-08-30 Mark Hatle - - * config/tc-ppc.c (md_parse_option): Recognize -m405. - -2000-08-31 Kazu Hirata - - * listing.c: Fix formatting. - -2000-08-29 Kazu Hirata - - * app.c: Fix a comment typo. Fix formatting. - -2000-08-25 J. David Anglin - - * tc-vax.c (md_convert_frag): Correctly calculate the pc relative - offset of the target destination for jmp instructions. - (md_assemble): Change mode to VAX_ABSOLUTE_MODE as per comments. - -2000-08-24 Hans-Peter Nilsson - - * NEWS: Mention support for CRIS. - -Thu Aug 24 20:41:05 2000 Denis Chertykov - - * config/tc-avr.h (TC_IMPLICIT_LCOMM_ALIGNMENT): New macros. - Sets `.lcomm' alignment to zero. - -2000-08-23 Alexandre Oliva - - * config/tc-i386.h - (TC_FIX_ADJUSTABLE): Define. - -2000-08-23 Jim Wilson - - * config/tc-ia64.c (output_unw_records): Set U & E flags only if - unwind.personality_routine is set. - -2000-08-23 H.J. Lu - - * write.c (TC_FIX_ADJUSTABLE): Remove the duplicate. - -2000-08-23 Alexandre Oliva - - * config/tc-i386.h (TC_FIX_ADJUSTABLE): Do *NOT* define if target - environment is pe. - -2000-08-22 H.J. Lu - - * config.in (STRICTCOFF): New for strict COFF. - - * configure.in: Define STRICTCOFF for i386-*-msdosdjgpp*, - i386-*-go32* and i386-go32-rtems*. - * configure: Rebuilt. - - * config/obj-coff.c (obj_coff_endef): Follow the historical - behavior if STRICTCOFF is not defined. - - * doc/internals.texi: Document STRICTCOFF. - -2000-08-22 Alexandre Oliva - - * write.c (TC_FIX_ADJUSTABLE): Define to 1, if not defined. - (fixup_segment) Use it instead of TC_DONT_FIX_NON_ADJUSTABLE. - * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. - (TC_FIX_ADJUSTABLE): Define. - * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. - (TC_FIX_ADJUSTABLE): Define. - * config/tc-i960.h, config/tc-m68k.h, config/tc-v850.h: - Likewise. - -2000-08-22 Eric Christopher - - * config/tc-mn10300.c: (md_apply_fix): New function. - (mn10300_force_relocation): New function. - (mn10300_fix_adjustable): New function. - - * config/tc-mn10300.h: (TC_FORCE_RELOCATION): Define. - (TC_HANDLES_FX_DONE): Define. - (obj_fix_adjustable): Define. - (MD_APPLY_FIX3): Define. - (TC_LINKRELAX_FIXUP): Define. - - * write.c: (TC_LINKRELAX_FIXUP): Define if not - previously defined. - (fixup_segment): Use TC_LINKRELAX_FIXUP. - - * doc/internals.texi: Document TC_LINKRELAX_FIXUP. - -2000-08-21 Jason Eckhardt - - * config/tc-i860.c (md_apply_fix3): Do not insert the immediate - if the fixup resulted in a relocation. - -2000-08-18 Nick Clifton - - * config/tc-arm.c (decode_shift): Replace as_tsktsk with as_warn. - Make reference to first element of shift_names explicit. - -2000-08-18 Alexandre Oliva - - * write.c (fixup_segment) [TC_DONT_FIX_NON_ADJUSTABLE]: Use - obj_fix_adjustable() and tc_fix_adjustable() to tell whether to - add a symbol's address. Removed all target-specific #ifdefs that - used to accomplished the same. - * config/tc-v850.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. - * config/tc-m68k.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. - * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. - * config/tc-i960.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. - * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. - -2000-08-17 Kazu Hirata - - * dwarf2dbg.c: Fix formatting. - -2000-08-17 Nick Clifton - - * config/tc-arm.c (decode_shift): Allow illegal shifts by zero - to be recoded as logical shift lefts by zero. - -2000-08-16 Jim Wilson - - * config/tc-ia64.c (specify_resource, case IA64_RS_GR): Handle - postincrement modified registers. Handle IA64_OPND_R3_2 addl - source registers. - (note_register_values): Handle IA64_OPND_R3_2 operands. - -2000-08-16 Jason Eckhardt - - * config/tc-i860.c (md_operand): Silly typo fixed. - -2000-08-16 Nick Clifton - - * config/tc-arm.c (struct asm_shift): Delete. - (shift[]): Delete. - (enum asm_shift_index): New. - (struct asm_shift_properties): New. - (struct asm_shift_name): New. - (shift_properties[]); New. - (shift_names[]); New. - - (decode_shift): Use new structures. - Issue a warning is "ROR #0" is used. - Issue a warning if "ASR #0" or "LSR #0" is used. - - (md_begin): Initialise arm_shift_hsh table from new - asm_shift_name array. - -2000-08-16 Jakub Jelinek - - * config/tc-sparc.c: Kill all warnings. - (md_parse_option): Set -32/-64 for -xarch=, allow all -A archs - in -xarch= as well. - (md_show_usage): Update usage text. - -2000-08-16 Nick Clifton - - * config/tc-arm.c (do_bx): Warn about "bx px" not being very - useful. - -2000-08-15 Will Cohen - - * config/tc-sh.h (DWARF2_LINE_MIN_INSN_LENGTH): Defined. - - * config/tc-sh.c (md_assemble): Changed so debug_type - test performed for ppi_assemble - * config/tc-sh.c: Included dwarf2dbg.h. - (debug_line): Defined. - (md_assemble): Generates dwarf2 line info. - (sh_finalize): New function. Finalize dwarf2 info. - (assemble_ppi): Returns size of code generated. - (build_Mytes): Returns size of code generated. - (md_pseudo_table): Added "file" and "loc" psuedo ops. - * config/tc-sh.h (md_end): Defined. - (sh_finalize): Declared. - -2000-08-15 Alexandre Oliva - - * config/tc-sh.c (md_apply_fix) [BFD_RELOC_32, BFD_RELOC_16]: Use - md_number_to_chars. - -2000-08-14 Nick Clifton - - * config/tc-arm.c (do_bx): Allow "bx pc". - -2000-08-14 Jim Wilson - - * config/tc-ia64.c (md_longopts): Add -mconstant-gp and -mauto-pic. - (md_parse_option): Add OPTION_MCONSTANT_GP and OPTION_MAUTO_PIC. - (md_begin): Change assignment to md.flag to OR in the new bit. - -2000-08-14 Mark Elbrecht - - * config/obj-coff.c (obj_coff_endef) [BFD_ASSEMBLER]: Set the debug - flag for storage types C_ARG, C_REGPARM, C_FIELD, C_MOS, C_MOE, - C_MOU, and C_EOS. - -2000-08-14 Jason Eckhardt - - * NEWS: Mention i860 support. - -Mon Aug 14 11:49:12 2000 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10300.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. - -2000-08-14 Andreas Schwab - - * doc/c-arm.texi (ARM Directives): Fix warnings from makeinfo. - -2000-08-11 Andreas Schwab - - * doc/c-i860.texi (Opcodes for i860): Remove braces from @item - argument. - -2000-08-11 Kazu Hirata - - * expr.c: Fix formatting. - * config/obj-bout.c: Likewise. - -2000-08-10 Jason Eckhardt - - * doc/c-i860.texi: Flesh out the i860 section more. - -2000-08-10 Kazu Hirata - - * symbols.c: Fix formatting. - * expr.c: Likewise. - -Wed Aug 9 16:28:21 EDT 2000 Diego Novillo - - * tc-i386.c (md_assemble): Skip suffix check if the opcode modifier - has the IgnoreSize bit set. - -2000-08-09 Alan Modra - - From Rodney Brown - * configure.in: Use elf on Unixware 7 (i586-sco-sysv5uw7.1.0) - * configure: Regenerate. - -2000-08-09 Kazu Hirata - - * hash.c: Fix formatting. - * gasp.c: Likewise. - -2000-08-08 Jason Eckhardt - - * config/tc-i860.h: Rework completely for BFD_ASSEMBLER. - (i860_fix_info): New enum. - (MD_APPLY_FIX3): Define. - (WORKING_DOT_WORD): Define. - (TC_HANDLES_FX_DONE): Define. - (DIFF_EXPR_OK): Define. - (LISTING_HEADER): Define. - (TARGET_FORMAT): Select target format based on endian flag. - (TARGET_BYTES_BIG_ENDIAN): Default to little endian. - (target_big_endian): Add external declaration. - - * config/tc-i860.c: All existing code reworked completely. Other - new code shown below. - (SYNTAX_SVR4): Define. - (target_warn_expand): New variable. - (md_shortopts): Declare and define (-Qy, -Qn, and -V options). - (md_longopts): Declare and define with new options (-EL, -EB, - and -mwarn-expand). - (md_show_usage): New function. - (md_operand): New function. - (obtain_reloc_for_imm16): New function. - (md_apply_fix3): New function. - (tc_gen_reloc): New function. - -2000-08-08 Stephane Carrez - - * config/tc-m68hc11.c (build_jump_insn): Make sure the - 2 bytes of the jump address are in the same frag. - (find): Accept 68hc12 register indirect modes. - - * NEWS: Mention 68HC11 & 68HC12 support. - -2000-08-07 Richard Henderson - - * config/tc-ia64.c (unwind): Add prologue_mask member. - (dot_vframe): Elide psp_gr record if it overlaps prologue_gr. - (dot_save): Likewise for pfs_gr, rp_gr, and preds_gr. - (dot_body): Clear unwind.prologue_mask. - (dot_prologue): Set it. Accept a register second argument. - -2000-08-07 Kazu Hirata - - * config/atof-ieee.c: Fix formatting. - * config/atof-tahoe.c: Likewise. - -2000-08-06 Nick Clifton - - * config/tc-sparc.c (md_begin): Fix typo in recent formatting - work. - - * doc/as.texinfo (Pseudo Ops): Update to include descriptions - of .popsection, .previous, .pushsection, .subsection, - .version, .vtable_entry, .vtable_inherit and .weak. - -2000-08-05 Kazu Hirata - - * config/tc-cris.c: Fix formatting. - * config/tc-i386.c: Likewise. - * config/tc-sparc.c (sparc_ip): Simplify the code. - -2000-08-04 Kazu Hirata - - * config/tc-cris.c: Rearrange code for readability. - * config/tc-d10v.c: Fix formatting. - * config/tc-m32r.c: Likewise. - * config/tc-sparc.c: Likewise. - -2000-08-02 Jim Wilson - - * config/tc-ia64.c (emit_one_bundle): Call ia64_free_opcode - before ia64_find_opcode. - (md_assemble): Likewise. - -2000-08-01 Nick Clifton - - * config/tc-arm.c (do_mrs): Fix skip of 'cpsr_all' flag. - Undo some formatting fixes. - -2000-08-01 Kazu Hirata - - * config/obj-som.c: Fix formatting. - * config/obj-ieee.c: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-v850.c: Likewise. - -2000-08-01 Nick Clifton - - * doc/c-m68k.texi (section M680x0 Options): Turn into a table - index by command line option. - -2000-08-01 Michael Sokolov - - * doc/c-m68k.texi (@cindex @samp{--pcrel}): Rewrite option description. - (@node M68K-Branch): Rewrite to match the reality. - -2000-07-31 Jason Eckhardt - - * doc/c-i860.texi: New file. - * doc/Makefile.am (CPU_DOCS): Add c-i860.texi. - * doc/Makefile.in: Regenerate. - * doc/all.texi: Add I860 as relevant architecture. - * doc/as.texinfo: Include i860 dependent file c-i860.texi. - -2000-07-31 Kazu Hirata - - * config/tc-d30v.c: Fix formatting. - -2000-07-31 Michael Sokolov - - * config/tc-m68k.c (flag_keep_pcrel, OPTION_PCREL): Add --pcrel option. - (md_convert_frag_1, md_estimate_size_before_relax): When making DBcc - long emit a long branch if available instead of an absolute jump, never - emit absolute jumps for anything with --pcrel. - - * doc/c-m68k.texi: Document new command line option. - -2000-07-29 Marek Michalkiewicz - - * config/tc-avr.c: Use PARAMS macro in function declarations. - Don't declare md_pcrel_from_section (already in tc-avr.h). - (avr_operands): Use AVR_UNDEF_P and AVR_SKIP_P macros. - (avr_operand): Don't set (unsigned) op_mask to -1. - -2000-07-28 Jason Eckhardt - - * configure.in: Add bits for i860-stardent-{sysv4, elf}*. - * configure: Regenerated. - * config/obj-elf.c (obj_elf_type): Recognize a fifth type - of operand to the .type directive (.e.g, "type"). - -2000-07-28 Alan Modra - - * as.h (warn_comment, found_comment, found_comment_file): Declare. - * app.c (do_scrub_chars): Record where first comment found. - * read.c (read_a_source_file): Init found_comment on entry, and - notify whether comments found on exit. - * config/tc-hppa.c (md_shortopts): Add "c". - (md_longopts): Add warn-comment. - (md_parse_option): Handle it. - (md_show_usage): Show available options. - * config/tc-hppa.h (WARN_COMMENTS): Define if TE_LINUX - -Thu Jul 27 11:25:01 2000 Andrew Cagney - - * config/tc-mn10300.c (md_convert_frag): Fix printfs. - (tc_gen_reloc): Add cast when assigning bfd_abs_symbol to - sym_ptr_ptr - (md_estimate_size_before_relax): Don't fall off end of function. - -2000-07-27 Kazu Hirata - - * config/tc-avr.c: Fix formatting. - * config/tc-ns32k.c: Likewise. - -2000-07-27 Alan Modra - - * config/tc-d10v.c (find_opcode): Remove extraneous `='. - -2000-07-27 Kazu Hirata - - * config/tc-d10v.c: Fix formatting. - * config/tc-z8k.c: Likewise. - * config/tc-sparc.c: Likewise. - -2000-07-26 Dave Brolley - - * cgen.c (queue_fixup): Declare opinfo. - (gas_cgen_parse_operand): Mark unused parameters with ATTRIBUTE_UNUSED. - (gas_cgen_md_operand): Ditto. - (gas_cgen_md_apply_fix3): Ditto. - -2000-07-24 Mark Elbrecht - - * config/obj-coff.c (obj_frob_symbol): Don't merge - labels. Don't merge if the symbol isn't constant. Return - immediately if a symbol is merged. - -2000-07-22 Alan Modra - - * frags.c (frag_align): Correct absolute section alignment. - -2000-07-20 DJ Delorie - - * config/obj-coff.c (obj_frob_symbol): revert previous change, - it breaks linking against DLLs. - -2000-07-20 Hans-Peter Nilsson - - * configure.in: Add CRIS support. - * configure: Regenerate. - * Makefile.am: (CPU_TYPES): Add cris. - (CPU_OBJ_VALID) [aout]: Add cris. - (MULTI_CPU_TYPES): Add cris. - (MULTI_CPU_OBJ_VALID) [aout]: Add cris. - [coff]: Only i386 and mips are valid. - (TARGET_CPU_CFILES): Add config/tc-cris.c. - (TARGET_CPU_HFILES): Add config/tc-cris.h. - (MULTI_CFILES): Add config/e-crisaout.c and config/e-criself.c. - Regenerate dependencies. - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * as.c: Declare crisaout, criself. - * config/tc-cris.h, config/tc-cris.c: New. - * config/e-criself.c, config/e-crisaout.c: New. - * po/POTFILES.in, po/gas.pot: Regenerate. - -2000-07-20 Kazu Hirata - - * read.c: Fix formatting. - * write.c: Fix formatting. - -2000-07-19 H.J. Lu - - * sb.c: Include if exists for abort (). - -2000-07-19 Alan Modra - - * config/tc-hppa.c (hppa_fix_adjustable): Correct LR%/RR% comment. - (arg_reloc_stub_needed): #ifdef OBJ_SOM, not #ifdef SOM. - (pa_type_args): Same here. - -2000-07-17 Mark Elbrecht - - * config/obj-coff.c (obj_frob_symbol): Don't merge labels. Don't - merge if the symbol isn't constant. Don't call S_SET_EXTERNAL if - the storage class is already set. - -2000-07-17 Kazu Hirata - - * config/tc-m68hc11.c: Fix formatting. - * config/tc-mn10200.c: Likewise. - * config/tc-mn10300.c: Likewise. - * config/tc-pj.c: Likewise. - * config/tc-tic80.c: Likewise. - * config/tc-w65.c: Likewise. - -2000-07-17 Frank Ch. Eigler - - * expr.c (operand): Permit %bin literals if LITERAL_PREFIXPERCENT_BIN - is defined. - -2000-07-15 Ian Lance Taylor - - * doc/c-mips.texi (MIPS Opts): Remove erroneous space after - @code. - -2000-07-15 Alan Modra - - * config/tc-hppa.c (hppa_fix_adjustable): Use the same checks for - ELF as are used for SOM (except the 32-bit reloc one) to decide - whether a symbol can be reduced to a section symbol. Expand on - the comment for symbols involved in LR% and RR% expressions. - -2000-07-14 Nick Clifton - - * config/tc-mips.c (mips_disable_float_construction): New - static variable. Set to true if doubles should not be - constructed by loading two single width fp registers with - halves of the value. - (mips_ip): Test mips_disable_float_construction. - (md_longopts): Add command line switches --construct-floats - and --no-construct-floats. - (md_parse_option): Parse new command line options. - (md_show_usage): Describe new command line options. - - * doc/c-mips.texi: Document new command line options. - -2000-07-13 Koundinya K - - * configure.in: Remove the test /usr/dde for mips-*-sysv4*MP* - * configure: Regenerate. - -2000-07-13 Hans-Peter Nilsson - - * configure.in (DEFAULT_EMULATION setting): Revert part of - 2000-07-01 change that set te_multi=multi unless set to tmips. - * configure: Regenerate. - -2000-07-12 Mark Elbrecht - - * config/obj-coff.c (coff_frob_section): Add padding to the last - section when aligning it increases its size. - -2000-07-11 Kazu Hirata - - * config/tc-tic54x.c: Fix formatting. - -2000-07-10 Kazu Hirata - - * config/tc-h8500.c: Fix formatting. - * config/tc-tic54x.c: Fix formatting. - -2000-07-10 Alan Modra - - * config/tc-hppa.c (md_apply_fix): Check fmt 12 and 22 pc-rel - displacements correctly. - - * read.h (s_abort): Add ATTRIBUTE_NORETURN. - -2000-07-10 Ryan Bradetich - - * hash.c (hash_insert): Add cast to obstruct_alloc to fix - warning. - (hash_jam): Ditto. - -2000-07-09 Alan Modra - - From David Huggins-Daines - * config/te-hppalinux64.h: Add a new emulation. - * configure.in (emulations): Add configure bits to support the - 64-bit Linux/parisc target. - * configure: Regenerate. - - * config/tc-hppa.c (md_parse_option): Support `-V' for ELF. - (md_shortopts): Add `V' for ELF. - - * config/tc-hppa.c (arg_reloc_stub_needed): Define as zero except - when SOM or ELF_ARG_RELOC are defined. - (pa_type_args): Only set symbol_arg_reloc_info when SOM or - ELF_ARG_RELOC are defined. - (pa_stringer_aux): Don't pa_check_current_space_and_subspace here.. - (pa_stringer): ..Do it here instead. Fix comment typos. - (hppa_force_relocation): Cast enums to int before comparing with - ints. - - From Ryan Bradetich - * config/tc-hppa.c: Removed unneeded libbfd.h to fix macro - redifinition warning. - (md_apply_fix): Added cast from enum to int for fixP->fx_r_type. - (hppa_force_relocation): ditto - (md_apply_fix): Added cast to buf to fix warnings. - - * config/tc-hppa.h (pa_define_label, parse_cons_expression_hppa, - cons_fix_new_hppa, hppa_force_relocation): Prototype. - - * config/tc-hppa.c (reloc_type): It's an enum for OBJ_ELF. - (R_N0SEL, R_N1SEL): Define only for OBJ_SOM. - (tc_gen_reloc): Make `code' a reloc_type and `codes' a - reloc_type** to avoid warnings in switch. - (md_apply_fix): Make insn, val signed. Zap buf_wd and read insn a - little earlier instead. - - * config/tc-hppa.c (symbol_arg_reloc_info): Define for both som - and elf. - (pa_type_args): Use symbol_arg_reloc_info. - (struct pa_it): Make arg_reloc unsigned int. - (struct hppa_fix_struct): Likewise for fx_arg_reloc. - (pa_text, pa_data, pa_comm): Don't compile for TE_LINUX. - (pa_code): Delete. pa_text duplicates this function. - (md_pseudo_table): Call obj_elf_text for ".code" if TE_LINUX. - (fix_new_hppa): Argument offset is offsetT, arg_reloc is unsigned - int. - (cons_fix_new_hppa): Actually change selector to e_fsel when - warning about assuming so. - (tc_gen_reloc): More example elf arg reloc code. - (md_apply_fix): Use arg_reloc_stub_needed for elf too. - (hppa_force_relocation): Likewise. - - * config/tc-hppa.h: Use TARGET_ARCH_SIZE to select target include - files. - (pa_end_of_source): Prototype. - (hppa_fix_adjustable): Prototype. - (LABELS_WITHOUT_COLONS): Move it.. - * config/te-hppa.h: To here. - - * config/te-hppa64.h: New file. - - * config/tc-hppa.c: Use TARGET_ARCH_SIZE to select target reloc - type. - (md_apply_fix): Pass stdoutput to bfd_hppa_insn2fmt. Handle - format -10, -16, 16 relocs. - (hppa_elf_mark_end_of_function): Test for null - last_call_info->start_symbol - - * config/tc-hppa.c (pa_ip): In case 'V', pass `strict' to - CHECK_FIELD, not INSERT_FIELD_AND_CONTINUE. Don't pass opcode to - re_assesmble_* functions. Delete extraneous statements. Fix - typos in comments. - (md_apply_fix): Compare against 1048575 in case 21. Don't pass - insn to re_assemble_*. - -2000-07-08 Ulf Carlsson - - * doc/internals.texi (Expressions): Fix typo. - -2000-07-08 Kazu Hirata - - * config/tc-sh.c: Fix formatting. - * config/tc-tic54x.c: Fix formatting. - * depend.c: Fix formatting. - * flonum-konst.c: Likewise. - * flonum-mult.c: Likewise. - -2000-07-07 Kazu Hirata - - * config/tc-sh.c: Fix comments. - * config/obj-vms.c: Fix comments. - * config/tc-a29k.c: Likewise. - * config/tc-alpha.c: Likewise. - * config/tc-h8300.c: Likewise. - * config/tc-h8500.c: Likewise. - * config/tc-i370.c: Likewise. - * config/tc-ia64.c: Likewise. - * config/tc-m68hc11.c: Likewise. - * config/tc-m68k.c: Likewise. - * config/tc-mips.c: Likewise. - * config/tc-ns32k.c: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-z8k.c: Likewise. - -2000-07-06 Mark Elbrecht - - * config/obj-coff.c (TC_COFF_SECTION_DEFAULT_ATTRIBUTES): New. - Default to '(SEC_LOAD | SEC_DATA)'. - (obj_coff_section) [BFD_ASSEMBLER]: Use it. - - * doc/internals.texi (CPU Backend): Describe - TC_COFF_SECTION_DEFAULT_ATTRIBUTES. - -Thu Jul 6 17:20:58 2000 Andrew Cagney - - * as.c (parse_args): NULL terminate the long option list. - -Tue Jul 4 14:08:28 2000 Andrew Cagney - - * config/tc-d30v.h: Include "write.h" for fixS. - (d30v_start_line, md_pcrel_from_section): Add function prototypes. - -2000-07-05 Nick Clifton - - * config/tc-d30v.c (write_2_short): Further changes to warning - messages produced when combining EITHER_BUT_PREFER_MU attributed - opcodes. - -2000-07-05 DJ Delorie - - * MAINTAINERS: new - -2000-07-04 Alexandre Oliva - - * config/tc-arm.c (psrs): Accept combinations of flags. - -2000-07-03 Marek Michalkiewicz - - * config/tc-avr.c: Change _ () to _() around all strings marked - for translation (exception from the usual coding style). - (avr_opt): New struct variable, how the new switches are set. - (OPTION_MMCU): Define as 'm' and actually use. - (md_longopts): Add -mall-opcodes, -mno-skip-bug, -mno-wrap. - (show_mcu_list): New function, display the list of known MCUs. - (md_show_usage): Document the new switches. Call show_mcu_list. - (avr_set_arch): Change 'm' to OPTION_MMCU. - (md_parse_option): Call show_mcu_list if unknown MCU specified. - Handle the new switches. - (avr_operands): Disable warnings for undefined combinations of - operands if -mall-opcodes. Disable warnings for skipping two-word - instructions if enhanced core or -mno-skip-bug. - (avr_operand): Accept all addressing modes on avr1 if -mall-opcodes. - (md_apply_fix3): Reject 8K wrap if >8K or -mno-wrap. - (md_assemble): Accept opcodes not supported by MCU if -mall-opcodes. - (avr_ldi_expression): Warn about implicit lo8(). - * config/tc-avr.h (md_pcrel_from_section): Add prototype. - -2000-07-01 Koundinya K - - * configure.in: Add entry for mips-*-sysv4*MP* - * configure: Rebuild - * config/tc-mips.c (mips_target_format): Return elf32-tradbigmips or - elf32-tradlittlemips for traditional mips targets. - * config/tc-mips.c (md_estimate_size_before_relax): Duplicate the - test for Link Once sections as in adjust_reloc_syms. - * config/te-tmips.h: New file for traditional mips targets. Define - TE_TMIPS. - -2000-06-29 Mark Elbrecht - - * config/obj-coff.c (obj_coff_setcion) [BFD_ASSEMBLER]: If the - flags argument is not present, don't change an existing section's - section's attributes. If the flags argument is present, warn if the - attributes don't match the section's current attributes. When - long section names are supported, set SEC_LINK_ONCE and - SEC_LINK_DUPLICATES_DISCARD for a new .gnu.linkonce section. - -Thu Jun 29 21:30:00 2000 Hans-Peter Nilsson - - * config/obj-aout.c (obj_aout_type): Do not ignore for undefined - symbols; create them. - -2000-06-29 Mark Elbrecht - - * write.c (set_segment_vma): New: Set vma and lma for a segment. - (write_object_file) [BFD_ASSEMBLER && OBJ_COFF && TE_GO32]: Use it. - -2000-06-27 Aldy Hernandez - - * config/tc-mips.c (mips_ip): handle "(foo-.-4)" type of - expressions. Ignore the problem when handling 16 bit signed - immediates, because the assembler will take care of the relocation - later. - -2000-06-27 Nick Clifton - - * config/tc-d30v.c (write_2_short): Do not allow opcodes with - the EITHER_BUT_PREFER_MU attribute to be combined into a reverse - sequential order, and emit warning messages if the input source - code contains constructs like that, or parallel constructs - containing such opcodes. - -2000-06-26 Marek Michalkiewicz - - * config/tc-avr.c (mcu_types): Rename avr4 to avr5, add avr4. - Add more MCU types for avr4 and avr5. Replace at94k{10,20,40} - with just at94k. Change AVR_ISA_85xx back to AVR_ISA_2xxx. - (md_show_usage): Update usage message. - (md_parse_option): Allow redefinition of MCU type within the - same avr[1-5] bfd machine type. Show both old and new MCU type - in the error message. - (md_apply_fix3): Support 8K wrap if AVR_ISA_MEGA is not set. - Simplify 8K wrap code. - -2000-06-25 Kazu Hirata - - * config/obj-aout.c: Remove all uses of DEFUN. - * config/obj-ieee.c: Likewise. - * config/tc-sh.c: Fix comment typos. - * config/tc-tahoe.c: Likewise. - * config/tc-vax.c: Likewise. - * config/tc-w65.c: Likewise. - * config/tc-z8k.c: Likewise. - * config/tc-h8300.c (build_bytes): Assemble ldmac correctly. - -2000-06-24 DJ Delorie - - * config/tc-i386.c (md_estimate_size_before_relax): Revert - more changes from Sept 1999 - (tc_i386_fix_adjustable): ditto - (md_apply_fix3): ditto - -2000-06-24 Frank Ch. Eigler - - * cgen.c (expr_jmp_buf_p): New validity flag for expr_jmp_buf. - (gas_cgen_parse_operand): Set it around expression() call. - (gas_cgen_md_operand): Test for it before longjmp(). - -2000-06-24 Kazu Hirata - - * config/tc-h8500.c: Remove all uses of DEFUN. - * config/tc-sh.c: Likewise. - * config/tc-w65.c: Likewise. - * config/tc-z8k.c: Likewise. - - * config/tc-h8500.c: Fix typos in comments. - -2000-06-23 Frank Ch. Eigler - - * expr.c (operand): Permit $hex literals if LITERAL_PREFIXDOLLAR_HEX - is defined. - -2000-06-23 matthew green - - * expr.c (operand): Do not as_bad() if RELAX_PAREN_GROUPING is - defined. Fix error message for `[' grouping. - -2000-06-22 Kazu Hirata - - * config/tc-h8300.c: Fix formatting and comment typos. - -2000-06-22 Timothy Wall - - * config/tc-ia64.c (note_register_values): Move premature QP - notation clearing into the appropriate place. - -2000-06-22 Alan Modra - - * dep-in.sed: Escape literal `.'s on patterns. Trim off `../' - first before anything else. Add bin-bugs.h, emul.h and progress.h - Sort list of files as for $(OBJS) in Makefile.am. - - * Makefile.am (DEP): grep for leading `/' in DEPA, and fail if we - find one. Remake dependencies. - ($(OBJS)): Add bin-bugs.h, emul.h, and progress.h Sort the list. - * Makefile.in: Regenerate. - * doc/Makefile.in: Regenerate. - - * config/tc-i386.c (i386_displacement): Don't assume a constant - displacement is necessarily 16 bits when in 16 bit code mode. - (md_assemble): Instead size the displacement here after we know - for sure that a .code16gcc operand hasn't automatically added - operand size prefixes. - -2000-06-21 H.J. Lu - - * Makefile.am: Rebuild dependency. - * Makefile.in: Rebuild. - -2000-06-21 Kazu Hirata - - * config/tc-h8300.c (parse_reg): Make the function static. - (parse_exp): Likewise. - -2000-06-20 DJ Delorie - - * config/tc-i386.c (tc_i386_fix_adjustable): Revert change from - Sept 1999; RVA relocs need to be treated more like DIR32 relocs - for cygwin import libraries to work properly. - -2000-06-20 H.J. Lu - - * Makefile.am: Rebuild dependency. - * Makefile.in: Rebuild. - * configure: Likewise. - * doc/Makefile.in: Likewise. - -2000-06-20 Timothy Wall - - * doc/internals.texi (CPU backend): Add @itemx for - TC_START_LABEL_WITHOUT_COLON. - * doc/c-tic54x.texi: New. - * doc/as.texinfo: Add tic54x features and include primary tic54x - documentation file. - * doc/all.texi: Add C54X. - * doc/Makefile.am (CPU_DOCS): Add c-tic54x.texi. - * doc/Makefile.in: Regenerate. - * configure.in: Add tic54x and define LIBM for tic54x. - * configure: Regenrate. - * config/tc-tic54x.[ch]: New. - * config/obj-coff.h: Add tic54x. - * Makefile.am: (CPU_TYPES): Add tic54x. - (TARGET_CPU_CFILES): Add 'tc-tic54x.c'. - (TARGET_CPU_HFILES): Add 'tc-tic54x.h'. - (as_new_LDADD): Add $(LIBM). - * Makefile.in: Regenerate. - -2000-06-18 Stephane Carrez - - * doc/Makefile.am (CPU_DOCS): Added 68hc11 file. - * doc/c-m68hc11.texi: Document 68HC11 and 68HC12 port. - * doc/as.texinfo: Likewise. - - * configure, Makefile.in: Regenerate. - * configure.in (emulations): Recognize m6811 and m6812. - * Makefile.am (CPU_TYPES, TARGET_CPU_CFILES, TARGET_CPU_HFILES): - Added files for 68hc11 and 68hc12 assembler. - * config/tc-m68hc11.c: Assembler for 68hc11 and 68hc12. - * config/tc-m68hc11.h: Header definition for that assembler. - -2000-06-18 Nick Clifton - - * symbols.c (resolve_symbol_value): Use bfd_octets_per_byte - instead of OCTETS_PER_BYTE. - - * config/tc-v850.c: Fix compile time warnings. - * config/tc-ppc.c: Fix compile time warnings. - -2000-06-18 H.J. Lu - - * configure.in: Don't emulate i386-pc-pe-coff with i386coff. - * configure: Rebuild. - -2000-06-17 Mark Elbrecht - - * config/obj-coff.c (obj_coff_weak): Typo fix: Change BFD_ASSEMLER - to BFD_ASSEMBLER. - -2000-06-16 Nick Clifton - - * config/tc-mips.c (md_parse_option): Accept RM5200,RM5230, - RM5231, RM5261, RM5721 and RM7000 as r5000 cpu variants. - - * doc/c-mips.texi: Document newly accepted cpu variants. - -2000-06-15 Ulf Carlsson - - * config/tc-mips.h: Remove definition of ONLY_STANDARD_ESCAPES. - -2000-06-13 Ulf Carlsson - - * macro.c (getstring): Make it possible to escape the quote - character. - -Tue Jun 13 20:58:28 2000 Catherine Moore - - * config/tc-hppa.c (pa_export): Weak symbols can be global. - -2000-06-13 H.J. Lu - - * configure: Regenerate. - -2000-06-09 Alan Modra - - * app.c (do_scrub_begin): Don't default lex[';'] as a line - separator. - * doc/internals.texi (line_separator_chars): Semicolon is no - longer a default. Mention null and newline as defaults. - - * read.c (is_end_of_line): Remove ifdef TC_HPPA. - - * config/tc-i386.h (line_separator_chars): Explicitly mention `;' - * config/tc-i860.h (line_separator_chars): Likewise. - * config/tc-h8300.c (line_separator_chars): Likewise. - * config/tc-i960.c (line_separator_chars): Likewise. - * config/tc-m68k.c (line_separator_chars): Likewise. - * config/tc-mips.c (line_separator_chars): Likewise. - * config/tc-ns32k.c (line_separator_chars): Likewise. - * config/tc-sparc.c (line_separator_chars): Likewise. - * config/tc-vax.c (line_separator_chars): Likewise. - - * config/tc-h8300.c (comment_chars): Use string initialiser. - * config/tc-i960.c (line_comment_chars): Likewise. - * config/tc-z8k.c (comment_chars, line_comment_chars, - line_separator_chars): Likewise. - - * config/tc-arm.c (line_separator_chars): Always use `;', not just - for TE_LINUX. - -2000-06-08 Nick Clifton - - * config/tc-arm.c (cons_fix_new_arm): Assign correct reloc value - for size 1 fixes. - -2000-06-08 David O'Brien - - * configure.in (VERSION): Update to show this is the CVS mainline. - -2000-06-08 Matthew Jacob - - * config/tc-alpha.c (md_undefined_symbol): Properly understand that - $at is the integer register $r28, vs. both $r28 and the floating - point register $f28. - -2000-06-08 James E. Wilson - - * config/tc-ia64.c (generate_unwind_image): Call ia64_flush_insns. - (dot_endp): Don't call ia64_flush_insns. - (emit_one_bundle): Don't delete prologue/body records from - unwind_record list in first loop. Rewrite second loop to account for - this. - -2000-06-07 David Mosberger - - * config/tc-ia64.c: Add missing prototypes. - (generate_unwind_image): Cast argument to output_unw_records call. - -Wed Jun 7 22:44:14 2000 Denis Chertykov - - * config/tc-avr.c (avr_operand): fix the formatting of the comment. - -Wed Jun 7 21:26:15 2000 Denis Chertykov - - * config/tc-avr.c (AVR_ISA_???): moved to include/opcode/avr.h - (REGISTER_P): likewise. - (avr_opcodes): uses include/opcode/avr.h - (avr_operand): enable ld r,Z or st r,Z for at90s1200. - -2000-06-04 Alan Modra - - * read.c (is_end_of_line): No ';' for TC_HPPA. Add missing - initializers too. - -2000-06-03 H.J. Lu - - * read.c (is_end_of_line): Put back `;'. - -2000-06-03 Alan Modra - - * config/tc-i386.c (md_shortopts): Remove 'm', add 'q' to non-elf. - -2000-06-01 Alan Modra - - * expr.c (operand): Test is_end_of_line outside switch to catch - line separator chars that are also operators. - (operator): Return O_illegal for line separator chars. - - * read.c (is_end_of_line): Use 1 instead of 99. Don't set `;' - entry (or `!' entry for TC_HPPA). - - * config/tc-arm.c (my_get_float_expression): Cast to unsigned char - before indexing is_end_of_line. Remove redundant check for '\0'. - (fp_op2): Likewise. - * config/tc-h8500.c (md_assemble): Likewise. - * config/tc-mcore.c (md_assemble): Likewise. - * config/tc-tic30.c (tic30_find_parallel_insn): Likewise. - (md_atof): Likewise - - * config/tc-m88k.c (s_bss): Cast to unsigned char before indexing - is_end_of_line. - * config/tc-mcore.c (mcore_cons): Likewise. - (mcore_float_cons): Likewise. - (mcore_stringer): Likewise. - * config/tc-tic30.c (tic30_find_parallel_insn): Likewise. - -2000-06-01 Scott Bambrough - - * config/tc-arm.c (do_mrs): Allow SPSR_BIT to be set correctly. - -2000-05-29 Nick Clifton - - * config/tc-sh.c: Fix compile time warning messages. - - * config/tc-mips.c: Fix compile time warning messages. - -2000-05-29 Philip Blundell - - * doc/as.texinfo: Update copyright dates. - (Local Labels): Delete misplaced mention of ARM. - * NEWS: Mention ARM ELF support. - -2000-05-27 Alexandre Oliva - - * config/tc-mn10300.c (md_assemble): Copy size to real_size before - it is modified, and use the real_size to compute the frag address - for dwarf2 line info. - -2000-05-27 Alan Modra - - * Makefile.am (DEP, DEP1, dep, dep-in, dep-am): Use a better sed - line-matching scheme to cope with automake moving variables around. - ($(TARG_CPU_O)): Remove dependency on TARG_CPU_DEP_@target_cpu_type@ - * Makefile.in: Regenerate. - -2000-05-26 Jakub Jelinek - - * config/tc-sparc.c (sparc_relax): New. - (md_longopts): Add -relax and -no-relax options. - (md_parse_options, md_show_usage): Likewise. - (md_apply_fix3): Optimize tail call into branch always if possible. - -Thu May 4 15:27:07 2000 Donald Lindsay - - * config/tc-d10v.c (write_2_short, parallel_ok, md_assemble, - d10v_cleanup) implement Mitsubishi's newly explained branch-packing - rules, with warning when a GAS statement specifies a packing that - will result in an instruction being squashed. - Added typdef packing_type and enumerals, changed various integer - literals to use the enumerals. - -2000-05-24 David Mosberger - - * config/tc-ia64.c (dot_restorereg_p): New function. - (md_pseudo_table): Add restorereg.p. - (output_X3_format): Fix typo: record type should be UNW_X3, not UNW_X1. - (output_X4_format): Fix typo: record type should be UNW_X4, not UNW_X2. - - * config/tc-ia64.h (unw_record_type): Add unwabi. - (unw_r_record): Rename member MASK to GRMASK. Add sub-structure - called MASK with members for imask, and the masks produced by - fr_mem, gr_mem, br_mem, and frgr_mem. - (unw_p_record): Add members ABI and CONTEXT. - (unw_x_record): Add member AB. - * config/tc-ia64.c (enum reg_symbol): Add REG_PSP and REG_PRIUNAT - as pseudo-register for use during unwind info generation. - (AR_PFS, AR_LC): New macros. - (enum pseudo_type): Add PSEUDO_FUNC_REG to permit declaring registers - whose names start with an at sign (as in "@priunat"). - (pseudo_func): Add "svr4", "hpux", "nt" constants and "priunat" - register. - (unwind_list, unwind_tail, current_unwind_entry, proc_start, - proc_end, unwind_info, personality_routine): Consolidate into - "unwind" structure to reduce offset-table use. Add member - NEXT_SLOT_NUMBER to track the slot number for the next instruction - to be emitted. - (output_R1_format, output_R3_format, output_P3_format, - output_P6_format): Initialize R with zero to reduce compiler warnings. - (output_P7_format): Ditto. Add `default' branch to switch - statement to reduce compiler warnings. - (output_P8_format, output_B1_format, output_B4_format): Ditto. - (output_P4_format): Rename 2nd & 3rd arg to IMASK and IMASK_SIZE. - (format_ab_reg): Rename from format_a_b_reg. Merge A and B args - into single argument. - (output_X1_format, output_X3_format): Initialize R with zero to reduce - compiler warnings. Merge A and B args into single argument. - (output_X2_format, output_X4_format): Remove unused variable R. Merge - A and B args into single argument. - (free_record): Removed (wasn't used). - (free_list_records): Also free imasks in prologue records. - (output_prologue, output_prologue_gr): Initialize mask bits to zero. - (output_spill_mask): Remove. - (output_unwabi): New function. - (output_epilogue, output_label_state, output_copy_state): Call - alloc_record. - (output_spill_psprel, output_spill_sprel, output_spill_psprel_p, - output_spill_sprel_p, output_spill_reg, output_spill_reg_p): Add AB - argument. - (process_one_record): New locals FR_MASK and GR_MASK. Ignore - gr_mem, fr_mem, br_mem, and frgr_mem records and instead emit them - as part of handling the prologue records. Emit region's imask if - we have one. Handle unwabi, epilogue, label_state, copy_state, - spill_psprel, spill_sprel, spill_reg, spill_psprel_p, - spill_sprel_p, and spill_reg_p records. - (set_imask, count_bits, slot_index): New function. - (fixup_unw_records): Fix region size computation. Handle - epilogue, spill_reg, spill_sprel, spill_psprel, spill_reg_p, - spill_sprel_p, and spill_psprel_p records. Merge mask bits of - frgr_mem, fr_mem, gr_mem, br_mem on a per-region basis and - set_imask accordingly. Update imask for gr_gr, and br_gr records. - (convert_expr_to_ab_reg, convert_expr_to_xy_reg): New function. - (dot_save): Use manifest constants for applicaton registers. - Handle REG_PR and REG_PRIUNAT. - (dot_restore): Don't just ignore it. - (dot_restorereg): New function.. - (generate_unwind_image): Ensure unwind info is a multiple of eight - bytes, not just four bytes. - (dot_handlerdata, dot_unwentry): Demand empty rest of line. - (dot_altrp): Don't just ignore it. - (dot_savemem): New function. Replaces dot_savesp() and - dot_savepsp(). Use manifest constants for applicaton registers. - Handle REG_PR and REG_PRIUNAT. - (dot_savef): Simplify. - (dot_saveb): Support generation of br_gr. - (dot_spillreg, dot_spillmem, dot_spillreg_p, dot_spillmem_p, - dot_label_state, dot_copy_state): New function. - (dot_unwabi): Don't just ignore it. - (md_pseudo_table): Add restorereg, spillreg, spillsp, spillpsp, - spillreg.p, spillsp.p, spillpsp, label_state, copy_state, - unwabi, vframesp, and vframepsp. Fix typo alprp->altrp. - (emit_one_bundle): Set slot number for prologue/body records - *before* emitting the first insn. - (emit_one_bundle): Set UNWIND.NEXT_SLOT_NUMBER. - (md_begin): Declare "psp" pseudo-register. - (md_operand): Handle PSEUDO_FUNC_REG. Fix printing of error message - so we don't get segfault. - (output_psp_sprel): Output sp/psp relative offsets as 4-byte word - counts as required per SW Conventions manual - (output_rp_psprel, output_rp_sprel, output_pfs_psprel,output_pfs_sprel, - output_preds_psprel, output_preds_sprel, output_spill_base, - output_unat_psprel, output_unat_sprel, output_lc_psprel, - output_lc_sprel, output_fpsr_psprel, output_fpsr_sprel, - output_priunat_psprel, output_priunat_sprel, output_bsp_psprel, - output_bsp_sprel, output_bspstore_psprel, output_bspstore_sprel, - output_rnat_psprel, output_rnat_sprel, output_spill_psprel, - output_spill_sprel, output_spill_psprel_p, output_spill_sprel_p):Ditto. - (dot_vframe): Implement. - (dot_vframesp, dot_vframepsp): New function. - -Tue May 23 00:57:05 2000 Hans-Peter Nilsson - - * configure.in (i386-*-freebsd a.out entry): Quote properly. - * configure: Regenerate. - -2000-05-23 Alan Modra - - * config/tc-i386.c (md_assemble): Pass jump reloc in fr_var... - (md_estimate_size_before_relax): so we can use it here instead of - old kludges. Localise vars to blocks. Comment. - - * frags.c (frag_new): Update fr_var comments. - * frags.h (struct frag): Ditto. - -2000-05-22 Richard Henderson - - * config/tc-ia64.c (FUNC_PC_RELATIVE): New. - (pseudo_func): Add pcrel. - (operand_match): Handle IA64_OPND_TGT64. - (build_insn): Likewise. - (md_begin): Initialize pseudo_func[FUNC_PC_RELATIVE]. - (ia64_gen_real_reloc_type): Handle FUNC_PC_RELATIVE. - (fix_insn): Handle all three 64-bit relocation types. - -Mon May 22 22:43:32 2000 Hans-Peter Nilsson - - * obj.h (struct format_ops): New members begin, app_file, - s_set_other, s_set_desc, s_get_type, s_set_type, - separate_stab_sections, init_stab_section. - - * config/obj-multi.h: Update GPL notice to v2. - (obj_begin): New. - (obj_app_file): New. - (S_SET_SIZE): Test s_set_size for NULL before calling. - (S_SET_ALIGN): Similar for s_set_align. - (S_SET_OTHER): New. - (S_SET_DESC): New. - (S_GET_TYPE): New. - (S_SET_TYPE): New. - (SEPARATE_STAB_SECTIONS): New. - (INIT_STAB_SECTION): New. - (EMIT_SECTION_SYMBOLS): New. - (AOUT_STABS) [OBJ_MAYBE_AOUT]: Define. - - * config/obj-elf.h: Update GPL notice to v2. - Mention that this file is included from obj-multi.h. - (obj_begin): Wrap definition in ifndef. - (elf_file_symbol): Constify declaration. - (obj_app_file): Ditto. - (SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB): - Wrap in ifndef SEPARATE_STAB_SECTIONS. - - * config/obj-elf.c (elf_s_set_other): New. - (elf_file_symbol): Constify argument. - (elf_separate_stab_sections): New. - (elf_init_stab_section): New. - (elf_format_ops): Add new members. Remove comma at end. - - * config/obj-ecoff.c (ecoff_separate_stab_sections): New. - (ecoff_format_ops): Add new fields. Remove comma at end. - Mention inconsistency for emit_section_symbols. - - * config/obj-coff.h (c_dot_file_symbol): Constify declaration. - - * config/obj-coff.c (c_dot_file_symbol): Constify argument. - (coff_separate_stab_sections): New. - (coff_format_ops): Add new members. - - * config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New. - (obj_aout_s_set_other): New. - (obj_aout_s_set_desc): New. - (obj_aout_s_get_type): New. - (obj_aout_s_set_type): New. - (obj_aout_separate_stab_sections): New. - (aout_format_ops): New members added. Use obj_aout_process_stab, - not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0. - (obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as - appropriate. - (obj_aout_line, obj_aout_weak, obj_aout_type): Ditto. - -2000-05-22 Alan Modra - - * config/tc-i386.c (tc_i386_fix_adjustable): Prevent adjustment - for OBJ_MAYBE_ELF too. Use S_IS_EXTERNAL instead of S_IS_EXTERN. - (md_estimate_size_before_relax): Ensure jumps to weak and - externally visible symbols are relocatable. - -Sat May 20 16:41:55 2000 Hans-Peter Nilsson - - * stabs.c (aout_process_stab): Make global. - (s_desc): Add ATTRIBUTE_UNUSED to args as appropriate. - * read.h (aout_process_stab): Declare. - - * configure.in (EMULATIONS) [i386aout, i386coff, i386elf]: - Generalize to *aout, *coff *elf. - * configure: Regenerated. - - * doc/internals.texi (Object format backend): Say - SEPARATE_STAB_SECTIONS needs to be nonzero, not just defined. - - * Makefile.am (TARG_ENV_HFILES): Delete te-multi.h. - * Makefile.in: Regenerated. - -2000-05-19 Catherine Moore - - * cgen.h (GAS_CGEN_MAX_FIXUPS): Check if already defined. - -2000-05-18 Alan Modra - - * config/tc-hppa.c (md_apply_fix): Mask out immediate bits of - instruction to reflect change in re_assemble_*. - -Thu May 18 10:52:14 2000 Jeffrey A Law (law@cygnus.com) - - * configure.in (hppa-*-hpux11*): If the cpu is hppa*64*, then - build PA64 ELF tools. - * configure: Rebuilt. - -2000-05-17 Alan Modra - - * Makefile.am: Regenerate dependencies. - * Makefile.in: Regenerate. - -2000-05-15 Nick Clifton - - * config/tc-arm.c (struct asm_psr): Add boolean field - distinguishing between CSPR and SPSR. Rename 'number' field - to 'field'. - (psrs): Rearrange contents to match new asm_psr structure. - (arm_psr_parse): Move next to psr_required_here. Make it - return an asm_psr structure. - (psr_required_here): Use asm_psr structure returned by - arm_psr_parse. - (do_msr): Reorganise to allow psr_required_here to be called - only once. - (md_undefined_name): Mark 'name' parameter as unused, since - the COFF target does not use it. - -2000-05-14 David O'Brien - - * config/te-386bsd.h: Clean up comments to adhere to the GNU coding - standards. - * config/te-aux.h: Likewise. - * config/te-dpx2.h: Likewise. - * config/te-go32.h: Likewise. - * config/te-hp300.h: Likewise. - * config/te-hppa.h: Likewise. - * config/te-i386aix.h: Likewise. - * config/te-ic960.h: Likewise. - * config/te-interix.h: Likewise. - * config/te-nbsd532.h: Likewise. - * config/te-pc532mach.h: Likewise. - * config/te-ppcnw.h: Likewise. - * config/te-psos.h: Likewise. - * config/te-sparcaout.h: Likewise. - * config/te-sun3.h: Likewise. - * config/te-sysv32.h: Likewise. - -2000-05-14 Alan Modra - - * config/tc-h8300.c (do_a_fix_imm): Don't rely on `short' being 16 - bits. Instead explicitly mask and sign extend. Do the 8 bit mask - and sign extend without an if statement. - (build_bytes): Likewise. - -2000-05-14 Kazu Hirata - - * config/tc-h8300.c (do_a_fix_imm): Output a reloc for no - X_add_symbol L_32 case. - -2000-05-14 David O'Brien - - * config/te-freebsd.h: New file. - -2000-05-13 Alan Modra - - * asintl.h (gettext, dgettext, dcgettext, textdomain, - bindtextdomain): Replace defines with those from intl/libgettext.h - to quieten gcc warnings. - - * NEWS: Mention x86 .arch and -q. - - * config/tc-i386.c (quiet_warnings): New. - (md_assemble): Use quiet_warnings. - (md_parse_option): Set quiet_warnings from -q. - (md_show_usage): Mention -q, delete -m. - (flag_do_long_jump): Delete. - (md_parse_option): Remove -m. - (md_show_usage): Remove -m. - (md_create_long_jump): Remove useless flag_do_long_jump code. - - * as.c (parse_args): In case OPTION_DEFSYM, use a valueT to hold - the symbol value, and use bfd_scan_vma if BFD_ASSEMBLER. - -2000-05-13 Alan Modra - Alexander Sokolov - - * doc/c-i386.texi (i386-Arch): New section. - (i386-Syntax): Mention .intel_syntax and .att_syntax. - - * config/tc-i386.c (cpu_arch_name, cpu_arch_flags): New. - (smallest_imm_type): Use smallest opcode for shift by one if cpu - architecture has been given and is not 486. - (set_cpu_arch): New. - (md_pseudo_table): Add .arch. - (md_assemble): Warn if cpu architecture has been given and an - unsupported instruction. - - * config/tc-i386.h (SMALLEST_DISP_TYPE): Delete. - Move operand_types bit defines after relevant template field. - (template): Add cpu_flags. - (Cpu*): Define. - (arch_entry): New. - -2000-05-12 Alexandre Oliva - - * config/tc-mn10300.h (md_end): Define. - (mn10300_finalize): Declare. - * config/tc-mn10300.c: Include dwarf2dbg.h. - (debug_line): Define. - (md_assemble): Generate dwarf2 line info. - (mn10300_finalize): New function. Finalize dwarf2 info. - -2000-05-11 Ulf Carlsson - - * config/tc-mips.c (md_estimate_size_before_relax): Use the - external version of the relocation for weak symbols. - -2000-05-08 David Mosberger - - * config/tc-ia64.c (output_P7_format, case mem_stack_f): Output fixed - frame size in units of 16 bytes, as required per SW Conventions manual. - (output_unw_records): Output info-block header as a dword to get - byte-order right. - -2000-05-08 Alan Modra - - * as.h: #include "file", not on files from ../include. - (as_abort, as_fatal): Add ATTRIBUTE_NORETURN. - * config/tc-m68k.c (m68k_ip): Fix signed/unsigned warnings. - (md_convert_frag): Add ATTRIBUTE_UNUSED. - (tc_coff_symbol_emit_hook): Ditto. - (OPTCOUNT): Cast to int to avoid compiler warning. - (md_begin): Fix signed/unsigned warnings. - -2000-05-08 Michael Sokolov - - * config/tc-m68k.c (md_convert_frag_1): Abort if we end up in the - ABRANCH LONG case for a conditional branch on a 68000. - (md_estimate_size_before_relax): Likewise. Also handle - flag_short_refs correctly for ABRANCH, BCC68000, and DBCC. - (m68k-ip: case ABSL): Relax absolute references to 16-bit - PC-relative on all CPUs. - (md_estimate_size_before_relax): Likewise. - -2000-05-04 Alan Modra - - * as.c (parse_args): Just mention current year in printed - copyright message. - -2000-05-03 J.T. Conklin - - * config/tc-ppc.c (pre_defined_registers): Add entries for vector - unit registers. - (md_parse_option): Recognize -m7400. - -2000-05-03 Ian Lance Taylor - - * config/atof-ieee.c (gen_to_words): When adding carry back in, - don't permit lp to become less than the words array. - -2000-05-03 Rodney Brown - - config/tc-mcore.c (md_apply_fix3): BFD_RELOC_MCORE_PCREL_IMM11BY2 - Fix little-endian case. - -2000-05-03 David O'Brien - - * as.c (parse_args): Update copyright. - -2000-05-03 Mark Elbrecht - - * gas/config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 - for the .bss section too. - -2000-05-02 Alan Modra - - * configure.in: Set em=linux for hppa-*-linux. - * configure: Regenerate. - * doc/Makefile.in: Regenerate with correct automake. - - * frags.c (frag_grow): Sanity check chunk_size. - - * config/obj-elf.h: #include "bfd.h" not - * config/obj-som.h: Likewise. - * config/obj-ieee.h: Likewise. - - * config/tc-hppa.h: Test BFD_ARCH_SIZE, not BFD64. - - * config/tc-hppa.c (log2): Only compile when OBJ_SOM. - (md_pseudo_table): Fully initialise OBJ_ELF cases. - (fix_new_hppa): Add ATTRIBUTE_UNUSED to args as appropriate. - (pa_ip): low_sign_unext now returns via function value. Use - re_assemble_* instead of dis_assemble_* and - INSERT_FIELD_AND_CONTINUE combination. Don't call sign_unext - unnecessarily. - (md_convert_frag): Add ATTRIBUTE_UNUSED to args as appropriate. - (md_section_align, md_parse_option, md_show_usage, - md_undefined_symbol, pa_align, pa_block, pa_brtab, pa_try, - pa_callinfo, pa_code, pa_comm, pa_end, pa_enter, pa_entry, - pa_exit, pa_export, pa_import, pa_label, pa_leave, pa_level, - pa_origin, pa_param, pa_proc, pa_procend, pa_space, pa_spnum, - pa_version, pa_compiler, pa_copyright, pa_data, pa_fill, pa_lsym, - pa_text): Likewise. - (md_apply_fix): Change type of new_val to offsetT. Delete w1, w2, - w, resulti. Add insn, val. Move bfd_get_32 and bfd_put_32 - outside of switch. Correct mask and shifting errors in case 10 - and case -11. In case 21, compare against signed range to suit - hppa_field_adjust changes. In case 12, use re_assemble_12. In - case 17 and case 22, use offsetT variable to properly check range. - Use re_assemble_* here too. - (evaluate_absolute): Change type of value to offsetT. Call - hppa_field_adjust to do the work for us. - (pa_parse_cmpb_64_cmpltr): Delete save_s. - (pa_parse_cmpib_64_cmpltr): Ditto. - (pa_build_unwind_subspace): Delete unused var subseg. Change type - of i to unsigned int. - (pa_type_args): Conditionally declare symbol if OBJ_SOM. - (pa_end_of_source): Return type is void. - -Mon May 1 08:54:23 2000 Catherine Moore - - * macro.c (macro_expand_body): Don't prepend macro number with zeroes. - -Mon May 1 14:19:39 2000 Denis Chertykov - - * config/tc-avr.c: ATTRIBUTE_UNUSED added to the necessary places. - More comments added. - (md_begin): Removed "construct symbols for each register name". - Because register names conflicts with GCC generated function - names. - (avr_operand): Now constant numbers can be used as a register - identifiers (0 as r0, 31 as r31). - (md_assemble): use skip_space () before parsing instruction - operands. - -2000-05-01 Alan Modra - - * configure.in: Set bfd_gas=yes on i386-*-pe and i386-*-nt* to - ensure all pe targets use bfd. Remove unnecessary bfd_gas=yes on - arm-*-netbsd* and arm-*-wince as this is set for all arm*. - * configure: Regenerate. - -2000-04-29 Andreas Jaeger - - * as.h: Correctly check GCC version. - -2000-04-26 David O'Brien - - * doc/as.1: Fix unbalanced brackets. - - * config/tc-i386.c (comment_chars): Don't use '/' as comment start if - TE_FreeBSD. - (line_comment_chars): Set to '/' if TE_FreeBSD. - -Tue Apr 25 11:02:02 2000 Jeffrey A Law (law@cygnus.com) - - * configure.in: Configury support for PA64 (currently disabled). - * configure: Rebuilt. - -2000-04-25 Machida Hiroyuki - - * config/tc-mips.c (s_change_sec): Use record_alignment, not - bfd_set_section_alignment. - -2000-04-25 Alan Modra - - * config/tc-i386.c (offset_in_range): Ensure shift counts are less - than 32. - -2000-04-24 Nick Clifton - - * doc/c-arm.texi (ARM Directives): Document behaviour of .align 0. - * doc/as.texinfo (Align): Include arm and strongarm in list of - targets that have the second form of the behaviour of the .align - directive. - -2000-04-24 Mark Klein - - * obj-som.c: Terminate obj_pseudo_table. - -Mon Apr 24 15:21:11 2000 Clinton Popetz - - * as.c (parse_args): Allow md_parse_option to override -a listing - option. - * config/obj-coff.c (add_lineno): Change type of offset parameter - from "int" to "bfd_vma." - * config/tc-ppc.c (md_pseudo_table): Add "llong" and "machine." - (ppc_mach, ppc_subseg_align, ppc_target_format): New. - (ppc_change_csect): Align correctly for XCOFF64. - (ppc_machine): New function, which discards "ppc_machine" line. - (ppc_tc): Cons for 8 when code is 64 bit. - (md_apply_fix3): Don't check operand->insert. Handle 64 bit - relocations. - (md_parse_option): Handle -a64 and -a32. - (ppc_xcoff64): New. - * config/tc-ppc.h (TARGET_MACH): Define. - (TARGET_FORMAT): Move to function. - (SUB_SEGMENT_ALIGN): Use ppc_subseg_align. - -Sun Apr 23 16:45:45 2000 Denis Chertykov - - * config/tc-avr.c: New AVR_ISA_ defined. - (md_assemble): Handle opcodes with optional operands (lpm,elpm). - (avr_operand): Handle 'a', 'v' and 'z' constraint letters needed - for `fmul', `movw' and `lpm R,Z' instructions. - (avr_operands): Warn if current opcode is a two-word instruction - and previous opcode was cpse/sbic/sbis/sbrc/sbrs. - (avr_opcodes): New commands added. - (REGISTER_P): Check 'a' and 'v' constraint letters. - (mcu_types): New MCU added. - -2000-04-22 Timothy Wall - - * config/tc-ia64.c (pseudo_func[]): Add new "nat" entry equivalent - to "natval". - (operand_match): Conditionally insert default bit values for IMMU9. - -2000-04-14 Matthew Green - - * configure.in: Add NetBSD/sparc ELF and NetBSD/sparc64 support. - * configure: Rebuilt. - -Fri Apr 21 14:29:43 2000 Jeffrey A Law (law@cygnus.com) - Jason Eckhardt - - * config/tc-hppa.c (md_apply_fix): Handle new PA2.0 formats. - - * config/tc-hppa.c (CHECK_ALIGN): New macro. - Added handling of new operand types l,y,&,fe,fE,fx. - -Fri Apr 21 13:20:53 2000 Richard Henderson - David Mosberger - Timothy Wall - Andrew MacLeod - Jim Wilson - - * Makefile.am (CPU_TYPES): Add ia64. - (TARGET_CPU_CFILES): Add config/tc-ia64.c. - (TARGET_CPU_HFILES): Add config/tc-ia64.h. - * Makefile.in: Rebuild. - * app.c (do_scrub_chars): Handle DOUBLESLASH_COMMENTS. - * configure: Rebuild. - * configure.in: Recognize ia64 as cpu type. Set bfd_gas. - (ia64-*-elf*, ia64-*-linux-gnu*): New targets. - * expr.c (expr): Handle md_optimize_expr. - * read.c (LEX_HASH): Add comment. - * config/tc-ia64.c, config/tc-ia64.h: New files. - -2000-04-21 Richard Henderson - - * config/tc-d30v.c (write_2_short): Disregard opcode1->ecc when - bundling a non-delayed branch type instruction. - -2000-04-20 Alexandre Oliva - - * config/tc-mn10300.c (HAVE_AM30): Define. - (md_assemble): Use it. - -2000-04-19 Alan Modra - - * config/obj-elf.c (obj_elf_change_section): Check for changed - section attributes. - - * Makefile.am: (CPU_MULTI_VALID): Remove. - (MULTI_CPU_TYPES): Define. - (MULTI_CPU_OBJ_VALID): Define. - (DEPTC): Use the above. - (DEPOBJ): Same here. - (DEP2): And here. - Regenerate dependencies. + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. + * gas/po/POTFILES.in: Regenerate. -2000-04-19 Michael Sokolov - - * Makefile.am (YACC, LEX): Get them from configure. - -2000-04-18 H.J. Lu (hjl@gnu.org) - - * config/tc-i386.c (offset_in_range): Use addressT instead of - bfd_vma for non-bfd assemblers. - -2000-04-17 Alan Modra - - * config/tc-i386.c (offset_in_range): Sign extend val so BFD64 - doesn't give spurious errors. - -2000-04-14 Michael Sokolov - - * as.h (SEEK_SET): Define if undefined. +2002-01-21 DJ Delorie -2000-04-13 Alan Modra + * config/obj-coff.c (obj_coff_init_stab_section): Make the + stabstr_name allocation permanent, as it will be referenced from + the section hash. - * config/tc-arm.c (md_apply_fix3): Don't use UL suffix on - constants, and don't assume offsetT is 32 bits. +2002-01-21 Jason Thorpe -2000-04-12 Andrew Cagney + * configure.in (ia64-*-netbsd*): New target. + * configure: Regenerate. - * config/tc-d10v.h: Include "write.h" to get definition of fixS. - (md_pcrel_from_section): Add prototype. - (d10v_fix_adjustable): Add prototype. - (d10v_force_relocation): Replace 'struct fix' with 'fixS'. +2002-01-21 Hans-Peter Nilsson - * config/tc-d10v.c (md_apply_fix3): Add paren around &&. + * doc/as.texinfo (Overview) : Add missing {} + to @dots call. + : Ditto. + * doc/c-arm.texi (ARM Options): Ditto. -2000-04-12 Nick Clifton +2002-01-18 Richard Earnshaw - * config/tc-d10v.c (find_opcode): Correctly calculate position of - symbol in frag chain. + * tc-arm.c (do_xsc_mia, do_xsc_mar, do_xsc_mra): Renamed from + do_mia, do_mar and do_mra respectively. + (do_mav_*): Renamed from do_c_*. + (mav_reg_required_here, mav_parse_offset): Renamed from + cirrus_reg_required_here and cirrus_parse_offset respectively. + (MAV_MODE?): Renamed from CIRRUS_MODE?. -2000-04-10 Alan Modra +2002-01-18 Richard Earnshaw + Keith Walker - * config/tc-i386.c (fits_in_signed_byte): Change arg to offsetT. - (fits_in_unsigned_byte, fits_in_unsigned_word): Ditto. - (fits_in_signed_word, smallest_imm_type): Ditto. - (md_assemble): Use an offsetT var to hold offsetT values, not a - long. - (offset_in_range): New. - (md_assemble): Use it. - (md_convert_frag): Change type of target_address, opcode_address, - and displacement_from_opcode_start to offsetT. - (md_create_short_jump): Change type of offset to offsetT. - (md_create_long_jump): Ditto. - (md_apply_fix3): Use -4, not 0xfffffffc for BFD_RELOC_386_PLT32. - (md_chars_to_number): Remove. - (output_invalid): Remove duplicate prototype. + * tc-arm.c (ARM_EXT_V5J, ARM_ARCH_V5TEJ): Define. + (insns): Add pattern for bxj instruction. + (do_bxj): New function. + (arm_cpus): Add arm926ej. + (arm_archs): Add armv5tej. -2000-04-09 Nick Clifton +2002-01-18 Richard Earnshaw - * Makefile.am (CPU_TYPES): Add 'avr'. - (TARGET_CPU_CFILES): Add 'tc-avr.c'. - (TARGET_CPU_HFILES): Add 'tc-avr.h'. + * doc/c-arm.texi: Add new fpe options to list of supported flags. - * Makefile.in: Regenerate. - - * doc/as.texinfo: Add M32R documentation. - -Fri Apr 7 15:56:57 2000 Andrew Cagney - - * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add - --enable-build-warnings option. - * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. - * Makefile.in, configure: Re-generate. +2002-01-19 Keith Walker -2000-04-07 Nick Clifton + * tc-arm.c (arm_fpus): Add fpe2 and fpe3. - * config/tc-arm.c (md_apply_fix3): Treat BFD_RELOC_ARM_PCREL_BLX - in the same way as BFD_RELOC_ARM_PCREL_BRANCH, and - BFD_RELOC_THUMB_PCREL_BLX lie BFD_RELOC_THUMB_PCREL_BRANCH. - (tc_gen_reloc): Accept BFD_RELOC_{ARM|THUMB}_PCREL_BLX. - (arm_force_relocation): Force relocations for - BFD_RELOC_{ARM|THUMB}_PCREL_BLX as well. +2002-01-18 Richard Earnshaw -Wed Apr 5 22:26:32 2000 J"orn Rennecke + * NEWS: Mention new ARM command-line options and VFP support. - * config/tc-sh.c (get_operands): There's no third operand if the - first operand is an immediate. + * config/tc-arm.c (ARM_CEXT_XSCALE): Replaces ARM_EXT_XSCALE. All + uses changed. + (ARM_CEXT_MAVERICK): Similarly. + (ARM_ANY): Now means any core instruction. + (CPU_DEFAULT): Default to ARM_ANY. + (uses_apcs_26, atcps, support_interwork, uses_apcs_float) + (pic_code): Declare for all object types. Make type int. + (legacy_cpu, legacy_fpu, mcpu_cpu_opt, mcpu_fpu_opt, march_cpu_opt) + (march_fpu_opt, mfpu_opt): Declare. + (md_longopts): Tidy up conditional definitions. + (arm_opts, arm_cpus, arm_archs, arm_fpus, arm_extensions) + (arm_long_opts): New tables. + (arm_parse_cpu, arm_parse_arch, arm_parse_fpu): New functions. + (arm_parse_extension): New function. + (md_parse_option): Rewrite using new table-driven system. + (md_show_usage): Use new table-driven system. + (md_begin): Calculate cpu_variant from command line option data. + * doc/as.texinfo (ARM ISA options): Docuement new ARM-specific + command-line options. + * doc/c-arm.texi: Likewise. -Wed Apr 5 22:07:19 2000 J"orn Rennecke +2002-01-18 Andreas Jaeger - * config/tc-sh.c (immediate): Delete. - (sh_operand_info): Add immediate member. - (parse_reg): Use A_PC for pc. - (parse_exp): Add second argument 'op'. All callers changed. - (parse_at): Expect pc to be coded as A_PC. - Use immediate field in *op. - (insert): Add fourth argument 'op'. All callers changed. - (build_relax): Add second argument 'op'. All callers changed. - (insert_loop_bounds): New function. - (build_Mytes): Remove DISP_4. - Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT. - (assemble_ppi): Use immediate field in *operand. - (sh_force_relocation): Handle BFD_RELOC_SH_LOOP_{START,END}. - (md_apply_fix): Likewise. - (tc_gen_reloc): Likewise. Check for a pcrel BFD_RELOC_SH_LABEL. + * as.c (parse_args): Update year. -Wed Apr 5 06:35:45 2000 Alexandre Oliva +2002-01-17 Timothy Wall - * config/tc-sparc.c (sparc_ip): Avoid string pasting. + * config/tc-tic54x.c (encode_address): Add a more informative + warning about incorrect syntax. -Tue Apr 4 19:27:50 2000 Hans-Peter Nilsson - - * internals.texi (CPU backend): Document - TC_CHECK_ADJUSTED_BROKEN_DOT_WORD. - -2000-04-04 Alan Modra +2002-01-17 Nick Clifton * po/gas.pot: Regenerate. - * as.c (show_usage): Restore translated part of bug string. - * gasp.c (show_usage): Likewise. - - * Makefile.am (MKDEP): Use gcc -MM rather than ../mkdep. - (DEP): Quote when passing vars to sub-make. Use "mv -f" rather - than move-if-change. - (DEP1): Modify for "gcc -MM". - (DEPTC): Likewise. - (DEPOBJ): Likewise. - (DEP2): Likewise. - (CLEANFILES): Add DEPTCA, DEPOBJA, DEP2a, DEPA. - Update dependencies. - * Makefile.in: Regenerate. - -2000-04-03 Alexandre Oliva - - * config/tc-mn10300.c (md_pseudo_table): Use constant names. - (md_begin): Likewise. - (HAVE_AM33): New macro. - (md_assemble): Use it. Match r_regs and xr_regs only if - HAVE_AM33. - -2000-04-03 Alan Modra - - * as.h: #include "bin-bugs.h" - * as.c (show_usage): Use REPORT_BUGS_TO. - * gasp.c: #include "bin-bugs.h" - (show_usage): Use REPORT_BUGS_TO. - - * config/tc-sparc.c (md_show_usage): Add a trailing newline. - -Mon Apr 3 13:56:03 2000 Hans-Peter Nilsson - - * write.c (write_object_file) [! WORKING_DOT_WORD]: If defined, - call TC_CHECK_ADJUSTED_BROKEN_DOT_WORD for each word after - adjustments. - -2000-04-03 Alan Modra - - * config/tc-i386.c (i386_immediate): Don't assume a constant - immediate is necessarily 16 bits when in 16 bit code mode. - (md_assemble): Instead set guess_suffix here after we have checked - registers. - -2000-04-02 Richard Henderson - - * config/tc-d30v.c (check_range): Allow signed or unsigned 32-bit - quantities. Correct right shift sign extension. - (build_insn): Make `number' unsigned long. Mask top 6 bits of - 32-bit value when shifting into place. - -2000-04-01 Ian Lance Taylor - - * app.c: Add ATTRIBUTE_UNUSED as needed. - * config/tc-ppc.c: Likewise. - (ppc_size): Make unsigned long. - (ppc_insert_operand): Add casts to avoid warnings. - -2000-03-31 Nick Clifton - - * config/tc-d10v.h (md_flush_pending_output): Define. - -2000-03-29 Nick Clifton - - * config/tc-sh.h (SEG_NAME): New macro: return the name of a - segment. Works for both BFD_ASSEMBLER and others. - (SUB_SEGMENT_ALIGN): Use SEG_NAME. - -2000-03-29 Nick Clifton - - * listing.c (LISTING_LHS_WIDTH): Default depends on - LISTING_WORD_SIZE. - (LISTING_LHS_WIDTH_SECOND): Default to LISTING_LHS_WIDTH. - -2000-03-27 Ian Lance Taylor - - * config/tc-sh.c (md_show_usage): Use backslash before newline in - string literal. - -2000-03-27 Alan Modra - - * config/tc-avr.h (TC_HANDLES_FX_DONE): Define. - - * config/tc-avr.c (mcu_types): Add missing initialiser. - (md_pcrel_from_section): Add prototype. - (avr_operand): Remove redundant test of unsigned < 0. - (avr_cons_fix_new): Ensure exp_mod_pm zero on function exit. - -2000-03-27 Denis Chertykov - - * config/tc-avr.c: New file for AVR support. - * config/tc-avr.h: Likewise. - * configure.in: Add AVR support. - * configure: Regenerate. - -2000-03-26 Timothy Wall - - * gasp.c (macro_op): Add new argument to check_macro call. - Macro structure definitions moved to macro.h - * sb.h: Add argument to prototype for input_scrub_include_sb. - * input-scrub.c (input_scrub_include_sb): Allow disabling of sb - nesting checks with an additional flag. - (struct input_save): Add flag to indicate whether current sb - should be checked for proper macro/conditional nesting. - (input_scrub_push/pop): Save/restore nest check flag. - (input_scrub_next_buffer): Ditto. Also call end of macro hook if - defined. - * macro.c (check_macro): Allow caller to retrieve parsed macro - information if a pointer is provided. This information may be - used by the new macro hooks. - * macro.h: Update prototype for check_macro. Macro struct - definitions moved here from macro.c/gasp.c. - * read.c (read_a_source_file): Add parameter to check_macro call, - and pass macro info to the macro hook, if defined. - (input_scrub_insert_line): New. Allow insertion of a line of - characters into the input stream. - (input_scrub_insert_file): New. Allow insertion of an arbitrary - file into the input stream. - (s_include): Use input_scrub_insert_file. - * internals.texi: Document new macro hooks. - * as.h: New prototypes added. - -2000-03-26 Alan Modra - - * config/tc-i386.c: Don't start any as_bad or as_warn message with - an initial capital letter. - (i386_index_check): Reindent. - -2000-03-19 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): Fix bug detecting overflow of pc - relative branches. - -2000-03-17 Thomas de Lellis - - * config/tc-arm.c (do_t_adr): Flag "adr Rd,label" - instruction operand bad if Rd > 7 when generating - thumb instructions. Prevents for example, - "adr r12,label" from silently failing and generating - the wrong instruction. - -2000-03-17 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): Handle same-section relocations - that have a destingation >= 0x400000. - Fix compile time warning messages. - -Thu Mar 16 23:45:16 2000 J"orn Rennecke - - * config/tc-sh.c (md_begin): When encountering insn that are - not supported by the current arch, only change the name if - its contents are the same as prev_name. - (get_specific): If the the architecture doesn't match, fail. - -Thu Mar 16 21:18:13 2000 J"orn Rennecke - - * config/tc-sh.c (IDENT_CHAR): Define. - (parse_reg): Use it instead of isalnum. Put r[0..7]_bank operand - matching back where it came from. - -Thu Mar 16 20:58:10 2000 J"orn Rennecke - - * config/tc-sh.c (md_show_usage): Add description of -dsp. - -2000-03-15 Jonathan Larmour - - * config/tc-sh.c (parse_reg): Match r[0..7]_bank operands before - normal operands. - -2000-03-15 Kazu Hirata - - * config/tc-h8300.c: Add ATTRIBUTE_UNUSED as appropriate. - -Mon Mar 13 22:02:59 2000 Hans-Peter Nilsson - - * expr.c (operand) [case 'f']: When testing if '0f' can start a - floating-point-number, make sure 'f' is in FLT_CHARS. - -Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson - - * read.c (TC_IMPLICIT_LCOMM_ALIGNMENT): New default-definition. - (s_lcomm_internal): Use it. - * doc/internals.texi (CPU backend): Document it. - * config/obj-evax.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Set to 2**3 - bytes. - -2000-03-10 Geoffrey Keating - - * config/tc-mips.c (mips_ip): Don't put stuff in .rodata - when embedded-pic. - - * config/tc-mips.c (SWITCH_TABLE): The ELF embedded-pic - implementation doesn't have special handling for switch - statements. - (macro_build): Allow for code in sections other than .text. - (macro): Likewise. - (mips_ip): Likewise. - (md_apply_fix): Do pc-relative relocation madness for MIPS ELF. - Don't perform relocs if we will be outputting them. - (tc_gen_reloc): For ELF, just use fx_addnumber for pc-relative - relocations. Allow BFD_RELOC_16_PCREL_S2 relocs when - embedded-pic. +2002-01-17 Nick Clifton -2000-03-09 Catherine Moore + * macro.c (get_any_string): Add no-c-format comment to prevent + confusion when translating string. + * gasp.c (get_any_string): Add no-c-format comment to prevent + confusion when translating string. - * config/tc-m32r.c (m32r_fix_adjustable): Look up the - relocation type based on the entry in the fixup structure. - Put S_IS_EXTERN processing back in. +2002-01-16 Thiemo Seufer + Johannes Stezenbach + * config/tc-mips.c (percent_op): Ensure longer percent_op's are + matched before the shorter ones. + (my_getSmallParser): Fix handling of nested parentheses in + percent_op's. Code cleanup. + (my_getPercentOp): New function, code from my_getSmallParser. + (my_getSmallExpression): Fix handling of closing parentheses. + Code cleanup. Better comments. -2000-03-08 H.J. Lu (hjl@gnu.org) +2002-01-16 Nick Clifton - * Makefile.am (install-exec-tooldir): Depend on - install-exec-bindir for parallel make. - * Makefile.in: Regenerated. - -2000-03-06 Nick Clifton - - * config/tc-m32r.c (struct md_longopts): Add -m32r command line - switch. - (md_parse_option): Parse -m32r command line switch - disable m32rx - compatability. - (md_show_usage): Document new option. - - * doc/Makefile.am (CPU_DOCS): Add c-m32r.texi. - * doc/Makefile.in: Regenerate. - * doc/c-m32r.texi (M32R-Opts): Document new command line switch. - -2000-03-02 Michael Meissner - - * config/tc-d30v.c (check_range): Remove code that incorrectly - sign extended values where bits < 32. + po/tr.po: New file: Turkish translation. + configure.in (LINGUAS): Add "tr". + configure: Regenerate. -2000-03-02 H.J. Lu (hjl@gnu.org) +2002-01-15 Richard Earnshaw + + Support for VFP instructions + * tc-arm.c (CP_WB_OK, CP_NO_WB): New defines. + (cp_address_required_here): New argument wb_ok. When false, do not + accept write-back forms of addressing. Change all callers. + (FPU_VFP_EXT_NONE, FPU_VFP_EXT_V1xD, FPU_VFP_VFP_V1) + (FPU_VFP_EXT_V2): Define. + (FPU_ARCH_VFP, FPU_ARCH_VFP_V1xD, FPU_ARCH_VFP_V1, FPU_ARCH_VFP_V2): + Define in terms of above. + (vfp_dp_reg_pos, vfp_sp_reg_pos, vfp_ldstm_type): New enums. + (vfp_reg): New struct. + (vfp_regs): New array of registers. + (insns): Add VFP instructions. + (sn_table): New array of VFP single-precision register names. + (dn_table): New array of VFP double-precision register names. + (all_reg_maps): Add the new register tables. + (arm_reg_type): Add new values for above. Increase RET_TYPE_MAX. + (vfp_sp_reg_required_here, vfp_dp_reg_required_here, do_vfp_sp_monadic) + (do_vfp_dp_monadic, do_vfp_sp_dyadic, do_vfp_dp_dyadic) + (do_vfp_reg_from_sp, do_vfp_sp_reg2, do_vfp_sp_from_reg) + (do_vfp_reg_from_dp, do_vfp_reg2_from_dp, do_vfp_dp_from_reg) + (do_vfp_dp_from_reg2, vfp_psr_parse, vfp_psr_required_here) + (do_vfp_reg_from_ctrl, do_vfp_ctrl_from_reg, do_vfp_sp_ldst) + (do_vfp_dp_ldst, vfp_sp_reg_list, vfp_dp_reg_list, vfp_sp_ldstm) + (vfp_dp_ldstm, do_vfp_sp_ldstmia, do_vfp_sp_ldstmdb, do_vfp_ldstmia) + (do_vfp_dp_ldstmdb, do_vfp_xp_ldstmia, do_vfp_xp_ldstmdb) + (do_vfp_sp_compare_z, do_vfp_dp_compare_z, do_vfp_dp_sp_cvt) + (do_vfp_sp_dp_cvt): New functions. + (md_begin): Set soft-float flag for appropriate VFP work. + (md_atof): Handle VFP-format doubles. + (md_parse_option): Handle VFP command-line options. + (md_show_usage): Display VFP command-line options. + +2002-01-15 Richard Earnshaw + + * tc-arm.c (md_parse_option): Tidy up setting of cpu_variant for + various command line options. + +2002-01-15 Nick Clifton + + * config/tc-xstormy16.c: (xstormy16_fix_adjustable): Do not fix + vtinherit relocs. + (xstormy16_md_apply_fix3): Do not return a value. + +2002-01-14 Richard Earnshaw + + * tc-arm.c (md_longopts): On targets that aren't bi-endian, support + the -EL/-EB option that matches the target's endianness. + (md_parse_option): Likewise. - * configure.in: Support --enable-targets=all on ia32. +2002-01-14 Richard Earnshaw + + * tc-arm.c (md_longopts): Fix misplaced #endif -- the -oabi option + is not dependent on ARM_BI_ENDIAN. + +2002-01-14 Richard Earnshaw + + * tc-arm.c (all error messages): Normalize capitalization of messages. + + * tc-arm.h (md_operand): Delete define. + * tc-arm.c (in_my_get_expression): New static variable. + (my_get_expression): Set and clear it. + (md_operand): New function. If called from my_get_expression + put the error in inst.error. + (output_inst): Now takes argument of instruction being assembled. + Print it out with any error message. + (do_ldst, do_ldstv4, thumb_load_store): Fault attempt to use a store + with '=' syntax. + (end_of_line): Don't update inst.error if it is already set. + +2002-01-11 Richard Earnshaw + + * tc-arm.c ((do_ldst): Fix handling an immediate expression pseudo + op that can be translated into a mvn instruction. + +2002-01-11 Steve Ellcey + + * gas/config/tc-ia64.h (MD_FLAGS_DEFAULT): New Macro for + setting default md.flags. + (SHT_INIT_ARRAY): New elf special section used by HP-UX. + (SHT_FINI_ARRAY): New elf special section used by HP-UX. + * gas/config/tc-ia64.c (setup_unwind_header): Add support + for 32 bit unwind info blocks. + (generate_unwind_image): Add support for different types + of unwind images (32 bits and/or big-endian). + (ia64_init): Use MD_FLAGS_DEFAULT to set md.flags. + (ia64_target_format): Add support for hpux target formats. + (ia64_gen_real_reloc_type): Add support for FUNC_IPLT_RELOC. + (ia64_elf_section_type): Add support for SHT_INIT_ARRAY and + SHT_FINI_ARRAY elf section types. + +2002-01-10 Richard Earnshaw + + * tc-arm.c (struct reg_entry): Move before prototypes. + (int_register, cp_register, fp_register): Delete. + (reg_table): Delete. Replaced with ... + (rn_table, cp_table, cn_table, fn_table, mav_mvf_table) + (mav_mvd_table, mav_mvfx_table, mav_mvdx_table, mav_mvax_table) + (mav_dspsc_table): ... one table per register set. + (arm_reg_hsh): Delete. + (struct reg_map): New structure. + (all_reg_maps): New array. + (enum arm_reg_type): New enums. + (build_reg_hsh): New function. + (insert_reg_alias): Use hash table passed by caller. Adjust all + callers. + (create_register_alias): New function, split out from ... + (md_assemble): ... here. + (md_begin): Build new register hash tables. + (arm_reg_parse): New argument for the hash table to search. Adjust all + callers. + (arm_reg_parse_any): New function. + (co_proc_number): Look up the processor number in the processor hash + table. + (cirrus_regtype): Delete. + (cirrus_register, cirrus_mvf_register, cirrus_mvd_register) + (cirrus_mvfx_register, cirrus_mvdx_register, cirrus_mvax_register) + (ARM_EXT_MAVERICKsc_register): Delete. + (do_c_binops_1, do_c_binops_2, do_c_binops_3): Delete. + (do_c_binops_1[a-o], do_c_binops_2[a-c], do_c_binops_3[a-d]): New + functions. + (do_c_triple_4, do_c_triple_5): Delete. + (do_c_triple_4[ab], do_c_triple_5[a-h]): New functions. + (do_c_quad_6): Delete. + (do_c_quad_6[ab]): New functions. + (do_c_binops, do_c_triple, do_c_quad, do_c_shift, do_c_ldst): Rework + arguments to use new register parsing methods. + (cirrus_reg_required_here): Likewise. + (insns): Reclassify cirrus maverick worker functions. + (cirrus_valid_reg): Delete. + +2002-01-07 Jason Thorpe + + * configure.in (sh*le): Set cpu_type=sh and endian=little. + (sh*-*-netbsdelf*): New target. + * configure: Regenerate. + * tc-sh.h: Update copyright years. + (TARGET_FORMAT): Add version for TE_NetBSD. + +2002-01-07 Nick Clifton + + * read.c (emit_expr): Do not allow 'size' or 'nbytes' to go + negative. + +2002-01-06 Alan Modra + + * config/tc-m68k.h (md_prepare_relax_scan): Rewrite. + * config/tc-m68k.c (md_relax_table): Add md_prepare_relax_scan comment. + +2002-01-05 Daniel Jacobowitz + + * tc-mips.c (mips_cprestore_valid): New flag. + (mips_frame_reg_valid): New flag. + (macro) [M_JAL_2]: Check both flags. + [M_JAL_A]: Likewise. + (s_cprestore): Set mips_cprestore_valid. + (tc_get_register): If setting mips_frame_reg, set + mips_frame_reg_valid and clear mips_cprestore_valid. + (s_mips_ent): Clear both flags. + (s_mips_end): Clear both flags. + +2002-01-05 Alan Modra + + * write.c (write_object_file): Make use of bfd_section_list_remove. + * config/obj-ecoff.c (ecoff_frob_file): Likewise. + * config/tc-mmix.c (mmix_frob_file): Likewise. + +2002-01-04 Jason Thorpe + + * configure.in (i386-*-netbsdelf*): Collapse target into... + (i386-*-netbsd*): ...this. Add support for x86-64. * configure: Regenerated. -2000-03-01 Nick Clifton - - * gasp.c (do_align): Remove bogus check of alignment value. - -2000-02-27 Thomas de Lellis - - * config/obj-elf.c (elf_frob_symbol): Remove code which when - TC_PPC was defined forced the type of a symbol with no other type - to be BSF_OBJECT. - -2000-02-27 Hans-Peter Nilsson - - * doc/internals.texi (CPU backend): Mention that - line_separator_chars do not break up comments. Fix typos for - LEX_AT and LEX_NAME descriptions. Document operands for - TC_EQUAL_IN_INSN, md_operand and md_section_align. Correct - description of md_create_short_jump usage. Document argument for - md_undefined_symbol. - -2000-02-27 Jakub Jelinek - - * config/tc-sparc.c (OPTION_UNDECLARED_REGS): New option. - (md_parse_option): Handle it. - (md_show_usage): Document it. - -2000-02-27 Ian Lance Taylor - - * config/tc-alpha.c (md_assemble): Accept `1' and `9' in an - opcode, for the instruction `pal19'. From Andrea Arcangeli - . - -2000-02-26 Alan Modra - - * config/tc-i386.c (i386_immediate): Move constant operand sizing - from here.. - (md_assemble): To here, before template operands are matched. - Also ensure a constant immediate is sign extended when we know the - size is at most 16 bits. This is to catch cases like "add - $0xffc0,%ax" where we don't know the size, and thus that the - immediate can be represented as Imm8S until after parsing the - register operand. - (i386_displacement): Similarly sign extend 16 bit constant - displacements. - (md_assemble): Relax 16-bit jump constant range check to suit sign - extended displacements. - -2000-02-26 Andreas Jaeger - - * doc/c-mips.texi (MIPS Opts): Fix typo in last patch. - -2000-02-25 Alan Modra - - * config/tc-i386.c (md_assemble): Don't swap intersegment jmp and - call operands when intel_syntax. - (intel_float_operand): Return 2 for "fi...". - (i386_operand_modifier): Change "DWORD PTR" test to suit above. - Return SHORT_MNEM_SUFFIX for "WORD PTR" when "fi...". Revert - earlier "SHORT" change. - (md_assemble): When determining suffix from Regs, exclude - InOutPortReg. - -2000-02-24 Nick Clifton - - * configure: Add arm-wince, mips-pe and sh-pe targets. - * configure: Regenerate. - - * config/obj-coff.h (COFF_WITH_PE): Define for mips-pe and - sh-pe targets. - (TARGET_FORMAT): Set to "pe-shl" for the sh-pe target and to - "pe-mips" for the mips-pe target. - - * config/tc-arm.c (insns): Change displacement encoded in BL - and B instructions if the target port is arm-wince. - (do_ldst): Do not bias the relocation offset if the target - port is arm-wince. - (md_pcrel_from): Add in missing relocation offset bias if the - target os arm-wince. - - * config/tc-mips.c (mips_target_format): Support COFF flavour. - (md_begin): Disable -G support for mips-pe target. - (md_apply_fix): Treat BFD_RELOC_RVA reloc as BFD_RELOC_32. - * config/tc-mips.h (USE_GLOBAL_POINTER_OPT): Add support for - COFF flavour. - - * config/tc-sh.c (md_begin): sh-pe target is little endian. - * config/tc-sh.h (SUB_SEGMENT_ALIGN): If using a BFD - assembler, just set the alignment to 4. - - * config/te-wince-pe.h: New file for WinCE targets. Define - TE_WINCE. - -2000-02-25 Alan Modra - - * config/tc-i386.c (md_assemble): Swap segments too for intel mode - string instructions. - (i386_operand_modifier): Set i.suffix = WORD_MNEM_SUFFIX for SHORT. - (i386_intel_memory_operand): After finding a segment override, - check again for no `[' before looking for a displacement. Bomb if - more than one displacement rather than silently discarding the - second and subsequent ones. Free strings malloc'd by - build_displacement_string. - -2000-02-24 Catherine Moore - - * config/obj-som.c (obj_pseudo_table): Add "weak". - (obj_som_weak): New routine. - -2000-02-24 Alan Modra - - * config/tc-i386.c (union i386_op): New. - (struct _i386_insn): Delete disps[], imms[], regs[]. Add op[]. - Throughout file replace occurences of disps[n], imms[n], regs[n] - with equivalent op[n].disps, op[n].imms, op[n].regs. Simplify - intel mode operand swapping. Add assert in regKludge and - fake_zero_displacement code. Test i.types[n] when outputting - displacements and immediates. Combine output of Disp16 with - Disp32. - (md_assemble): Don't try to fix broken UNIXWARE_COMPAT opcodes - when in intel mode by (not) reversing fsub and fdiv operands - before the template search. This fails for single operand - shorthand forms of the instruction, and if UNIXWARE_COMPAT is - undefined. Instead fix the base_opcode after we've found the - template. Move base_opcode xor with found_reverse_match from - opcode output code to before this fix so we test for the correct - opcodes. - (md_assemble): Don't use strcmp when deciding to ignore the suffix - check in intel mode. Instead compare opcodes. - - * config/tc-i386.h (TC_RELOC): Delete. - * config/tc-i386.c (TC_RELOC): Delete. Replace usage of TC_RELOC - with equivalent call to reloc. - - * as.h (flag_m68k_mri): Move declaration after target include, and - only declare when TC_M68K defined. Define as zero otherwise. - (LABELS_WITHOUT_COLONS, NO_PSEUDO_DOT): If undefined, define as 0. - * app.c (scrub_m68k_mri): Declare only when TC_M68K defined. - Define as zero otherwise. - (do_scrub_begin): Use m68k_mri parameter only when TC_M68K defined. - (struct app_save): Declare scrub_m68k_mri only when TC_M68K. - (app_push, app_pop): Save scrub_m68k_mri only when TC_M68K. - (do_scrub_chars): Use LABELS_WITHOUT_COLONS directly rather than - testing whether defined. - * cond.c (ignore_input): Use NO_PSEUDO_DOT directly. - * expr.c (operand): #ifdef unused case labels when TC_M68K undefined. - * read.c: Use LABELS_WITHOUT_COLONS and NO_PSEUDO_DOT directly - rather than testing whether defined. - (s_mri): Set flag_m68k_mri only when TC_M68K defined. - (parse_mri_cons): Declare and use only when TC_M68K. - * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define as 1. - * config/tc-m68k.h (NO_PSEUDO_DOT): Define as 1. - * config/tc-m88k.h (NO_PSEUDO_DOT): Define as 1. - - * NEWS: Mention IBM 370 support. - -2000-02-23 Richard Henderson - - * config/tc-i386.c (md_assemble): When swapping operands for - intel_syntax, assume everything that's not Imm or Disp is a - register. - -2000-02-23 Linas Vepstas - - * config/tc-i370.c, config/tc-i370.h: New files. - * Makefile.am: Add support for Linux/IBM 370. - * configure.in: Likewise. - * app.c (do_scrub_begin): Don't lex single quote when TC_I370. - * config/obj-elf.c: Include elf/i370.h - (obj_elf_section): Don't do anything special for flag_mri if TC_I370. - - * Makefile.in: Regenerate. - * configure: Regenerate. - - * doc/c-i370.texi: New file. - * doc/all.texi: Include it. - * doc/as.texinfo: And here. - * doc/Makefile.am(CPU_DOCS): Add c-i370.texi. - * doc/Makefile.in: Regenerate. - -2000-02-19 Michael Meissner - - * config/tc-d30v.c (parallel_ok): Use FLAG_NOT_WITH_ADDSUBppp to - determine if an instruction can be used in parallel with an ADDppp - or SUBppp instruction. - -2000-02-22 Andrew Haley - - * doc/c-mips.texi (MIPS Opts): Document -mgp32 and -mgp64. - -2000-02-22 Andrew Haley - - * config/tc-mips.c (mips_gp32): New variable. - (macro_build) Use mips_gp32. - (mips_ip): Ditto. - (md_longopts): Add "-mgp32" and "-mgp64". - (md_parse_option): Add OPTION_GP32 and OPTION_GP64. - - (OPTION_M7900): Change offset - (OPTION_NO_M7900): Ditto. - -2000-02-22 Alexandre Oliva - - * config/obj-coff.c (add_lineno): Accept non-positive lineno with - warning, and bump it to 1. - -2000-02-22 Ian Lance Taylor - - From Brad Lucier : - * dwarf2dbg.c (print_stats): Add cast to force printf argument to - match format. - -2000-02-21 Catherine Moore - - * config/tc-mips.c (MF_HILO_INSN): Define. - (mips_7000_hilo_fix): Declare. - (append_insn): Conditionally insert nops after an mfhi/mflo insn. - (md_parse_option): Check for 7000_HILO_FIX options. - (OPTION_M7000_HILO_FIX): Define. - (OPTION_NO_M7000_HILO_FIX): Define. - * doc/c-mips.texi (-mfix7000): Describe. - -2000-02-21 Alan Modra - - * listing.c (print_lines): Remove unused variable `end'. - - * config/tc-i386.c (md_assemble): Use `reloc()' to select reloc - type for JumpInterSegment output. Use enum bfd_reloc_code_real for - reloc_type when BFD_ASSEMBLER. - (md_estimate_size_before_relax): Use enum bfd_reloc_code_real for - reloc_type when BFD_ASSEMBLER. Move common code out of switch - statement and quell signed vs. unsigned comparison warning. - -2000-02-18 Nick Clifton - - * config/tc-d10v.c (find_opcode): Add a symbol's value to - the computed frag offset, rather than overwriting it. - -Thu Feb 17 00:11:08 2000 J"orn Rennecke - - * config/tc-sh.c ("elf/sh.h"): Include. - (sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables. - (md.begin): Initialize target_arch. - Only include opcodes in has table that match selected architecture. - (parse_reg): Recognize register names for sh-dsp. - (parse_at): Recognize post-modify addressing. - (get_operands): The leading space is now optional. - (get_specific): Remove FDREG_N support. Add support for sh-dsp - arguments. Update valid_arch. - (build_Mytes): Add support for SDT_REG_N. - (find_cooked_opcode): New function, broken out of md_assemble. - (assemble_ppi, sh_elf_final_processing): New functions. - (md_assemble): Use find_cooked_opcode and assemble_ppi. - (md_longopts, md_parse_option): New option: -dsp. - * config/tc-sh.h (elf_tc_final_processing): Define. - (sh_elf_final_processing): Declare. - -Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_build_unwind_subspace): Use subseg_new to create - the unwinder subspace. Save the current seg/subseg before creating - the new seg/subseg. - -2000-02-10 Nick Clifton - - * config/tc-mcore.c (INST_BYTE0): Redefine to handle big and - little endian targets. - (INST_BYTE1): Redefine to handle big and little endian - targets. - (cpu_type): New type: Select between M340 and M210. - (parse_psrmod): New function: Parse the PSRCLR and PSRSET - instructions of the M340. - (md_assemble): Add support for the MULSH and OPSR classes of - instructions. - (md_atof): Add support for little endian targets. - (md_parse_option): Add support for -EL, -EB and -mcpu command - line switches. - (md_convert_frag): Add support for little endian targets. - (md_apply_fix3): Add support for little endian targets. - (md_number_to_chars): Add support for little endian targets. - -2000-02-10 Timothy Wall - - * read.c (read_a_source_file): If TC_START_LABEL_WITHOUT_COLON is - defined, use it to verify the symbol just read should be a label. - -2000-02-10 Timothy Wall - - * app.c (do_scrub_chars): Handle "||" for parallel instructions - when DOUBLEBAR_PARALLEL is defined. Avoid stripping whitespace - around colons when KEEP_WHITE_AROUND_COLON is defined. - * doc/internals.texi (CPU backend): Document DOUBLEBAR_PARALLEL - and KEEP_WHITE_AROUND_COLON. - -2000-02-08 Timothy Wall - - * read.c (s_rept): Call do_repeat, which abstracts the repeat - logic. - (do_repeat): New. Abstract repeat logic so that a "break" can be - implemented. - (end_repeat): New. Provide support for a "break" out of the - repeat loop. - * read.h: Add prototypes for new functions. - -2000-02-08 Timothy Wall - - * doc/internals.texi: Document NUMBERS_WITH_SUFFIX macro. - * as.h: Provide a default NUMBERS_WITH_SUFFIX definition (zero). - * expr.c: Handle numbers with suffixes if NUMBERS_WITH_SUFFIX is - non-zero. - -2000-02-08 Timothy Wall - - * read.c: Added elseif to directives table. - * read.h: Added prototype for s_elseif. - * doc/as.texinfo: Added description for elseif. - * cond.c (s_elseif): New function - -2000-02-04 Timothy Wall - - * listing.c (print_lines): Remove conditionals causing bug in - listings. - -2000-02-03 Timothy Wall - - * as.h: Define OCTETS_PER_BYTE and OCTETS_PER_BYTE_POWER - default values. - * frags.c (frag_new): Calculate fr_fix in octets - (frag_now_fix) Return offset as target address offset (bytes). - (frag_now_fix_octets) New - Return offset in octets (8-bit - quantities). - * frags.h: Added prototype for frag_now_fix_octets(). - Distinguish between octets and bytes in field descriptions. - * listing.c (calc_hex): Account for octets vs bytes when - printing addresses/offsets. - (print_lines) Ditto. Also, if LISTING_WORD_SIZE is not 1, and - target is little-endian, print the octets in a word in big-endian - order so that the display looks like a proper hexadecimal number, - instead of having the octets reversed. - * read.c (do_align): When recording alignment, alignment power - should be in terms of target bytes (minimum addressible unit) - instead of octets. - (do_org) Convert ORG target address (byte) argument into an - octet offset when generating a variable fragment. - * symbols.c (resolve_symbol_value): Symbol final value - converted to a target address offset (bytes) from its octet offset. - * config/obj-coff.c (coff_frob_symbol): Symbol target address - offset (bytes) is adjusted by the frag offset (octets) converted - to bytes. - (coff_frob_section) Section alignment power is in terms of bytes; - convert it to an octet alignment power when calculating size (and - size mask) in octets. Don't modify the section size in order to - "align" it for TI COFF, since that format has a different method - for storing alignment information. - -2000-02-01 Timothy Wall - - * stabs.c (generate_asm_file): Escape backslashes in stabs file - entries, matching the way GCC generates them. If not escaped, the - filename is encoded incorrectly. - -2000-01-31 Nick Clifton - - * config/tc-arm.c (reg_table): Add support for ATPCS register - naming conventions. - -2000-01-31 Geoff Keating - - * config/obj-coff.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Don't define if - already defined. - * config/tc-ppc.h [OBJ_XCOFF] (OBJ_COPY_SYMBOL_ATTRIBUTES): - New macro. - * config/tc-ppc.c (ppc_fix_adjustable): Don't look at the frag - of a symbol when we really care about its value. - -2000-01-19 Chandra Chavva - - * config/tc-mcore.c (md_assemble): Give warning message if - operands passes to instruction are more than the spec. - -2000-01-27 Thomas de Lellis - - * config/tc-arm.c (armadjust_symtab): If the assembler is in - Thumb mode but the label seen was not declared as '.thumb_func' - then set the ST_INFO type to STT_ARM_16BIT mode. This allows - correct disassembly of Thumb code bounded by non function labels. - -2000-01-27 Alan Modra - - * Makefile.am (MULTI_CFILES): Add config/e-i386aout.c - Add dependencies for e-i386aout.o. Fix 2 comment lines. - - * Makefile.in: Same here. - Update copyright. - - * configure.in: Set bfd_gas for i386-aout when primary target - is bfd. Handle i386aout emulation. Don't use te_file=multi, as - we may need the primary te_file. Remove incorrect comment. - - * configure: Regenerate. - - * config/e-i386aout.c: New file. - - * as.c (USE_EMULATIONS): Move to before print_version_id. - (struct emulation): Add i386aout. - (show_usage): Split text strings. Reformat -a text. Add --em - help. - Update copyright. - - * obj.h (struct format_ops): Add s_get_other and s_get_desc. - (aout_format_ops): New. - Update copyright. - - * read.c (s_lcomm_internal): Rewrite OBJ_AOUT,OBJ_BOUT - preprocessor conditional and add aout USE_EMULATIONS tests. - (read_a_source_file): Don't pass error strings to printf as - format arg. - Update copyright. - - * gasp.c (exp_get_abs): Don't pass error strings to printf as - format arg. - (do_data): Same here. - (process_file): And here. - Update copyright. - - * symbols.c (colon): Rewrite "already defined" fatal message - code for aout with USE_EMULATIONS. - Update copyright. - - * config/obj-aout.c (OBJ_HEADER): Define. - (obj_pseudo_table): Rename to aout_pseudo_table. Init all - fields of sentinel. - (obj_aout_frob_symbol): Expand S_GET_DESC, S_GET_TYPE, - S_GET_OTHER, S_SET_TYPE macros since we don't need obj-multi - forms here. - (obj_aout_type): Expand S_SET_OTHER here too. - (obj_read_begin_hook): Remove. - (aout_pop_insert): New. - (obj_aout_s_get_other): New. - (obj_aout_s_get_desc): New. - (aout_format_ops): New. - Update copyright. - - * config/obj-aout.h (obj_pop_insert): Define so non-multi usage - gets aout_pseudo_table. - (aout_pseudo_table): Declare. - (obj_read_begin_hook): Define. - Update copyright. - - * config/obj-coff.c (obj_pseudo_table): Rename to - coff_pseudo_table. - (coff_pop_insert): Use coff_pseudo_table. - (coff_sec_sym_ok_for_reloc): Remove. - (coff_format_ops): Add 0 entries for s_get_size, s_set_size, - and comment all zero entries and remove #if 0 code. - Update copyright. - - * config/obj-coff.h (obj_pop_insert): Define. - (coff_pseudo_table): Declare. - Update copyright. - - * config/obj-ecoff.c (ecoff_format_ops): Add 0 entries for - s_get_size, s_set_size. Comment all zero entries. - Update copyright. - - * config/obj-elf.c (elf_s_get_other): New function. - (obj_read_begin_hook): Rename to elf_obj_read_begin_hook. - (obj_symbol_new_hook): Rename to elf_obj_symbol_new_hook. - (elf_format_ops): Add elf_s_get_other, 0 s_get_size entry, and - comment. - (obj_elf_parse_section_letters): Don't pass error strings to - printf as format arg. - Update copyright. - - * config/obj-elf.h (ECOFF_DEBUGGING): Define when - OBJ_MAYBE_ECOFF. - (elf_s_get_other): Declare. - (S_GET_OTHER) Define as elf_s_get_other if not already - defined. - (S_SET_OTHER): Only define when not already defined. - (elf_obj_read_begin_hook): Declare. - (obj_read_begin_hook): Define. - (elf_obj_symbol_new_hook): Declare. - (obj_symbol_new_hook): Define. - Update copyright. - - * config/obj-multi.h: Add copyright header and protect against - multiple inclusion. Add * to all function pointers. - (OBJ_HEADER): If defined, include it rather than other defines - in this file. - (obj_frob_file_after_relocs): Test for NULL. - (obj_symbol_new_hook): Here too. - (obj_sec_sym_ok_for_reloc): And here. - (S_GET_OTHER): Define. - (S_GET_DESC): Define. - (ECOFF_DEBUGGING): Remove as it's done in obj-elf.h - (OBJ_MAYBE_ELF): Update comment. - - * config/tc-i386.c (i386_immediate): Add OBJ_MAYBE_AOUT to - OBJ_AOUT preprocessor conditional and handle emulation by - testing OUTPUT_FLAVOR. - (i386_displacement): Here too. - (md_section_align): Similarly here. - (i386_target_format): Conditionally compile when more than one - of OBJ_MAYBE_{ELF,COFF,AOUT} defined. Add aout case. - (i386_immediate): Fix error message for aout BFD_ASSMBLER. - (i386_displacement): Here too. - Update copyright. - - * config/tc-i386.h (AOUT_TARGET_FORMAT): Define for each TE_*. - Define TARGET_FORMAT for aout only when not multi. - Update copyright. - - * config/te-multi.h: Delete file as it's identical to te-generic.h - -2000-01-15 Alan Modra - - * config/tc-i386.h (DWORD_MNEM_SUFFIX): Delete. - * config/tc-i386.c (DWORD_MNEM_SUFFIX): Rename all occurrences to - LONG_MNEM_SUFFIX. - - * config/tc-i386.h (INTEL_DWORD_MNEM_SUFFIX): Rename to - DWORD_MNEM_SUFFIX. - * config/tc-i386.c (INTEL_DWORD_MNEM_SUFFIX): Here too. Fix some - comments. - -2000-01-13 Clinton Popetz - - * config/tc-mips.c (mips_do_align): New function. - * config/tc-mips.h (md_do_align): Define. - -2000-01-10 Philip Blundell - - * doc/c-arm.texi (ARM Options): Fix typo. - (ARM-Chars): Correct description of `#'. Mention that `;' is a - line separator for Linux. - * doc/as.texinfo (Comments): Mention the ARM. - -2000-01-10 Philip Blundell - - * configure.in (arm*-*-conix*): New target. - (arm*-*-linux-gnu*): Match instead of arm-*-linux* and - armv*-*-linux-gnu. - * configure: Regenerate. +2002-01-03 matthew green -2000-01-03 Martin v. Loewis + * config/tc-ppc.c (md_parse_option): BookE is not Motorola specific. - * config/obj-elf.c (elf_pseudo_table): Define visibility pseudos. - (obj_elf_visibility): New function. +2002-01-02 Nick Clifton - * doc/as.texinfo (Visibility): New node: document visibility - pseudo ops. + * config/tc-m68k.c (md_estimate_size_before_relax): Test for a + NULL frag link. -For older changes see ChangeLog-9899 +For older changes see ChangeLog-0001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/gas/ChangeLog-0001 b/contrib/binutils/gas/ChangeLog-0001 new file mode 100644 index 0000000..9d8af6f --- /dev/null +++ b/contrib/binutils/gas/ChangeLog-0001 @@ -0,0 +1,7703 @@ +2001-12-31 Richard Henderson + + * config/tc-ia64.c (errata_nop_necessary_p): Prototype. + (make_unw_section_name): Constify local variables. + + * config/tc-ia64.c (has_suffix_p): New. + (note_register_values): Use it instead of strstr. + +2001-12-31 Jeffrey A Law (law@redhat.com) + + * config/tc-hppa.c (pa_ip): Handle new 'c' mode completers, + 'X', 'M', and 'A'. + +2001-12-21 Jakub Jelinek + + * config/tc-sparc.h (TC_PARSE_CONS_EXPRESSION): Define. + (sparc_cons): Provide prototype. + * config/tc-sparc.c (tc_gen_reloc): Handle BFD_RELOC_*_PCREL and + BFD_RELOC_SPARC_PLT{32,64}. Enumerate for which relocs + reloc->addend = fixp->fx_addnumber shouldn't be done instead of + enumarating for which pc relative ones it should be done. + (sparc_cons_special_reloc): New variable. + (sparc_cons): New function. + (cons_fix_new_sparc): Use sparc_cons_special_reloc. + * testsuite/gas/sparc/pcrel.s: New test. + * testsuite/gas/sparc/pcrel.d: Expected output. + * testsuite/gas/sparc/pcrel64.s: New test. + * testsuite/gas/sparc/pcrel64.d: Expected output. + * testsuite/gas/sparc/plt.s: New test. + * testsuite/gas/sparc/plt.d: Expected output. + * testsuite/gas/sparc/plt64.s: New test. + * testsuite/gas/sparc/plt64.d: Expected output. + * testsuite/gas/sparc/sparc.exp: Add pcrel, pcrel64, plt and plt64 + tests. + +2001-12-20 Thiemo Seufer + Daniel Jacobowitz + + * config/tc-mips.c (file_mips_gp32): Initialize to invalid value. + (file_mips_fp32): Likewise. + (md_begin): Compatibility handling for -mipsN option. + +2001-12-20 Alexandre Oliva + + * config/tc-sh.c (parse_at): Reject @(r0) and @(r0,). + +2001-12-20 matthew green + + * config/tc-ppc.c (md_parse_option): Make -maltivec default + to generating PowerPC instructions. + +2001-12-20 Jason Thorpe + + * configure.in (mips-dec-netbsd*): Delete. + * configure: Regenerate. + + * configure.in (arm-*-netbsdelf*): Add target. + * configure: Regenerate. + +2001-12-18 Nick Clifton + + * config/tc-mips.h (TC_HANDLE_FX_DONE): Remove redundant + definition. + +2001-12-18 Niibe Yutaka + + * configure.in (assign object format): Bug fix for setting + endian. + * configure: Regenerate. + +2001-12-18 matthew green + + * configure.in (m68k-*-netbsdelf*): New target. + (m68k-*-netbsd*): Also include ELF support. + (m68k-*-netbsdaout*): New alias for m68*-*-netbsd*. + * configure: Regenerate. + +2001-12-18 Thiemo Seufer + + * gasp.c (main): Protoype. + +2001-12-17 Richard Henderson + + * config/tc-alpha.c (alpha_handle_align): Encode unop with RB as $sp. + +2001-12-17 Nick Clifton + + * cgen.c: Add prototype for queue_fixup. + (gas_cgen_parse_operand): Move initilisastion of errmsg to avoid + possible longjmp corruption. + * cgen.h: Add prototype for gas_cgen_md_operand. + +2001-12-15 Alan Modra + + * config/obj-elf.c (obj_elf_init_stab_section): References are + kept to section name strings. Don't alloca them! + +2001-12-12 Alexandre Oliva + + * config/tc-d10v.c (get_operands): Mark OPERAND_PLUS after + OPERAND_ATSIGN as O_absent. + +2001-12-07 Geoffrey Keating + Richard Henderson + + * configure.in: Add support for xstormy16. + * configure: Regenerated. + * Makefile.am: Add support for xstormy16. + * Makefile.in: Regenerated. + * config/tc-xstormy16.c: New file. + * config/tc-xstormy16.h: New file. + +2001-12-06 Richard Earnshaw (rearnsha@arm.com) + + * tc-arm.c (do_arit, do_cmp, do_mov, do_ldst, do_ldstt, do_ldmstm) + (do_branch, do_swi, do_adr, do_adrl, do_empty, do_mul, do_mla) + (do_swap, do_msr, do_mrs, do_mull, do_ldstv4, do_bx, do_blx) + (do_bkpt, do_clz, do_lstc2, do_cdp2, do_co_reg2, do_smla, do_smlal) + (do_smul, do_qadd, do_pld, do_ldrd, do_co_reg2c, do_cdp, do_lstc) + (do_co_reg, do_fpa_ctrl, do_fpa_ldst, do_fpa_ldmstm, do_fpa_monadic) + (do_fpa_dyadic, do_fpa_cmp, do_fpa_from_reg, do_fpa_to_reg, do_mia) + (do_mar, do_mra, do_c_binops, do_c_binops_1, do_c_binops_2) + (do_c_binops_3, do_c_triple, do_c_triple_4, do_c_triple_5, do_c_quad) + (do_c_quad_6, do_c_dspsc, do_c_dspsc_1, do_c_dspsc_2, do_c_shift) + (do_c_shift_1, do_c_shift_2, do_c_ldst, do_c_ldst_1, do_c_ldst_2) + (do_c_ldst_3, do_c_ldst_4, do_branch25): Delete redundant argument, + FLAGS. + (struct asm_opcode): Adjust parms field accordingly. + (md_assemble): Don't pass dummy second argument when calling worker + functions. + (build_arm_ops_hsh): Add prototype + (BAD_FLAGS): Delete. + +2001-12-05 Richard Earnshaw + + * tc-arm.c (struct asm_opcode): Delete comp_suffix and flags. Add + cond_offset. Rename variants->variant. + (insns): Adjust for new format. Explicitly code each variant that + takes flags. Remove temporary instructions. + (struct arm_it): Remove redundant field suffix. + (s_flag, ldr_flags, str_flags, byte_flag, cmp_flags, ldm_flags) + (stm_flags, lfm_flags, sfm_flags, round_flags, fix_flags, except_flag) + (long_flag): Delete. + (struct asm_flg): Delete. + (LONGEST_INST): Delete. + (V4_STR_BIT): Define. + (struct thumb_opcode): Rename variants->variant. + (do_empty): Renamed from do_nop. + (ldst_extend): Delete argument hwse. Split code for half-word and + signed byte instructions to ... + (ldst_extend_v4): ... here. + (ld_mode_required_here): Use ldst_extend_v4. + (do_ldrd): Simplify now that this is only called for ldrd. No + need to test for XScale, which was wrong anyway. Don't reject r12 + as a target register. Add test that ldrd doesn't update an index + register. + (do_pld): Don't allow post-indexed or write-back addressing modes. + Adjust call to ldst_extend. + (do_adr): Split code for adrl to ... + (do_adrl): ... here. + (do_cmp): No need to fold in COND_BIT. + (do_ldst): Simplify. Split code for ldrt/strt into do_ldstt. Split + code to handle half-word and signed byte instructions to ... + (do_ldstv4): ... here. + (do_ldstt): New function. Handle load/store with translate. + (do_ldmstm): Write feature modification bits directly into + inst.instruction. + (do_fpa_ldst): Remove suffix handling code. + (do_fpa_dyadic, do_fpa_monadic, do_fpa_from_reg): Likewise. + (do_fpa_ldmstm): Type of access is now held in inst.instruction. + (build_arm_ops_hsh): New function. + (md_begin): Call it. Don't build the ARM opcode directly. + (md_assemble): Simplify ARM instruction handling. + +2001-12-05 Arati Dikey + + * tc-sh.c (parse_at): Corrected incorrect op->type selection due + to missing 'else'. + +2001-12-04 Alexandre Oliva + + * config/tc-d10v.c (write_2_short): Don't skip dummy fixups, so + that we can tell which operand refers to the insn put in the L + container and mark it as such, so that the relocation type can be + adjusted. + +2001-12-04 Thiemo Seufer + + * config/tc-mips.c (mips_cpreturn_offset): Better comment. + (load_register): Better error message. Cast away signedness + mismatches. Add casts needed for varargs. + (load_address): Replace checks of HAVE_64BIT_ADDRESS with dbl. + Remove superfluous casts. + (macro): Cast away signedness mismatches. Remove superfluous casts. + (s_cpload): Fix wrong comment. + (s_mips_weakext): Standardize output message. + (get_number): Likewise. + +2001-12-04 Thiemo Seufer + + * config/tc-mips.c (append_insn): Add jump address range overflow + check. + +2001-12-04 Thiemo Seufer + + * config/tc-mips.c (md_parse_option): Fix comment. Allow -mabi option + for ELF only. + (show): Document -mabi option. + +2001-12-03 Jeroen Dobbelaere + + * config/tc-arm.c (md_parse_option): Only clear cpu part when + specifying 'xscale' cpu (don't change the fpu part). + +2001-12-04 Alexandre Oliva + + * config/tc-d10v.c (find_opcode): Reject SP operand if + OPERAND_NOSP flag is present. + +2001-12-03 Eric Christopher + + * config/tc-mips.c (tc_gen_reloc): One missed BFD_RELOC_MIPS_GPREL. + +2001-12-02 Thiemo Seufer + + * config/tc-mips.c (macro_build): Replace BFD_RELOC_MIPS_GPREL + by BFD_RELOC_GPREL16. + (load_address): Likewise. + (macro): Likewise. + (md_apply_fix): Likewise. Replace BFD_RELOC_MIPS_GPREL32 by + BFD_RELOC_GPREL32. + (s_gpword): Replace BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32. + (tc_gen_reloc): Replace BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16. + *config/tc-mips.h: Replace BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16. + +2001-11-29 Alexandre Oliva + + * config/tc-d10v.c (get_operands): Emit OPERAND_PLUS for + prefix `+'. + + * config/tc-d10v.c (find_opcode): Reject non-SP operand if + flags requires SP. + +2001-11-29 Arati Dikey + + * tc-sh.c (parse_at): Removed case-sensitivity of index register + R8, R9. + +2001-11-28 Jakub Jelinek + + * write.c (adjust_reloc_syms): Mark SEC_MERGE symbols as used + in reloc if it has non-zero addend. + * config/tc-alpha.c (tc_gen_reloc): Reinstall SEC_MERGE check. + * config/tc-sparc.c (md_apply_fix3): Likewise. + +2001-11-28 Andreas Schwab + + * as.c (parse_args): Call md_after_parse_args if defined. + * config/tc-ia64.h (md_after_parse_args): Define. + * config/tc-ia64.c (ia64_after_parse_args): Reject --gstabs. + * doc/internals.texi (CPU backend): Document md_after_parse_args. + +2001-11-23 Jakub Jelinek + + * config/tc-alpha.c (tc_gen_reloc): Remove SEC_MERGE test. + * write.c (adjust_reloc_syms): Don't handle relocs against + SEC_MERGE section symbols specially. + (fixup_segment): Likewise. + +2001-11-21 Richard Sandiford + + * config/tc-mips.c (mips_need_elf_addend_fixup): New, extracted from... + (md_apply_fix3): ...here. Don't prevent the symbol value being + subtracted twice from GPREL addends. + (tc_gen_reloc): Add the symbol value to a GPREL addend if it was + subtracted by the previous function. + +2001-11-20 Nick Clifton + + * config/tc-avr.c (md_apply_fix3): Fix typo introduced by + md_apply_fix3 change. + +2001-11-20 Ben Elliston + + * config/tc-m88k.c (md_apply_fix3): Match local variable `val' to + usage after md_apply_fix3 cleanups. + +2001-11-19 Hans-Peter Nilsson + + * doc/c-mmix.texi: Use texinfo 4 features. + (MMIX-mmixal): Fix typo. + +2001-11-17 Hans-Peter Nilsson + + * config/tc-cris.c (md_apply_fix3): Cast value, not pointer, in + val assignment. + +2001-11-16 Michael Snyder + + * stabs.c (stabs_generate_asm_lineno): Remember file and line number + from one call to the next, and eliminate consecutive duplicates + (thereby emitting only one line symbol per source line). + * dwarf2dbg.c (dwarf2_gen_line_info): Ditto. + +2001-11-16 Alan Modra + + * config/tc-m68k.c (md_apply_fix3): Change val back to a signed type. + +2001-11-15 H.J. Lu + + * config/tc-hppa.c (md_apply_fix3): Fix a typo. + +2001-11-15 H.J. Lu + + * config/tc-alpha.c (md_apply_fix3): Fix a typo. + +2001-11-15 Nick Clifton + + * write.c (fixup_segment): Remove references to md_apply_fix and + TC_HANDLE_FX_DONE. + * cgen.c, config/obj-coff.c, config/tc-*.c: Update all occurances + of md_apply_fix to md_apply_fix3. + Make all md_apply_fix3 functions void. + * cgen.h, config/obj-coff.h, tc-*.h: Remove all definitions of + MD_APPLY_FIX3 and TC_HANDLE_FX_DONE. + * doc/internals.texi: Update references to md_apply_fix3. + * tc.h: Update prototype for md_apply_fix3. + +2001-11-15 Alan Modra + + * config/tc-i386.h (md_end): Define. + (i386_elf_emit_arch_note): Declare. + (CpuUnknown): Delete. + * config/tc-i386.c (default_arch): Constify. + (smallest_imm_type): Remove CpuUnknown test. + (md_assemble): Don't bother checking cpu_arch_flags non-zero. + (i386_elf_emit_arch_note): New function. + + * po/POTFILES.in: Regenerate. + +2001-11-15 Thiemo Seufer + + * config/tc-mips.c (mips_ip): Re-allow %hi() op for non-ELF assembler. + +2001-11-15 Alan Modra + + * frags.c (frag_grow): Revert last change. + + * dwarf2dbg.c (get_frag_fix): Align last frag size. + + * config/tc-ppc.c (ppc_insert_operand): Pass (ppc_cpu | ppc_size) + to operand->insert. + (md_assemble): Likewise. + +2001-11-12 Nick Clifton + + * frags.c (frag_grow): Use frag_make_room() to grow the + obstack. + +2001-11-14 Nick Clifton + + * config/tc-sparc.c (md_apply_fix3): Do not remove the symbol's + value from the addend for fixups against local symbols in + SEC_MERGE sections - it was not added in, in the first place. + +2001-11-11 Timothy Wall + + * write.c (relax_segment): Convert symbol address into an octet + offset prior to adding to the frag address, which is an octet + offset. Add comments to that effect. + * config/tc-tic54x.c: Fix bugs causing tests to fail. + * config/tc-tic54x.h: Ditch PARAMS macro. + +2001-11-13 Alan Modra + + * config/obj-elf.c (obj_elf_version): Ensure terminating NUL is + put in note section. Use sizeof instead of hard-coded constants. + +2001-11-12 Thiemo Seufer + + * config/tc-mips.c (support_64bit_objects): Define for OBJ_ELF only. + (md_longopts): Allow OPTION_MABI for ELF compilation only. RE-allow + OPTION_GP32, OPTION_GP64, OPTION_FP32 for non-ELF compilation. + Sort options a bit more logical. + (md_parse_option): Allow OPTION_32, OPTION_N32, OPTION_N64, + OPTION_MABI only for elf targets. + +2001-11-12 Thiemo Seufer + + * config/tc-mips.c (set_at): Add cast needed for varargs. + (load_register): Likewise. + (macro): Likewise. Some code reformatting. + (macro2): Add cast needed for varargs. + (mips16_macro): Likewise. + +2001-11-12 Thiemo Seufer + + * config/tc-mips.c (md_assemble): Remove superflous casts. + (append_insn): Likewise. + (mips16_macro_build): Likewise. + (macro): Likewise. + (mips16_ip): Likewise. + (s_cpload): Likewise. + (mips_relax_frag): Likewise. + +2001-11-12 Thiemo Seufer + + * config/tc-mips.c (mips_abi_level): Move in front of + mips_set_options. + (mips_set_options): Add members gp32, fp32, abi. + (file_mips_gp32): New flag. + (file_mips_fp32): New flag. + (mips_opts): Initialize the new members. + (mips_gp32): Remove. + (mips_fp32): Remove. + (HAVE_32BIT_GPRS): Use the new values from mips_opts. + (HAVE_32BIT_FPRS): Likewise. + (HAVE_NEWABI): Likewise. + (HAVE_64BIT_OBJECTS): Likewise. + (md_begin): Likewise. Save default (file) values. + (md_parse_option): Use the new values from mips_opts. + (s_mipsset): Likewise. Fix logic to keep the ABI selection if + possible. Let .set mipsN work together with .set push/pop. + Enhance error messages. + (mips_elf_final_processing): Use file_mips_* for header processing. + +2001-11-09 Marek Michalkiewicz + + * config/tc-avr.c (mcu_types): Update for new devices. + +2001-11-09 Stephane Carrez + + * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for + the page man title. + * doc/Makefile.in: Rebuild. + * doc/as.texinfo: Do not put man SEEALSO in document; + Use @command for commands, @option for options; Reorganize usage + to clearly identify target specific options. + +2001-11-08 Thiemo Seufer + + * config/tc-mips.c (mips_force_relocation): Remove duplicate code. + +2001-11-06 Thiemo Seufer + + * config/tc-mips.c (my_getSmallParser): Fix small parser bug. + +2001-11-05 Martin Schwidefsky + + * config/tc-s390.c (tc_s390_force_relocation): Force all relocations + that need the global offset table. + (md_apply_fix3): Add code to undo opertions done in fixup_segment + triggered by TC_FORCE_RELOCATION. + * config/tc-s390.h (TC_FORCE_RELOCATION): Replace macro code with + a call to function tc_s390_force_relocation. + (TC_FIX_ADJUSTABLE): Define. + +2001-11-04 Chris Demetriou + + * configure.in (mips-*-netbsd*): Add support for target. + * configure: Regenerate. + +2001-11-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add 'fr'. + * configure: Regernate. + * po/fr.po: New file. Obtained from the translation project web + site. + +2001-11-02 Richard Earnshaw + + * tc-arm.c: Re-arrange prototypes by architecture. + (insns): Re-arrange instructions by archtitecture. Pld instruction + is part of ARMv5E. + (tinsns): blx and bkpt are part of ARMv5T. + (do_fp_{ctrl,ldst,ldstm,dyadic,monadic,cmp,from_reg,to_reg}): Rename + to do_fpa_*. All callers changed. + + * tc-arm.c (insns): Add two temporary instructions to handle + ldrd/strd. + +2001-11-01 Stephane Carrez + + * config/tc-m68hc11.c (build_jump_insn): Allocate worst case storage + for bra/bsr and use frag_variant(), this ensure that the possible + 16-bit BFD_RELOC_16 will be in the same frag. + +2001-10-31 Chris Demetriou + + * config/tc-mips.c (HAVE_32BIT_ADDRESSES): If compiling embedded + PIC code, assume pointers the same size as GPRs. + (macro): In M_LA_AB handling for embedded PIC code, support + "la $treg,foo-bar($breg)". In load/store handling + (label ld_st) support " $treg,-($breg)" + which is used by the compiler for switch statements. + In load/store double multi-instruction macro handling + (label ldd_std) add a comment that no special handling + is currently done for embedded PIC. + (mips_ip): In 'o' (16-bit offset) case, only accept 16 + bit offsets. + +2001-10-31 Richard Earnshaw + + General cleanup of feature definitions. + * tc-arm.c (ARM_EXT_LONGMUL, ARM_EXT_HALFWORD, ARM_EXT_THUMB): Delete. + (ARM_2UP, ARM_ALL, ARM_3UP, ARM_6UP): Delete. + (FPU_CORE, FPU_FPA10, FPA_FPA11, FPU_ALL, FPA_MEMMULTI): Delete. + (ARM_EXT_V{1,2,2S,3,3M,4,4T,5T,5ExP}): New defines. + (ARM_EXT_V{5,5E}): Synchronize with above. + (ARM_ARCH_V*): Define a complete set in terms of above features. + (ARM_{1,2,3,250,6,7,8,9,STRONG}): Define in terms of architecture. + (FPU_FPA_EXT_V[12]): Define. + (FPU_ARCH_FPE, FPU_ARCH_FPA): Define in terms of above. + (FPU_ANY): Define. + (FPU_DEFAULT): Default to FPA. + (CPU_DEFAULT): For XScale, this is now just ARM_ARCH_XSCALE; for + Thumb, this is now ARM_ARCH_V5T. + (insns): Rework for new feature defines. + (tinsns): Likewise. + (opcode_select, do_ldst, md_begin, md_parse_option): Likewise. + +2001-10-31 NIIBE Yutaka + + * configure.in: Handle sh*eb-*-linux* and sh*-*-linux*. + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/c-sh.texi (SH Options): Added descriptions. + +2001-10-30 Hans-Peter Nilsson + + * configure.in: Update for MMIX port. + * Makefile.am: Ditto. Regenerate dependencies. + * Makefile.in: Regenerate. + * configure: Regenerate. + * config/tc-mmix.h, config/tc-mmix.c: New files. + * doc/Makefile.am (CPU_DOCS): Add c-mmix.texi + * doc/Makefile.in: Regenerate. + * doc/all.texi: @set MMIX. + * doc/as.texinfo: Ditto. Add MMIX gas manpage option overview. + Include c-mmix.texi. + * doc/c-mmix.texi: New file. + +2001-10-24 Chris Demetriou + + * config/tc-mips.c (hilo_interlocks, cop_interlocks): Make + these evaluate to true if mips_arch indicates SB-1. + +2001-10-23 Alan Modra + + * as.c (parse_args): Print the date as well for --version. + +2001-10-20 Chris Demetriou + + * config/tc-mips.c (md_show_usage): Print "sb1" for Broadcom + SB-1 CPU for consistency. + (mips_cpu_info_table): Tweak comment about SB-1. + +2001-10-20 H.J. Lu + + * config/tc-arm.c (do_c_shift): Use ISDIGIT instead of isdigit. + (cirrus_parse_offset): Likewise. + +2001-10-19 Nick Clifton + + * config/tc-arm.c: Restore line_comment_chars. + +2001-10-18 Nick Clifton + + * config/tc-arm.c (comment_chars): Remove semi-colon accidentally + added to the list. + +2001-10-18 Hans-Peter Nilsson + + * write.c (fixup_segment): Handle fixups for SEC_MERGE sections as + for undefined symbols. + +2001-10-17 Chris Demetriou + + * doc/as.texinfo (MIPS ISA options): Added accidentally + omitted "-mips64" option to list of options. + +2001-10-17 matthew green + + * config/tc-ppc.c (md_show_usage): Add missing -maltivec, -m7400, + -m7410, -m7450 and -m7455 options. + +2001-10-17 Alan Modra + + * config/tc-ppc.c (PPC_HA, PPC_HIGHERA, PPC_HIGHESTA): Simplify. + (ppc_size): Select PPC_OPCODE_64 if 64 bit. + (md_begin): Don't set ppc_size here. + (ppc_target_format): Test ppc_size as well as BFD_DEFAULT_TARGET_SIZE. + (md_shortopts): Constify. + (md_longopts): Likewise. + (md_longopts_size): Likewise. + (ppc_elf_suffix): Only allow 64-bit relocs when ppc_size specifies + 64-bit opcodes. + (ppc_machine): Explain why this function is a nop. + +2001-10-17 Alan Modra + + * bit_fix.h: Comment typo fix. + * config/tc-mips.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-arc.c (arc_code_symbol): Remove unnecessary test. + + * configure.in (MIPS_STABS_ELF): AC_DEFINE in only one place so + that autoheader doesn't duplicate config.in entries. + (DEFAULT_ARCH): Ditto. + * configure: Regenerate. + * config.in: Regenerate. + +2001-10-16 Alan Modra + + From Andrew Pines + * config/tc-m68k.c (m68k_ip): Correct absolute jmp opcodes. + +2001-10-16 NIIBE Yutaka , + Hans-Peter Nilsson + + * config/tc-sh.c (shl): Remove. + (big): New function. + (little): Remove shl handling. Emit error for endian mismatch. + (md_show_usage): Add description of -big. + (md_parse_option): Handle OPTION_BIG. Remove shl handling. + (OPTION_BIG): Add. + (md_pseudo_table): Add .big. + (md_longopts): Add -big. + (md_begin): Don't set target_big_endian here. + * config/tc-sh.h (TARGET_BYTES_BIG_ENDIAN): Remove. + (LISTING_HEADER, COFF_MAGIC, TARGET_FORMAT): Use target_big_endian. + (shl): Remove. + * configure.in (endian): Default is big. + (sh-*-pe*): Little endian. + (cpu_type): Set sh for target sh*. + * configure: Regenerate. + +2001-10-15 Thiemo Seufer + + * config/tc-mips.c (md_apply_fix): Preliminary handling of NewABI + relocations. + +2001-10-13 Nick Clifton + + * config/tc-arm.c: Replace CONST with const. + + * cgen.c: Tidy up formatting. + +2001-10-12 matthew green + + * config/tc-ppc.c (md_parse_option): New -m7410, -m7450 and -m7455 + flags, equivalent to -m7400. New -maltivec to enable AltiVec + instructions. New -mbook64 and -mbooke/-mbooke32 flags to enable + 64-bit and 32-bit BookE support, respectively. Change -m403 and + -m405 to set PPC403 option. + (md_show_usage): Adjust for new options. + * doc/all.texi: Set PPC. + * doc/as.texinfo: Add PPC support and pull in c-ppc.texi. + * doc/c-ppc.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add c-ppc.texi. + * doc/Makefile.in: Regenerate. + +2001-10-12 Nick Clifton + + * read.c (s_bad_endr): New function. Issues a warning message + about a bad use of the .rept pseudo op. + (po_table[]): Add .endr. + * read.h: Prototype s_bad_endr. + + * CONTRIBUTORS: Update contact email address. + +2001-10-11 Kazu Hirata + + * config/tc-alpha.c: Fix comment typos. + * config/tc-cris.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-tahoe.c: Likewise. + * config/tc-v850.c: Likewise. + +2001-10-11 Kazu Hirata + + * app.c: Fix comment typos. + * bit_fix.h: Likewise. + * expr.c: Likewise. + * itbl-ops.c: Likewise. + +2001-10-11 Nick Clifton + + * input-file.c: Include safe-ctype.h. + (input_file_open): Use ISSPACE instead of isspace. + +2001-10-10 Thiemo Seufer + + * config/tc-mips.c (mips_cpreturn_offset): New variable. + (mips_cpreturn_register): Likewise. + (mips_gp_register): Likewise. + (s_cpsetup): New function prototype. + (s_cplocal): Likewise. + (s_cpreturn): Likewise. + (s_gpvalue): Likewise. + (mips_pseudo_table): Add .cpsetup, .cplocal, .cpreturn, .gpvalue + pseudo-ops. + (macro): Don't warn about .cprestore for NewABI. + (md_pcrel_from): Code cleanup. + (mips_force_relocation): Force output of some NewABI relocations even + without a defined symbol. + (s_cpload): Ignore .cpload for NewABI. + (s_cpsetup): Handle .cpsetup. + (s_cplocal): Handle .cplocal. + (s_cprestore): Ignore .cprestore for NewABI. + (s_cpreturn): Handle .cpreturn. + (s_gpvalue): Handle .gpvalue. + (s_cpadd): Ignore .cpadd for NewABI. + (nopic_need_relax): Take g_switch_value into account as gp + optimization. + (tc_gen_reloc): Don't handle BFD_RELOC_MIPS_{CALL,GOT}* for NewABI. + +2001-10-10 Thiemo Seufer + + * config/tc-mips.c (my_getSmallParser): New function prototype. + (small_ex_type): Named this enum, more return values for + my_getSmallExpression. + (mips_ip): Allow SPC and HT between arguments. Handle some NewABI + triple relocations. Protect some parts with ifdef OBJ_ELF. + (percent_op_match): New struct, lookup table for %some_reloc(). + (my_getSmallParser): New function, parses nested percent_ops also. + (my_getSmallExpression): Rewite to support nested percent_ops. + +2001-10-10 Thiemo Seufer + + * config/tc-mips.c + (load_address): Support both 32- and 64-bit addresses. + (macro): Call load_register correctly. Expand 64-bit loads ans stores. + (macro2): Call load_address correctly. + +2001-10-09 Christian Groessler + + * config/tc-z8k.c: Include opcodes/z8k-opc.h after bfd.h + since z8k-opc.h now uses the PARAMS macro. + +2001-10-09 Aldy Hernandez + + * config/tc-arm.c: Change MAVERIK to MAVERICK. + +2001-10-09 Alan Modra + + * config/obj-elf.c: Make use of elf_group_name and elf_next_in_group + throughout file. + (obj_elf_change_section): Rename "group" to "group_name". + (obj_elf_section): Likewise. + (elf_frob_file): Don't use sec->lineno for SHT_GROUP section to store + first member section; Instead use elf_next_in_group. + +2001-10-09 Alan Modra + + * config/obj-elf.c: (obj_elf_change_section): Add "group" param. + Set elf_section_data group from it. Warn if group name changed. + (obj_elf_parse_section_letters): Parse 'G' too. + (obj_elf_section): Parse group name. + (struct group_list): New. + (build_group_lists): New function. + (elf_frob_file): Create SEC_GROUP section(s). + + * config/obj-elf.c: (elf_copy_symbol_attributes): Zap trailing + whitespace. + +2001-10-08 Aldy Hernandez + + * doc/arm/c-arm.texi (ARM Options): Add arm9e documentation. + + * config/tc-arm.c (ARM_EXT_MAVERIK): New macro. + (cirrus_regtype): New enum. + (LONGEST_INST): Change to 10. + (CIRRUS_MODE1): New. + (CIRRUS_MODE2): New. + (CIRRUS_MODE3): New. + (CIRRUS_MODE4): New. + (CIRRUS_MODE5): New. + (CIRRUS_MODE6): New. + (insns): Add cirrus dsp instructions. + (ARM_EXT_MAVERIKSC_REG): New. + (cirrus_register): New. + (cirrus_mvf_register): New. + (cirrus_mvd_register): New. + (cirrus_mvfx_register): New. + (cirrus_mvdx_register): New. + (cirrus_mvax_register): New. + (ARM_EXT_MAVERIKsc_register): New. + (reg_table): Add cirrus registers. + (cirrus_valid_reg): New. + (cirrus_reg_required_here): New. + (do_c_binops_1): New. + (do_c_binops_2): New. + (do_c_binops_3): New. + (do_c_triple_4): New. + (do_c_triple_5): New. + (do_c_quad_6): New. + (do_c_dspsc_1): New. + (do_c_dspsc_2): New. + (do_c_shift_1): New. + (do_c_shift_2): New. + (do_c_ldst_1): New. + (do_c_ldst_2): New. + (do_c_ldst_3): New. + (do_c_ldst_4): New. + (do_c_binops): New. + (do_c_triple): New. + (do_c_quad): New. + (do_c_dspsc): New. + (do_c_shift): New. + (cirrus_parse_offset): New. + (do_c_ldst): New. + (md_parse_option): Add arm9e. + (md_show_usage): Same. + +2001-10-08 Tom Rix + + * config/tc-ppc (ppc_bf, ppc_biei) : Set first .bi lineno value to + location of next .bf + * config/obj-coff.c (coff_frob_symbol) : XCOFF does not use endndx. + +2001-10-07 Alan Modra + + * config/obj-elf.c: Standardize error/warning messages - don't + capitalise, no final period or newline, don't say "ignoring" for + as_bad messages. In some cases, change the wording to that used + elsewhere for similar messages. + (obj_elf_section_name): New function, split out from .. + (obj_elf_section): .. here. Correctly mask off SHF_MERGE if + entsize not specified. + +2001-10-05 Jakub Jelinek + + * doc/as.texinfo: Document M and S ELF section flags. + +2001-10-05 Alan Modra + + * subsegs.c (subseg_text_p): Return 0 for absolute section. + * read.c (do_align): If in absolute section, warn about and ignore + non-zero fill pattern. + +2001-10-05 Alexandre Oliva + + * config/tc-mn10300.c (tc_gen_reloc): Don't free + reloc->sym_ptr_ptr if it's not allocated. + +2001-10-04 Thiemo Seufer + + * config/tc-mips.c (prev_insn_reloc_type): Make it an array to hold a + relocation triple. + (prev_insn_fixp): Likewise. + (append_insn): Changed prototype to accept a relocation pointer. + (imm_reloc): Make it an array. + (offset_reloc): Likewise. + (md_assemble): Handle triple relocations. + (append_insn): Likewise. Add handling for some NewABI relocations. + (mips_no_prev_insn): Handle triple relocations. + (macro_build): Likewise. Add handling for some NewABI relocations. + Move handling for the 'u' case to append_insn(). + (mips16_macro_build): Handle triple relocations. + (macro_build_lui): Likewise. Don't handle _gp_disp as special symbol + for NewABI. + (mips_ip): Handle triple relocations. + (mips16_ip): Likewise. + (mips_force_relocation): Force handling of triple relocations + without symbols for NewABI. + (md_apply_fix): Add handling for some NewABI relocations. + +2001-10-05 Alan Modra + + * config/tc-i386.c (parse_register): If not producing code for + x86_64, reject x86_64 register name matches. + (md_assemble): Remove now redundant check for x86_64 regs. + +2001-10-04 Alan Modra + + * config/tc-ppc.c (md_assemble ): Test ppc_size as well + as BFD_DEFAULT_TARGET_SIZE. + (ppc_tc): Likewise. + (ppc_is_toc_sym): Likewise. + (md_apply_fix3): Likewise. + +2001-10-03 Thiemo Seufer + + * config/tc-mips.c (mips_64): Remove. + (mips_target_format): Move downwards in file, use HAVE_64BIT_OBJECTS + in it. + (mips_abi_level, mips_abi): New enum. + (mips_32bit_abi): Remove. + (HAVE*PRS): Use mips_abi instead of mips_32bit_abi. + (HAVE_NEWABI): New define. + (HAVE_64BIT_OBJECTS): New define. + (HAVE_32BIT_ADDRESSES): Don't return true for 64bit objects. + (HAVE_64BIT_ADDRESSES): New define, inverse of HAVE_32BIT_ADDRESSES. + (support_64bit_objects): New prototype. + (md_begin): Use mips_abi instead of mips_32bit_abi. Don't write + .reginfo section for n32, use .MIPS.options instead. + (support_64bit_objects): New function, code from md_parse_option. + (md_longopts): Add -n32 option. + (md_parse_option): Use mips_abi instead of mips_32bit_abi/mips64. + Add -n32 option. Protect with OBJ_ELF. + (s_mipsset): Use mips_abi instead of mips_32bit_abi. + (mips_elf_final_processing): Likewise. Don't write .reginfo section + for n32, use .MIPS.options instead. + +2001-10-03 Alan Modra + + * po/POTFILES.in: Regenerate. + * configure: Regenerate. + +2001-10-02 Alan Modra + + * config/tc-ppc.c (md_apply_fix3 ): Make it 64 + bits if target is 64 bit. + + * doc/as.texinfo (listing): Fix typo. + + * as.c (print_version_id): Use BFD_VERSION_STRING in place of + BFD_VERSION. + * Makefile.am (Makefile): Depend on bfd/configure.in. + Run "make dep-am". + * Makefile.in: Regenerate. + +2001-09-30 H.J. Lu + + * config/obj-elf.c (obj_elf_parse_section_letters): Accept "am" + and "ams" for compatibility. + +2001-09-30 Hans-Peter Nilsson + + * config/tc-sh.c (md_pcrel_from_section): Transformed from + md_pcrel_from. Handle pc-relativeness against link-time + symbol. Handle relativeness to elsewhere than the fixup. + * config/tc-sh.h (MD_PCREL_FROM_SECTION): Define. + (md_pcrel_from_section): Prototype. + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate. + +2001-09-30 Stephane Carrez + + * config/tc-m68hc11.c (cmp_opcode): Define prototype. + (print_opcode_format, skip_whites): Likewise. + (convert_branch, m68hc11_new_insn): Likewise. + (build_dbranch_insn, build_indexed_byte): Likewise. + (build_reg_mode, find, find_opcode): Likewise. + (print_insn_format): Fix call to print_opcode_format. + (md_assemble): Fix call to build_dbranch_insn. + +2001-09-27 Nick Clifton + + * config/tc-arm.c: Add missing prototypes. + +2001-09-26 Jeff Johnston + + * input-file.c (input_file_open): When reading the + first line looking for #NO_APP, prepare for the possibility + of finding #APP instead. Also fix algorithm to allow + white-space to follow either #NO_APP or #APP directives. + +2001-09-25 Geoff Berry + + * listing.c (buffer_line): Don't write past the end of `line' when + EOF is reached. + +2001-09-25 Alexandre Oliva + + * config/tc-mn10300.c (tc_gen_reloc): Don't emit an *ABS* + relocation for differences between symbols in a section other + than the one in which the difference is to be placed; apply + the relocation instead. + +2001-09-24 Nick Clifton + + * config/tc-arc.c: Add missing prototype. + (md_atof): Change type to int. Add missing prototype. + * config/tc-arc.h: Prototype exported functions. + +2001-09-22 Nick Clifton + + * as.c: Add missing function prototype. + * config/obj-aout.c: Fix compile time warning. + +2001-09-21 Bruno Haible + + * config/tc-openrisc.c: Don't include . + +2001-09-19 Martin Schwidefsky + + * gas/config/tc-s390.c: Add option -mwarn-areg-zero. + +2001-09-19 Alan Modra + + * config/tc-i370.c: Fix typo in last change. + +2001-09-19 Nick Clifton + + * doc/as.texinfo (Symbol Names): Improve documentation on local + labels and add documenation about dollar labels. + +2001-09-18 Bruno Haible + + * as.h: Don't include . + * as.c (main): For gettext, also set the LC_CTYPE locate facet. + * atof-generic.c: Include "safe-ctype.h" instead of . + (atof_generic): Use ISDIGIT instead of isdigit. + * config/m68k-parse.y: Include "safe-ctype.h". + (yylex): Use ISDIGIT/ISALNUM instead of isdigit/isalnum. + * config/obj-elf.c: Include "safe-ctype.h". + (obj_elf_vtable_inherit): Use ISSPACE instead of isspace. + * config/obj-vms.c: Include "safe-ctype.h". + (Write_VMS_MHD_Records): Use TOUPPER instead of islower/toupper. + (VMS_Case_Hack_Symbol): Use ISUPPER/ISLOWER/TOUPPER/TOLOWER + instead of isupper/islower/toupper/tolower. + * config/tc-a29k.c: Include "safe-ctype.h" instead of . + (insert_sreg): Use TOUPPER instead of islower/toupper. + (machine_ip): Use ISALPHA/ISALNUM/ISUPPER/TOLOWER instead of + isalpha/isalnum/isupper/tolower. + (a29k_unrecognized_line, md_operand): Use ISDIGIT instead of + isdigit. + * config/tc-alpha.c: Include "safe-ctype.h" instead of . + (md_undefined_symbol, s_alpha_ent): Use ISDIGIT instead of isdigit. + * config/tc-arc.c: Include "safe-ctype.h" instead of . + (md_assemble): Use ISSPACE/ISALNUM instead of isspace/isalnum. + (arc_extoper): Use TOLOWER instead of isupper/tolower. + * config/tc-arm.c: Include "safe-ctype.h" instead of . + (arm_psr_parse): Use ISALPHA instead of isalpha. + (accum0_required_here): Use ISALNUM instead of isalnum. + (do_ldrd): Use ISSPACE instead of isspace. + (decode_shift): Use ISALPHA instead of isalpha. + (insert_reg): Use TOUPPER instead of islower/toupper. + (arm_reg_parse): Use ISALPHA instead of isalpha. + (arm_parse_reloc): Use ISALNUM/ISPUNCT/TOLOWER instead of + isalnum/ispunct/tolower. + * config/tc-avr.c: Include "safe-ctype.h" instead of . + (md_parse_option): Use TOLOWER instead of tolower. + (avr_operand): Use ISDIGIT/TOLOWER instead of isdigit/tolower. + * config/tc-cris.c: Include "safe-ctype.h" instead of . + (cris_process_instruction): Use ISLOWER instead of islower. + (get_gen_reg): Use ISALNUM/ISDIGIT instead of isalnum/isdigit. + (get_spec_reg): Use TOLOWER/ISALNUM instead of isupper/tolower/isalnum. + (get_flags): Use ISSPACE instead of isspace. + * config/tc-d10v.c: Include "safe-ctype.h" instead of . + (do_assemble): Use TOLOWER instead of tolower. + * config/tc-d30v.c: Include "safe-ctype.h" instead of . + (do_assemble): Use TOLOWER instead of tolower. + (d30v_start_line): Use ISSPACE instead of isspace. + * config/tc-fr30.c: Include "safe-ctype.h" instead of . + (fr30_is_colon_insn): Use TOLOWER instead of tolower. + * config/tc-h8300.c: Include "safe-ctype.h" instead of . + (skip_colonthing, get_operand): Use ISDIGIT instead of isdigit. + * config/tc-h8500.c: Include "safe-ctype.h" instead of . + (start_label): Use ISALPHA instead of isalpha. + * config/tc-hppa.c: Include "safe-ctype.h" instead of . + (pa_ip): Use ISUPPER/ISLOWER/TOLOWER instead of + isupper/islower/tolower. + (pa_parse_number): Use ISDIGIT instead of isdigit. + (pa_chk_field_selector): Use TOLOWER instead of tolower. + (pa_stringer): Use ISDIGIT instead of isdigit. + * config/tc-i370.c: Include "safe-ctype.h" instead of . + (register_name): Use ISALPHA instead of isalpha. + (i370_elf_suffix): Use ISALNUM/TOLOWER instead of + isalnum/islower/tolower. + (i370_addr_offset): Use ISDIGIT/ISALPHA instead of + isdigit/isalpha. + (i370_addr_cons): Use ISALPHA/ISXDIGIT instead of + isalpha/isxdigit. + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-i386.c: Include "safe-ctype.h" instead of . + (md_begin): Use ISDIGIT/ISLOWER/ISUPPER/TOLOWER/ISALPHA + instead of isdigit/islower/isupper/tolower/isalpha. + (output_invalid): Use ISPRINT instead of isprint. + * config/tc-i860.c: Include "safe-ctype.h" instead of . + (i860_ip): Use ISLOWER/ISDIGIT instead of islower/isdigit. + * config/tc-i960.c: Include "safe-ctype.h" instead of . + (get_args): Use ISALNUM instead of isalnum. + * config/tc-ia64.c: Include "safe-ctype.h". + (dot_pred_rel): Use TOUPPER/ISDIGIT instead of toupper/isdigit. + (ia64_unrecognized_line): Use ISDIGIT instead of isdigit. + (ia64_parse_name): Likewise. + * config/tc-m32r.c: Include "safe-ctype.h" instead of . + (assemble_two_insns): Use ISSPACE/ISALNUM/ISUPPER/TOLOWER + instead of isspace/isalnum/isupper/tolower. + * config/tc-m68hc11.c: Include "safe-ctype.h" instead of . + (md_assemble): Use TOLOWER/ISALNUM instead of tolower/isalnum. + * config/tc-m68k.c: Include "safe-ctype.h" instead of . + (mklower_table): Remove variable. + (mklower): Remove macro. + (insert_reg): Use TOUPPER instead of islower/toupper. + (md_begin): Remove initialization of mklower_table. + (s_reg): Use ISALNUM instead of isalnum. + (mri_assemble): Use ISUPPER/TOLOWER instead of isupper/tolower. + (parse_mri_condition): Use TOLOWER instead of isupper/tolower. + (build_mri_control_operand): Use TOLOWER instead of tolower. + (s_mri_else, s_mri_break, s_mri_next, s_mri_for): Likewise. + * config/tc-m88k.c: Include "safe-ctype.h" instead of . + (md_assemble): Use ISSPACE instead of isspace. + (get_imm16): Use ISALNUM instead of isalnum. + (get_cnd): Use ISDIGIT/ISUPPER/TOLOWER instead of + isdigit/isupper/tolower. + (get_bf_offset_expression): Use ISALPHA/ISUPPER/TOLOWER + instead of isalpha/isupper/tolower. + (hexval): Use ISDIGIT/ISLOWER/ISUPPER instead of + isdigit/islower/isupper. + * config/tc-mcore.c: Include "safe-ctype.h" instead of . + (mcore_s_section): Use ISSPACE instead of isspace. + (parse_reg): Use ISSPACE/TOLOWER/ISALNUM instead of + isspace/tolower/isalnum. + (parse_creg): Use ISSPACE/TOLOWER instead of isspace/tolower. + (parse_psrmod): Use TOLOWER instead of isascii/tolower. + (parse_exp, parse_mem, md_assemble): Use ISSPACE instead of + isspace. + * config/tc-mips.c: Include "safe-ctype.h" instead of . + (mips_ip): Use ISSPACE/ISDIGIT instead of isspace/isdigit. + (mips16_ip): Use ISLOWER/ISDIGIT instead of islower/isdigit. + (my_getSmallExpression): Use ISDIGIT/TOLOWER instead of + isdigit/tolower. + (tc_get_register): Likewise. + (get_number): Use ISDIGIT/ISXDIGIT instead of isdigit/isxdigit. + (s_mips_ent): Use ISDIGIT instead of isdigit. + * config/tc-mn10200.c: Include "safe-ctype.h" instead of . + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-mn10300.c: Include "safe-ctype.h" instead of . + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-ns32k.c: Don't include . + * config/tc-pdp11.c: Include "safe-ctype.h". + (mklower): Remove function. + (parse_reg): Use TOLOWER instead of mklower. + * config/tc-pj.c: Include "safe-ctype.h". + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-ppc.c: Include "safe-ctype.h" instead of . + (register_name): Use ISALPHA instead of isalpha. + (ppc_elf_suffix): Use ISALNUM/TOLOWER instead of + isalnum/islower/tolower. + (md_assemble): Use ISSPACE instead of isspace. + (ppc_canonicalize_symbol_name): Use ISLOWER/TOUPPER instead of + islower/toupper. + * config/tc-s390.c: Include "safe-ctype.h" instead of . + (register_name): Use ISALPHA instead of isalpha. + (s390_elf_suffix, s390_lit_suffix): Use ISALNUM instead of isalnum. + (md_gather_operands, md_assemble, s390_insn): Use ISSPACE instead of + isspace. + * config/tc-sh.c: Include "safe-ctype.h" instead of . + (sh_elf_suffix): Use ISALNUM/TOLOWER instead of + isalnum/islower/tolower. + (IDENT_CHAR): Use ISALNUM instead of isalnum. + (parse_reg): Use TOLOWER instead of tolower. + (find_cooked_opcode): Use TOLOWER instead of isupper/tolower. + * config/tc-sparc.c: Include "safe-ctype.h" instead of . + (sparc_ip): Use ISLOWER/ISDIGIT instead of islower/isdigit. + (parse_keyword_arg): Use ISALNUM instead of isalnum. + * config/tc-tahoe.c: Include "safe-ctype.h". + (tahoe_reg_parse): Use ISDIGIT instead of isdigit. + (tip_op): Use TOLOWER instead of isupper/tolower. + * config/tc-tic30.c: Include "safe-ctype.h". + (md_begin): Use ISLOWER/ISDIGIT/ISUPPER/TOLOWER/ISLOWER/ + ISALPHA instead of islower/isdigit/isupper/tolower/islower/isalpha. + (tic30_operand): Use TOLOWER instead of tolower. + (tic30_find_parallel_insn): Likewise. + (output_invalid): Use ISPRINT instead of isprint. + * config/tc-tic54x.c: Include "safe-ctype.h". + (tic54x_asg, tic54x_eval): Use ISALPHA instead of isalpha. + (lookup_version): Use TOUPPER instead of toupper. + (tic54x_var): Use ISALPHA instead of isalpha. + (tic54x_mlib): Use ISSPACE instead of isspace. + (subsym_iscons): Use TOUPPER instead of toupper. + (get_operands): Use ISSPACE instead of isspace. + (is_type): Use TOUPPER/ISDIGIT instead of toupper/isdigit. + (encode_indirect, encode_operand): Use TOUPPER instead of toupper. + (next_line_shows_parallel): Use ISSPACE instead of isspace. + (subsym_get_arg, subsym_substitute): Use ISDIGIT instead of isdigit. + (tic54x_start_line_hook, md_assemble, tic54x_start_label): Use + ISSPACE instead of isspace. + * config/tc-tic80.c: Include "safe-ctype.h". + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-v850.c: Include "safe-ctype.h" instead of . + (system_register_name): Use ISDIGIT instead of isdigit. + (md_assemble): Use ISSPACE instead of isspace. + * config/tc-vax.c: Include "safe-ctype.h" instead of . + (vax_reg_parse): Use TOLOWER/ISDIGIT instead of + isupper/tolower/isdigit. + (vip_op): Use TOLOWER instead of isupper/tolower. + * config/tc-w65.c: Don't include . + * config/tc-z8k.c: Include "safe-ctype.h" instead of . + (tohex): Use ISDIGIT/ISLOWER instead of isdigit/islower. + (whatreg): Use ISDIGIT instead of isdigit. + * ecoff.c: Include "safe-ctype.h" instead of . + (ecoff_directive_ent, ecoff_stab): Use ISDIGIT instead of isdigit. + * expr.c: Include "safe-ctype.h" instead of . + (integer_constant): Use ISALNUM/TOUPPER instead of + isalnum/islower/toupper. + (operand): Use TOLOWER instead of isupper/tolower. + * gasp.c: Include "safe-ctype.h" instead of . + (sb_strtol, level_0, change_base, doinstr): Use ISDIGIT instead + of isdigit. + (process_assigns, whatcond): Use TOUPPER instead of toupper. + (chartype_init): Use ISALPHA/ISDIGIT instead of isalpha/isdigit. + (main): For gettext, also set the LC_CTYPE locate facet. + * hash.c: Include "safe-ctype.h". + (main): Use TOLOWER instead of isupper/tolower. + * itbl-lex.l: Don't include . + * listing.c: Include "safe-ctype.h" instead of . + (listing_newline): Use ISCNTRL instead of isascii/iscntrl. Don't + omit non-ASCII characters. + (debugging_pseudo): Use ISSPACE instead of isspace. + * macro.c: Include "safe-ctype.h" instead of . + (buffer_and_nest): Use ISALNUM instead of isalnum. + (get_token): Use ISALPHA/ISALNUM instead of isalpha/isalnum. + (define_macro): Use ISUPPER/TOLOWER instead of isupper/tolower. + (macro_expand_body): Use ISALNUM/ISDIGIT/ISUPPER/ISALPHA + instead of isalnum/isdigit/isupper/isalpha. + (check_macro): Use ISALPHA/ISALNUM/ISUPPER/TOLOWER instead + of isalpha/isalnum/isupper/tolower. + * read.c: Include "safe-ctype.h" instead of . + (read_a_source_file): Use ISUPPER/TOLOWER/ISDIGIT instead of + isupper/tolower/isdigit. + (s_mri_common): Use ISDIGIT instead of isdigit. + (s_mri_sect): Use ISDIGIT/TOUPPER instead of isdigit/toupper. + (s_float_space): Use ISALPHA instead of isalpha. + (ignore_rest_of_line): Use ISPRINT instead of isprint. + (float_cons): Use ISALPHA instead of isalpha. + (next_char_of_string): Use ISDIGIT/ISXDIGIT instead of + isdigit/isxdigit. + * symbols.c: Include "safe-ctype.h" instead of . + (save_symbol_name): Use ISLOWER/TOUPPER instead of + islower/toupper. + (symbol_find_base): Use TOUPPER instead of islower/toupper. + (decode_local_label_name): Use ISDIGIT instead of isdigit. + +2001-09-18 Martin Schwidefsky + + * tc-s390.c (s390_insn): Add code to cope with 6 byte O_constants + in 64 bit mode and make format "e" work. + +2001-09-18 Alan Modra + + * dwarf2dbg.c (dwarf2_directive_file): Avoid signed/unsigned warning. + + * write.c (set_symtab): Update bfd_alloc declaration. Use a temp + var to ensure bfd_alloc arg is the right type. + (write_object_file): Cast args of bfd_seek. Replace bfd_write with + bfd_bwrite. + + * config/obj-coff.c: Replace calls to bfd_write with calls to + bfd_bwrite. Cast args of bfd_seek. + + * config/obj-elf.c (obj_elf_change_section): Avoid signed/unsigned + warning. + + * config/tc-mn10300.c (set_arch_mach): Make param unsigned. + + * config/tc-tic54x.c (tic54x_mlib): Replace bfd_read call with + call to bfd_bread. + +2001-09-15 Hans-Peter Nilsson + + * config/tc-sh.h (sh_force_relocation): Prototype. + (struct fix): Forward declare. + * config/tc-sh.c (type sh_operand_info): Move to top of file. + (cons, s_align_bytes): Remove old-type declarations. + (sh_elf_suffix, parse_reg, dot, parse_exp, parse_at, get_operand, + get_operands, get_specific, insert, build_relax, + insert_loop_bounds, build_Mytes): Prototype. + (little): Make static. Prototype. + (check, tc_Nout_fix_to_chars): Delete unused functions. + +2001-09-14 Eric Christopher + + * config/tc-mips.c (md_parse_option): Remove setting mips_64 via + -mgp32/mgp64. + +2001-09-14 Kevin Lo + + * configure.in: Add arm-openbsd target. + * configure: Regenerate. + +2001-09-14 Thiemo Seufer + + * configure.in: Change machine triplets from mips-*-linux-gnu* to + mips*-*-linux*. + +2001-09-12 Thiemo Seufer + + * config/tc-mips.c (append_insn): Don't rightshift BFD_RELOC_16_PCREL. + +2001-09-11 Richard Henderson + + * config/tc-alpha.c (alpha_elf_section_letter): New. + (alpha_elf_section_flags): New. + * config/tc-alpha.h (md_elf_section_letter): New. + (md_elf_section_flags): New. + * config/tc-ia64.c (ia64_elf_section_letter): New. + * config/tc-ia64.h (md_elf_section_letter): New. + +2001-09-11 Jakub Jelinek + + * config/obj-elf.c (obj_elf_parse_section_letters): Use 'M' instead + of 'm', 'S' instead of 's'. Update bad_msg. + * config/tc-ppc.c (ppc_section_letter): Update bad_msg. + * config/tc-i370.c (i370_sectioN_letter): Update bad_msg. + +2001-09-09 Alan Modra + + * expr.c (expr): Move code setting "retval" to the end of the loop, + and rearrange for efficiency. For "PIC code" subtraction, use + "rightseg" rather than recalculating. For "symbol OP symbol" + subtract, set "retval" to absolute_section if symbols in same + section. + * symbols.c (resolve_symbol_value): Resolve "sym +/- expr" to an + O_symbol. Simplify a +/- b code. Allow equality and non-equality + comparisons on symbols from any section. Allow other comparison + operators as for subtraction. + (symbol_equated_reloc_p): New predicate function. + * symbols.h (symbol_equated_reloc_p): Declare. + * write.c (relax_segment ): Ensure segment + for expression syms is set correctly. + (adjust_reloc_syms): Use symbol_equated_reloc_p. + (write_relocs): Likewise. + (write_object_file): Likewise. + * config/tc-mips.c (md_estimate_size_before_relax): Likewise. + * config/tc-i386.c (md_assemble ): Don't lose part + of a complex expression when setting up frag_var. + +2001-09-07 Richard Henderson + + * config/tc-alpha.c (alpha_reloc_op_tag): Replace need_seq with + require_seq and allow_seq. Let !literal omit the sequence number. + (tokenize_arguments): Reject sequence numbers of !allow_seq. + +2001-09-08 Jakub Jelinek + + * config/tc-sparc.c (md_apply_fix3): Handle relocs against SEC_MERGE + section symbols the same way as externs. + +2001-09-07 Thiemo Seufer + + * config/tc-mips.c (s_mipsset): Reallow unrestricted use of .set mipsX + pseudo-op. + +2001-09-07 Thiemo Seufer + + * config/tc-mips.c (append_insn): Handle BFD_RELOC_16_PCREL. + (macro_build): Use BFD_RELOC_16_PCREL_S2 only for embedded + PIC, BFD_RELOC_16_PCREL for the rest. + (mips_ip): Likewise. + (md_pcrel_from): return the right offset for the differently shifted + pcrel relocs. + (md_apply_fix): Handle BFD_RELOC_16_PCREL. + +2001-09-05 Richard Henderson + + * config/tc-ia64.c (FUNC_IPLT_RELOC): New. + (pseudo_func): Add @iplt. + (pseudo_opcode): Add data16 and data16.ua. + (md_begin): Set iplt pseudo. + (ia64_cons_fix_new): Handle 16 byte iplt reloc specially. + +2001-09-04 Richard Henderson + + * config/tc-alpha.c (struct alpha_insn): Make sequence scalar long. + (MACRO_LITERAL, MACRO_BASE, MACRO_BYTOFF, MACRO_JSR): Remove. + (alpha_macros): Remove occurrences of same. + (O_lituse_addr, O_gprel): New. + (DUMMY_RELOC_LITUSE_*): New. + (s_alpha_ucons, s_alpha_arch): Prototype. + (alpha_reloc_op): Construct elements via DEF macro. + (ALPHA_RELOC_SEQUENCE_OK): Remove. + (struct alpha_reloc_tag): Rename from alpha_literal_tag; rename + members to not be literal specific. + (next_sequence_num): New. + (md_apply_fix3): Cope with missing GPDISP_LO16. Adjust for + added/removed BFD relocations. + (alpha_force_relocation, alpha_fix_adjustable): Likewise. + (alpha_adjust_symtab_relocs): Handle GPDISP relocs as well. + (tokenize_arguments): Parse ! relocations properly. + (find_macro_match): Delete unused macro argument types. + (assemble_insn): Add reloc parameter; emit that instead of the + default as appropriate. + (get_alpha_reloc_tag): New. Split from ... + (emit_insn): ... here. Allocate a reloc tag for GPDISP. + (assemble_tokens): Don't search macros if user relocation present. + Copy reloc sequence number to insn struct. + (emit_ldgp): Remove user reloc handling. + (load_expression, emit_lda, emit_ldah, emit_ir_load): Likewise. + (emit_loadstore, emit_ldXu, emit_ldil, emit_stX): Likewise. + (emit_sextX, emit_division, emit_jsrjmp, emit_retjcr): Likewise. + * config/tc-alpha.h (tc_adjust_symtab): Always define. + (struct alpha_fix_tag): Name members less literal specific. + +2001-09-04 Jeffrey A Law (law@cygnus.com) + + * tc-h8300.c (tc_gen_reloc): Give an error if we try to take the + address of two symbols in different sections. + +2001-08-31 Eric Christopher + Jason Eckhardt + + * config/tc-mips.c (mips_cpu_info): Add support for mipsisa32, + 5kc, and 20kc. Clean up old entries. + +2001-08-31 J"orn Rennecke + Jeff Law + + * config/tc-h8300.c (build_bytes): For OBJ_ELF, make relocation's + offset match H8 ELF spec. + (md_section_align): Alternate implementation for BFD_ASSEMBLER. + (md_apply_fix): Fix argument and return types for BFD_ASSEMBLER. + + * tc-h8300.c (relocation mappings): Remove. Moved to tc-h8300.h. + (build_bytes): Mark fixups for PCrel branches as signed. For + OBJ_ELF, make sure the reloc's offset points to the first byte + to be modified. + (md_convert_frag): Update definiton based on BFD_ASSEMBLER. + * tc-h8300.h (relocation mappings): Add. + +2001-08-30 J"orn Rennecke + + * tc-h8300.c (tc_crawl_symbol_chain, tc_headers_hook): Don't + define for BFD_ASSEMBLER. + (tc_reloc_mangle): Likewise. + (tc_gen_reloc): New function for BFD_ASSEMBLER. + +2001-08-29 Jeffrey A Law (law@cygnus.com) + + * config/tc-h8300.c (h8300hmode): Record the machine type + if BFD_ASSEMBLER is defined. + (h8300smode, md_begin): Similarly. + +2001-08-29 Joel Sherrill + + * configure.in (i[3456]86-*-rtems*, m68*-*-rtems*): Change + default from coff to elf. + * configure: Regenerate. + +2001-08-29 J"orn Rennecke + + * tc-h8300.c: If OBJ_ELF, include elf/h8.h, and define + assorted coff relocations to the corresponding elf relocations. + * tc-h8300.h (TARGET_ARCH, TARGET_FORMAT): Define appropriately. + + * configure.in: Add case for h8300-*-elf. + * configure: Regenerate. + +2001-08-29 J"orn Rennecke + + * doc/internals.texi (MD_PCREL_FROM_SECTION): Change + documentation to reflect reality. + +2001-08-27 Thiemo Seufer + + * config/tc-mips.c (load_address): Reflect change to MAX_GPREL_OFFSET. + (macro): Reflect change to MAX_GPREL_OFFSET. + +2001-08-27 Torbjorn Granlund + Staffan Ulfberg + Linus Nordberg + Alan Modra + + * configure.in: Recognise powerpc*le*, not just powerpcle*. + * configure: Regenerate. + * config/tc-ppc.c (PPC_LO, PPC_HI, PPC_HA, PPC_HIGHER, + PPC_HIGHERA, PPC_HIGHEST, PPC_HIGHESTA, SEX16): New macros. + (md_assemble): Use them. + (ppc_machine): Support stub for ELF64 as well as XCOFF. + (md_pseudo_table): Add "llong", "quad". + (md_parse_option): Match default_cpu of powerpc*. + (ppc_arch): Likewise. + (ppc_subseg_align): Only for OBJ_XCOFF. + (ppc_target_format): Return elf64-powerpc strings for 64 bit ELF. + (md_begin): Select PPC_OPCODE_64 for 64 bit. + (ppc_insert_operand): Don't bother testing 'file' before calling + as_bad_where. Use as_bad_where for operand->insert errors. + (mapping): Add ELF64 relocation modifiers. + (ppc_elf_suffix): Replace symbol on BFD_RELOC_PPC64_TOC reloc + expressions with abs_symbol. + (ppc_elf_cons): Correct offset for little endian targets. + (ppc_elf_frob_symbol): New. + (md_assemble): Add support for 64 bit ELF relocs. + (ppc_tc): Ensure 8 byte alignment when 64 bit. + (ppc_is_toc_sym): Only define for OBJ_XCOFF and OBJ_ELF. Match + ".toc" section for 64 bit ELF. + (ppc_fix_adjustable): New. Macro body moved from tc-ppc.h. + (md_apply_fix3): Silence warning with ATTRIBUTE_UNUSED. Only do + the ppc_is_toc_sym check for OBJ_XCOFF and OBJ_ELF. For 64 bit, + use BFD_RELOC_PPC64_TOC16_DS instead of BFD_RELOC_PPC_TOC16. + Expand on comments, error message. Add support for 64 bit relocs, + and use PPC_HI etc. macros. + * config/tc-ppc.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define. + (HANDLE_ALIGN): Define to generate nops in code sections rather + than zeros. + (TC_FORCE_RELOCATION): Force for BFD_RELOC_PPC64_TOC. + (ELF_TC_SPECIAL_SECTIONS): Add 64 bit ELF sections. + (tc_fix_adjustable): Move body of macro to tc-ppc.c. + (ppc_fix_adjustable): Declare. + (tc_frob_symbol): Define. + (ppc_elf_frob_symbol): Declare. + +2001-08-26 Andreas Jaeger + + * config/tc-s390.c: Add missing prototypes + (md_gather_operands): Make static. + +2001-08-26 Thiemo Seufer + + * config/tc-mips.h (MAX_GPREL_OFFSET): Change it to the maximum + allowed value, not the word beyond maximum. + * config/tc-mips.c (macro_build_lui): Code cleanup. + (macro): Reflect change to MAX_GPREL_OFFSET. + (mips_ip): Check explicitly against S_EX_NONE. + (my_get_SmallExpression): parse for %gp_rel, not %gprel. + (md_apply_fix): Code cleanup. + +2001-08-24 Andreas Jaeger + + * config/tc-ppc.h: Fix prototype declaration. + +2001-08-23 Jakub Jelinek + + * config/tc-ia64.c (dot_endp): Set function symbol sizes. + * config/obj-elf.c (obj_elf_size): When size is constant, free + and clear symbol_get_obj(sym)->size if any. + +2001-08-21 Thiemo Seufer + + * config/tc-mips.c (md_begin): Warn about incompatibility between + -march=FOO and -mipsN option, continue with default ISA. + +2001-08-21 Thiemo Seufer + + * config/tc-mips.c (md_parse_option): #ifdef the + traditional/non-traditional names as it is done in mips_target_format. + +2001-08-20 Richard Henderson + + * config/tc-alpha.h (MD_APPLY_FIX3): Define. + * config/tc-alpha.c (md_apply_fix3): Rename from md_apply_fix; + use seg parameter instead of now_seg. + +2001-08-18 H.J. Lu + + * config/tc-mips.c (show): Add the missing prototype. + +2001-08-18 Thiemo Seufer + + * config/tc-mips.c (S_EX_*): New enum for my_getSmallExpression() + return values. + (mips_ip): Use the new return values instead of characters. Add + support for %higher and %highest. + (LP): Remove. + (RP): Remove. + (my_getSmallExpression): Make parsing case insensitive and more + reliable. Add support for %higher and %highest. Further support to + parse %gprel and %neg is implemented but currently deactivated. + +2001-08-17 Alan Modra + + * ecoff.c (ecoff_frob_symbol): Remove casts from bfd_get_gp_size. + (ecoff_build_symbols): Likewise. + * read.c (s_lcomm_internal): Fix signed/unsigned warning. + +2001-08-16 Thiemo Seufer + + * config/tc-mips.c (mips_elf_final_processing): Set elf header flags + for n32 ABI if appropriate. + +2001-08-16 Thiemo Seufer + + * config/tc-mips.c (cons_fix_new_mips): Remove. + * config/tc-mips.h (TC_CONS_FIX_NEW): Remove. + (cons_fix_new_mips): Remove. + +2001-08-14 Jeff Johnston + + * expr.c (operand)[LITERAL_PREFIXDOLLAR_HEX]: Treat $L as + a label, not a hex constant. + +2001-08-13 Nick Clifton + + * config/tc-v850.h: Add missing prototypes. + +2001-08-12 Martin Schwidefsky + + * config/tc-s390.c (s390_elf_cons): Correct fixups for PLT + relocations. + +2001-08-12 TAKAI Kousuke + + * config/tc-sparc.c (cons_fix_new_sparc): Move + `sparc_no_align_cons = 0;' to... + (s_uacons): ...here so that sparc_no_align_cons will get + cleared properly. + +2001-08-11 Kazu Hirata + + * config/tc-mips.c: Fix a comment typo. + +2001-08-10 Richard Sandiford + + * config/tc-mips.c (move_register): New function. + (macro_build): Remove OPCODE_IS_MEMBER's gp32 argument. + (mips_ip): Likewise. + (macro2): Use move_register rather than macro_build for moves. + (mips16_macro): Likewise. + (macro): Likewise. Handle M_MOVE. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * as.h (alloca): Don't declare if __GNUC__. Remove an old comment. + Comment indentation of #pragma. + * macro.c (alloca): Likewise. + + * config/tc-ppc.c: Revert 2001-08-08. + +2001-08-09 Alan Modra + + * symbols.c: Add missing prototypes. + * config/e-i386elf.c: Likewise. + * config/e-i386coff.c: Likewise. + * config/e-i386aout.c: Likewise. + * config/obj-coff.c: Likewise. + (def_symbol_in_progress, stack): Move definition. + * config/obj-elf.c: Add missing prototypes. + (obj_elf_change_section): Make static. + (obj_elf_parse_section_letters): Likewise. + (obj_elf_section_word): Likewise. + (obj_elf_section_type): Likewise. + +2001-08-08 Alan Modra + + From 1999-10-25 Torbjorn Granlund + * config/tc-ppc.c (md_apply_fix3): Replace haphazard code for + determining reloc type with code reading operands->reloc field. + +2001-08-08 Alan Modra + + * config/obj-elf.c (elf_copy_symbol_attributes): Make it a global + function, and expand old obj-elf.h OBJ_COPY_SYMBOL_ATTRIBUTES here. + * config/obj-elf.h (elf_copy_symbol_attributes): Declare. + (OBJ_COPY_SYMBOL_ATTRIBUTES): Call elf_copy_symbol_attributes. + + * output-file.c (output_file_create): Don't try to open a second + time as it's unnecessary. FOPEN_W was undefined too. + +2001-08-07 Thiemo Seufer + + * config/tc-mips.c (macro_build): Replace magic constants by defines. + (mips_ip): Likewise. Typo. + +2001-08-04 Thiemo Seufer + + * config/tc-mips.c (mips_abi_string): Initialize with NULL instead + of 0. + (RELAX_ENCODE): Replace bfd_vma by valueT. + (load_address): Formatting. + (macro): Likewise. Code cleanup. Typo. + (macro2): Formatting. + (md_parse_option): Typo. + (s_mipsset): Reorder cases to look nicer. + (md_estimate_size_before_relax): Formatting. Code cleanup. + (mips_elf_final_processing): Check against NULL instead of 0. + (md_obj_end): Remove ugly `' in message string. + (s_mips_ent): Remove ugly `' in message string. + +2001-07-30 Thiemo Seufer + + * config/tc-mips.c (md_begin): Take -mcpu value into account even when + -mipsX is specified. Make both -mcpu/-march and -mcpu/-mtune pairs + mutually exclusive (if they are different). + (md_parse_option): Warn if an -march/-mtune/-mcpu/-m option is + set more than once. + +2001-08-03 Richard Sandiford + + * config/tc-mips.c (md_apply_fix): Don't subtract the symbol value + from GPREL addends. + +2001-08-02 Richard Sandiford + + * doc/c-mips.tex (-mgp32, -mfp32): Added -mfp32, unified with -mgp32. + * config/tc-mips.c (mips_fp32, mips_32bit_abi): New static variables. + (md_long_opts): Add -mfp32 option. + (md_parse_option): Handle it. Set mips_32bit_abi given -mabi=32. + (md_show_usage): Show usage for -mfp32 and -mgp32. + (HAVE_32BIT_GPRS, HAVE_32BIT_FPRS): New macros. + (HAVE_64BIT_GPRS, HAVE_64BIT_FPRS): New macros, inverse of the above. + (HAVE_32BIT_ADDRESSES): New macro. + (load_register): Use HAVE_32BIT_GPRS to determine the register width. + (load_address): Use HAVE_32BIT_ADDRESSES to determine the address size. + (s_cprestore, s_cpadd): Likewise. + (macro): Use HAVE_32BIT_GPRS to determine the width of registers + used in branch and M_LI_D macros. Use HAVE_64BIT_FPRS to determine + the width registers used in M_LI_DD macros. Use HAVE_32BIT_ADDRESSES + to determine the width of addresses in load, store and jump macros. + (macro2): Use HAVE_32BIT_GPRS to determine the width of registers + used in set instructions; do not check the address size for them. + Use HAVE_32BIT_ADDRESSES to determine the width of addresses in + unaligned load and store macros. + (mips_ip): Use the new macros to check the width of a register when + processing float constants. Force a constant into memory if it is + destined for an FPR and the FPRs are wider than the GPRs. Warn about + odd FPR numbers if HAVE_32BIT_FPRS. Use HAVE_32BIT_GPRS rather + than mips_gp32 to select synthetic instructions. + (macro_build): Use HAVE_32BIT_GPRS rather than mips_gp32 to select + synthetic instructions. + +2001-08-01 Christian Groessler + + * config/tc-z8k.c (parse_reg): If a string starts with "r", "rl", + "rh", "rr", "rq", or "sp" then don't automatically assume + it's a register name. Check whether there is a number + following. + +2001-08-01 Alan Modra + + * config/tc-i386.c (lex_got): Match lower case relocation tokens. + Don't allocate more space than necessary for the input line copy. + +2001-08-01 Alan Modra + + * read.c: Standardize error/warning messages - don't capitalise, no + final period or newline, don't say "ignored" or "zero assumed" for + as_bad messages. In some cases, change the wording to that used + elsewhere for similar messages. + * app.c: Likewise. + * as.c: Likewise. + * atof-generic.c: Likewise. + * cgen.c: Likewise. + * cond.c: Likewise. + * depend.c: Likewise. + * dwarf2dbg.c: Likewise. + * ecoff.c: Likewise. + * expr.c: Likewise. + * frags.c: Likewise. + * input-file.c: Likewise. + * input-scrub.c: Likewise. + * listing.c: Likewise. + * output-file.c: Likewise. + * stabs.c: Likewise. + * subsegs.c: Likewise. + * symbols.c: Likewise. + * write.c: Likewise. + * ecoff.c (ecoff_directive_end): Test for missing name by + comparing input line pointers rather than reading string. + (ecoff_directive_ent): Likewise. + * read.c (s_set): Likewise. + (s_align): Report a warning rather than an error for + alignment too large. + (s_comm): Check for missing symbol name. + (s_lcomm_internal): Likewise. + (s_lsym): Likewise. + (s_globl): Use is_end_of_line instead of looking for '\n'. + (s_lcomm_internal): Likewise. + (ignore_rest_of_line): Report a warning rather than an error. + +2001-07-31 Geoffrey Keating + + * config/tc-ppc.c (ppc_elf_validate_fix): It's OK to have + any kind of relocation against a not-loaded section. + +2001-07-30 Alan Modra + + * config/obj-elf.c (obj_elf_symver): Temporarily modify lex_type + to include '@' in symbol names when parsing versioned symbols + rather than calling get_symbol_end multiple times. + * config/tc-i370.c (register_name): Format fixes. Don't call + get_symbol_end after parsing number. + * config/tc-mn10200.c (data_register_name): Format fixes. Hoist + code out of conditional. + (address_register_name): Likewise. + (other_register_name): Likewise. + * config/tc-mn10300.c (r_register_name): Likewise. + (xr_register_name): Likewise. + (data_register_name): Likewise. + (address_register_name): Likewise. + (other_register_name): Likewise. + * config/tc-ppc.c (register_name): Likewise. + * config/tc-s390.c (register_name): Likewise. + +2001-07-27 Stephane Carrez + + * config/tc-m68hc11.c (md_estimate_size_before_relax): Fix bsr + and bra relax: update fragP->fr_fix after the fixup. + +2001-07-27 Tracy Kuhrt + + * read.c (s_set): Check for missing symbol name. + +2001-07-26 Alan Modra + + * write.c (relax_segment ): Account for fr_fix. + +2001-07-25 H.J. Lu + + * config/tc-mips.c (md_estimate_size_before_relax): Make sure + we treat weak like extern only for ELF. + (mips_fix_adjustable): Make sure we don't adjust extern/weak + symbols only for ELF. + +2001-07-25 Chris Demetriou + + * config/tc-mips.c: Fix spelling error in comment. + +2001-07-25 Dave Brolley + + * app.c (LEX_IS_PARALLEL_SEPARATOR): New macro. + (IS_PARALLEL_SEPARATOR): New macro. + (do_scrub_begin): Set up characters in tc_parallel_separator_chars + as LEX_IS_PARALLEL_SEPARATOR, if it is defined. + (do_scrub_chars): Handle LEX_PARALLEL_SEPARATOR chars like + LEX_LINE_SEPARATOR except that we go to state 1 (as if the label has + been seen). + +2001-07-24 Alan Modra + + * Makefile.am (DEP_FLAGS): Define, add -DOBJ_MAYBE_ELF. + (DEP1, DEPTC, DEPOBJ, DEP2): Use it. + Update dependencies with "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2001-07-23 Kazu Hirata + + * config/tc-alpha.h: Fix formatting. + * config/tc-arc.c: Likewise. + * config/tc-d10v.h: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i386.h: Likewise. + * config/tc-i960.h: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-ia64.h: Likewise. + * config/tc-m32r.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-m88k.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-pdp11.c: Likewise. + * config/tc-pj.h: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-sparc.h: Likewise. + * config/tc-tic80.c: Likewise. + * config/tc-w65.h: Likewise. + +2001-07-23 Alan Modra + + * symbols.c (S_GET_VALUE): Don't treat O_constant and local + symbols specially. Always resolve, adding fr_address to value. + * write.c (write_object_file): Don't add fr_address to sym values. + (relax_frag): Likewise. + (relax_segment): Likewise. + * config/obj-ieee.c (do_symbols): Likewise. + * config/tc-cris.c (md_convert_frag): Likewise. + * config/tc-fr30.c (md_convert_frag): Likewise. + * config/tc-i386.c (md_convert_frag): Likewise. + * config/tc-m32r.c (md_convert_frag): Likewise. + * config/tc-m68hc11.c (md_convert_frag): Likewise. + * config/tc-mcore.c (md_convert_frag): Likewise. + * config/tc-mips.c (mips16_extended_frag): Likewise. + * config/tc-ns32k.c (md_convert_frag): Likewise. + * config/tc-m68k.c (md_convert_frag_1): Likewise. + (BRANCHBWL, BRABSJUNC, BRABSJCOND, BRANCHBW, FBRANCH, DBCCLBR, + DBCCABSJ, PCREL1632, PCINDEX, ABSTOPCREL): Decrement. + (md_relax_table): Remove first four entries. Format. + (md_estimate_size_before_relax): Remove old_fix. Don't bother + setting fr_var. Simplify byte branch checks. + +2001-07-23 Alan Modra + + * config/tc-hppa.c (pa_parse_nonneg_cmpsub_cmpltr): Remove + "isbranch" param as all calls have it set. + (pa_parse_neg_cmpsub_cmpltr): Likewise. + (pa_parse_nonneg_add_cmpltr): Likewise. Remember result of + strcasecmp in "nullify" var. + (pa_parse_neg_add_cmpltr): Likewise. + (pa_ip): Don't "save_s" unnecessarily. Update calls to above + functions. Don't print wrong conditions in error messages. + +2001-07-23 Andreas Jaeger + + * config/tc-s390.c (s390_force_relocation): Removed. + + * config/tc-s390.h: Remove double declaration of + TC_FORCE_RELOCATION. + +2001-07-22 H.J. Lu + + * config/tc-mips.c (s_mips_end): Remove unused variables. + (s_mips_frame): Add ATTRIBUTE_UNUSED. + +2001-07-17 Andreas Schwab + + * config/tc-m68k.c (md_pseudo_table) [OBJ_ELF]: Add .file and + .loc. + (md_assemble) [OBJ_ELF]: Call dwarf2_emit_insn before emitting + insn. + * config/tc-m68k.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + +2001-07-17 matthew green + + * config/tc-i386.c (comment_chars): Don't use '/' as comment start if + TE_NetBSD. + (line_comment_chars): Set to '/' if TE_NetBSD. + +2001-07-14 matthew green + + * configure.in (i386-*-netbsdelf*): New target. + * configure: Regenerate. + +2001-07-10 Mark Elbrecht + + * config/obj-coff.c (coff_frob_symbol): Don't merge if the storage + class of the non-debug symbol is C_NULL. + +2001-07-10 Anders Norlander + + * doc/as.texinfo (Incbin): Fix grammatical errors. + +2001-07-10 Nick Clifton + + * depend.c: Use FOPEN_.. macros in calls to fopen(). + * input-file.c: As above. + * itbl-ops.c: As above. + * listing.c: As above. + * output-file.c: As above. + * read.c: As above. + +2001-07-08 Anders Norlander + + * read.c (s_incbin): New .incbin function. + * read.c (potable): Add "incbin" pseudo-op. + * read.h: Add s_incbin prototype. + * doc/as.texinfo (incbin): Document .incbin pseudo-op. + * NEWS: Mention new feature. + +2001-07-07 Nick Clifton + + * ecoff.c (add_file): Only set debug_type to DEBUG_NONE if it is + DEBUG_UNSPECIFIED. + +2001-07-06 John Healy + + * cgen.c (gas_cgen_save_fixups): Modified to allow more than one + set of fixups to be stored. + (gas_cgen_restore_fixups): Modified to allow the fixup chain to be + restored to be chosen from any that are saved. + (gas_cgen_swap_fixups): Modified to allow the current set of + fixups to be swapped with any other set that has been saved. + (gas_cgen_initialize_saved_fixups_array): New routine. + * cgen.h: Modifed prototypes for gas_cgen_save_fixups, + gas_cgen_restore_fixups, and gas_cgen_swap_fixups. Added definitions + or MAX_SAVED_FIXUP_CHAINS. + * config/tc-m32r.c (assemble_two_insns): Changed calls to fixup + store, swap and restore fuctions to reflect the new interface. + +2001-07-06 Nick Clifton + + * config/tc-m68k.c (md_estimate_size_before_relax): Catch and + ignore empty, ineffectual alignment frags when deciding if a + branch can be short. + +2001-07-05 Steve Ellcey + + * config/tc-ia64.c (special_section): Add SPECIAL_SECTION_INIT_ARRAY + and SPECIAL_SECTION_FINI_ARRAY. + (special_section_name): Add .init_array and .fini_array. + (md_pseudo_table): Add init_array and fini_array. + (md): Add pointer_size and pointer_size_shift fields. + (setup_unwind_header): New static function. + (output_unw_records): Modify to use setup_unwind_header. + (generate_unwind_image, dot_endp): Modify to use md.pointer_size and + md.pointer_size_shift. + (md_begin): Initialize md.pointer_size and md.pointer_size_shift. + +2001-07-05 Ben Elliston + + * README (Supported platforms): m88k no longer suffers bitrot. + + * config/tc-m88k.c (md_pseudo_table): Remove redundant "global". + +2001-07-05 Alan Modra + + * struc-symbol.h (struct local_symbol): Rename lsy_offset to + lsy_value. Correct typos in comments. + * symbols.c (local_symbol_make): Update for name change. + (local_symbol_convert): Likewise. + (colon): Likewise. + (S_GET_VALUE): Likewise. + (S_SET_VALUE): Likewise. + (print_symbol_value_1): Likewise. + (resolve_symbol_value): Likewise. Don't divide local sym values + by OCTETS_PER_BYTE twice. + +2001-07-04 Jim Wilson + + * config/tc-ia64.c (md_pseudo_table): Add 2byte, 4byte, and 8byte. + + * config/tc-ia64.c (is_conditional_branch): Rewrite to exclude mod + sched branches. + +2001-07-05 Ben Elliston + + * read.c (s_fill): Correct spelling error in comments. + + * doc/c-m88k.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add c-m88k.texi. + * doc/Makefile.in: Regenerate. + * doc/all.texi: Set M880X0. + * doc/as.texinfo: Hook in m88k-dependent documentation. + +2001-07-04 Eric Christopher + + * doc/c-mips.texi (MIPS Opts): Document 12000 as valid cpu. + + * config/tc-mips.c (mips_cpu_info_table): Add rm5200, rm5231, rm5261, + and rm5721 as valid cpu strings. + (md_show_usage): Add rm5200, rm5231, rm5261, rm5721. + +2001-07-04 Richard Sandiford + + * config/tc-mips.c (md_apply_fix): Prevent addend from becoming zero + if it's expected to be non-zero. + +2001-07-03 Nick Clifton + + * config/tc-sh.c (sh_frob_section): Replace symbol_get_frag() with + fscan->fx_frag. + + * write.c (TC_FINALIZE_SYMS_BEFORE_SIZE_SEG): Default to 1. + (write_object_file): Set finalize_syms to + TC_FINALIZE_SYMS_BEFORE_SIZE_SEG just before size_segs is + called. + + * doc/internals.texi: Document + TC_FINALIZE_SYMS_BEFORE_SIZE_SEG. + +2001-07-02 Alan Modra + + * config/tc-ppc.c: Formatting fixes. + +2001-07-01 Ben Elliston + + * config/tc-m88k.c: Back out warning fixes from 2001-06-24, as + they cause some subtle breakage. Will fix them again later. + +2001-06-28 Nick Clifton + + * config/obj-coff.c (obj_coff_ln): Treat a .ln directive + outside of a function as a .appline directive. + +2001-06-28 Eric Christopher + H.J. Lu + + * config/tc-mips.c (mips_arch): New. Use mips_arch instead + of mips_cpu for the ISA selection. + (md_longopts): Add OPTION_MARCH and OPTION_MTUNE. + (md_parse_option): Handle OPTION_MARCH and OPTION_MTUNE. + (mips_tune): New. Use mips_tune for scheduling and optimization + issues. + (append_insn): Use mips_tune and mips_arch. + (macro_build): Ditto. + (mips_ip): Ditto. + (md_begin): Handle mips_arch, mips_tune and mips_cpu. For + backwards compatability mips_cpu generates arch and tune. + (md_show_usage): Document new behavior. + + * doc/c-mips.texi (MIPS Opts): Document -march and -mtune. + Deprecate -mcpu. + + * NEWS: Update. + +2001-06-27 Nick Clifton + + * write.c (write_object_file): Do not set finalize_syms until + after the segments have been sized. Some backends may still + need to access the syms's frags in order to adjust relaxed + frags. + + * config/tc-arm.c (do_ldst): Use MVN to build simple inverted + constants. + +2001-06-27 Alan Modra + + * write.c (fixup_segment ): Don't + subtract MD_PCREL_FROM_SECTION for 68k. + (fixup_segment ): Only fudge + by adding MD_PCREL_FROM_SECTION for 68k or if not already pcrel. + +2001-06-27 Tracy A. Kuhrt + + * write.c (fixup_segment ): If + pcrel, subtract MD_PCREL_FROM_SECTION value. + +2001-06-24 Ben Elliston + + * stabs.c (generate_asm_file): Make local variable `len' a size_t. + +2001-06-24 Jakub Jelinek + + * config/tc-alpha.c (tc_gen_reloc): Handle relocs against SEC_MERGE + section symbols the same way as externs. + +2001-06-24 Ben Elliston + + * config/tc-m88k.c (md_number_to_imm): Remove; unused since 1993. + (emit_relocations): Ditto. + (s_bss): Ditto. + (md_begin): Reformat comments to conform to the GNU standards. + (md_assemble): Ditto. + + * config/tc-m88k.c (get_reg): Adjust type of `reg_prefix' to char. + (md_parse_option): Mark parameters as unused. + (md_show_usage): Ditto. + (calcop): Adjust type of `reg_prefix' to char. + (get_reg): Ditto. + (getval): Adjust type of local `c' to char. + (md_create_short_jump): Mark from_addr, to_addr params as unused. + (md_create_long_jump): Ditto. + (md_estimate_size_before_relax): Mark parameters as unused. + + * config/tc-m88k.c (md_pseudo_table): Properly terminate the table + to allay a possible compiler warning. + +2001-06-22 Nick Clifton + + * doc/internals.texi (CPU backend): Document md_atof. + +2001-06-22 Matthew Wilcox + + * config/tc-hppa.c (pre_defined_registers): Add %mrp (millicode + return pointer) alias for %r2 or %r31, depending on 32 or 64 bit + architecture. + +2001-06-21 Philip Blundell + + * config/tc-arm.c (cplong_flag): Rename to long_flag. All uses + updated. + (insns): Remove entry for adrl. Add long_flag for adr. + (do_adr): Handle `l' suffix. + (do_adrl): Delete. + +2001-06-21 Alan Modra + + * config/tc-hppa.c (CHECK_FIELD_WHERE): Define. + (md_apply_fix): Use it here. Replace printf with equivalent + as_bad_where. + (tc_gen_reloc): Use as_bad_where instead of as_bad. + (md_apply_fix): Here too. + * config/tc-i386.c (tc_gen_reloc): Use as_bad_where instead of as_bad. + * config/tc-m68k.c (tc_gen_reloc): Likewise. + (md_convert_frag_1): Likewise. + +2000-06-20 Tom Rix + + * config/tc-ppc.c (ppc_comm): Change default alignment to 4 bytes. + +2001-06-18 H.J. Lu + + * doc/Makefile.am (info): Depend on $(MANS). + (as.1): Remove the prefix `$(srcdir)/'. + * doc/Makefile.in: Regenerated. + + * as.1: Removed. + +2001-06-18 Philip Blundell + + * config/tc-arm.c (do_msr): Remove restriction on usage of + immediate operands. + +2001-06-19 Alan Modra + + * dwarf2dbg.c (dwarf2_finish): Output file info even when no + line info. + +2001-06-13 Philip Blundell + + * config/tc-arm.c (thumb_shift): Improve wording of error message. + (do_t_arit): Likewise. + +2001-06-13 Nick Clifton + + * config/tc-sh.c (md_pseudo_table): Only intercept the .file and + .loc pseudos if the dfwarf2 functions are available. + (md_assemble): Only call dwarf2_emit_insn if it is available. + + * expr.c: Fix typo in comment. + +2001-06-12 Nick Clifton + + * doc/as.texinfo (Infix Ops): Document that comparison and + combiner operators can be used as infix operators. + +2001-06-12 Peter Jakubek + + * config/tc-m68k.c (parse_mri_control_operand): Fix handling + of AND/OR. + (swap_mri_condition): Add HS (alias fo CC) and LO (alias for CS). + (reverse_mri_condition): Likewise. + (swap_mri_condition): Issue warning for conditions that can not be + swapped. + (build_mri_control_operand): Fix order of operands (swapped). + (build_mri_control_operand): Allow upper case extension in structured + control directives. + (s_mri_else): Likewise. + (s_mri_next): Likewise. + (s_mri_for): Likewise. + (s_mri_if): Fix handling comment ('*') in mri mode. + (s_mri_while): Likewise. + * macro.c (macro_expand): Allow macro invocation with empty + extension. + +2001-06-12 Nick Clifton + + * config/tc-arm.c: Fix test for overlow of literal pool. + +2001-06-11 H.J. Lu + + * NEWS: Updated for the new -n option for the MIPS assembler. + + * config/tc-mips.c (md_show_usage): Add -n. + + * doc/as.texinfo: Document the new -n option. + * doc/c-mips.texi: Likewise. + * doc/as.1: Regenerated. + +2001-06-10 Alan Modra + + * config/obj-coff.c (obj_coff_section): Formatting fix. + + * config/tc-i386.c (md_assemble): Accept branch hints as ",pt" and + ",pn". + +2001-06-08 H.J. Lu + + * config/tc-mips.c (warn_nops): New variable. Set to 0 to + disable warning about all NOPS that the assembler generates. + (macro): Warn NOPS generated only if warn_nops is not 0. + (md_shortopts): Add `n'. + (md_parse_option): Set warn_nops to 1 for `n'. + +2001-06-08 H.J. Lu + + * config/tc-mips.c (mips_ip): Properly handle illegal operands. + +2001-06-08 H.J. Lu + + * config/tc-mips.c (md_apply_fix): Don't adjust common + extern/weak symbols for ELF. + (md_estimate_size_before_relax): Treat weak like extern for + ELF. + (mips_fix_adjustable): Don't adjust extern/weak symbols for + ELF. + +2001-06-08 Alan Modra + + * Makefile.am: 'som' is not wrongly spelled 'some'. + * Makefile.in: Regenerate. + + * config/tc-mips.c (mips16_mark_labels): Reduce number of calls to + S_GET_VALUE by using a temp. + (append_insn): Likewise, and for S_SET_VALUE too. + (mips_emit_delays): Likewise. + (my_getExpression): Likewise. + (md_apply_fix): Likewise. Use "valueT" rather than "long" for "value". + (mips16_extended_frag): Remove code concerned with avoiding + locking in a frag address now that symbols are not finalized until + relaxation is complete. Cater for first relaxation pass having + bogus addresses. Use relax_marker to reliably determine whether a + symbol frag has been reached on the current pass. + +2001-06-07 H.J. Lu + + * configure.in: Move "mips-*-linux-gnu*" before "mips-*-gnu*". + * configure: Regenerate. + +2001-06-07 H.J. Lu + + * configure.in: Use MIPS_STABS_ELF for Linux/mips and remove + ecoff emulation. + * configure: Regenerate. + +2001-06-07 H.J. Lu + + * config/tc-mips.c (mips_pseudo_table): Add "extern" if + MIPS_STABS_ELF is defined. + +2001-06-06 Nick Clifton + + * as.c (show_usage): Remove L from listing options. It is not a + generic option. + +2001-06-06 Christian Groessler + + * config/tc-z8k.c: Removed many warnings by removing unused + variables and tagging unused parameters as such. + (md_begin): Fixed a typo (","instead of ";"). + (struct ctrl_table): Add parentheses to initialize array + correctly. + (struct flag_table): Likewise. + (struct intr_table): Likewise. + (struct table): Likewise. + (check_operand): "#if 0"'ed since it doesn't seem to be used. + +2001-06-06 Peter Jakubek + + * config/tc-m68k.c (md_show_usage): Add all supported ColdFire + options to list (e.g. m5206e, m5307, m5407). + +2001-06-06 Martin Schwidefsky + + * config/tc-s390.h (TC_FORCE_RELOCATION): Always emit relocations + BFD_RELOC_VTABLE_INHERIT and BFD_RELOC_VTABLE_ENTRY. + +2001-06-06 Alan Modra + + * config/tc-i386.c (md_assemble): Handle Pentium4 branch hints. + : Remove dead code. + +2001-06-06 Tracy Kuhrt + + * as.c (parse_args): Correct option name "listing-lhs-width2". + +2001-06-05 Nick Clifton + + * symbols.c (S_SET_EXTERNAL): Do not override a section symbol's + status. + +2001-05-30 Richard Henderson + + * read.c (emit_leb128_expr): Call md_cons_align. + +2001-05-28 Jeff Sturm + + * config/tc-sparc.c (md_apply_fix3): Handle BFD_RELOC_SPARC_UA16, + BFD_RELOC_SPARC_UA32 and BFD_RELOC_SPARC_UA64. + (tc_gen_reloc): Likewise. + (sparc_cons_align): Don't clear sparc_no_align_cons. + (cons_fix_new_sparc): Substitute BFD_RELOC_SPARC_UA{16|32|64} for + BFD_RELOC_{16|32|64} iff sparc_no_align_cons is set. + +2001-05-27 Alan Modra + + * write.c (relax_segment ): Check the section of a + symbol to determine whether it is absolute rather than comparing + its frag against zero_address_frag as listings play tricks with + frags. + + * config/tc-m68k.c (md_assemble): Ensure variable part of frag is + allocated in the same chunk as the fixed part. + +2001-05-26 Alan Modra + + * write.c (relax_segment ): Calculate growth using + addresses before stretch. Prevent repeated error messages. + From Peter Jakubek + Use as_bad_where and as_warn_where to pinpoint errors. + +2001-05-25 Alan Modra + + * symbols.c (resolve_symbol_value): Always set segment, even when + not finalizing symbol value. + + * config/obj-ieee.c (write_object_file): Set finalize_syms. + * config/obj-coff.c (write_object_file): Likewise. + * (size_section): Remove rs_space assert as fr_symbol is no longer + removed. + (fill_section): Likewise. + + * configure.in: Replace linuxoldld with linux*oldld. + * configure: Regenerate. + + From 2.11 branch 2001-03-30 Richard Henderson + * config/tc-i386.c (md_convert_frag): Don't die on local symbols + that have been finalized. + + * symbols.c (resolve_symbol_value): Clear sy_resolving before + taking exit_dont_set_value. + + * write.c (relax_segment ): Don't zap fr_symbol when + relaxing. + +2000-05-24 Tom Rix + + * config/obj-coff.c (add_lineno): xcoff allows negative line + numbers + * config/tc-ppc.c (ppc_stabx): fix generated symbol + +2001-05-24 Alan Modra + + * write.c (write_object_file): Set finalize_syms = 1 before + size_seg is called. + +2001-05-23 Thiemo Seufer + + * config/tc-mips.c (ISA_HAS_64BIT_REGS): Add ISA_MIPS64 as 64 bit + architecture, remove erraneous ISA_MIPS32. + (md_show_usage): Add MIPS r12k support. + (mips_cpu_info_table): Add MIPS r12k support. + +2001-05-22 Alan Modra + + * config/tc-arc.c (md_assemble): Use is_end_of_line instead of + testing for NULs. + + * symbols.c (resolve_symbol_value): Remove "finalize" param, + instead use finalize_syms directly. Don't treat expressions + specially with regard to finalize_syms. Update calls to self. + (resolve_local_symbol): Update call to resolve_symbol_value. + (S_GET_VALUE): Likewise. Return resolve_symbol_value if + !finalize_syms. + * symbols.h (resolve_symbol_value): Update prototype. + * config/obj-aout.c (obj_crawl_symbol_chain): Update call + to resolve_symbol_value. + * config/obj-bout.c (obj_crawl_symbol_chain): Likewise. + * config/obj-coff.c (do_relocs_for): Likewise. + (yank_symbols): Likewise. + (fixup_segment): Likewise. + * config/obj-vms.c (obj_crawl_symbol_chain): Likewise. + * config/tc-mips.c (md_convert_frag): Likewise. + * config/tc-ppc.c (ppc_frob_symbol): Likewise. + (ppc_fix_adjustable): Likewise. + * dwarf2dbg.c (dwarf2dbg_estimate_size_before_relax): Likewise. + (dwarf2dbg_convert_frag): Likewise. + * ehopt.c (eh_frame_estimate_size_before_relax): Likewise. + (eh_frame_convert_frag): Likewise. + * expr.c (make_expr_symbol): Likewise. + * write.c (adjust_reloc_syms): Likewise. + (write_object_file): Likewise. + (relax_segment): Likewise. + (fixup_segment): Likewise. + (finalize_syms): Init to zero, and update comment. + (write_object_file): Set finalize_syms to 1 rather than 2. + * doc/internals.texi (sy_value): Mention finalize_syms. + (S_GET_VALUE): Remove restriction on when S_GET_VALUE can be called. + + * config/tc-m68k.c (relaxable_symbol): Only treat external symbols + as relaxable if embedded system, make weak syms non-relaxable. + Move definition.. + (tc_m68k_fix_adjustable): ..so it can be used here. + (md_apply_fix_2): Sign extend without conditional. + + * config/tc-v850.c: Update copyright. + +2001-05-16 Jeff Johnston + + * cgen.c (gas_cgen_tc_gen_reloc): Changed error message when + howto entry is not found. + +2001-05-15 Alexandre Oliva + + * config/tc-mn10300.c (mn10300_force_relocation): Don't + optimize differences between symbols in code sections to + constants. + (mn10300_fix_adjustable): Don't adjust to section+offset + relocations pointing at symbols in code sections. + +2001-05-16 Alan Modra + + * config/tc-arc.c (md_assemble): Correct dwarf2_emit_insn param + for 8 byte insns. + * config/tc-i386.c (md_assemble): Call dwarf2_emit_insn before + opcodes are output rather than after. Delete insn_size. + * config/tc-v850.c (md_assemble): Similarly, but delete + total_insn_size. + +2001-05-14 Richard Henderson + + * ehopt.c (eh_frame_convert_frag): Fix missed subtype adjustment + last change. + +2001-05-14 Richard Henderson + + * ehopt.c (get_cie_info): Rename from eh_frame_code_alignment; + also collect whether to expect an FDE augmentation. + (check_eh_frame): Rewrite as a state machine. Track where in + an FDE we are located, skip any augmentation. + (eh_frame_estimate_size_before_relax): Get code alignment from + the fragment subtype. + (eh_frame_relax_frag, eh_frame_convert_frag): Likewise. + * read.c (emit_leb128_expr): Call check_eh_frame. + +2001-05-14 Alexandre Oliva + + * config/tc-mn10300.c (md_assemble): Anchor dwarf2 line info + before a relaxable insns. + +2001-05-13 Alexandre Oliva + + * config/tc-mn10300.c (tc_gen_reloc): Don't reject differences + between symbols if the base symbol is in the current section; + emit a PC-relative relocation instead. + +2001-05-12 Peter Targett + + * config/tc-arc.c: Update copyright and tidy source comments. + (md_pseudo_table): Add directive .cpu back as an alias for + .option. Add .file and .line for dwarf2 support. + (arc_mach_type): Make bfd_mach_arc_6 default. + (md_longopts): Add entry 'pre-v6' representing old command line + option when assembling for 'arc5' core versions. + (md_parse_option): Make OPTION_ARC same as OPTION_ARC6, for new + default behaviour. + (arc_code_symbol): Make symbol value for @h30 fixup expression + equal to O_constant. + (md_assemble): Call dwarf2_emit_insn. + Include "dwarf2dbg2.h". Formatting fixes throughout file. + * config/tc-arc.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + * doc/c-arc.texi (ARC_CORE_DEFAULT): Update to new default. + +2001-05-11 Jakub Jelinek + + * config/tc-ia64.c (special_linkonce_name): New. + (make_unw_section): Map .gnu.linkonce.t.FOO text section into + .gnu.linkonce.ia64unw{,i}.FOO. + (ia64_elf_section_type): Handle .gnu.linkonce.ia64unw{,i}.FOO. + (dot_endp): Add comment about it. + +2001-05-11 Nick Clifton + + * config/tc-arm.c (arm_handle_align): When truncating an aligned + block, ensure that the low order bits of the alignment are + preserved. + +2001-05-10 Alan Modra + + * config/obj-vms.c (obj_crawl_symbol_chain): Don't take address of + symbol_next. + + * config/tc-fr30.c (md_estimate_size_before_relax): Return size of + current variable part of frag. + * config/tc-m32r.c (md_estimate_size_before_relax): Likewise. + * config/tc-openrisc.c (md_estimate_size_before_relax): Likewise. + * config/tc-m68hc11.c (RELAX_STATE): Define. + (RELAX_LENGTH): Define. + (md_estimate_size_before_relax): Handle non-relaxable cases + separately from relaxable cases for clarity, and return correct + size for multi-pass relaxation. + * config/tc-tahoe.c (RELAX_LENGTH): Correct. + (md_estimate_size_before_relax): As for tc-m68hc11.c. + (md_convert_frag): Remove "length_code". + * config/tc-vax.c (RELAX_STATE): Define. + (RELAX_LENGTH): Define. + (md_relax_table): Add missing entry. + (md_estimate_size_before_relax): As for tc-m68hc11.c. + (md_convert_frag): Remove "length_code". + * config/tc-ns32k.c (md_estimate_size_before_relax): Simplify and + don't bother setting fr_var. Return correct size for multi-pass + relaxation. + * config/tc-v850.c (md_estimate_size_before_relax): Rewrite. + (md_convert_frag): Don't bother clearing fr_var. + (md_pseudo_table): Correct initialization. + * config/tc-h8500.c (md_convert_frag): Don't bother clearing fr_var. + (md_estimate_size_before_relax): No need to set fr_var. + * config/tc-mcore.c (md_convert_frag): Don't bother clearing fr_var. + (md_estimate_size_before_relax): No need to set fr_var. + +2001-05-09 Richard Henderson + + * config/tc-ia64.c (generate_unwind_image): Align the fragment + beginning a function's unwind info block. + +2001-05-09 Alexandre Oliva + + * config/tc-mn10300.c (md_apply_fix3): Accept PC-relative relocs. + +2001-05-08 Andreas Schwab + + * config/tc-m68k.c: Instead of replacing -1 by 64 in assignment to + fx_pcrel_adjust explicitly sign extend when reading it. + +2001-05-08 Alan Modra + + * config/tc-m68k.c (md_estimate_size_before_relax): Set fr_var + from md_relax_table, and combine some switch cases. + +2001-05-06 Alexandre Oliva + + * config/tc-mn10300.c (md_assemble): Subtract operand->shift + from offset in non-pcrel operands too. + +2001-05-06 Nick Clifton + + * config/tc-arm.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define. + * config/tc-arm.c (arm_handle_align): Do not insert more than + MAX_MEM_FOR_RS_ALIGN_CODE bytes. + (arm_frag_align_code): Use MAX_MEM_FOR_RS_ALIGN_CODE. + +2001-05-03 Thiemo Seufer + + * Makefile.am (TARG_ENV_HFILES): Add te-hppa64.h and te-hppalinux64.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in: Remove duplicate mips-*-ecoff* entry. + * configure: Regenerate. + + * config/obj-ecoff.c (obj_pseudo_table): Fix terminating entry. + (n_names): Cast away type mismatch. + (ecoff_sec_sym_ok_for_reloc): Add unused attribute. + (obj_ecoff_frob_symbol): Likewise. + * ecoff.c: (add_file): Add unused attribute. + (ecoff_directive_begin): Likewise. + (ecoff_directive_bend): Likewise. + (ecoff_directive_def): Likewise. + (ecoff_directive_dim): Likewise. + (ecoff_directive_scl): Likewise. + (ecoff_directive_size): Likewise. + (ecoff_directive_type): Likewise. + (ecoff_directive_tag): Likewise. + (ecoff_directive_val): Likewise. + (ecoff_directive_endef): Likewise. + (ecoff_directive_end): Likewise. + (ecoff_directive_ent): Likewise. + (ecoff_directive_extern): Likewise. + (ecoff_directive_file): Likewise. + (ecoff_directive_fmask): Likewise. + (ecoff_directive_frame): Likewise. + (ecoff_directive_mask): Likewise. + (ecoff_directive_loc): Likewise. + (mark_stabs): Likewise. + (ecoff_stab): Likewise. + (ecoff_frob_symbol): Cast away type mismatch. + (ecoff_padding_adjust): Likewise. + (ecoff_build_symbols): Likewise. + (ecoff_build_procs): Likewise. + (ecoff_build_aux): Likewise. + (ecoff_build_strings): Likewise. + (ecoff_build_fdr): Likewise. + (ecoff_build_debug): Likewise. + * itbl-ops.c (itbl_assemble): Variable initialization. + +2001-05-03 Alan Modra + + * config/tc-i386.c (i386_displacement): Call as_bad for bad GOTOFF + expressions rather than triggering an assert. + +2001-05-02 Johan Rydberg + + * config/tc-openrisc.c: New file. + * config/tc-openrisc.h: Likewise. + + * Makefile.am: Add OpenRISC target. + * Makefile.in: Regenerated. + + * configure.in (openrisc-*-*): Add target. + * configure: Regenerated. + +2001-05-02 Nick Clifton + + * config/tc-arm.c (arm_frag_align_code): Change error message to + more explanatory version. + +2001-04-29 Keith M Wesolowski + + * config/tc-mips.c (md_parse_option): Also accept + elf64-tradbigmips and elf64-tradlittlemips for OPTION_64. + +2001-04-27 David Mosberger + + * config/tc-ia64.c (dot_spillmem_p): Fix output_spill_?sprel_p() + argument passing order: predicate goes last, not first. + +2001-04-27 Sean McNeil + + * configure.in: Add arm-vxworks. + * configure: Regenerate. + +2001-04-26 Nick Clifton + + * config/tc-arm.c (arm_handle_align): New Function: Generate + no-op filled alignment frags. + (arm_frag_align_code): New Function: Create a code alignment frag. + (arm_init_frag): New Function: Initialse the target dependent + parts of a frag. + + * config/tc-arm.h (TC_FRAG_TYPE): Define. + (TC_FRAG_INIT): Define. + (HANDLE_ALIGN): Define. + (md_do_align): Define. + +2001-04-25 Nick Clifton + + * config/obj-coff.c (do_linenos_for): Check to see if the filename + symbol has been initialised before extracting its symbol index. + +2001-04-24 H.J. Lu + + * configure: Regenerated with the right version of autoconf. + +2001-04-24 Christian Groessler + + * config/tc-z8k.c (build_bytes): 12 and 16 bit displacements now + generate R_CALLR and R_REL16 relocations + +2000-04-20 Jason Eckhardt + + * config/tc-d10v.h (tc_frob_label): Update the symbol's frag + since frag_now can change after d10v_cleanup is called. + +2001-04-16 David O'Brien + + * configure.in: Add the em type for FreeBSD targets. + * configure: Regenerate. + +2001-04-14 Alexandre Oliva + + * struc-symbol.h (struct local_symbol): New TC_LOCAL_SYMFIELD_TYPE. + * symbols.c (local_symbol_convert): Call TC_LOCAL_SYMFIELD_CONVERT. + + * config/tc-mn10300.c (md_assemble): Simplify offset adjustment of + pc-relative relocations not placed at the end of the instruction. + +2001-04-13 Jim Wilson + + * tc-ia64.c (is_conditional_branch): Return true for br, brl, and br. + excluding br.i. + +2001-04-13 Jakub Jelinek + + * config/obj-elf.c (obj_elf_change_section): Add entsize argument, + handle SHF_MERGE and SHF_STRINGS. + (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. + (obj_elf_section): Allow additional argument specifying entity size. + * write.c (adjust_reloc_syms): Keep relocations against local symbols + in SEC_MERGE sections. + +2001-04-12 Jason Merrill + + * dwarf2dbg.c (process_entries): Don't optimize redundant line notes. + +2001-04-12 Alexandre Oliva + + * expr.c (operand): Pass &c to md_parse_name(). + * config/tc-ia64.h, config/tc-ppc.h, config/tc-tic54x.h: Adjust. + +2001-04-07 Steven J. Hill + + * config/tc-mips.c: Support ELF64 for traditional MIPS targets. + + * Makefile.am: (TARG_ENV_HFILES): Add tc-mips.h. + * Makefile.in: Regenerated. + + * configure.in: Use traditional MIPS targets for Linux/MIPS. + * configure: Regenerated. + +2001-04-06 Alexandre Oliva + + * config/tc-mn10300.c (xr_registers): Added `pc'. + +2001-04-05 Alan Modra + + * configure.in: Add h8500-*-coff and h8500-*-rtems targets. + * configure: Regenerate. + + * config/tc-h8500.c (md_estimate_size_before_relax): Add missing + cases, and always return size based on current fr_subtype. + (md_begin): Move initialization of md_relax_table.. + (md_relax_table): ..to static initializer. Set rlx_length for + UNDEF_WORD_DISP cases. + * config/tc-w65.c (md_estimate_size_before_relax): Likewise. + (md_begin): Likewise. + (md_relax_table): Likewise. + * config/tc-mcore.c (md_estimate_size_before_relax): Likewise. + (md_relax_table): Set rlx_length for UNDEF_WORD_DISP cases. + Set rlx_backward and rlx_forward to zero for unused states. + * config/tc-sh.c (md_estimate_size_before_relax): Likewise. + (md_relax_table): Set rlx_length for UNDEF_WORD_DISP cases. + (UNCOND12, UNCOND32): Remove duplicate defines. + +2001-04-04 Hans-Peter Nilsson + + * config/tc-cris.c (md_estimate_size_before_relax) : Don't emit + 32-bit branch, just set fragP->fr_subtype. Set fragP->fr_var. + : Always set fragP->fr_var using md_cris_relax_table. + Add cases to cover all relax states. + (cris_insn_first_word_frag): New. + (md_assemble): Call cris_insn_first_word_frag to get the first + frag in an insn, not frag_more. Don't call dwarf2_emit_insn at + end. Drop variable insn_size. + (gen_bdap): Call cris_insn_first_word_frag, not frag_more. + (cris_sym_leading_underscore): Wrap first as_bad parameter in _(). + (cris_sym_no_leading_underscore, s_cris_file, s_cris_loc): Ditto. + + * write.c (write_object_file): Reset broken word state before + calling relax_seg. + +2001-03-31 Alan Modra + + * listing.c (listing_listing): Enable listing on EDICT_NOLIST_NEXT + for one line if not already enabled. + * cond.c (s_elseif): Correct conditional assembly listing. + (s_else): Likewise. + + * cond.c (s_endif): Correct handling of "if .. elseif .." trees. + Don't abort on NULL current_cframe. + +2001-03-30 Alan Modra + + * dwarf2dbg.c (dwarf2_directive_file): Fix warnings. + (dwarf2dbg_convert_frag): Pass `finalize_syms' to resolve_symbol_value. + * config/obj-aout.c (obj_crawl_symbol_chain): Likewise. + * config/obj-bout.c (obj_crawl_symbol_chain): Likewise. + * config/obj-coff.c (do_relocs_for): Likewise. + (yank_symbols): Likewise. + (fixup_segment): Likewise. + * config/tc-ppc.c (ppc_frob_symbol): Likewise. + (ppc_fix_adjustable): Likewise. + * config/tc-mips.c (md_convert_frag): Likewise. + * config/obj-vms.c (obj_crawl_symbol_chain): Likewise. + * ehopt.c (eh_frame_convert_frag): Likewise. + * expr.c (make_expr_symbol): Likewise. + + * frags.h (struct frag): Add last_fr_address. Reorder fields for + better packing. + * symbols.c (resolve_symbol_value): Don't fix expression values + until relaxation is complete. + (resolve_local_symbol): Pass `finalize_syms' to resolve_symbol_value. + (S_GET_VALUE): Likewise, and return unresolved expression value. + * write.c (finalize_syms): New. + (relax_and_size_seg): Split into.. + (relax_seg): New function, returns 1 if anything changed.. + (size_seg): And the remainder of relax_and_size_seg. + (fixup_segment): Arrange for final resolution of sym values. + (adjust_reloc_syms): Likewise. + (write_object_file): Likewise, and repeatedly call relax_seg until + nothing more changes. + (relax_segment): Return 1 if anything changed. Use correct types + for rs_org `target' and `after'. + * write.h (finalize_syms): Declare. + (relax_segment): Update prototype. + + * config/tc-sh.c (md_estimate_size_before_relax): Add extra + do-nothing cases to switch to avoid abort on a second relaxation + pass, and tidy code a little. + * config/tc-cris.c (md_estimate_size_before_relax): Likewise. + * config/tc-h8500.c (md_estimate_size_before_relax): Likewise. + * config/tc-w65.c (md_estimate_size_before_relax): Likewise. + * config/tc-i386.c (UNCOND_JUMP, COND_JUMP, COND_JUMP86): Decrement. + (md_relax_table): Remove first four unused entries. Increment + rlx_length by one throughout table, and update comments to suit. + (md_estimate_size_before_relax): Return size of current variable + part of frag to reflect reality when relaxing more than once. + * config/tc-mcore.c (COND12, UNCD12): Rename to DISP12 throughout. + (COND32, UNCD32): Rename to DISP32 throughout. + (UNDEF_WORD_DISP): Renumber to 3. + (md_estimate_size_before_relax): Add extra do-nothing cases. + * config/tc-mn10200.c (md_estimate_size_before_relax): Rewrite. + * config/tc-mn10300.c (md_estimate_size_before_relax): Rewrite. + * config/tc-ns32k.c (md_estimate_size_before_relax): Add cases to + handle word and dword branches. + +2001-03-29 Hans-Peter Nilsson + + * config/tc-cris.h (tc_fix_adjustable): Allow only + BFD_RELOC_CRIS_32_GOTREL of the PIC relocs. + * config/tc-cris.c (cris_get_pic_suffix): Correct reloc type in + example in comment to valid type. + +2001-03-28 H.J. Lu + + * read.c (equals): Set to local for COFF only if it hasn't been + defined before. + +2001-03-28 Alan Modra + + * config/tc-hppa.c (DEFAULT_LEVEL): Define. + (md_begin): Use it when setting default architecture. + +2001-03-27 Nick Papadonis + + * read.c (equals): (for COFF) default symbols to being local. + +2001-03-27 Hans-Peter Nilsson + + * configure.in (cris-*-*): Change default emulation to criself. + (cris-*-*aout*): New rule. + * configure: Regenerate. + +2001-03-26 Martin Schwidefsky + + * config/tc-s390.c (tc_s390_fix_adjustable): Add test for + BFD_RELOC_390_GOTENT. + * config/tc-s390.h (TC_RELOC_RTSYM_LOC_FIXUP): Add test for + BFD_RELOC_390_GOTENT. + +2001-03-26 Nick Clifton + + * config/tc-s390.h (TC_FORCE_RELOCATION): Define. + * config/tc-s390.c (s390_force_relocation): New function: Force + relocations for VTINHERIT relocs. + +2001-03-23 Stephane Carrez + + * doc/as.texinfo: Put @c man begin to generate the as man page. + When generating man, define all the variables. Re-organize some + options to obtain better indentation of man page. + * doc/Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variable. + (as.1): Build from as.texinfo. + * doc/Makefile.in: Regenerate.Index: binutils/Makefile.am + +2001-03-25 Alan Modra + + * config/tc-i386.c (i386_scale): Accept an absolute expression for + scale factor, and return the end of the expression. + (i386_operand): Modify for above. + +2001-03-23 Nick Clifton + + * doc/as.texinfo: Document --listing-XXX command line switches. + Explain why listings behave differently when -pipe is used. + +2001-03-23 Richard Sandiford + + * write.c (fix_new_exp): Print an error if passed a register. + +2001-03-23 Hans-Peter Nilsson + + * config/tc-cris.c: Tweak attribution. Fix typos. PIC support. + (PIC_SUFFIX_CHAR): New macro. + (cris_get_pic_suffix, cris_get_pic_reloc_size): New functions. + (pic): New variable. + (md_longopts): New option --pic. + (OPTION_PIC): Define. + (md_estimate_size_before_relax): Tweak longish comment. + (md_create_long_jump): Make the long jumps generate ADD.D offset,PC. + (md_assemble): Handle a PIC relocation on prefix and normal + instruction operands. + : Handle + "complex" operand expressions. Call frag_more outside + gen_cond_branch_32 parameter list. + (cris_process_instruction): Handle PIC relocs on parsed + operand expressions. Validize PIC reloc sizes. + (get_autoinc_prefix_or_indir_op): Handle PIC suffix. + (gen_bdap): Handle "complex" operand expressions. + (gen_cond_branch_32): Use as_warn_where, not as_warn. Use + ADD.D offset,PC as jump instruction if generating PIC. Generate + error instead of crashing on complex expressions. + (cris_number_to_imm): Add segT parameter. All callers changed. + Use segT parameter, not now_seg, for segment of fixup. Handle + PCREL relocations but check that they are fully resolved. + (md_parse_option): Handle OPTION_PIC. + (tc_gen_reloc): Handle PIC relocs. + (md_show_usage): Update for --pic. + (md_apply_fix3): Renamed from md_apply_fix. + (md_pcrel_from): Accept emitting PCREL relocs when ELF. + (md_cris_force_relocation): Force relocation for PIC relocs. + + * config/tc-cris.h: Tweak attribution. + (MD_APPLY_FIX3): Define. + (IS_CRIS_PIC_RELOC): New macro. + (TC_RELOC_RTSYM_LOC_FIXUP): Define. + (tc_fix_adjustable): Don't adjust a globally visible symbol when + generating ELF. + (tc_frob_symbol): Avoid emitting undefined symbols. + +2001-03-20 Alan Modra + + * frags.h (struct frag): Add relax_marker. + * write.c (is_dnrange): Delete. + (relax_frag): Use correct types for `aim', `target', `address'. + Delete `offset', `was_address'. Test `relax_marker' instead of + using fragile (and slow) address test. + (relax_segment): Init and flip `relax_marker'. + +2001-03-19 Alan Modra + + * config/tc-i386.c (md_assemble ): Correct + used register name. + +2001-03-18 Stephane Carrez + + * config/tc-m68hc11.c (md_pseudo_table): Recognize xrefb to comply + with 'Motorola specification for assembly language input standard'. + +2001-03-17 Richard Henderson + + * dwarf2dbg.c (user_filenum, user_filenum_allocated): Remove. + (dwarf2_directive_loc): Don't use them. + (dwarf2_directive_file): Reject duplicate file definitions. + (get_filenum): Zero allocated memory. + (out_file_list): Complain about missing file definitions. + +2001-03-17 Alan Modra + + * read.c (do_org): Handle complex expressions. + * cgen.c (gas_cgen_finish_insn): Likewise. + +2001-03-15 David Mosberger + + * config/tc-ia64.c (md): New member keep_pending_output. + (ia64_flush_pending_output): Flush only if md.keep_pending_output + is not set. + (dot_xdata): Turn on md.keep_pending_output for the duration of + this function. + (dot_xfloat_cons): Ditto. + (dot_xstringer): Ditto. + (dot_xdata_ua): Ditto. + (dot_xfloat_cons_ua): Ditto. + +2001-03-15 Jim Wilson + + * config/tc-ia64.c (ia64_unrecognized_line, case '['): Add local + label support. + +2001-03-15 Alexandre Oliva + + * config/tc-sh.c (parse_reg): Match capital MACH and MACL. + +2001-03-15 DJ Delorie + + * stabs.c (s_stab_generic): Don't corrupt the notes obstack by + blindly freeing string if it isn't at the top of the obstack. + +2001-03-13 Alan Modra + + * config/tc-i386.c (RELOC_ENUM): Define. Use throughout file. + (NUM_FLAG_CODE): Define. + (lex_got): New function. + (got_reloc): New global var. + (x86_cons_fix_new): New function. + (x86_cons): New function. + (i386_immediate): Use lex_got here, replacing inline code. Change + "ignoring junk.." error message to "junk.." + (i386_displacement): Likewise. + * config/tc-i386.h (TC_PARSE_CONS_EXPRESSION): Define. + (x86_cons): Declare. + (TC_CONS_FIX_NEW): Define. + (x86_cons_fix_new): Declare. + +2001-03-12 Nick Clifton + + * config/tc-arm.c (md_begin): Always set machine type based on + cpu_variant. + +2001-03-07 Alan Modra + + * config/tc-i386.c (struct _i386_insn): Rename disp_reloc to reloc. + (md_assemble) : Use correct field of i.op[] + union. + : Use correct i.disp_reloc[]. + : Likewise. + +2001-03-06 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Clear bit zero of offset in + BLX(1) instruction. + +2001-03-06 Igor Shevlyakov + + * config/tc-m68k.c : Add 5407 to archs[] table. + (HAVE_LONG_BRANCH): Add mcf5407. + (select_control_regs): Recognize 5407. + +2001-03-02 Dave Brolley + + * config/tc-m32r.c (expand_debug_syms): Call frag_align_code rather + than m32r_do_align. + +2001-03-02 Richard Sandiford + + * config/atof-ieee.c (TC_LARGEST_EXPONENT_IS_NORMAL): New macro. + (gen_to_words): Print warnings if NaNs are found and the target CPU + does not support them. Allow largest exponent to be used in normal + numbers if TC_LARGEST_EXPONENT_IS_NORMAL evaluates to true. + +2001-02-28 Andreas Jaeger , Bo Thorsen + + * config/tc-i386.c (tc_gen_reloc): Remove ugly hack which is not needed + anymore since we use bfd_elf_generic_reloc now. + (md_apply_fix3): Only apply hack for partial_inplace if not using RELA. + +2001-02-27 Alan Modra + + * configure.in (BFD_VERSION): New. + (AM_INIT_AUTOMAKE): Use $BFD_VERSION. + * configure: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2001-02-26 Mark Elbrecht + + * config/obj-coff.c [BFD_ASSEMBLER] (obj_coff_section): Set + SEC_NEVER_LOAD when the 'n' flag is used. + Add SEC_NEVER_LOAD to matchflags. + +2001-02-24 Stephane Carrez + + * symbols.c (decode_local_label_name): Initialize message_format + only when an error is reported (perf pb due to I18N). + +2001-02-23 H.J. Lu + + * dwarf2dbg.c (dwarf2_directive_file): Call s_app_file (0) if + BFD_ASSEMBLER is not defined. + +2001-02-23 Richard Sandiford + + * config/tc-mn10300.c (md_apply_fix3): Don't mark a fixup as + done if it's against a symbol. + +2001-02-22 Timothy Wall + + * config/tc-ia64.c (ia64_target_format): Return ia64-aix-specific + target formats if applicable. + * config/te-ia64aix.h: New. Configuration for AIX5 on IA-64. + * Makefile.am (TARG_ENV_HFILES): Added config/te-ia64aix.h. + * Makefile.in: Regenerated. + * configure.in: Added configuration for ia64-*-aix*. + * configure: Regenerated. + +2001-02-21 David Mosberger + + * config/tc-ia64.c (enum operand_match_result): New type. + (operand_match): Change return type to operand_match_result. + Fix all returns appropriately, adding support for returning the + out-of-range result. + (parse_operands): New locals result, error_pos, out_of_range_pos, + curr_out_of_range_pos. Rewrite operand matching loop to give better + error messages. + +2001-02-21 David Mosberger + + * config/tc-ia64.c (struct unwind): Add member "prologue_count". + (dot_proc): Clear unwind.prologue_count to zero. + (dot_prologue): Increment unwind.prologue_count. + (dot_restore): If second operand is omitted, use + unwind.prologue_count -1 for "ecount" (# of additional regions to + pop). Decrement unwind.prologue_count by number of regions + popped. + +2001-02-21 Nick Clifton + + * doc/as.texinfo (Section): Note that some flags to the COFF + version of .section remove attributes rather than setting them. + +2001-02-20 Kazu Hirata + + * config/tc-pdp11.c: Fix formatting. + * config/tc-pdp11.h: Likewise. + +2001-02-20 Bo Thorsen + + * config/tc-i386.c (tc_i386_fix_adjustable): Fix GOTPCREL GOT + entry. + +2001-02-18 David O'Brien + + * configure.in (cpu_type, arch): Add a generic FreeBSD specification as + all FreeBSD platforms should look the same at this level. + * configure: Rebuilt. + * config/tc-i386.c: Add support for old FreeBSD a.out hosts. + +2001-02-18 lars brinkhoff + + * Makefile.am: Add PDP-11 target. + * configure.in: Likewise. + * config/tc-pdp11.c: New file. + * config/tc-pdp11.h: New file. + * doc/Makefile.am: Add PDP-11 documentation. + * doc/all.texi: Likewise. + * doc/as.texinfo: Likewise. + * doc/c-pdp11.texi: New file. + +2001-02-16 matthew green + + * cgen.c (gas_cgen_md_apply_fix3): Support BFD_RELOC_64. + +2001-02-13 Jim Wilson + + * config/tc-ia64.c (operand_match, case TAG13): Make a BFD_RELOC_UNUSED + reloc instead of a 0 reloc. + (md_apply_fix3): Check for BFD_RELOC_UNUSED instead of 0, and mark it + as done. + * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): Likewise. + +2001-02-13 Ian Lance Taylor + + * write.c (is_dnrange): Stop as soon as the address becomes + larger. + (relax_frag): Add segment parameter. Only call symbol_get_frag + once. Only call is_dnrange if the symbol is in the same segment, + and the symbol address is larger. + (relax_segment): Pass segment to md_relax_frag and relax_frag. + * write.h (relax_frag): Update declaration. + * config/tc-fr30.c (fr30_relax_frag): Add segment parameter. Pass + it to relax_frag. + * config/tc-m32r.c (m32r_relax_frag): Likewise. + * config/tc-m32r.h (md_relax_frag): Add segment parameter. + (m32r_relax_frag): Update declaration. + * config/tc-mips.h (md_relax_frag): Add segment parameter. + * config/tc-tic54x.h (md_relax_frag): Likewise. + * doc/internals.texi (CPU backend): Update documentation for + md_relax_frag. + +2001-02-13 Alan Modra + + * doc/c-i386.texi (i386-Arch): Add "jumps"/"nojumps" blurb. + Mention effect of < 386 architectures on jump promotion. + (i386-Jumps): xref above. Don't assume long disp is 32 bits. + + * config/tc-i386.c (no_cond_jump_promotion): New. + (set_cpu_arch): Parse "jumps" arch modifier. + (insn_size): Modify usage comment. + (ENCODE_RELAX_STATE): Reformat and protect macro arg. + (SIZE_FROM_RELAX_STATE): Rename to DISP_SIZE_FROM_RELAX_STATE. + (TYPE_FROM_RELAX_STATE): New define. + (UNCOND_JUMP, COND_JUMP): Renumber. + (md_relax_table): Reorder to suit. + (COND_JUMP86): New define. + (md_relax_table): Handle COND_JUMP86 cases. Add a few comments. + (md_assemble): Create frag var for jumps of max size, encode relax + state for COND_JUMP86. + (md_estimate_size_before_relax): Handle COND_JUMP86 cases, and + leave conditional jumps small if no_cond_jump_promotion. + (md_convert_frag): Likewise. + + * expr.c (operator): Don't bump input_line_pointer for two char + operators. Instead return operator size via new param num_chars. + (expr): Use above to parse multi-char operators correctly. + +2001-02-12 Jan Hubicka + + * config/tc-i386.c (i386_displacement): Fix handling of + BFD_RELOC_X86_64_GOTPCREL. + (i386_validate_fix): Likewise. + +2001-02-12 Philip Blundell + + * config/tc-arm.c (do_ldst): Improve warnings for unpredictable + ldrt/strt instructions. + +2001-02-11 Maciej W. Rozycki + + * config/tc-mips.c (macro): For M_LA_AB emit a + BFD_RELOC_MIPS_CALL16 relocation or a + BFD_RELOC_MIPS_CALL_HI16/BFD_RELOC_MIPS_CALL_LO16 pair instead of + BFD_RELOC_MIPS_GOT16 and + BFD_RELOC_MIPS_GOT_HI16/BFD_RELOC_MIPS_GOT_LO16, respectively for + loading the jump register when generating SVR4_PIC code. + +2001-02-10 Chris Demetriou + + * configure.in: Make 'mipself' and 'mipsecoff' emulations + map to MIPS-specific files, as they used to do before the + change on 2000-05-21. + * configure: Regerate. + +2001-02-10 Chris Demetriou + + * config/tc-mips.c (md_parse_option): Don't try to compile + ELF-only option code if not ELF. + +2001-02-08 David Mosberger + + * config/tc-ia64.h (md_elf_section_type): New macro. + (ELF_TC_SPECIAL_SECTIONS): Drop .IA_64.unwind and .IA_64.unwind_info + (they're now handled via ia64_elf_section_type. + + * config/tc-ia64.c (unwind): New members saved_text_seg, + saved_text_subseg, and force_unwind_entry. + (optimize_unw_records): New function to optimize away unnecessary + unwind directives. + (ia64_elf_section_type): New function. + (output_unw_records): Generate unwind info only if the size is + non-zero or if it's forced for some other reason (e.g., + handlerdata or a personality routine). + (generate_unwind_image): Don't switch back to previous + section---stay inside the unwind info section instead so that + handlerdata that may follow goes into the right place. + (dot_handlerdata): Force generation of unwind entry and save the + current active text segment before generating unwind image. + (dot_unwentry): Force generation of unwind entry. + (dot_personality): Ditto. + (dot_endp): Generate unwind table entry only if there is + some unwind info or the unwind entry was forced. + + * config/tc-ia64.c (make_unw_section_name): New macro to form + unwind section name. + (generate_unwind_image): Add "text_name" argument. Use it to + form unwind section name. + (dot_handlerdata): Determine current segment (section) name and + pass it to generate_unwind_image(). + (dot_endp): Determine current segment (section) name and use + it to determine the appropriate unwind section name. + (ia64_md_do_align): Add missing ATTRIBUTE_UNUSED declarations to + n, fill, and max arguments. + +2001-02-09 Schwidefsky + + * Makefile.am: Add linux target for S/390. + * configure.in: Likewise. + * config/tc-s390.c: New file. + * config/tc-s390.h: New file. + +2001-02-09 Alexandre Oliva + + * config/tc-sh.c (md_pseudo_table): Add uaquad. Use s_uacons for + 2byte, 4byte and 8byte. + +2001-02-08 Alan Modra + + * config/tc-hppa.c (pa_build_unwind_subspace): Don't call + md_number_to_chars with size > sizeof (valueT). + +2001-02-06 H.J. Lu + + * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): Do fixup if + there is no relocation. + +2001-02-06 H.J. Lu + + * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): New. Defined. + + * config/tc-ia64.c (md_parse_option): Only accept the valid + ia64 options on "-axxx". + +2001-02-05 Jim Wilson + + * config/tc-ia64.c (errata_nop_necessary_p): Return 0 instead of + aborting for invalid operands. + +2001-02-06 Alan Modra + + * config/tc-hppa.c (fix_new_hppa): Pass in unwind directly rather + than via pointer. Update all callers. + (UNWIND_LOW32): Define. + (UNWIND_HIGH32): Define. + (pa_build_unwind_subspace): Use the above macros instead of dumping + bitfields directly. Call frag_more once rather than multiple times. + (md_assemble): Use UNWIND_LOW32. + (pa_entry): Likewise + (pa_procend): Likewise. + (process_exit): Use UNWIND_HIGH32. + +2001-02-04 Stephane Carrez + + * config/tc-m68hc11.h (LISTING_HEADER): Use m68hc11_listing_header + function to select the header according to the cpu. + (md_after_pass_hook, md_do_align): Remove. + (md_cleanup, m68hc11_cleanup): Remove. + (md_pcrel_from_section): Declare. + * config/tc-m68hc11.c (build_dbranch_insn): Remove insn_size. + (build_jump_insn, build_insn): Likewise. + (m68hc11_listing_header): New function. + (m68hc11_cleanup): Remove. + +2001-02-02 Stephane Carrez + + * config/tc-m68hc11.c (relaxable_symbol): Relax externally visible + symbols because there is no support for shared libraries and these + symbols can't be overridden (unless they are weak). + +2001-02-01 Momchil Velikov + + * dwarf2dbg.c (out_debug_abbrev): Terminate the abbreviations + for the compilation unit with a zero byte. + +2001-01-30 Alan Modra + + * config/tc-hppa.c (pa_ip): Support 12 bit branches to absolute + destinations. Correct range check for 17 and 22 bit branches. + +2001-01-25 Nick Clifton + + * config/tc-m68k.c (tc_gen_reloc): Do not abort if tcbit is + still set. Issue an error message instead. + (md_estimate_size_before_relax): Delete unused variable + 'buffer_address'. Fixup parentheses around if statement. + +2001-01-23 Kazu Hirata + + * as.c: Fix formatting. + * ehopt.c: Likewise. + * messages.c: Likewise. + * stabs.c: Likewise. + * symbols.c: Likewise. + +2001-01-23 Ben Elliston + + * config/tc-m32r.c (m32r_handle_align): Declare type of fragp. + +2001-01-22 Kazu Hirata + + * config/tc-alpha.c: Fix formatting. + +2001-01-19 Kazu Hirata + + * config/tc-alpha.c: Fix formatting. + +2001-01-18 Kazu Hirata + + * config/tc-alpha.c: Fix formatting. + +2001-01-18 Nick Clifton + + * config/tc-arm.c (ldm_flags): Remove redundant bit from "fa" and + "da" flags. + (stm_flags): Remove redundant bit from "ed" and "da" flags. + +2001-01-18 Alexandre Oliva + + * configure.in (cpu_type, arch): Match i386 too. + * configure: Rebuilt. + +2001-01-16 Kazu Hirata + + * config/tc-i386.c: Fix formatting. + +2001-01-16 Alan Modra + + * config/tc-hppa.c (tc_gen_reloc): Use SEGREL32 instead of DIR32 + relocs for .PARISC.unwind section. + + * config/tc-hppa.c (pa_build_unwind_subspace): Build unwind + depending on section flags, not just for .text. + +2001-01-15 Jim Wilson + + * config/tc-ia64.c (ia64_flush_insns): Handle unwind directives + not immediately followed by an instruction. + +2001-01-15 Kazu Hirata + + * config/tc-m68hc11.c: Fix formatting. + +2001-01-15 Nick Clifton + + * symbols.c (colon): Change 'already defined symbol' from a + fatal error to an ordinary error. There is no reason why this + error should be fatal. + + * message.c (as_fatal): Delete output file, if one has been + created. + +2001-01-14 Alan Modra + + * config/tc-hppa.h (TARGET_FORMAT): Add hppa-linux variants. + +2001-01-14 Kazu Hirata + + * config/tc-alpha.c: Fix formatting. + * config/tc-arc.c: Likewise. + * config/tc-arc.h: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tahoe.c: Likewise. + * config/tc-vax.c: Likewise. + + * config/tc-arc.c: Fix formatting. + + * config/tc-arc.c: Fix formatting. + +2001-01-14 Alan Modra + + * config/tc-hppa.c (pa_build_unwind_subspace): Use SEGREL32 for + both 32 and 64 bit ELF. + + * config/tc-hppa.c (pa_ip): Store `a' flag in bit zero of operand + and don't bother storing `m' for "ce" completer. Tidy handling of + 'J' and 'K' operands to suit. Handle '<' and '>' operands. + +2001-01-14 Jan Hubicka + + * config/tc-i386.h (TARGET_MACH): New macro. + (i386_mach): Declare. + * config/tc-i386.c (i386_mach): New function. + +2001-01-13 Philip Blundell + + * doc/as.texinfo: Fix spelling and cross-references. + + * doc/c-arm.texi: Fix typos. Say that `;' is a line separator + character for all systems, not just GNU/Linux. Make it explicit + that `-k' doesn't affect code generation, just ELF flags. + +2001-01-13 Jan Hubicka + + * config/tc-i386.c (md_assemble): Check cpu_flags even for nullary + instructions. + +2001-01-12 Frank Ch. Eigler + + * cgen.c (gas_cgen_finish_insn): Call dwarf2_emit_insn. + +2001-01-12 Nick Clifton + + * as.c (print_args): Update copyright date to 2001. + +2001-01-12 Peter Targett + + * doc/c-arc.texi: New file. + Some sections to be expanded. + +2001-01-12 Alan Modra + + * config/tc-i386.c (md_longopts): Recognize "--64" only for ELF. + (md_parse_option): Always accept "--32". + +2001-01-11 Peter Targett + + * as.h (TC_ARC): Ensure struc-symbol.h included. + * as.c (dwarf2dbg.h): Include to remove implicit declaration + warnings. + * struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Define. + (TARGET_SYMBOL_FIELDS) added. + + * doc/Makefile.am (CPU_DOCS): Added c-arc.texi. + * doc/c-arc.texi: New file. + Some sections to be expanded. + * doc/as.texinfo: Update command-line options. + Removed outdated text for ARC dependant features, instead include + text from above file. + + * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Define local flag. + (TARGET_SYMBOL_FIELDS): Alias to previous definition. + (targ-cpu.h) header. + * config/tc-arc.h: + * config/tc-arc.c: New updated configuration for + ARC, including selection of core variants, and extensibility of + instructions, registers etc. through directives. + + * config/tc-arc.c (arc_extinst): Minor corrections for + error messages. + (arc_common) Likewise. Make alignment argument optional for local + symbols also, with default of zero. + +2001-01-11 Stephane Carrez + + * config/tc-m68hc11.c (md_estimate_size_before_relax): Fix + STATE_INDEXED_OFFSET when the symbol is undefined (16-bit offset). + (build_indexed_byte): Don't relax indexed byte, use 16-bit offset + and fix_new_exp() instead. + (md_convert_frag): For indexed post byte use the symbol value + rather than the displacement. + (md_relax_table): Fix indexed offset relax. + +2001-01-11 Stephane Carrez + + * config/tc-m68hc11.c (md_estimate_size_before_relax):Don't + relax weak symbols. + (relaxable_symbol): New function. + +2001-01-11 Andreas Jaeger + + * config/tc-i386.h (TC_RELOC_GLOBAL_OFFSET_TABLE): Removed, it's + not used anywhere. + +2001-01-10 Nick Clifton + + * config/tc-arm.c (arm_fix_adjustable): Define for OBJ_COFF. + * config/tc-arm.h (obj_fix_adjustable): Define for OBJ_COFF + +2001-01-10 Nick Clifton + + * symbols.c (DOLLAR_LABEL_CHAR): New constant - the magic + character used to dollar local symbols. + (LOCAL_LABEL_CHAR): New constant - the magic character used to + local label symbols. + (dollar_label_name): Use DOLLAR_LABEL_CHAR. + (fb_label_name): Prefix local labels with LOCAL_LABEL_PREFIX, + if defined. + Use LOCAL_LABEL_CHAR. + (decode_local_label_name): Skip LOCAL_LABEL_PREFIX. + Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR. + (S_IS_LOCAL): Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR. + +2001-01-08 Bo Thorsen + + * config/tc-i386.c (i386_immediate, i386_displacement): + GOTPCREL check fix. + +2001-01-07 Ian Lance Taylor + + * doc/c-i386.texi (i386-Arch): Remove spaces incorrectly inserted + in last change. + +2001-01-07 Philip Blundell + + * doc/as.texinfo (Bug Reporting): Update email address for + reports. + * README: Likewise. + +2001-01-06 Jan Hubicka + + * configure.in: Define DEFAULT_ARCH for i386. + * config/tc-i386.c (md_assemble): Return after the error message; + move testing for 64bit operands to proper place. + +2001-01-06 Jan Hubicka , Andreas Jaeger + + * doc/as.texinfo: Document '#' as comment character for i386 and + x86_64. Add AMD x86-64 into menu of machine dependent information. + + * doc/c-i386.texi: Document x86_64 extensions. + +2001-01-05 Jan Hubicka + + * config/tc-i386.c (md_assemble): Handle third byte of the opcode as prefix. + +2001-01-04 Jan Hubicka + + * config/tc-i386.c (cpu_arch): Add Pentium4 and modify sledgehammer entry. + * NEWS: Add note about Pentium4 support. + +2001-01-04 Jan Hubicka + + * config/tc-i387.c (pi, pte, pt): Update. + (type_names): Add new types. + +2001-01-03 Jan Hubicka + + * config/tc-i386.h (CpuK6, CpuAthlon, CpuSledgehammer, CpuMMX, Cpu3dnow, + CpuUnknown): Renumber + (CpuP4, CpuSSE2): New. + (CpuUnknownFlags): Add CpuP4 and CpuSSE2 + +2001-01-03 Philip Blundell + + * config/tc-alpha.c (alpha_force_relocation): Handle vtable + relocs. + (alpha_fix_adjustable): Likewise. + (md_apply_fix): Likewise. + +2000-12-31 H.J. Lu + + * listing.c (listing_message): Allocate string only if it is + used. + + * configure: Rebuild. + +2000-12-31 Hans-Peter Nilsson + + * doc/internals.texi (Relaxing with a table) : + Point out caveats with generating fixups for the opcode in a frag. + +2000-12-30 Jan Hubicka + + * configure.in: Add support for x86_64 and x86_64-*-linux-gnu* + * NEWS: Add x86_64. + +2000-12-29 H.J. Lu + + * listing.c (calc_hex): Print the variable part only if the + fragment type is rs_fill. + +2000-12-29 Hans-Peter Nilsson + + * doc/internals.texi (tc_conditional_pseudoop, + TC_LINKRELAX_FIXUP): Fix typos. + +2000-12-28 Richard Henderson + + * write.c (subsegs_finish): Fix thinko last change -- don't + "optimize" the alignment == 0 case. + +2000-12-28 Richard Henderson + + * as.h (rs_align_test): New. + * frags.c (NOP_OPCODE): Move default from read.c. + (MAX_MEM_FOR_RS_ALIGN_CODE): New default. + (frag_align_code): New. + * frags.h (frag_align_code): Declare. + * read.c (NOP_OPCODE): Remove. + (do_align): Use frag_align_code. + * write.c (NOP_OPCODE): Remove. + (get_recorded_alignment): New. + (cvt_frag_to_fill): Handle rs_align_test. + (relax_segment): Likewise. + (subsegs_finish): Align last subseg in section to the + section alignment. Use frag_align_code. + * write.h (get_recorded_alignment): Declare. + * config/obj-coff.c (size_section): Handle rs_align_test. + (fill_section, fixup_mdeps): Likewise. + (write_object_file): Use frag_align_code. + + * config/tc-alpha.c (alpha_align): Use frag_align_code. + (alpha_handle_align): New. + * config/tc-alpha.h (HANDLE_ALIGN): New. + (MAX_MEM_FOR_RS_ALIGN_CODE): New. + + * config/tc-i386.h (md_do_align): Use frag_align_code. + (MAX_MEM_FOR_RS_ALIGN_CODE): New. + + * config/tc-ia64.c (ia64_md_do_align): Don't do code alignment. + (ia64_handle_align): New. + * config/tc-ia64.h (HANDLE_ALIGN): New. + (MAX_MEM_FOR_RS_ALIGN_CODE): New. + + * config/tc-m32r.c (m32r_do_align): Remove. + (m32r_handle_align): New. + (fill_insn): Use frag_align_code. + * config/tc-m32r.h (md_do_align): Remove. + (HANDLE_ALIGN, MAX_MEM_FOR_RS_ALIGN_CODE): New. + * config/tc-m88k.c, config/tc-m88k.h: Similarly. + * config/tc-mips.c, config/tc-mips.h: Similarly. + + * config/tc-sh.c (sh_cons_align): Use rs_align_test. + (sh_handle_align): Likewise. Handle rs_align_code. + (sh_do_align): Remove. + * config/tc-sh.h (md_do_align): Remove. + (MAX_MEM_FOR_RS_ALIGN_CODE): New. + + * config/tc-sparc.c (sparc_cons_align): Use rs_align_test. + (sparc_handle_align): Likewise. Handle rs_align_code. + * config/tc-sparc.h (md_do_align): Remove. + (MAX_MEM_FOR_RS_ALIGN_CODE): New. + +2000-12-22 DJ Delorie + + * config/tc-d10v.c (md_assemble): set prev_seg and prev_subseg + when we assemble the first half of a pair. + +2000-12-22 H.J. Lu + + * config/tc-i386.c (reloc): Update the macro for non-bfd + assembler. + (BFD_RELOC_X86_64_GOTPCREL): Set to 0 for non-bfd assembler. + +2000-12-22 H.J. Lu + + * dwarf2dbg.c (dwarf2_finish): Remove #if BFD_ASSEMBLER. + +2000-12-20 Jan Hubicka + + * config/tc-i386.h (i386_target_format): Define even for ELFs. + (QWORD_MNEM_SUFFIX): New macro. + (CpuK6,CpuAthlon,CpuSledgehammer, Cpu64, CpuNo64, CpuUnknownFlags): + New macros + (CpuMMX,CpuSSE,Cpu3dnow, CpuUnknown): Renumber. + (IgnoreSize, DefaultSize, No_?Suf, FWait, IsString, regKludge, IsPrefix, + ImmExt): Renumber. + (Size64, No_qSuf, NoRex64, Rex64): New macros. + (Reg64, Imm32S, Imm64, Disp32S, Disp64): New macros. + (Imm8, Imm8S, Imm16, Imm32, Imm1, BaseIndex, Disp8, Disp16, Disp32, + InOutPortReg,ShiftCount, Control, Debug, Test, FloatReg, FloatAcc, + SReg2, SReg3, Acc, JumpAbsolute, RegMMX, RegXMM, EsSeg, InvMem): + Renumber. + (Reg, WordReg): Add Reg64. + (Imm): Add Imm32S and Imm64. + (EncImm): New. + (Disp): Add Disp64 and Disp32S. + (AnyMem): Add Disp32S. + (RegRex, RegRex64): New macros. + (rex_byte): New type. + * config/tc-i386.c (set_16bit_code_flag): Kill. + (fits_in_unsigned_long, fits_in_signed_long): New functions. + (reloc): New parameter "signed"; support x86_64. + (set_code_flag): New. + (DEFAULT_ARCH): New macro; default to "i386". + (default_arch): New static variable. + (struct _i386_insn): New fields Operand_PCrel; rex. + (flag_16bit_code): Kill; All tests replaced to "flag_code == CODE_64BIT" + (flag_code): New enum and static variable. + (use_rela_relocations): New static variable. + (flag_code_names): New static variable. + (cpu_arch_flags): Default to CpuUnknownFlags|CpuNo64. + (cpu_arch): Add "sledgehammer"; Add CPUAthlon to Athlon and CpuK6 to + K6 and Athlon. + (i386_align_code): Return plain "nop" for x86_64. + (mode_from_disp_size): Support Disp32S. + (smallest_imm_type): Support Imm32S and Imm64. + (offset_in_range): Support size of 8. + (set_cpu_arch): Do not clobber to Cpu64/CpuNo64. + (md_pseudo_table): Add "code64"; use set_code_flat. + (md_begin): Emit sane error message on hash failure. + (tc_i386_fix_adjustable): Support x86_64 relocations. + (md_assemble): Support QWORD_MNEM_SUFFIX, REX registers, + instructions supported on particular arch just partially, + output of 64bit immediates, handling of Imm32S and Disp32S type. + (i386_immedaite): Support x86_64 relocations; support 64bit constants. + (i386_displacement): Likewise. + (i386_index_check): Cleanup; support 64bit addresses. + (md_apply_fix3): Support x86_64 relocation and rela. + (md_longopts): Add "32" and "64". + (md_parse_option): Add OPTION_32 and OPTION_64. + (i386_target_format): Call even for ELFs; choose between + elf64-x86-64 and elf32-i386. + (i386_validate_fix): Refuse GOTOFF in 64bit mode. + (tc_gen_reloc): Support rela relocations and x86_64. + (intel_e09_1): Support QWORD. + +2000-12-15 Diego Novillo + + * config/tc-i386.c (intel_e09_1): Only flag as a memory operand if + it's not an offset expression. + (intel_e10_1): Ditto. Also, if the operand is an offset expression, + keep the braces '[' and ']' in the output string. + (intel_e11): Ditto. Also remove comparison intel_parser.op_modifier + != FLAT. There is no such op_modifier. + +2000-12-14 Michael Sokolov + + * dwarf2dbg.c: If we don't have , try including + if we have it. + +2000-12-13 Kazu Hirata + + * as.h: Fix formatting. + * cgen.h: Likewise. + * dwarf2dbg.c: Likewise. + * input-scrub.c: Likewise. + * read.h: Likewise. + +2000-12-13 Mark Elbrecht + + * configure.in (i386-*-msdosdjgpp): Set bfd_gas to yes. + configure: Regenerate. + +2000-12-13 Michael Sokolov + + * dwarf2dbg.c: #include only if it exists. + +2000-12-13 Rodney Brown + + * config/tc-hppa.c (pa_ip): Correct CHECK_FIELD typo. + (md_apply_fix): Here too. + +2000-12-12 Jim Wilson + + * config/tc-ia64.h (ia64_init): Add prototype. + +2000-12-12 H.J. Lu + + * dwarf2dbg.c: Enabled only if BFD_ASSEMBLER is defined. + + * read.h (outputting_stabs_line_debug): Change it to int. + * stabs.c (outputting_stabs_line_debug): Likewise. + +2000-12-12 Geoffrey Keating + + * config/obj-bout.c (obj_crawl_symbol_chain): Don't take + the address of a function result. + +2000-12-12 Franz Sirl + + * config/tc-ppc.c (md_pseudo_table): Add .file and .loc. + (md_assemble): Call dwarf2_emit_insn. + (shlib): Fix typo SHILB -> SHLIB. + (md_parse_option): Likewise. + (ppc_elf_validate_fix): Likewise: + * config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): New. + +2000-12-12 Nick Clifton + + * cgen.h: Fix formatting. + * input-scrub.c: Fix formatting. + * macro.c: Fix formatting. + * config/tc-mips.c: Fix formatting. + * doc/c-mips.texi: Fix formatting. + +2000-12-11 Jan hubicka + + * config/tc-i386.c (md_assemble): Refuse 's' and 'l' suffixes in the intel + mode; convert 'd' suffix to 's' or 'l'; remove all DWORD_MNEM_SUFFIX + references. + (intel_e09_1): Convert QWORD to 'l' suffix for FP operations; refuse + otherwise. + * config/tc-i386.h (DWORD_MNEM_SUFFIX): Kill. + (No_dSuf): Kill. + + * i386.h (*_Suf): Remove No_dSuf. + (d_suf, wld_Suf,sld_Suf, sldx_Suf, bwld_Suf, d_FP, sld_FP, sldx_FP) + Remove. + (i386_optab): Remove 'd' in the suffixes. + +2000-12-06 Mark Elbrecht + + * config/tc-i386.c (T_SHORT): Undefine before defining. + +2000-12-05 Kazu Hirata + + * config/tc-mips.c: Fix formatting. + +2000-12-04 Matthew Hiller + + * config/tc-d10v.c (flag_allow_gstabs_packing): New variable. + (md_longopts): New options --gstabs-packing, --no-gstabs-packing. + (md_show_usage): Ditto. + (md_parse_option): Ditto. + (d10v_cleanup): Writes pending instruction only if + ! outputting_stabs_line_debug || ! flag_allow_gstabs_packing. + Fix compile time warning messages. + + * doc/c-d10v.texi: Documents new options. + +2000-12-04 Matthew Hiller + + * stabs.c (outputting_stabs_line_debug): New variable. + (stabs_generate_asm_lineno): Set outputting_stabs_line_debug at + function entry and unset at function exit. + + * read.h (outputting_stabs_line_debug): New extern declaration. + + * as.c: Include dwarf2dbg.h for definition of dwarf2_finish. + + * dwarf2dbg.c: Fix compile time warning messages. + +2000-12-03 Kazu Hirata + + * config/tc-a29k.c: Fix formatting. + * config/tc-alpha.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-cris.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-m88k.c: Likewise. + * config/tc-pj.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tahoe.c: Likewise. + * config/tc-vax.c: Likewise. + +2000-12-01 Chris Demetriou + + * config/tc-mips.c (mips_ip): When calculating offsets, + don't accept as constant the difference between the + addresses of symbols in two different sections. + + * config/tc-mips.c (macro_build): Add new 'U' and 'J' operand + specifiers. + (validate_mips_insn): Likewise. Also, update 'B' operand + specifier to use OP_*_CODE20 constants and delete 'm' operand + specifier. + (mips_ip): Remove 'm' operand specifier, add 'U' and 'J' + operand specifiers. Change warning generated by 'B' operand + specifier to reflect its new multi-purpose usage. + + * config/tc-mips.c (mips_set_options): Use ISA_UNKNOWN rather than + -1, and update comment. + (file_mips_isa): Likewise. + (mips_cpu): Use CPU_UNKNOWN rather than -1, and update comment. + (ISA_HAS_COPROC_DELAYS, ISA_HAS_64BIT_REGS, gpr_interlocks): Use + ISA_* constants rather than hard-coded numbers. + (mips_cpu_info): New structure. + (mips_cpu_info_table): New table describing CPU and ISA names + and numbers. + (mips_cpu_info_from_name, mips_cpu_info_from_isa, + mips_cpu_info_from_cpu): New functions. + (mips_isa_to_str): New function to get string for ISA name. + (mips_cpu_to_str): Convert to use mips_cpu_info_from_cpu, and + return const char *. + (md_begin): Redo CPU and ISA selection logic, using + mips_cpu_info_from_*. Convert to use ISA_* constants rather + than hard-coded numbers. + (append_insn, mips_emit_delays, macro, macro2): Convert to use + ISA_* constants rather than hard-coded numbers. + (mips_ip): Convert to use mips_isa_to_str to get ISA name. + (md_longopts): Delete OPTION_NO_MIPS32. + (md_parse_option): Convert to use ISA_* constants rather than + hard-coded numbers. Make OPTIONS_MIPS32 case treat MIPS32 + as an ISA. Delete OPTION_NO_MIPS32 case. Convert OPTION_MCPU + to use strcasecmp to recognize "default" and to use + mips_cpu_info_from_name to get CPU numbers from argument. + (md_show_usage): Move -mips32 so it's with the rest of the ISA + flags. Change 4Kc, 4Kp and 4Km CPU entries to just be + mips32-4k. + (s_mipsset): Accept ISA value 32. + * doc/as.texinfo: Clean up MIPS options summary slightly, + remove -no-mips32. Add note about -mips4 and -mips32 + specifying those ISA levels. Delete -mips32 and -no-mips32 + cpu flag descriptions. + * doc/c-mips.texi: Add -mips32 to list of ISA switches. Clean + up the supported CPU switch list, and replace 4Kc, 4Km, and + 4Kp entries with a single mips32-4k entry. Note that you can + use ".set mips32". + + * config/tc-mips.c (ISA_HAS_64BIT_REGS): Add checks for ISA_MIPS5 and + ISA_MIPS64. + (md_longopts, OPTION_MIPS5, OPTION_MIPS64): Add options for + -mips5 and -mips64. + (md_parse_option): Add cases for OPTION_MIPS5 and + OPTION_MIPS64. + (md_show_usage): Mention -mips5 and -mips64 arguments. + (s_mipsset): Add cases for MIPS5 and MIPS64. + (mips_cpu_info_table): Add entries for MIPS5 and MIPS64 ISAs + and pseudo-CPUs. + * doc/as.texinfo: Mention -mips5 and -mips64 options + and their meanings. + * doc/c-mips.texi: Likewise. Also update introduction + and ".set" usage information. + + * config/tc-mips.c (md_show_usage): Add "sb1" to the + CPU list. + (mips_cpu_info_table): Add SB-1 entries. + * doc/c-mips.texi: Add "sb1" to the list of CPUs + known to the -mcpu option. + + * doc/as.texinfo: Correct description of MIPS -mcpu + option, by copying some of the text from doc/c-mips.texi. + +2000-12-01 Joel Sherrill + + * configure.in (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*): + New targets. + (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. + (sparc*-*-rtems*): Switched from a.out to ELF. + * configure: Regenerate. + * config.in: Regenerate. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * po/gas.pot: Regenerate. + +2000-11-30 Philip Blundell + + * config/obj-coff.c (obj_coff_weak): Use S_SET_WEAK if it exists, + even in non BFD_ASSEMBLER case. + +2000-11-30 Diego Novillo + + * config/tc-i386.c (md_assemble): Swap i.disp_relocs when using intel + syntax. + +2000-11-29 Richard Henderson + + * dwarf2dbg.c: Rewrite from scratch. Queue all debugging output + until dwarf2_finish; use relaxation to get cross-fragment offsets; + thread multiple subsegments properly; handle multiple code + sections properly; emit proper compilation unit info for assembler + generated debugging. + + * as.h (enum _relax_state): Add rs_dwarf2dbg. + * dwarf2dbg.h (struct dwarf2_line_info): Remove filename. + (dwarf2dbg_estimate_size_before_relax): Declare. + (dwarf2dbg_relax_frag, dwarf2dbg_convert_frag): Declare. + * write.c: Include dwarf2dbg.h. + (cvt_frag_to_fill): Handle rs_dwarf2dbg. + (relax_segment): Likewise. + +2000-11-28 Hans-Peter Nilsson + + * config/tc-sh.c (md_convert_frag) : Use as_bad_where instead of as_bad. Tweak error message + accordingly. Stabilize frag by updating fix part and resetting + variant part. + : Ditto. + (sh_elf_cons): Cast *input_line_pointer to unsigned char when + indexing is_end_of_line[]. + (md_assemble): Initialize size to 0. + (md_section_align): Mark parameter seg as unused. + (parse_reg): Parse names case-insensitively. + +2000-11-28 Kazu Hirata + + * config/obj-aout.h: Fix formatting. + * config/obj-bout.h: Likewise. + * config/obj-coff.c: Likewise. + * config/obj-coff.h: Likewise. + * config/obj-elf.h: Likewise. + * config/obj-som.h: Likewise. + * config/obj-vms.c: Likewise. + * config/obj-vms.h: Likewise. + * config/tc-h8300.h: Likewise. + * config/tc-ns32k.h: Likewise. + * config/tc-sparc.h: Likewise. + * config/tc-tic54x.h: Likewise. + * config/tc-z8k.h: Likewise. + +2000-11-28 Nick Clifton + + * doc/as.1 (COPYING): Mention that the GNU Free Documentation + License is present in the sources, but not the output, and + also available from the GNU website. + (GNU Free Documentation License): Comment out this section. + +2000-11-28 Hans-Peter Nilsson + + * Makefile.am (CPU_OBJ_VALID): Add case to filter out invalid coff + targets. Remove i860 from valid a.out targets. + * Makefile.in: Regenerate. + + * config/tc-cris.c: Include dwarf2dbg.h. + (md_pseudo_table): Add .file and .loc. + (md_assemble): Call dwarf2_emit_insn if generating ELF. + (s_cris_file, s_cris_loc): New. + * config/tc-cris.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + +2000-11-28 Alan Modra + + * expr.c (STANDARD_MUL_PRECEDENCE): Correct value. + (MRI_MUL_PRECEDENCE): Likewise. + (op_rank): Fix a comment typo. + +2000-11-26 Stephane Carrez + + * config/tc-m68hc11.c (build_indexed_byte): Print the offset in + the error message. + (get_operand): Fix analysis for movw/movb instructions. + +2000-11-24 Nick Clifton + + * configure.in (xscale-elf): Add target. + (xscale-coff): Add target. + * configure: Regenerate. + + * config/tc-arm.c (ARM_EXT_V5E): New ARM architecture + extenstion. + (ARM_EXT_XSCALE): New ARM architecture extension. + (ARM_LONGMUL): Rename to ARM_EXT_LONGMUL. + (ARM_HALFWORD): Rename to ARM_EXT_HALFWORD. + (ARM_THUMB): Rename to ARM_EXT_THUMB. + (ARM_ARCH_V4): Remove processor from architecture. + (ARM_ARCH_3M): New architecutre definition. + (ARM_ARCH_V5TE): New architecutre definition. + (ARM_ARCH_XSCALE): New architecutre definition. + (CPU_DEFAULT): Allow to be defaulted to XScale. + (atpcs): New boolean variable. + (ldr_flags): Support 'd' flag for double word loads. + (str_flags): Support 'd' flag for double word stored. + (do_mia): New function. + (do_mar): New function. + (do_mra): New function. + (do_pld): New function. + (do_ldrd): New function. + (do_blx): New function. + (do_bkpt): New function. + (do_clz): New function. + (do_lstc2): New function. + (do_cdp2): New function. + (do_t_blx): New function. + (do_t_bkpt): New function. + (do_smla): New function. + (do_smlal): New function. + (do_smul): New function. + (do_qadd): New function. + (do_co_reg2c): New function. + (LONGEST_INSN): Redefine to 7. + + * doc/c-arm.texi: Document -mxscale, -mmarmv5te and -matpcs + command line switches. + +2000-11-22 Jim Wilson + + * config/tc-ia64.c (pseudo_func): Add missing initializers. + (struct rsrc): Make line unsigned. + (gr_values): Add missing initializer. + (SLOT_NUM_NOT_SET): Add unsigned cast. + (ia64_elf_section_flags, output_vbyte_mem, count_output, dot_radix, + dot_fframe, dot_vframe, dot_vframesp, dot_vframepsp, dot_save, + dot_restore, dot_restorereg, dot_restorereg_p, dot_handlerdata, + dot_unwentry, dot_altrp, dot_saveg, dot_savef, dot_saveb, dot_savegf, + dot_spill, dot_spillreg, dot_spillreg_p, dot_label_state, + dot_copy_state, dot_unwabi, dot_personality, dot_proc, dot_body, + dot_prologue, dot_endp, dot_regstk, dot_psr, dot_alias, dot_ln, + dot_reg_val, dot_entry, dot_mem_offset, ia64_init, mark_resource, + md_undefined_symbol, md_apply_fix3, tc_gen_reloc, ia64_md_do_align): + Add ATTRIBUTE_UNUSED to unused parameters. + (convert_expr_to_ab_reg): Add parens. + (convert_expr_to_xy_reg): Add parens. Comment out >= REG_GR test. + (dot_prologue): Initialize grsave when declared. + (md_pseudo_table): Add missing initializers. + (operand_match): Add casts to bfd_vma. + (emit_one_bundle): Delete unused local prev. Make required_template + unsigned. + (specify_resource): Cast i to unsigned. + (note_register_values): Use fprintf_vma. + (print_dependency): Likewise. + +2000-11-21 Jim Wilson + + * config/tc-ia64.c (generate_unwind_image): Call record_alignment + for unwind info section. + (dot_endp): Likewise for unwind section. + + * config/tc-ia64.c (emit_one_bundle): Pass size of 8 not 4 to + fix_new_exp. + +2000-11-21 Jakub Jelinek + + * config/tc-sparc.c (md_pseudo_table): Add .file and .loc. + (output_insn): Call dwarf2_emit_insn. + * config/tc-sparc.h (DWARF2_LINE_MIN_INSN_LENGTH): New. + +2000-11-17 Richard Henderson + + * ehopt.c (eh_frame_code_alignment): New arg `in_seg', update all + callers. Don't switch segments. Expect CIE == -1 in .debug_frame. + (check_eh_frame): Handle .eh_frame and .debug_frame concurrently. + +2000-11-17 Nick Clifton + + * config/tc-arm.c (md_pseudo_table): Add support for .line and + .file pseudo ops. + +2000-11-17 Richard Henderson + + * config/tc-i386.c (md_pseudo_table): Add .file and .loc. + +2000-11-17 Richard Henderson + + * dwarf2dbg.c (dwarf2_gen_line_info): Early out for no line number. + * config/obj-elf.h (ECOFF_DEBUGGING) [TC_ALPHA]: Adjust for + tri-state definition of alpha_flag_mdebug. + * config/tc-alpha.c (alpha_flag_mdebug): Init to -1. + (s_alpha_file): Store first .file directive. + (s_alpha_stab): New. + (md_pseudo_table): Add stabs and stabn. + +2000-11-17 Richard Henderson + + * config/tc-i386.c (md_assemble): Call dwarf2_emit_insn. + +2000-11-17 Richard Henderson + + * as.c (debug_type): Init to DEBUG_UNSPECIFIED. + (main): Call dwarf2_finish. + * as.h (debug_type): Clarify documentation of the meaning + of this variable. + * dwarf2dbg.c (DWARF2_LINE_MIN_INSN_LENGTH): Default to 1. + (print_stats): Fix parenthesis problem. + (now_subseg_size): New. + (dwarf2_finish): Use it. If DEBUG_DWARF2, emit bits for .debug_info. + (dwarf2_directive_file): Don't set debug_type. + (dwarf2_where): Honor DEBUG_DWARF2 first. + (dwarf2_emit_insn): Renamed from dwarf2_generate_asm_lineno; + do nothing if not emitting dwarf2 debug info, or no work. + * dwarf2dbg.h (dwarf2_emit_insn): Update. + * ecoff.c (add_file): Turn on DEBUG_ECOFF only if DEBUG_UNSPECIFIED. + (ecoff_new_file): Likewise. + * read.c (generate_lineno_debug): Kill ecoff hackery. Update + commentary wrt dwarf2. + + * config/tc-alpha.c (alpha_adjust_symtab_relocs): Add + ATTRIBUTE_UNUSED as needed. + (emit_insn): Call dwarf2_emit_insn. + (s_alpha_file): New. + (s_alpha_loc): New. + (s_alpha_coff_wrapper): Don't handle them. + (md_pseudo_table): Update for .file and .loc. + * config/tc-alpha.h (DWARF2_LINE_MIN_INSN_LENGTH): New. + + * config/tc-arm.c (output_inst): Update for dwarf2_emit_insn; + don't protect with debug_type. + * config/tc-hppa.c (md_assemble): Likewise. + * config/tc-m68hc11.c (m68hc11_new_insn): Likewise. + * config/tc-mn10300.c (md_assemble): Likewise. + * config/tc-sh.c (md_assemble): Likewise. + * config/tc-v850.c (md_assemble): Likewise. + + * config/tc-arm.c (arm_end_of_source): Remove. + * config/tc-hppa.c (pa_end_of_source): Remove. + * config/tc-m68hc11.c (m68hc11_end_of_source): Remove. + * config/tc-mn10300.c (mn10300_finalize): Remove. + * config/tc-sh.c (sh_finalize): Remove. + * config/tc-v850.c (sh_finalize): Remove. + + * config/tc-arm.h (md_end): Remove. + * config/tc-hppa.h (md_end): Remove. + (DWARF2_LINE_MIN_INSN_LENGTH): New. + * config/tc-m68hc11.h (md_end): Remove. + * config/tc-mn10300.h (md_end): Remove. + * config/tc-sh.h (md_end): Remove. + * config/tc-v850.h (md_end): Remove. + + * config/tc-ia64.c (emit_one_bundle): Don't protect + dwarf2 bits with debug_type. + (md_assemble): Likewise. + (ia64_end_of_source): Don't call dwarf2_finish. + +2000-11-16 Jim Wilson + + * config/tc-ia64.c (errata_nop_necessary_p): Abort if general regno + >= 128 instead of > 128. Abort if predicate regno is >= 64 instead of + > 16. + +2000-11-16 H.J. Lu + + * config/obj-elf.c (obj_elf_symver): Don't check the missing + version name. + +2000-11-15 Kazu Hirata + + * config/tc-tic30.c: Fix formatting. + * config/tc-tic80.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-z8k.c: Likewise. + +2000-11-14 DJ Delorie + + * config/tc-v850.c: Support dwarf2. + * config/tc-v850.h: Ditto. + + * config/tc-v850.c (cons_fix_new_v850): Don't rely on + parse_cons_expression_v850 to initialize hold_cons_reloc. + +2000-11-15 Bernd Schmidt + + * config/tc-ia64.c (struct md): New entries LAST_GROUPS, GROUP_IDX. + (errata_nops_necessary_p): New function. + (emit_one_bundle): Call it. Update the GROUP_IDX field in struct + md. + +2000-11-14 Jim Wilson + + * config/tc-ia64.c (ia64_target_format): If EF_IA_64_BE not set, then + return little endian bfd formats. + +2000-11-14 Kazu Hirata + + * config/aout_gnu.h: Fix formatting. + * config/atof-vax.c: Likewise. + * config/m68k-parse.h: Likewise. + * config/m88k-opcode.h: Likewise. + * config/obj-elf.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-cris.c: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/te-386bsd.h: Likewise. + * config/te-hppa.h: Likewise. + * config/te-nbsd.h: Likewise. + * config/te-ppcnw.h: Likewise. + * config/te-sparcaout.h: Likewise. + * config/te-tmips.h: Likewise. + * config/vax-inst.h: Likewise. + * config/vms-conf.h: Likewise. + +2000-11-14 Jakub Jelinek + + * config/tc-alpha.c (s_alpha_prologue): Preserve visibility bits. + +2000-11-13 H.J. Lu + + * config/obj-elf.c (elf_frob_symbol): Support + ".symver name,name2@@@nodename". + (elf_frob_file_before_adjust): Likewise. + + * doc/as.texinfo: Updated for ".symver name,name2@@@nodename" + and ".symver name,name2@@@nodename". + Fix a typo. + +2000-11-12 H.J. Lu (hjl@gnu.org) + + * config/obj-elf.c (obj_elf_symver): Check missing version + name. + +2000-11-12 H.J. Lu (hjl@gnu.org) + + * dwarf2dbg.c (dwarf2_generate_asm_lineno): Use addressT + instead of bfd_vma for non-bfd assemblers. + +2000-11-09 Kazu Hirata + + * itbl-ops.c: Fix comment typos. + +2000-11-08 Jim Wilson + + * config/tc-ia64.c (struct unw_rec_list): Add slot_frag field. + (struct unwind): Add next_slot_frag field. + (slot_index): New parameters slot_frag and first_frag. Add code + to add in frag sizes when different. Add comments. + (fixup_unw_records): New locals first_frag and last_frag. Pass new + arguments to slot_index. + (emit_one_bundle): Set slot_frag field. Set next_slot_number after + loop end. Set next_slot_frag field. + +2000-11-07 H.J. Lu + + * doc/as.texinfo (.symver): Updated for versioned symbol + reference. + + * obj.h (format_ops): Add the frob_file_before_adjust field. + + * config/obj-aout.c (aout_format_ops): Set the + frob_file_before_adjust field to 0. + * config/obj-coff.c (coff_format_ops): Likewise. + * config/obj-ecoff.c (ecoff_format_ops): Likewise. + + * config/obj-elf.c (obj_elf_symver): Allow duplicated version + name. + (elf_frob_file_before_adjust): New function to remove unneeded + versioned symbols from the symbol table. + (elf_format_ops): Set the frob_file_before_adjust field to + elf_frob_file_before_adjust. + + * config/obj-elf.h (obj_frob_file_before_adjust): Defined if + not defined. + + * config/obj-multi.h (obj_frob_file_before_adjust): Defined. + +2000-11-07 Peter Targett + + * config/tc-arc.h: Avoid warnings for LITTLE_ENDIAN and + BIG_ENDIAN macros. + * config/tc-arc.c: Use S_IS_LOCAL to test local symbols. + Fix compile time warning messages. + +2000-11-07 Nick Clifton + + * stabs.c (generate_asm_file): Increase length of xmalloc'ed + buffer in order to avoid buffer overflows. + +2000-11-06 Steve Ellcey + + * config/tc-ia64.c (md_shortopts, md_parse_option, md_show_usage): + Change M to m for -milp32 or -mlp64 to match gcc. + (dot_endp): Use bytes_per_address instead of 8. + (emit_one_bundle): Use number_to_chars_littleendian instead of + md_number_to_chars. + (fix_insn): Likewise. + (ia64_init): New function. + (ia64_target_format): New function. + (md_begin): Set endianness, arch, and machine as appropriate. + * config/tc-ia64.h: (TARGET_BYTES_BIG_ENDIAN, md_number_to_chars): + Make these macros depend on TE_HPUX macro. + (TARGET_FORMAT): Define. + (HOST_SPECIAL_INIT): Define. + * config/te-hpux.h: New file. + * configure.in: Add "ia64-*-hpux*" target to configure. + * configure: Regenerate. + +2000-11-06 Kazu Hirata + + * as.c: Fix formatting. + * dwarf2dbg.c: Likewise. + * input-file.c: Likewise. + * input-file.h: Likewise. + * input-scrub.c: Likewise. + * itbl-ops.c: Likewise. + * listing.c: Likewise. + * macro.h: Likewise. + * messages.c: Likewise. + * read.c: Likewise. + * subsegs.c: Likewise. + * subsegs.h: Likewise. + * write.c: Likewise. + +2000-11-06 Nick Clifton + + * doc/as.texinfo: Add GNU Free Documentation License. + * doc/gasp.texi: Add GNU Free Documentation License. + * doc/as.1: Add GNU Free Documentation License. + +2000-11-05 Nick Clifton + + * config/tc-arm.c: Add include of "dwarf2dbg.h" + +2000-11-02 Per Lundberg + + * configure.in: Recognise i[3456]86-chaosdev-storm-chaos. + * configure: Regenerate. + +2000-11-01 Nick Clifton + + * read.c (original_case_string): New global variable. + (read_a_source_file): Copy opcode string into + original_case_string if clobbering the case of the opcode. + * read.h: Export the definition of original_case_string. + * config/tc-arm.c (md_assembler): When parsing a .req + directive use the original opcode string, not the case + clobbered version. + +2000-11-02 Nick Clifton + + * config/tc-mn10300.c (debug_line): Remove this static + variable. + (md_assemble): Call dwarf2_generate_asm_lineno instead of + dwarf2_where and dwarf2_gen_line_info. + +2000-11-02 Theo Honohan + + * config/tc-arm.c (do_msr): Improve error message. + +2000-10-31 Eric Christopher + + * config/tc-mn10300.c (md_apply_fix3): Use valuep if fully resolved + or pc-relative, else use fx_offset. + +2000-10-31 Jim Wilson + + * config/tc-ia64.c (struct md): New field tag_fixups. + (ia64_flush_insns): Handle tag_fixups. Error if dangling + qualifying predicate. + (emit_one_bundle): Delete spurious multiplication by one. Handle + tag_fixups. + (ia64_start_line): Error if dangling qualifying predicate. + (defining_tag): New static variable. + (ia64_unrecognized_line, case '['): Parse tags. + (ia64_frob_label): Create tag_fixups. + (md_assemble): Reset md.qp.X_op after using it. + +2000-10-31 Kaz Kojima + + * config/tc-sh.c (md_apply_fix [BFD_RELOC_SH_PCDISP12BY2]): Allow 4094. + +2000-10-31 Bernd Schmidt + + * config/tc-ia64.c (extra_goodness): Only prefer F in slot 1 and B in slot 2. + +2000-10-30 Kazu Hirata + + * expr.c: Fix formatting. + * flonum-copy.c: Likewise. + * flonum.h: Likewise. + * gasp.c: Likewise. + * hash.c: Likewise. + +2000-10-30 Hans-Peter Nilsson + + * as.h (OPTION_MD_BASE): Bump to 190. + * as.c (parse_args) : Add comment about the need to + check OPTION_MD_BASE in as.h. + + * config/tc-sh.c (md_apply_fix): For ELF, do not "adjust back" VAL + for weak symbols. + +2000-10-27 Nick Clifton + + * configure.in (emulations): Add m68hc12. + * configure: Regenerate. + * po/gas.pot: Regenerate. + +2000-10-27 Aldy Hernandez + + * config/tc-arm.c (psrs): Remove lowercase versions of spsr* and + cpsr*. + (arm_psr_parse): Handle lowercase CPSR and SPSR. + +2000-10-25 Nick Clifton + + * dwarf2out.c (dwarf2_generate_asm_lineno): New function: Generate + a DWARF2 line number information sequence. + + *dwarf2out.h: Add prototype for dwarf2_generate_asm_lineno. + + * read.c (generate_lineno_debug): Update comment describing why + DWARF2 line number debug information is not generated + automatically by this function. + + * doc/as.texinfo: Note that --gdwarf2 only works on some targets, + not all. + + * config/tc-arm.h (md_end): Define. + (DWARF2_LINE_MIN_INSN_LENGTH): Define. + + * config/tc-arm.c (output_inst): Call dwarf2_generate_asm_lineno + if generating DWARF2 line numbers. + (arm_end_of_source): New function. Call dwarf2_finish if + necessary. + + * config/tc-hppa.c (md_assemble): Use dwarf2_generate_asm_lineno. + * config/tc-m68hc11.c (m68hc11_new_insn): Use dwarf2_generate_asm_lineno. + * config/tc-sh.c (md_assemble): Use dwarf2_generate_asm_lineno. + +2000-10-25 Diego Novillo + + * config/tc-i386.c: Fix prototype declarations for functions taking no + arguments. + +2000-10-24 Diego Novillo + + * config/tc-i386.c (i386_operand_modifier): Remove. + (build_displacement_string): Remove. + (i386_parse_seg): Remove. + (i386_intel_memory_operand): Remove. + (i386_intel_operand): Re-write using recursive descent parser based + on MASM documentation. + (struct intel_parser_s): New structure. + (intel_parser): New static variable. + (struct intel_token): New structure. + (cur_token, prev_token): New static variables. + (T_NIL): Define. + (T_CONST): Define. + (T_REG): Define. + (T_BYTE): Define. + (T_WORD): Define. + (T_DWORD): Define. + (T_QWORD): Define. + (T_XWORD): Define. + (T_SHORT): Define. + (T_OFFSET): Define. + (T_PTR): Define. + (T_ID): Define. + (intel_match_token): New function. + (intel_get_token): New function. + (intel_putback_token): New function. + (intel_expr): New function. + (intel_e05): New function. + (intel_e05_1): New function. + (intel_e06): New function. + (intel_e06_1): New function. + (intel_e09): New function. + (intel_e09_1): New function. + (intel_e10): New function. + (intel_e10_1): New function. + (intel_e11): New function. + +2000-10-20 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Fix a bug which caused v9_arg_p + instructions to loose any special insn->architecture mask. + + * config/tc-sparc.c (v9a_asr_table): Add v9b ASRs. + (sparc_md_end, sparc_arch_types, sparc_arch, + sparc_elf_final_processing): Handle v8plusb and v9b architectures. + (sparc_ip): Handle siam mode operands. Support v9b ASRs (and + request v9b architecture if they are used). + +2000-10-18 Michael Sokolov + + * config/tc-m68k.c: Fix the previous misapplied patch. + +2000-10-18 Michael Sokolov + + * config/tc-m68k.h (RELAX_RELOC_*): New definitions for both + BFD_ASSEMBLER and !BFD_ASSEMBLER. + * config/tc-m68k.c (md_convert_frag_1): Use them instead of + BFD_RELOC_*. + +2000-10-17 Kazu Hirata + + * debug.c: Fix formatting. + * depend.c: Likewise. + * dwarf2dbg.c: Likewise. + * dwarf2dbg.h: Likewise. + * ecoff.c: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + * flonum-konst.c: Likewise. + * frags.h: Likewise. + +2000-10-17 Chandrakala Chavva + + * as.c: New option OPTION_TARGET_HELP. Prints all target specific + options. + * doc/as.texinfo: Added notes about this new option. + +2000-10-16 Hans-Peter Nilsson + + * config/tc-sh.c (JREG): Remove. + (md_convert_frag): Remove #if 0:d code using JREG. + +2000-10-15 Diego Novillo + + * config/tc-i386.c (i386_operand_modifier): Only match + modifiers SHORT and FLAT if they are followed by a space. + (parse_register): When `allow_naked_reg' is set, do not confuse + identifiers that start with a register name with a register. + +2000-10-12 Kazu Hirata + + * app.c: Fix formatting. + * as.c: Likewise. + * as.h: Likewise. + * bit_fix.h: Likewise. + * cgen.c: Likewise. + * cgen.h: Likewise. + * cond.c: Likewise. + +2000-10-11 Alan Modra + + * config/obj-elf.c (elf_frob_symbol): Revert 2000-10-07 change. + +2000-10-07 Alan Modra + + * config/tc-hppa.c (md_apply_fix): Remove plainly wrong assert. + Re-arrange function a little and improve error message. + + * write.c (write_relocs): Fix a comment. + + * config/obj-elf.c (elf_frob_symbol): Make section syms global on + link-once sections. + +2000-10-05 Jim Wilson + + * config/tc-ia64.c (resources_match): Handle IA64_RS_PRr. + +2000-10-05 Alan Modra + + * config/tc-i386.c: Delete some useless comments, reformat others. + + * config/tc-i386.h (TC_FIX_ADJUSTABLE): Add check to cover + non-global syms in linkonce sections. + +2000-10-04 Ralf Baechle + + * config/tc-ia64.c (operand_match): Don't use // style comments. + * config/tc-i370.c: Likewise. + +2000-09-29 Hans-Peter Nilsson + + Changes to handle varying register prefix and user symbol prefix. + * config/tc-cris.c (SYNTAX_RELAX_REG_PREFIX, + SYNTAX_ENFORCE_REG_PREFIX, SYNTAX_USER_SYM_LEADING_UNDERSCORE, + SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE, REGISTER_PREFIX_CHAR): New. + (s_syntax, cris_force_reg_prefix, cris_relax_reg_prefix, + cris_sym_leading_underscore, cris_sym_no_leading_underscore): New. + (demand_register_prefix): New variable. + (md_pseudo_table): New pseudo ".syntax". + (md_longopts): New options --no-underscore and --underscore. + (cris_target_format): Return elf32-us-cris or elf32-cris depending + on symbols_have_leading_underscore. + (get_gen_reg): Accept or require REGISTER_PREFIX_CHAR. + (get_spec_reg): Ditto. + (cris_number_to_imm) : Remove FIXME. + Fix formatting. + (md_parse_option) : Deprecate; add reference to + --help. + : New. + (md_show_usage): Be brief and reformat to match continuation of + --help. + * po/gas.pot: Regenerate. + +2000-09-28 Alan Modra + + * config/tc-hppa.c (hppa_force_relocation): If OBJ_SOM, don't + force relocs for 12 bit branches. + (md_apply_fix): Similarly, adjust logic here. + +2000-09-28 Alan Modra + + * config/tc-hppa.c (md_apply_fix): Add fmt assertion. Don't + adjust for external and weak syms as we will use a reloc. Allow + for +8 offset when calculating limits of branches. + (hppa_fix_adjustable): Undo 2000-09-23 change. + (hppa_force_relocation): Likewise. Add fx_addsy assertion. + Correct distance calculation. + (tc_gen_reloc): Print the file name and line number if we can't + handle a fixup. + + From John David Anglin + * config/tc-hppa.c (nonzero_dibits): Define. + (arg_reloc_stub_needed): Check each arg and return value + separately for zero case. + (pa_align): Declare argument `bytes'. + +2000-09-25 Kazu Hirata + + * config/tc-cris.c: Fix formatting. + * config/tc-d10v.h: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-d30v.h: Likewise. + * config/tc-fr30.c: Likewise. + * config/tc-fr30.h: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-m68k.h: Likewise. + * config/tc-pj.h: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-ppc.h: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh.h: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-v850.h: Likewise. + * config/tc-vax.h: Likewise. + * config/tc-w65.h: Likewise. + * config/tc-z8k.h: Likewise. + +2000-09-23 Alan Modra + + * config/tc-hppa.c (hppa_fix_adjustable): Do the external and weak + checks only for ELF. + (hppa_force_relocation): Likewise. + +2000-09-22 Jim Wilson + + * config/tc-ia64.c (dv_sem): Add "stop". + (specify_resource, case IA64_RS_PR): Only handles regs 1 to 15 now. + (specify_resource, case IA64_RS_PRr): New for regs 16 to 62. + (specify_resource, case IA64_RS_PR63): Reorder (note == 7) test to + match above. + (mark_resources): Check IA64_RS_PRr. + +2000-09-22 Michael Sokolov + + * config/tc-m68k.c (md_relax_table, m68k_ip, md_convert_frag_1, + md_estimate_size_before_relax): Redesign and clean up the + relaxation mechanism. + +2000-09-21 Kazu Hirata + + * config/tc-ns32k.c: Fix formatting. + * config/tc-ns32k.h: Likewise. + +2000-09-20 Kazu Hirata + + * config/tc-m32r.c: Fix formatting. + * config/tc-m32r.h: Likewise. + * config/tc-m68851.h: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68hc11.h: Likewise. + * config/tc-m88k.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mcore.h: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-mips.h: Likewise. + * config/tc-mn10200.h: Likewise. + * config/tc-mn10300.h: Likewise. + * config/tc-tahoe.c: Likewise. + * config/tc-tahoe.h: Likewise. + +2000-09-19 Michael Sokolov + + * config/tc-vax.c (synthetic_votstrs): Remove jbssi and jbcci. + Likewise in relaxation description comments. + +2000-09-18 Alan Modra + + * config/tc-hppa.h (TC_FORCE_RELOCATION_SECTION): Allow + subtraction of two syms without emitting a relocation. + + From David Huggins-Daines + * config/tc-hppa.c (hppa_force_relocation): Force relocations for + global or weak symbols. + +2000-09-15 Kazu Hirata + + * config/tc-h8300.h: Fix formatting. + * config/tc-h8500.c: Likewise. + * config/tc-h8500.h: Likewise. + * config/tc-hppa.h: Likewise. + * config/tc-i370.h: Likewise. + * config/tc-i386.h: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i860.h: Likewise. + * config/tc-i960.h: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-ia64.h: Likewise. + +2000-09-14 Kazu Hirata + + * config/tc-a29k.c: Fix formatting. + * config/tc-alpha.c: Likewise. + * config/tc-arc.c: Likewise. + * config/tc-arc.h: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-arm.h: Likewise. + * config/tc-avr.c: Likewise. + * config/tc-avr.h: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-tic30.h: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-tic54x.h: Likewise. + * config/tc-tic80.c: Likewise. + * config/tc-tic80.h: Likewise. + +2000-09-14 Timothy Wall + + * config/tc-ia64.c (specify_resource): For PR%/PR63, note types of + parallel comparisons for later use. + (struct rsrc): Add parallel comparison type. + (resources_match): Skip special cases of PR usage (non-conflicting + parallel compares). + +2000-09-13 Kazu Hirata + + * config/obj-ecoff.c: Fix formatting. + * config/obj-elf.c: Likewise. + * config/obj-elf.h: Likewise. + * config/obj-evax.h: Likewise. + * config/obj-generic.h: Likewise. + * config/obj-hp300.c: Likewise. + * config/obj-hp300.h: Likewise. + * config/obj-ieee.h: Likewise. + * config/obj-vms.c: Likewise. + * config/obj-vms.h: Likewise. + +2000-09-13 Anders Norlander + + * config/tc-mips.c (md_begin): Recognize 4Kc, 4Km and 4Kp processors. + (md_parse_option): Ditto. + (md_longopts): Add -mips32 option. + (md_show_usage): Document new options. + (mips_ip): Assemble sdbbp 20 bit 'm' args for MIPS32. + (mips_ip): Assemble mfc0 with a sub-selection code. + (validate_mips_insn): Handle 'H' (OP_*_SEL) and 'm' (OP_*_CODE20). + (mips_cpu_to_str): New function. + (mips_ip): Use mips_cpu_to_str instead of printing numeric cpu value. + Use CPU_* defines instead of hardcoded numbers. + + * doc/as.texinfo: Document new options. + * doc/c-mips.texi: Ditto. + +2000-09-12 Kazu Hirata + + * as.h: Fix formatting. + * asintl.h: Likewise. + * bit_fix.h: Likewise. + * config/obj-aout.c: Likewise. + * config/obj-aout.h: Likewise. + * config/obj-bout.c: Likewise. + * config/obj-bout.h: Likewise. + * config/obj-coff.c: Likewise. + * config/obj-coff.h: Likewise. + * dwarf2dbg.h: Likewise. + * expr.h: Likewise. + * flonum.h: Likewise. + * frags.h: Likewise. + * itbl-ops.h: Likewise. + * macro.h: Likewise. + * read.h: Likewise. + * sb.h: Likewise. + * struc-symbol.h: Likewise. + * subsegs.h: Likewise. + * symbols.h: Likewise. + * tc.h: Likewise. + * write.h: Likewise. + +2000-09-11 Kazu Hirata + + * bignum-copy.c: Fix formatting. + * config/tc-i370.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-m68k.c: Likewise. + * ehopt.c: Likewise. + * flonum-copy.c: Likewise. + * flonum-konst.c: Likewise. + * flonum-mult.c: Likewise. + * literal.c: Likewise. + * read.c: Likewise. + * sb.c: Likewise. + * stabs.c: Likewise. + * subsegs.c: Likewise. + +2000-09-09 Philip Blundell + + * configure.in (arm*-*-uclinux*): New target. + * configure: Regenerate. + +2000-09-09 Kazu Hirata + + * input-file.c: Fix formatting. + * itbl-ops.c: Likewise. + * messages.c: Likewise. + +2000-09-08 Philip Blundell + + * config/tc-arm.c (md_apply_fix3): Correct handling of ADRL when + offset is negative. + +2000-09-07 H.J. Lu + + * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. + * configure: Rebuild. + +2000-09-07 Kazu Hirata + + * atof-generic.c: Fix formatting. + * config/tc-mips.c: Likewise. + * config/tc-vax.c: Likewise. + * input-scrub.c: Likewise. + +2000-09-07 Alexandre Oliva + + * config/tc-sh.h (TARGET_FORMAT): Use sh-linux targets. + * configure.in (sh-*-linux*): Added. + * configure: Rebuilt. + +2000-09-06 Kazu Hirata + + * config/tc-hppa.c: Fix formatting. + + * ecoff.c: Fix formatting. + +2000-09-06 Alexandre Oliva + + * configure: Rebuilt with new libtool.m4. + +2000-09-05 Kazu Hirata + + * cgen.c: Fix formatting. + * config/tc-ia64.c: Likewise. + +2000-09-05 Nick Clifton + + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + * po/gas.pot: Regenerate. + +2000-09-05 Hans-Peter Nilsson + + * config/tc-cris.c: Correct comment typos. + +2000-09-05 Eric Christopher + + * config/tc-mn10300.c: Cleanup. + (md_pcrel_from): Enable. + +2000-09-05 Alan Modra + + * expr.c (operand): Fix a comment typo. + * write.c (write_relocs): Fix a signed/unsigned warning. + + * config/tc-hppa.c (fudge_reg_expressions): New + (hppa_force_reg_syms_absolute): New. + (pa_equ): Allow reg_section expressions. + * config/tc-hppa.c (md_optimize_expr): Define. + (hppa_force_reg_syms_absolute): Prototype. + + * config/tc-hppa.c (pa_11_fp_reg_struct): Delete. + (pa_parse_number): Pass in arg to select fp reg parsing. + Return 1 to indicate format checks pass. If strict, then only + accept a register or register symbol. Return value in... + (pa_number): New static for pa_parse_number. + (FP_REG_BASE): Define. + (FP_REG_RSEL): Define. + (pre_defined_registers): Apply FP_REG_BASE and FP_REG_RSEL as + appropriate. White space changes. + (need_pa11_opcode): Don't bother passing any params, get them from + globals instead. + (pa_ip): Modify all calls to pa_parse_number and need_pa11_opcode. + Remove extraneous check in case 'Q'. + (pa_equ): Modify call to pa_parse_number to do strict parsing. If + reg, set section of resulting symbol to reg_section. + (pa_parse_space_stmt): Modify call to pa_parse_number. + (pa_space): Likewise. + + * config/tc-hppa.c: (md_apply_fix): Handle vtable relocs. + (hppa_force_relocation): Handle vtable relocs. + (pa_vtable_entry): New. + (pa_vtable_inherit): New. + (md_pseudo_table): Add entries for vtable pseudos. + (hppa_fix_adjustable): Reject reduction of R_PARISC_GNU_VTINHERIT + and R_PARISC_GNU_VTENTRY relocs. Reject reduction of relocs + against weak syms. + (tc_gen_reloc): Remove ELF_ARG_RELOC_INSN code. + (pa_type_args): Don't call symbol_get_bfdsym multiple times. + Set STT_PARISC_MILLICODE for OBJ_ELF when encountering a + millicode import. + * config/obj-elf.c (obj_elf_type): Allow md_elf_symbol_type to + specify a symbol type. + + * config/tc-hppa.h: Reorganize file a little, grouping OBJ_ELF + dependent things together. + (md_elf_symbol_type): Define. + + * config/tc-hppa.c (fix_new_hppa): Elide "$PIC_pcrel$0" pseudo + symbol. + * config/tc-hppa.h (tc_frob_symbol): Elide "$PIC_pcrel$0" here too. + + * config/obj-elf.h (obj_elf_vtable_inherit): Declare. + (obj_elf_vtable_entry): Declare. + + * config/obj-elf.c (obj_elf_vtable_inherit): Return struct fix * + and export function. + (obj_elf_vtable_entry): Similarly. + (elf_pseudo_table): Fix the damage with a cast. + +2000-09-03 Richard Henderson + + * config/tc-ia64.c (emit_one_bundle): Stop collecting insns + for template selection when a label is needed. + +2000-09-02 Kazu Hirata + + * config/tc-ia64.c: Fix formatting. + +2000-09-02 Nick Clifton + + * configure.in: Increase version number to 2.10.91. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/gas.pot: Regenerate. + * Makefile.in: Regenerate. + +2000-09-01 Alexandre Oliva + + * config/tc-sh.h [OBJ_ELF] (TC_FIX_ADJUSTABLE): Define. + * config/tc-sh.c (md_apply_fix): Map 32-bit relocations that + become PC-relative to BFD_RELOC_32_PCREL. Reject 16- or 8-bit + similar relocs. + (sh_obj_adjustable): Return 1 for PC-relative offsets used in + branches. + +2000-09-01 Niibe Yutaka , Kaz Kojima , Alexandre Oliva + + * config/tc-sh.h (DIFF_EXPR_OK, GLOBAL_OFFSET_TABLE_NAME, + TC_RELOC_GLOBAL_OFFSET_TABLE, TC_RELOC_RTSYM_LOC_FIXUP): Define. + * config/tc-sh.c (sh_elf_cons, sh_elf_suffix): New functions. + [OBJ_ELF] (md_pseudo_table) : Use them. + (GOT_symbol): New variable. + (md_undefined_symbol): Set it. + +2000-09-01 Richard Henderson + + * config/tc-ia64.c (match): Don't inline. + (extra_goodness): New. + (md_begin): Prefer nop.f and nop.b for best_template. + +2000-08-31 Kazu Hirata + + * as.c: Fix formatting. + * cond.c: Likewise. + * frags.c: Likewise. + * macro.c: Likewise. + +2000-08-31 Eric Christopher + + * config/tc-mn10300.c: Cleanup and fix warnings. + (md_pseudo_table): Add initializers. + (md_show_usage): Cleanup. + (md_parse_option): Fix warnings. + (md_undefined_symbol): Fix warnings. + (md_conver_frag): Fix warnings. + (tc_gen_reloc): Fix warnings. + (md_apply_fix3): Fix warnings. + (check_operand): Fix warnings. + +2000-08-31 Alexandre Oliva + + * acinclude.m4: Include libtool and gettext macros from the + top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-30 Mark Hatle + + * config/tc-ppc.c (md_parse_option): Recognize -m405. + +2000-08-31 Kazu Hirata + + * listing.c: Fix formatting. + +2000-08-29 Kazu Hirata + + * app.c: Fix a comment typo. Fix formatting. + +2000-08-25 J. David Anglin + + * config/tc-vax.c (md_convert_frag): Correctly calculate the pc relative + offset of the target destination for jmp instructions. + (md_assemble): Change mode to VAX_ABSOLUTE_MODE as per comments. + +2000-08-24 Hans-Peter Nilsson + + * NEWS: Mention support for CRIS. + +2000-08-24 Denis Chertykov + + * config/tc-avr.h (TC_IMPLICIT_LCOMM_ALIGNMENT): New macros. + Sets `.lcomm' alignment to zero. + +2000-08-23 Alexandre Oliva + + * config/tc-i386.h (OBJ_MAYBE_ELF, OBJ_MAYBE_COFF, + TC_FIX_ADJUSTABLE): Define. + +2000-08-23 Jim Wilson + + * config/tc-ia64.c (output_unw_records): Set U & E flags only if + unwind.personality_routine is set. + +2000-08-23 H.J. Lu + + * write.c (TC_FIX_ADJUSTABLE): Remove the duplicate. + +2000-08-23 Alexandre Oliva + + * config/tc-i386.h (TC_FIX_ADJUSTABLE): Do *NOT* define if target + environment is pe. + +2000-08-22 H.J. Lu + + * config.in (STRICTCOFF): New for strict COFF. + + * configure.in: Define STRICTCOFF for i386-*-msdosdjgpp*, + i386-*-go32* and i386-go32-rtems*. + * configure: Rebuilt. + + * config/obj-coff.c (obj_coff_endef): Follow the historical + behavior if STRICTCOFF is not defined. + + * doc/internals.texi: Document STRICTCOFF. + +2000-08-22 Alexandre Oliva + + * write.c (TC_FIX_ADJUSTABLE): Define to 1, if not defined. + (fixup_segment) Use it instead of TC_DONT_FIX_NON_ADJUSTABLE. + * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. + (TC_FIX_ADJUSTABLE): Define. + * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. + (TC_FIX_ADJUSTABLE): Define. + * config/tc-i960.h, config/tc-m68k.h, config/tc-v850.h: + Likewise. + +2000-08-22 Eric Christopher + + * config/tc-mn10300.c: (md_apply_fix): New function. + (mn10300_force_relocation): New function. + (mn10300_fix_adjustable): New function. + + * config/tc-mn10300.h: (TC_FORCE_RELOCATION): Define. + (TC_HANDLES_FX_DONE): Define. + (obj_fix_adjustable): Define. + (MD_APPLY_FIX3): Define. + (TC_LINKRELAX_FIXUP): Define. + + * write.c: (TC_LINKRELAX_FIXUP): Define if not + previously defined. + (fixup_segment): Use TC_LINKRELAX_FIXUP. + + * doc/internals.texi: Document TC_LINKRELAX_FIXUP. + +2000-08-21 Jason Eckhardt + + * config/tc-i860.c (md_apply_fix3): Do not insert the immediate + if the fixup resulted in a relocation. + +2000-08-18 Nick Clifton + + * config/tc-arm.c (decode_shift): Replace as_tsktsk with as_warn. + Make reference to first element of shift_names explicit. + +2000-08-18 Alexandre Oliva + + * write.c (fixup_segment) [TC_DONT_FIX_NON_ADJUSTABLE]: Use + obj_fix_adjustable() and tc_fix_adjustable() to tell whether to + add a symbol's address. Removed all target-specific #ifdefs that + used to accomplished the same. + * config/tc-v850.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. + * config/tc-m68k.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. + * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. + * config/tc-i960.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. + * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Define. + +2000-08-17 Kazu Hirata + + * dwarf2dbg.c: Fix formatting. + +2000-08-17 Nick Clifton + + * config/tc-arm.c (decode_shift): Allow illegal shifts by zero + to be recoded as logical shift lefts by zero. + +2000-08-16 Jim Wilson + + * config/tc-ia64.c (specify_resource, case IA64_RS_GR): Handle + postincrement modified registers. Handle IA64_OPND_R3_2 addl + source registers. + (note_register_values): Handle IA64_OPND_R3_2 operands. + +2000-08-16 Jason Eckhardt + + * config/tc-i860.c (md_operand): Silly typo fixed. + +2000-08-16 Nick Clifton + + * config/tc-arm.c (struct asm_shift): Delete. + (shift[]): Delete. + (enum asm_shift_index): New. + (struct asm_shift_properties): New. + (struct asm_shift_name): New. + (shift_properties[]); New. + (shift_names[]); New. + + (decode_shift): Use new structures. + Issue a warning is "ROR #0" is used. + Issue a warning if "ASR #0" or "LSR #0" is used. + + (md_begin): Initialise arm_shift_hsh table from new + asm_shift_name array. + +2000-08-16 Jakub Jelinek + + * config/tc-sparc.c: Kill all warnings. + (md_parse_option): Set -32/-64 for -xarch=, allow all -A archs + in -xarch= as well. + (md_show_usage): Update usage text. + +2000-08-16 Nick Clifton + + * config/tc-arm.c (do_bx): Warn about "bx px" not being very + useful. + +2000-08-15 Will Cohen + + * config/tc-sh.h (DWARF2_LINE_MIN_INSN_LENGTH): Defined. + + * config/tc-sh.c (md_assemble): Changed so debug_type + test performed for ppi_assemble + * config/tc-sh.c: Included dwarf2dbg.h. + (debug_line): Defined. + (md_assemble): Generates dwarf2 line info. + (sh_finalize): New function. Finalize dwarf2 info. + (assemble_ppi): Returns size of code generated. + (build_Mytes): Returns size of code generated. + (md_pseudo_table): Added "file" and "loc" psuedo ops. + * config/tc-sh.h (md_end): Defined. + (sh_finalize): Declared. + +2000-08-15 Alexandre Oliva + + * config/tc-sh.c (md_apply_fix) [BFD_RELOC_32, BFD_RELOC_16]: Use + md_number_to_chars. + +2000-08-14 Nick Clifton + + * config/tc-arm.c (do_bx): Allow "bx pc". + +2000-08-14 Jim Wilson + + * config/tc-ia64.c (md_longopts): Add -mconstant-gp and -mauto-pic. + (md_parse_option): Add OPTION_MCONSTANT_GP and OPTION_MAUTO_PIC. + (md_begin): Change assignment to md.flag to OR in the new bit. + +2000-08-14 Mark Elbrecht + + * config/obj-coff.c (obj_coff_endef) [BFD_ASSEMBLER]: Set the debug + flag for storage types C_ARG, C_REGPARM, C_FIELD, C_MOS, C_MOE, + C_MOU, and C_EOS. + +2000-08-14 Jason Eckhardt + + * NEWS: Mention i860 support. + +2000-08-14 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10300.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + +2000-08-14 Andreas Schwab + + * doc/c-arm.texi (ARM Directives): Fix warnings from makeinfo. + +2000-08-11 Andreas Schwab + + * doc/c-i860.texi (Opcodes for i860): Remove braces from @item + argument. + +2000-08-11 Kazu Hirata + + * expr.c: Fix formatting. + * config/obj-bout.c: Likewise. + +2000-08-10 Jason Eckhardt + + * doc/c-i860.texi: Flesh out the i860 section more. + +2000-08-10 Kazu Hirata + + * symbols.c: Fix formatting. + * expr.c: Likewise. + +2000-08-09 Diego Novillo + + * config/tc-i386.c (md_assemble): Skip suffix check if the opcode + modifier has the IgnoreSize bit set. + +2000-08-09 Alan Modra + + From Rodney Brown + * configure.in: Use elf on Unixware 7 (i586-sco-sysv5uw7.1.0) + * configure: Regenerate. + +2000-08-09 Kazu Hirata + + * hash.c: Fix formatting. + * gasp.c: Likewise. + +2000-08-08 Jason Eckhardt + + * config/tc-i860.h: Rework completely for BFD_ASSEMBLER. + (i860_fix_info): New enum. + (MD_APPLY_FIX3): Define. + (WORKING_DOT_WORD): Define. + (TC_HANDLES_FX_DONE): Define. + (DIFF_EXPR_OK): Define. + (LISTING_HEADER): Define. + (TARGET_FORMAT): Select target format based on endian flag. + (TARGET_BYTES_BIG_ENDIAN): Default to little endian. + (target_big_endian): Add external declaration. + + * config/tc-i860.c: All existing code reworked completely. Other + new code shown below. + (SYNTAX_SVR4): Define. + (target_warn_expand): New variable. + (md_shortopts): Declare and define (-Qy, -Qn, and -V options). + (md_longopts): Declare and define with new options (-EL, -EB, + and -mwarn-expand). + (md_show_usage): New function. + (md_operand): New function. + (obtain_reloc_for_imm16): New function. + (md_apply_fix3): New function. + (tc_gen_reloc): New function. + +2000-08-08 Stephane Carrez + + * config/tc-m68hc11.c (build_jump_insn): Make sure the + 2 bytes of the jump address are in the same frag. + (find): Accept 68hc12 register indirect modes. + + * NEWS: Mention 68HC11 & 68HC12 support. + +2000-08-07 Richard Henderson + + * config/tc-ia64.c (unwind): Add prologue_mask member. + (dot_vframe): Elide psp_gr record if it overlaps prologue_gr. + (dot_save): Likewise for pfs_gr, rp_gr, and preds_gr. + (dot_body): Clear unwind.prologue_mask. + (dot_prologue): Set it. Accept a register second argument. + +2000-08-07 Kazu Hirata + + * config/atof-ieee.c: Fix formatting. + * config/atof-tahoe.c: Likewise. + +2000-08-06 Nick Clifton + + * config/tc-sparc.c (md_begin): Fix typo in recent formatting + work. + + * doc/as.texinfo (Pseudo Ops): Update to include descriptions + of .popsection, .previous, .pushsection, .subsection, + .version, .vtable_entry, .vtable_inherit and .weak. + +2000-08-05 Kazu Hirata + + * config/tc-cris.c: Fix formatting. + * config/tc-i386.c: Likewise. + * config/tc-sparc.c (sparc_ip): Simplify the code. + +2000-08-04 Kazu Hirata + + * config/tc-cris.c: Rearrange code for readability. + * config/tc-d10v.c: Fix formatting. + * config/tc-m32r.c: Likewise. + * config/tc-sparc.c: Likewise. + +2000-08-02 Jim Wilson + + * config/tc-ia64.c (emit_one_bundle): Call ia64_free_opcode + before ia64_find_opcode. + (md_assemble): Likewise. + +2000-08-01 Nick Clifton + + * config/tc-arm.c (do_mrs): Fix skip of 'cpsr_all' flag. + Undo some formatting fixes. + +2000-08-01 Kazu Hirata + + * config/obj-som.c: Fix formatting. + * config/obj-ieee.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-v850.c: Likewise. + +2000-08-01 Nick Clifton + + * doc/c-m68k.texi (section M680x0 Options): Turn into a table + index by command line option. + +2000-08-01 Michael Sokolov + + * doc/c-m68k.texi (@cindex @samp{--pcrel}): Rewrite option description. + (@node M68K-Branch): Rewrite to match the reality. + +2000-07-31 Jason Eckhardt + + * doc/c-i860.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add c-i860.texi. + * doc/Makefile.in: Regenerate. + * doc/all.texi: Add I860 as relevant architecture. + * doc/as.texinfo: Include i860 dependent file c-i860.texi. + +2000-07-31 Kazu Hirata + + * config/tc-d30v.c: Fix formatting. + +2000-07-31 Michael Sokolov + + * config/tc-m68k.c (flag_keep_pcrel, OPTION_PCREL): Add --pcrel option. + (md_convert_frag_1, md_estimate_size_before_relax): When making DBcc + long emit a long branch if available instead of an absolute jump, never + emit absolute jumps for anything with --pcrel. + + * doc/c-m68k.texi: Document new command line option. + +2000-07-29 Marek Michalkiewicz + + * config/tc-avr.c: Use PARAMS macro in function declarations. + Don't declare md_pcrel_from_section (already in tc-avr.h). + (avr_operands): Use AVR_UNDEF_P and AVR_SKIP_P macros. + (avr_operand): Don't set (unsigned) op_mask to -1. + +2000-07-28 Jason Eckhardt + + * configure.in: Add bits for i860-stardent-{sysv4, elf}*. + * configure: Regenerated. + * config/obj-elf.c (obj_elf_type): Recognize a fifth type + of operand to the .type directive (.e.g, "type"). + +2000-07-28 Alan Modra + + * as.h (warn_comment, found_comment, found_comment_file): Declare. + * app.c (do_scrub_chars): Record where first comment found. + * read.c (read_a_source_file): Init found_comment on entry, and + notify whether comments found on exit. + * config/tc-hppa.c (md_shortopts): Add "c". + (md_longopts): Add warn-comment. + (md_parse_option): Handle it. + (md_show_usage): Show available options. + * config/tc-hppa.h (WARN_COMMENTS): Define if TE_LINUX + +2000-07-27 Andrew Cagney + + * config/tc-mn10300.c (md_convert_frag): Fix printfs. + (tc_gen_reloc): Add cast when assigning bfd_abs_symbol to + sym_ptr_ptr + (md_estimate_size_before_relax): Don't fall off end of function. + +2000-07-27 Kazu Hirata + + * config/tc-avr.c: Fix formatting. + * config/tc-ns32k.c: Likewise. + +2000-07-27 Alan Modra + + * config/tc-d10v.c (find_opcode): Remove extraneous `='. + +2000-07-27 Kazu Hirata + + * config/tc-d10v.c: Fix formatting. + * config/tc-z8k.c: Likewise. + * config/tc-sparc.c: Likewise. + +2000-07-26 Dave Brolley + + * cgen.c (queue_fixup): Declare opinfo. + (gas_cgen_parse_operand): Mark unused parameters with ATTRIBUTE_UNUSED. + (gas_cgen_md_operand): Ditto. + (gas_cgen_md_apply_fix3): Ditto. + +2000-07-24 Mark Elbrecht + + * config/obj-coff.c (obj_frob_symbol): Don't merge + labels. Don't merge if the symbol isn't constant. Return + immediately if a symbol is merged. + +2000-07-22 Alan Modra + + * frags.c (frag_align): Correct absolute section alignment. + +2000-07-20 DJ Delorie + + * config/obj-coff.c (obj_frob_symbol): revert previous change, + it breaks linking against DLLs. + +2000-07-20 Hans-Peter Nilsson + + * configure.in: Add CRIS support. + * configure: Regenerate. + * Makefile.am: (CPU_TYPES): Add cris. + (CPU_OBJ_VALID) [aout]: Add cris. + (MULTI_CPU_TYPES): Add cris. + (MULTI_CPU_OBJ_VALID) [aout]: Add cris. + [coff]: Only i386 and mips are valid. + (TARGET_CPU_CFILES): Add config/tc-cris.c. + (TARGET_CPU_HFILES): Add config/tc-cris.h. + (MULTI_CFILES): Add config/e-crisaout.c and config/e-criself.c. + Regenerate dependencies. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * as.c: Declare crisaout, criself. + * config/tc-cris.h, config/tc-cris.c: New. + * config/e-criself.c, config/e-crisaout.c: New. + * po/POTFILES.in, po/gas.pot: Regenerate. + +2000-07-20 Kazu Hirata + + * read.c: Fix formatting. + * write.c: Fix formatting. + +2000-07-19 H.J. Lu + + * sb.c: Include if exists for abort (). + +2000-07-19 Alan Modra + + * config/tc-hppa.c (hppa_fix_adjustable): Correct LR%/RR% comment. + (arg_reloc_stub_needed): #ifdef OBJ_SOM, not #ifdef SOM. + (pa_type_args): Same here. + +2000-07-17 Mark Elbrecht + + * config/obj-coff.c (obj_frob_symbol): Don't merge labels. Don't + merge if the symbol isn't constant. Don't call S_SET_EXTERNAL if + the storage class is already set. + +2000-07-17 Kazu Hirata + + * config/tc-m68hc11.c: Fix formatting. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-pj.c: Likewise. + * config/tc-tic80.c: Likewise. + * config/tc-w65.c: Likewise. + +2000-07-17 Frank Ch. Eigler + + * expr.c (operand): Permit %bin literals if LITERAL_PREFIXPERCENT_BIN + is defined. + +2000-07-15 Ian Lance Taylor + + * doc/c-mips.texi (MIPS Opts): Remove erroneous space after + @code. + +2000-07-15 Alan Modra + + * config/tc-hppa.c (hppa_fix_adjustable): Use the same checks for + ELF as are used for SOM (except the 32-bit reloc one) to decide + whether a symbol can be reduced to a section symbol. Expand on + the comment for symbols involved in LR% and RR% expressions. + +2000-07-14 Nick Clifton + + * config/tc-mips.c (mips_disable_float_construction): New + static variable. Set to true if doubles should not be + constructed by loading two single width fp registers with + halves of the value. + (mips_ip): Test mips_disable_float_construction. + (md_longopts): Add command line switches --construct-floats + and --no-construct-floats. + (md_parse_option): Parse new command line options. + (md_show_usage): Describe new command line options. + + * doc/c-mips.texi: Document new command line options. + +2000-07-13 Koundinya K + + * configure.in: Remove the test /usr/dde for mips-*-sysv4*MP* + * configure: Regenerate. + +2000-07-13 Hans-Peter Nilsson + + * configure.in (DEFAULT_EMULATION setting): Revert part of + 2000-07-01 change that set te_multi=multi unless set to tmips. + * configure: Regenerate. + +2000-07-12 Mark Elbrecht + + * config/obj-coff.c (coff_frob_section): Add padding to the last + section when aligning it increases its size. + +2000-07-11 Kazu Hirata + + * config/tc-tic54x.c: Fix formatting. + +2000-07-10 Kazu Hirata + + * config/tc-h8500.c: Fix formatting. + * config/tc-tic54x.c: Fix formatting. + +2000-07-10 Alan Modra + + * config/tc-hppa.c (md_apply_fix): Check fmt 12 and 22 pc-rel + displacements correctly. + + * read.h (s_abort): Add ATTRIBUTE_NORETURN. + +2000-07-10 Ryan Bradetich + + * hash.c (hash_insert): Add cast to obstruct_alloc to fix + warning. + (hash_jam): Ditto. + +2000-07-09 Alan Modra + + From David Huggins-Daines + * config/te-hppalinux64.h: Add a new emulation. + * configure.in (emulations): Add configure bits to support the + 64-bit Linux/parisc target. + * configure: Regenerate. + + * config/tc-hppa.c (md_parse_option): Support `-V' for ELF. + (md_shortopts): Add `V' for ELF. + + * config/tc-hppa.c (arg_reloc_stub_needed): Define as zero except + when SOM or ELF_ARG_RELOC are defined. + (pa_type_args): Only set symbol_arg_reloc_info when SOM or + ELF_ARG_RELOC are defined. + (pa_stringer_aux): Don't pa_check_current_space_and_subspace here.. + (pa_stringer): ..Do it here instead. Fix comment typos. + (hppa_force_relocation): Cast enums to int before comparing with + ints. + + From Ryan Bradetich + * config/tc-hppa.c: Removed unneeded libbfd.h to fix macro + redifinition warning. + (md_apply_fix): Added cast from enum to int for fixP->fx_r_type. + (hppa_force_relocation): ditto + (md_apply_fix): Added cast to buf to fix warnings. + + * config/tc-hppa.h (pa_define_label, parse_cons_expression_hppa, + cons_fix_new_hppa, hppa_force_relocation): Prototype. + + * config/tc-hppa.c (reloc_type): It's an enum for OBJ_ELF. + (R_N0SEL, R_N1SEL): Define only for OBJ_SOM. + (tc_gen_reloc): Make `code' a reloc_type and `codes' a + reloc_type** to avoid warnings in switch. + (md_apply_fix): Make insn, val signed. Zap buf_wd and read insn a + little earlier instead. + + * config/tc-hppa.c (symbol_arg_reloc_info): Define for both som + and elf. + (pa_type_args): Use symbol_arg_reloc_info. + (struct pa_it): Make arg_reloc unsigned int. + (struct hppa_fix_struct): Likewise for fx_arg_reloc. + (pa_text, pa_data, pa_comm): Don't compile for TE_LINUX. + (pa_code): Delete. pa_text duplicates this function. + (md_pseudo_table): Call obj_elf_text for ".code" if TE_LINUX. + (fix_new_hppa): Argument offset is offsetT, arg_reloc is unsigned + int. + (cons_fix_new_hppa): Actually change selector to e_fsel when + warning about assuming so. + (tc_gen_reloc): More example elf arg reloc code. + (md_apply_fix): Use arg_reloc_stub_needed for elf too. + (hppa_force_relocation): Likewise. + + * config/tc-hppa.h: Use TARGET_ARCH_SIZE to select target include + files. + (pa_end_of_source): Prototype. + (hppa_fix_adjustable): Prototype. + (LABELS_WITHOUT_COLONS): Move it.. + * config/te-hppa.h: To here. + + * config/te-hppa64.h: New file. + + * config/tc-hppa.c: Use TARGET_ARCH_SIZE to select target reloc + type. + (md_apply_fix): Pass stdoutput to bfd_hppa_insn2fmt. Handle + format -10, -16, 16 relocs. + (hppa_elf_mark_end_of_function): Test for null + last_call_info->start_symbol + + * config/tc-hppa.c (pa_ip): In case 'V', pass `strict' to + CHECK_FIELD, not INSERT_FIELD_AND_CONTINUE. Don't pass opcode to + re_assesmble_* functions. Delete extraneous statements. Fix + typos in comments. + (md_apply_fix): Compare against 1048575 in case 21. Don't pass + insn to re_assemble_*. + +2000-07-08 Ulf Carlsson + + * doc/internals.texi (Expressions): Fix typo. + +2000-07-08 Kazu Hirata + + * config/tc-sh.c: Fix formatting. + * config/tc-tic54x.c: Fix formatting. + * depend.c: Fix formatting. + * flonum-konst.c: Likewise. + * flonum-mult.c: Likewise. + +2000-07-07 Kazu Hirata + + * config/tc-sh.c: Fix comments. + * config/obj-vms.c: Fix comments. + * config/tc-a29k.c: Likewise. + * config/tc-alpha.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8500.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-z8k.c: Likewise. + +2000-07-06 Mark Elbrecht + + * config/obj-coff.c (TC_COFF_SECTION_DEFAULT_ATTRIBUTES): New. + Default to '(SEC_LOAD | SEC_DATA)'. + (obj_coff_section) [BFD_ASSEMBLER]: Use it. + + * doc/internals.texi (CPU Backend): Describe + TC_COFF_SECTION_DEFAULT_ATTRIBUTES. + +2000-06-06 Andrew Cagney + + * as.c (parse_args): NULL terminate the long option list. + +2000-06-04 Andrew Cagney + + * config/tc-d30v.h: Include "write.h" for fixS. + (d30v_start_line, md_pcrel_from_section): Add function prototypes. + +2000-07-05 Nick Clifton + + * config/tc-d30v.c (write_2_short): Further changes to warning + messages produced when combining EITHER_BUT_PREFER_MU attributed + opcodes. + +2000-07-05 DJ Delorie + + * MAINTAINERS: new + +2000-07-04 Alexandre Oliva + + * config/tc-arm.c (psrs): Accept combinations of flags. + +2000-07-03 Marek Michalkiewicz + + * config/tc-avr.c: Change _ () to _() around all strings marked + for translation (exception from the usual coding style). + (avr_opt): New struct variable, how the new switches are set. + (OPTION_MMCU): Define as 'm' and actually use. + (md_longopts): Add -mall-opcodes, -mno-skip-bug, -mno-wrap. + (show_mcu_list): New function, display the list of known MCUs. + (md_show_usage): Document the new switches. Call show_mcu_list. + (avr_set_arch): Change 'm' to OPTION_MMCU. + (md_parse_option): Call show_mcu_list if unknown MCU specified. + Handle the new switches. + (avr_operands): Disable warnings for undefined combinations of + operands if -mall-opcodes. Disable warnings for skipping two-word + instructions if enhanced core or -mno-skip-bug. + (avr_operand): Accept all addressing modes on avr1 if -mall-opcodes. + (md_apply_fix3): Reject 8K wrap if >8K or -mno-wrap. + (md_assemble): Accept opcodes not supported by MCU if -mall-opcodes. + (avr_ldi_expression): Warn about implicit lo8(). + * config/tc-avr.h (md_pcrel_from_section): Add prototype. + +2000-07-01 Koundinya K + + * configure.in: Add entry for mips-*-sysv4*MP* + * configure: Rebuild + * config/tc-mips.c (mips_target_format): Return elf32-tradbigmips or + elf32-tradlittlemips for traditional mips targets. + * config/tc-mips.c (md_estimate_size_before_relax): Duplicate the + test for Link Once sections as in adjust_reloc_syms. + * config/te-tmips.h: New file for traditional mips targets. Define + TE_TMIPS. + +2000-06-29 Mark Elbrecht + + * config/obj-coff.c (obj_coff_setcion) [BFD_ASSEMBLER]: If the + flags argument is not present, don't change an existing section's + section's attributes. If the flags argument is present, warn if the + attributes don't match the section's current attributes. When + long section names are supported, set SEC_LINK_ONCE and + SEC_LINK_DUPLICATES_DISCARD for a new .gnu.linkonce section. + +2000-06-29 Hans-Peter Nilsson + + * config/obj-aout.c (obj_aout_type): Do not ignore for undefined + symbols; create them. + +2000-06-29 Mark Elbrecht + + * write.c (set_segment_vma): New: Set vma and lma for a segment. + (write_object_file) [BFD_ASSEMBLER && OBJ_COFF && TE_GO32]: Use it. + +2000-06-27 Aldy Hernandez + + * config/tc-mips.c (mips_ip): handle "(foo-.-4)" type of + expressions. Ignore the problem when handling 16 bit signed + immediates, because the assembler will take care of the relocation + later. + +2000-06-27 Nick Clifton + + * config/tc-d30v.c (write_2_short): Do not allow opcodes with + the EITHER_BUT_PREFER_MU attribute to be combined into a reverse + sequential order, and emit warning messages if the input source + code contains constructs like that, or parallel constructs + containing such opcodes. + +2000-06-26 Marek Michalkiewicz + + * config/tc-avr.c (mcu_types): Rename avr4 to avr5, add avr4. + Add more MCU types for avr4 and avr5. Replace at94k{10,20,40} + with just at94k. Change AVR_ISA_85xx back to AVR_ISA_2xxx. + (md_show_usage): Update usage message. + (md_parse_option): Allow redefinition of MCU type within the + same avr[1-5] bfd machine type. Show both old and new MCU type + in the error message. + (md_apply_fix3): Support 8K wrap if AVR_ISA_MEGA is not set. + Simplify 8K wrap code. + +2000-06-25 Kazu Hirata + + * config/obj-aout.c: Remove all uses of DEFUN. + * config/obj-ieee.c: Likewise. + * config/tc-sh.c: Fix comment typos. + * config/tc-tahoe.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-z8k.c: Likewise. + * config/tc-h8300.c (build_bytes): Assemble ldmac correctly. + +2000-06-24 DJ Delorie + + * config/tc-i386.c (md_estimate_size_before_relax): Revert + more changes from Sept 1999 + (tc_i386_fix_adjustable): ditto + (md_apply_fix3): ditto + +2000-06-24 Frank Ch. Eigler + + * cgen.c (expr_jmp_buf_p): New validity flag for expr_jmp_buf. + (gas_cgen_parse_operand): Set it around expression() call. + (gas_cgen_md_operand): Test for it before longjmp(). + +2000-06-24 Kazu Hirata + + * config/tc-h8500.c: Remove all uses of DEFUN. + * config/tc-sh.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-z8k.c: Likewise. + + * config/tc-h8500.c: Fix typos in comments. + +2000-06-23 Frank Ch. Eigler + + * expr.c (operand): Permit $hex literals if LITERAL_PREFIXDOLLAR_HEX + is defined. + +2000-06-23 matthew green + + * expr.c (operand): Do not as_bad() if RELAX_PAREN_GROUPING is + defined. Fix error message for `[' grouping. + +2000-06-22 Kazu Hirata + + * config/tc-h8300.c: Fix formatting and comment typos. + +2000-06-22 Timothy Wall + + * config/tc-ia64.c (note_register_values): Move premature QP + notation clearing into the appropriate place. + +2000-06-22 Alan Modra + + * dep-in.sed: Escape literal `.'s on patterns. Trim off `../' + first before anything else. Add bin-bugs.h, emul.h and progress.h + Sort list of files as for $(OBJS) in Makefile.am. + + * Makefile.am (DEP): grep for leading `/' in DEPA, and fail if we + find one. Remake dependencies. + ($(OBJS)): Add bin-bugs.h, emul.h, and progress.h Sort the list. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + + * config/tc-i386.c (i386_displacement): Don't assume a constant + displacement is necessarily 16 bits when in 16 bit code mode. + (md_assemble): Instead size the displacement here after we know + for sure that a .code16gcc operand hasn't automatically added + operand size prefixes. + +2000-06-21 H.J. Lu + + * Makefile.am: Rebuild dependency. + * Makefile.in: Rebuild. + +2000-06-21 Kazu Hirata + + * config/tc-h8300.c (parse_reg): Make the function static. + (parse_exp): Likewise. + +2000-06-20 DJ Delorie + + * config/tc-i386.c (tc_i386_fix_adjustable): Revert change from + Sept 1999; RVA relocs need to be treated more like DIR32 relocs + for cygwin import libraries to work properly. + +2000-06-20 H.J. Lu + + * Makefile.am: Rebuild dependency. + * Makefile.in: Rebuild. + * configure: Likewise. + * doc/Makefile.in: Likewise. + +2000-06-20 Timothy Wall + + * doc/internals.texi (CPU backend): Add @itemx for + TC_START_LABEL_WITHOUT_COLON. + * doc/c-tic54x.texi: New. + * doc/as.texinfo: Add tic54x features and include primary tic54x + documentation file. + * doc/all.texi: Add C54X. + * doc/Makefile.am (CPU_DOCS): Add c-tic54x.texi. + * doc/Makefile.in: Regenerate. + * configure.in: Add tic54x and define LIBM for tic54x. + * configure: Regenrate. + * config/tc-tic54x.[ch]: New. + * config/obj-coff.h: Add tic54x. + * Makefile.am: (CPU_TYPES): Add tic54x. + (TARGET_CPU_CFILES): Add 'tc-tic54x.c'. + (TARGET_CPU_HFILES): Add 'tc-tic54x.h'. + (as_new_LDADD): Add $(LIBM). + * Makefile.in: Regenerate. + +2000-06-18 Stephane Carrez + + * doc/Makefile.am (CPU_DOCS): Added 68hc11 file. + * doc/c-m68hc11.texi: Document 68HC11 and 68HC12 port. + * doc/as.texinfo: Likewise. + + * configure, Makefile.in: Regenerate. + * configure.in (emulations): Recognize m6811 and m6812. + * Makefile.am (CPU_TYPES, TARGET_CPU_CFILES, TARGET_CPU_HFILES): + Added files for 68hc11 and 68hc12 assembler. + * config/tc-m68hc11.c: Assembler for 68hc11 and 68hc12. + * config/tc-m68hc11.h: Header definition for that assembler. + +2000-06-18 Nick Clifton + + * symbols.c (resolve_symbol_value): Use bfd_octets_per_byte + instead of OCTETS_PER_BYTE. + + * config/tc-v850.c: Fix compile time warnings. + * config/tc-ppc.c: Fix compile time warnings. + +2000-06-18 H.J. Lu + + * configure.in: Don't emulate i386-pc-pe-coff with i386coff. + * configure: Rebuild. + +2000-06-17 Mark Elbrecht + + * config/obj-coff.c (obj_coff_weak): Typo fix: Change BFD_ASSEMLER + to BFD_ASSEMBLER. + +2000-06-16 Nick Clifton + + * config/tc-mips.c (md_parse_option): Accept RM5200,RM5230, + RM5231, RM5261, RM5721 and RM7000 as r5000 cpu variants. + + * doc/c-mips.texi: Document newly accepted cpu variants. + +2000-06-15 Ulf Carlsson + + * config/tc-mips.h: Remove definition of ONLY_STANDARD_ESCAPES. + +2000-06-13 Ulf Carlsson + + * macro.c (getstring): Make it possible to escape the quote + character. + +2000-06-13 Catherine Moore + + * config/tc-hppa.c (pa_export): Weak symbols can be global. + +2000-06-13 H.J. Lu + + * configure: Regenerate. + +2000-06-09 Alan Modra + + * app.c (do_scrub_begin): Don't default lex[';'] as a line + separator. + * doc/internals.texi (line_separator_chars): Semicolon is no + longer a default. Mention null and newline as defaults. + + * read.c (is_end_of_line): Remove ifdef TC_HPPA. + + * config/tc-i386.h (line_separator_chars): Explicitly mention `;' + * config/tc-i860.h (line_separator_chars): Likewise. + * config/tc-h8300.c (line_separator_chars): Likewise. + * config/tc-i960.c (line_separator_chars): Likewise. + * config/tc-m68k.c (line_separator_chars): Likewise. + * config/tc-mips.c (line_separator_chars): Likewise. + * config/tc-ns32k.c (line_separator_chars): Likewise. + * config/tc-sparc.c (line_separator_chars): Likewise. + * config/tc-vax.c (line_separator_chars): Likewise. + + * config/tc-h8300.c (comment_chars): Use string initialiser. + * config/tc-i960.c (line_comment_chars): Likewise. + * config/tc-z8k.c (comment_chars, line_comment_chars, + line_separator_chars): Likewise. + + * config/tc-arm.c (line_separator_chars): Always use `;', not just + for TE_LINUX. + +2000-06-08 Nick Clifton + + * config/tc-arm.c (cons_fix_new_arm): Assign correct reloc value + for size 1 fixes. + +2000-06-08 David O'Brien + + * configure.in (VERSION): Update to show this is the CVS mainline. + +2000-06-08 Matthew Jacob + + * config/tc-alpha.c (md_undefined_symbol): Properly understand that + $at is the integer register $r28, vs. both $r28 and the floating + point register $f28. + +2000-06-08 James E. Wilson + + * config/tc-ia64.c (generate_unwind_image): Call ia64_flush_insns. + (dot_endp): Don't call ia64_flush_insns. + (emit_one_bundle): Don't delete prologue/body records from + unwind_record list in first loop. Rewrite second loop to account for + this. + +2000-06-07 David Mosberger + + * config/tc-ia64.c: Add missing prototypes. + (generate_unwind_image): Cast argument to output_unw_records call. + +2000-06-07 Denis Chertykov + + * config/tc-avr.c (avr_operand): fix the formatting of the comment. + +2000-06-07 Denis Chertykov + + * config/tc-avr.c (AVR_ISA_???): moved to include/opcode/avr.h + (REGISTER_P): likewise. + (avr_opcodes): uses include/opcode/avr.h + (avr_operand): enable ld r,Z or st r,Z for at90s1200. + +2000-06-04 Alan Modra + + * read.c (is_end_of_line): No ';' for TC_HPPA. Add missing + initializers too. + +2000-06-03 H.J. Lu + + * read.c (is_end_of_line): Put back `;'. + +2000-06-03 Alan Modra + + * config/tc-i386.c (md_shortopts): Remove 'm', add 'q' to non-elf. + +2000-06-01 Alan Modra + + * expr.c (operand): Test is_end_of_line outside switch to catch + line separator chars that are also operators. + (operator): Return O_illegal for line separator chars. + + * read.c (is_end_of_line): Use 1 instead of 99. Don't set `;' + entry (or `!' entry for TC_HPPA). + + * config/tc-arm.c (my_get_float_expression): Cast to unsigned char + before indexing is_end_of_line. Remove redundant check for '\0'. + (fp_op2): Likewise. + * config/tc-h8500.c (md_assemble): Likewise. + * config/tc-mcore.c (md_assemble): Likewise. + * config/tc-tic30.c (tic30_find_parallel_insn): Likewise. + (md_atof): Likewise + + * config/tc-m88k.c (s_bss): Cast to unsigned char before indexing + is_end_of_line. + * config/tc-mcore.c (mcore_cons): Likewise. + (mcore_float_cons): Likewise. + (mcore_stringer): Likewise. + * config/tc-tic30.c (tic30_find_parallel_insn): Likewise. + +2000-06-01 Scott Bambrough + + * config/tc-arm.c (do_mrs): Allow SPSR_BIT to be set correctly. + +2000-05-29 Nick Clifton + + * config/tc-sh.c: Fix compile time warning messages. + + * config/tc-mips.c: Fix compile time warning messages. + +2000-05-29 Philip Blundell + + * doc/as.texinfo: Update copyright dates. + (Local Labels): Delete misplaced mention of ARM. + * NEWS: Mention ARM ELF support. + +2000-05-27 Alexandre Oliva + + * config/tc-mn10300.c (md_assemble): Copy size to real_size before + it is modified, and use the real_size to compute the frag address + for dwarf2 line info. + +2000-05-27 Alan Modra + + * Makefile.am (DEP, DEP1, dep, dep-in, dep-am): Use a better sed + line-matching scheme to cope with automake moving variables around. + ($(TARG_CPU_O)): Remove dependency on TARG_CPU_DEP_@target_cpu_type@ + * Makefile.in: Regenerate. + +2000-05-26 Jakub Jelinek + + * config/tc-sparc.c (sparc_relax): New. + (md_longopts): Add -relax and -no-relax options. + (md_parse_options, md_show_usage): Likewise. + (md_apply_fix3): Optimize tail call into branch always if possible. + +2000-05-04 Donald Lindsay + + * config/tc-d10v.c (write_2_short, parallel_ok, md_assemble, + d10v_cleanup) implement Mitsubishi's newly explained branch-packing + rules, with warning when a GAS statement specifies a packing that + will result in an instruction being squashed. + Added typdef packing_type and enumerals, changed various integer + literals to use the enumerals. + +2000-05-24 David Mosberger + + * config/tc-ia64.c (dot_restorereg_p): New function. + (md_pseudo_table): Add restorereg.p. + (output_X3_format): Fix typo: record type should be UNW_X3, not UNW_X1. + (output_X4_format): Fix typo: record type should be UNW_X4, not UNW_X2. + + * config/tc-ia64.h (unw_record_type): Add unwabi. + (unw_r_record): Rename member MASK to GRMASK. Add sub-structure + called MASK with members for imask, and the masks produced by + fr_mem, gr_mem, br_mem, and frgr_mem. + (unw_p_record): Add members ABI and CONTEXT. + (unw_x_record): Add member AB. + * config/tc-ia64.c (enum reg_symbol): Add REG_PSP and REG_PRIUNAT + as pseudo-register for use during unwind info generation. + (AR_PFS, AR_LC): New macros. + (enum pseudo_type): Add PSEUDO_FUNC_REG to permit declaring registers + whose names start with an at sign (as in "@priunat"). + (pseudo_func): Add "svr4", "hpux", "nt" constants and "priunat" + register. + (unwind_list, unwind_tail, current_unwind_entry, proc_start, + proc_end, unwind_info, personality_routine): Consolidate into + "unwind" structure to reduce offset-table use. Add member + NEXT_SLOT_NUMBER to track the slot number for the next instruction + to be emitted. + (output_R1_format, output_R3_format, output_P3_format, + output_P6_format): Initialize R with zero to reduce compiler warnings. + (output_P7_format): Ditto. Add `default' branch to switch + statement to reduce compiler warnings. + (output_P8_format, output_B1_format, output_B4_format): Ditto. + (output_P4_format): Rename 2nd & 3rd arg to IMASK and IMASK_SIZE. + (format_ab_reg): Rename from format_a_b_reg. Merge A and B args + into single argument. + (output_X1_format, output_X3_format): Initialize R with zero to reduce + compiler warnings. Merge A and B args into single argument. + (output_X2_format, output_X4_format): Remove unused variable R. Merge + A and B args into single argument. + (free_record): Removed (wasn't used). + (free_list_records): Also free imasks in prologue records. + (output_prologue, output_prologue_gr): Initialize mask bits to zero. + (output_spill_mask): Remove. + (output_unwabi): New function. + (output_epilogue, output_label_state, output_copy_state): Call + alloc_record. + (output_spill_psprel, output_spill_sprel, output_spill_psprel_p, + output_spill_sprel_p, output_spill_reg, output_spill_reg_p): Add AB + argument. + (process_one_record): New locals FR_MASK and GR_MASK. Ignore + gr_mem, fr_mem, br_mem, and frgr_mem records and instead emit them + as part of handling the prologue records. Emit region's imask if + we have one. Handle unwabi, epilogue, label_state, copy_state, + spill_psprel, spill_sprel, spill_reg, spill_psprel_p, + spill_sprel_p, and spill_reg_p records. + (set_imask, count_bits, slot_index): New function. + (fixup_unw_records): Fix region size computation. Handle + epilogue, spill_reg, spill_sprel, spill_psprel, spill_reg_p, + spill_sprel_p, and spill_psprel_p records. Merge mask bits of + frgr_mem, fr_mem, gr_mem, br_mem on a per-region basis and + set_imask accordingly. Update imask for gr_gr, and br_gr records. + (convert_expr_to_ab_reg, convert_expr_to_xy_reg): New function. + (dot_save): Use manifest constants for applicaton registers. + Handle REG_PR and REG_PRIUNAT. + (dot_restore): Don't just ignore it. + (dot_restorereg): New function.. + (generate_unwind_image): Ensure unwind info is a multiple of eight + bytes, not just four bytes. + (dot_handlerdata, dot_unwentry): Demand empty rest of line. + (dot_altrp): Don't just ignore it. + (dot_savemem): New function. Replaces dot_savesp() and + dot_savepsp(). Use manifest constants for applicaton registers. + Handle REG_PR and REG_PRIUNAT. + (dot_savef): Simplify. + (dot_saveb): Support generation of br_gr. + (dot_spillreg, dot_spillmem, dot_spillreg_p, dot_spillmem_p, + dot_label_state, dot_copy_state): New function. + (dot_unwabi): Don't just ignore it. + (md_pseudo_table): Add restorereg, spillreg, spillsp, spillpsp, + spillreg.p, spillsp.p, spillpsp, label_state, copy_state, + unwabi, vframesp, and vframepsp. Fix typo alprp->altrp. + (emit_one_bundle): Set slot number for prologue/body records + *before* emitting the first insn. + (emit_one_bundle): Set UNWIND.NEXT_SLOT_NUMBER. + (md_begin): Declare "psp" pseudo-register. + (md_operand): Handle PSEUDO_FUNC_REG. Fix printing of error message + so we don't get segfault. + (output_psp_sprel): Output sp/psp relative offsets as 4-byte word + counts as required per SW Conventions manual + (output_rp_psprel, output_rp_sprel, output_pfs_psprel,output_pfs_sprel, + output_preds_psprel, output_preds_sprel, output_spill_base, + output_unat_psprel, output_unat_sprel, output_lc_psprel, + output_lc_sprel, output_fpsr_psprel, output_fpsr_sprel, + output_priunat_psprel, output_priunat_sprel, output_bsp_psprel, + output_bsp_sprel, output_bspstore_psprel, output_bspstore_sprel, + output_rnat_psprel, output_rnat_sprel, output_spill_psprel, + output_spill_sprel, output_spill_psprel_p, output_spill_sprel_p):Ditto. + (dot_vframe): Implement. + (dot_vframesp, dot_vframepsp): New function. + +2000-05-23 Hans-Peter Nilsson + + * configure.in (i386-*-freebsd a.out entry): Quote properly. + * configure: Regenerate. + +2000-05-23 Alan Modra + + * config/tc-i386.c (md_assemble): Pass jump reloc in fr_var... + (md_estimate_size_before_relax): so we can use it here instead of + old kludges. Localise vars to blocks. Comment. + + * frags.c (frag_new): Update fr_var comments. + * frags.h (struct frag): Ditto. + +2000-05-22 Richard Henderson + + * config/tc-ia64.c (FUNC_PC_RELATIVE): New. + (pseudo_func): Add pcrel. + (operand_match): Handle IA64_OPND_TGT64. + (build_insn): Likewise. + (md_begin): Initialize pseudo_func[FUNC_PC_RELATIVE]. + (ia64_gen_real_reloc_type): Handle FUNC_PC_RELATIVE. + (fix_insn): Handle all three 64-bit relocation types. + +2000-05-22 Hans-Peter Nilsson + + * obj.h (struct format_ops): New members begin, app_file, + s_set_other, s_set_desc, s_get_type, s_set_type, + separate_stab_sections, init_stab_section. + + * config/obj-multi.h: Update GPL notice to v2. + (obj_begin): New. + (obj_app_file): New. + (S_SET_SIZE): Test s_set_size for NULL before calling. + (S_SET_ALIGN): Similar for s_set_align. + (S_SET_OTHER): New. + (S_SET_DESC): New. + (S_GET_TYPE): New. + (S_SET_TYPE): New. + (SEPARATE_STAB_SECTIONS): New. + (INIT_STAB_SECTION): New. + (EMIT_SECTION_SYMBOLS): New. + (AOUT_STABS) [OBJ_MAYBE_AOUT]: Define. + + * config/obj-elf.h: Update GPL notice to v2. + Mention that this file is included from obj-multi.h. + (obj_begin): Wrap definition in ifndef. + (elf_file_symbol): Constify declaration. + (obj_app_file): Ditto. + (SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB): + Wrap in ifndef SEPARATE_STAB_SECTIONS. + + * config/obj-elf.c (elf_s_set_other): New. + (elf_file_symbol): Constify argument. + (elf_separate_stab_sections): New. + (elf_init_stab_section): New. + (elf_format_ops): Add new members. Remove comma at end. + + * config/obj-ecoff.c (ecoff_separate_stab_sections): New. + (ecoff_format_ops): Add new fields. Remove comma at end. + Mention inconsistency for emit_section_symbols. + + * config/obj-coff.h (c_dot_file_symbol): Constify declaration. + + * config/obj-coff.c (c_dot_file_symbol): Constify argument. + (coff_separate_stab_sections): New. + (coff_format_ops): Add new members. + + * config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New. + (obj_aout_s_set_other): New. + (obj_aout_s_set_desc): New. + (obj_aout_s_get_type): New. + (obj_aout_s_set_type): New. + (obj_aout_separate_stab_sections): New. + (aout_format_ops): New members added. Use obj_aout_process_stab, + not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0. + (obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as + appropriate. + (obj_aout_line, obj_aout_weak, obj_aout_type): Ditto. + +2000-05-22 Alan Modra + + * config/tc-i386.c (tc_i386_fix_adjustable): Prevent adjustment + for OBJ_MAYBE_ELF too. Use S_IS_EXTERNAL instead of S_IS_EXTERN. + (md_estimate_size_before_relax): Ensure jumps to weak and + externally visible symbols are relocatable. + +2000-05-20 Hans-Peter Nilsson + + * stabs.c (aout_process_stab): Make global. + (s_desc): Add ATTRIBUTE_UNUSED to args as appropriate. + * read.h (aout_process_stab): Declare. + + * configure.in (EMULATIONS) [i386aout, i386coff, i386elf]: + Generalize to *aout, *coff *elf. + * configure: Regenerated. + + * doc/internals.texi (Object format backend): Say + SEPARATE_STAB_SECTIONS needs to be nonzero, not just defined. + + * Makefile.am (TARG_ENV_HFILES): Delete te-multi.h. + * Makefile.in: Regenerated. + +2000-05-19 Catherine Moore + + * cgen.h (GAS_CGEN_MAX_FIXUPS): Check if already defined. + +2000-05-18 Alan Modra + + * config/tc-hppa.c (md_apply_fix): Mask out immediate bits of + instruction to reflect change in re_assemble_*. + +2000-05-18 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa-*-hpux11*): If the cpu is hppa*64*, then + build PA64 ELF tools. + * configure: Rebuilt. + +2000-05-17 Alan Modra + + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + +2000-05-15 Nick Clifton + + * config/tc-arm.c (struct asm_psr): Add boolean field + distinguishing between CSPR and SPSR. Rename 'number' field + to 'field'. + (psrs): Rearrange contents to match new asm_psr structure. + (arm_psr_parse): Move next to psr_required_here. Make it + return an asm_psr structure. + (psr_required_here): Use asm_psr structure returned by + arm_psr_parse. + (do_msr): Reorganise to allow psr_required_here to be called + only once. + (md_undefined_name): Mark 'name' parameter as unused, since + the COFF target does not use it. + +2000-05-14 David O'Brien + + * config/te-386bsd.h: Clean up comments to adhere to the GNU coding + standards. + * config/te-aux.h: Likewise. + * config/te-dpx2.h: Likewise. + * config/te-go32.h: Likewise. + * config/te-hp300.h: Likewise. + * config/te-hppa.h: Likewise. + * config/te-i386aix.h: Likewise. + * config/te-ic960.h: Likewise. + * config/te-interix.h: Likewise. + * config/te-nbsd532.h: Likewise. + * config/te-pc532mach.h: Likewise. + * config/te-ppcnw.h: Likewise. + * config/te-psos.h: Likewise. + * config/te-sparcaout.h: Likewise. + * config/te-sun3.h: Likewise. + * config/te-sysv32.h: Likewise. + +2000-05-14 Alan Modra + + * config/tc-h8300.c (do_a_fix_imm): Don't rely on `short' being 16 + bits. Instead explicitly mask and sign extend. Do the 8 bit mask + and sign extend without an if statement. + (build_bytes): Likewise. + +2000-05-14 Kazu Hirata + + * config/tc-h8300.c (do_a_fix_imm): Output a reloc for no + X_add_symbol L_32 case. + +2000-05-14 David O'Brien + + * config/te-freebsd.h: New file. + +2000-05-13 Alan Modra + + * asintl.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. + + * NEWS: Mention x86 .arch and -q. + + * config/tc-i386.c (quiet_warnings): New. + (md_assemble): Use quiet_warnings. + (md_parse_option): Set quiet_warnings from -q. + (md_show_usage): Mention -q, delete -m. + (flag_do_long_jump): Delete. + (md_parse_option): Remove -m. + (md_show_usage): Remove -m. + (md_create_long_jump): Remove useless flag_do_long_jump code. + + * as.c (parse_args): In case OPTION_DEFSYM, use a valueT to hold + the symbol value, and use bfd_scan_vma if BFD_ASSEMBLER. + +2000-05-13 Alan Modra + Alexander Sokolov + + * doc/c-i386.texi (i386-Arch): New section. + (i386-Syntax): Mention .intel_syntax and .att_syntax. + + * config/tc-i386.c (cpu_arch_name, cpu_arch_flags): New. + (smallest_imm_type): Use smallest opcode for shift by one if cpu + architecture has been given and is not 486. + (set_cpu_arch): New. + (md_pseudo_table): Add .arch. + (md_assemble): Warn if cpu architecture has been given and an + unsupported instruction. + + * config/tc-i386.h (SMALLEST_DISP_TYPE): Delete. + Move operand_types bit defines after relevant template field. + (template): Add cpu_flags. + (Cpu*): Define. + (arch_entry): New. + +2000-05-12 Alexandre Oliva + + * config/tc-mn10300.h (md_end): Define. + (mn10300_finalize): Declare. + * config/tc-mn10300.c: Include dwarf2dbg.h. + (debug_line): Define. + (md_assemble): Generate dwarf2 line info. + (mn10300_finalize): New function. Finalize dwarf2 info. + +2000-05-11 Ulf Carlsson + + * config/tc-mips.c (md_estimate_size_before_relax): Use the + external version of the relocation for weak symbols. + +2000-05-08 David Mosberger + + * config/tc-ia64.c (output_P7_format, case mem_stack_f): Output fixed + frame size in units of 16 bytes, as required per SW Conventions manual. + (output_unw_records): Output info-block header as a dword to get + byte-order right. + +2000-05-08 Alan Modra + + * as.h: #include "file", not on files from ../include. + (as_abort, as_fatal): Add ATTRIBUTE_NORETURN. + * config/tc-m68k.c (m68k_ip): Fix signed/unsigned warnings. + (md_convert_frag): Add ATTRIBUTE_UNUSED. + (tc_coff_symbol_emit_hook): Ditto. + (OPTCOUNT): Cast to int to avoid compiler warning. + (md_begin): Fix signed/unsigned warnings. + +2000-05-08 Michael Sokolov + + * config/tc-m68k.c (md_convert_frag_1): Abort if we end up in the + ABRANCH LONG case for a conditional branch on a 68000. + (md_estimate_size_before_relax): Likewise. Also handle + flag_short_refs correctly for ABRANCH, BCC68000, and DBCC. + (m68k-ip: case ABSL): Relax absolute references to 16-bit + PC-relative on all CPUs. + (md_estimate_size_before_relax): Likewise. + +2000-05-04 Alan Modra + + * as.c (parse_args): Just mention current year in printed + copyright message. + +2000-05-03 J.T. Conklin + + * config/tc-ppc.c (pre_defined_registers): Add entries for vector + unit registers. + (md_parse_option): Recognize -m7400. + +2000-05-03 Ian Lance Taylor + + * config/atof-ieee.c (gen_to_words): When adding carry back in, + don't permit lp to become less than the words array. + +2000-05-03 Rodney Brown + + config/tc-mcore.c (md_apply_fix3): BFD_RELOC_MCORE_PCREL_IMM11BY2 + Fix little-endian case. + +2000-05-03 David O'Brien + + * as.c (parse_args): Update copyright. + +2000-05-03 Mark Elbrecht + + * config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 + for the .bss section too. + +2000-05-02 Alan Modra + + * configure.in: Set em=linux for hppa-*-linux. + * configure: Regenerate. + * doc/Makefile.in: Regenerate with correct automake. + + * frags.c (frag_grow): Sanity check chunk_size. + + * config/obj-elf.h: #include "bfd.h" not + * config/obj-som.h: Likewise. + * config/obj-ieee.h: Likewise. + + * config/tc-hppa.h: Test BFD_ARCH_SIZE, not BFD64. + + * config/tc-hppa.c (log2): Only compile when OBJ_SOM. + (md_pseudo_table): Fully initialise OBJ_ELF cases. + (fix_new_hppa): Add ATTRIBUTE_UNUSED to args as appropriate. + (pa_ip): low_sign_unext now returns via function value. Use + re_assemble_* instead of dis_assemble_* and + INSERT_FIELD_AND_CONTINUE combination. Don't call sign_unext + unnecessarily. + (md_convert_frag): Add ATTRIBUTE_UNUSED to args as appropriate. + (md_section_align, md_parse_option, md_show_usage, + md_undefined_symbol, pa_align, pa_block, pa_brtab, pa_try, + pa_callinfo, pa_code, pa_comm, pa_end, pa_enter, pa_entry, + pa_exit, pa_export, pa_import, pa_label, pa_leave, pa_level, + pa_origin, pa_param, pa_proc, pa_procend, pa_space, pa_spnum, + pa_version, pa_compiler, pa_copyright, pa_data, pa_fill, pa_lsym, + pa_text): Likewise. + (md_apply_fix): Change type of new_val to offsetT. Delete w1, w2, + w, resulti. Add insn, val. Move bfd_get_32 and bfd_put_32 + outside of switch. Correct mask and shifting errors in case 10 + and case -11. In case 21, compare against signed range to suit + hppa_field_adjust changes. In case 12, use re_assemble_12. In + case 17 and case 22, use offsetT variable to properly check range. + Use re_assemble_* here too. + (evaluate_absolute): Change type of value to offsetT. Call + hppa_field_adjust to do the work for us. + (pa_parse_cmpb_64_cmpltr): Delete save_s. + (pa_parse_cmpib_64_cmpltr): Ditto. + (pa_build_unwind_subspace): Delete unused var subseg. Change type + of i to unsigned int. + (pa_type_args): Conditionally declare symbol if OBJ_SOM. + (pa_end_of_source): Return type is void. + +2000-05-01 Catherine Moore + + * macro.c (macro_expand_body): Don't prepend macro number with zeroes. + +2000-05-01 Denis Chertykov + + * config/tc-avr.c: ATTRIBUTE_UNUSED added to the necessary places. + More comments added. + (md_begin): Removed "construct symbols for each register name". + Because register names conflicts with GCC generated function + names. + (avr_operand): Now constant numbers can be used as a register + identifiers (0 as r0, 31 as r31). + (md_assemble): use skip_space () before parsing instruction + operands. + +2000-05-01 Alan Modra + + * configure.in: Set bfd_gas=yes on i386-*-pe and i386-*-nt* to + ensure all pe targets use bfd. Remove unnecessary bfd_gas=yes on + arm-*-netbsd* and arm-*-wince as this is set for all arm*. + * configure: Regenerate. + +2000-04-29 Andreas Jaeger + + * as.h: Correctly check GCC version. + +2000-04-26 David O'Brien + + * doc/as.1: Fix unbalanced brackets. + + * config/tc-i386.c (comment_chars): Don't use '/' as comment start if + TE_FreeBSD. + (line_comment_chars): Set to '/' if TE_FreeBSD. + +2000-04-25 Jeffrey A Law (law@cygnus.com) + + * configure.in: Configury support for PA64 (currently disabled). + * configure: Rebuilt. + +2000-04-25 Machida Hiroyuki + + * config/tc-mips.c (s_change_sec): Use record_alignment, not + bfd_set_section_alignment. + +2000-04-25 Alan Modra + + * config/tc-i386.c (offset_in_range): Ensure shift counts are less + than 32. + +2000-04-24 Nick Clifton + + * doc/c-arm.texi (ARM Directives): Document behaviour of .align 0. + * doc/as.texinfo (Align): Include arm and strongarm in list of + targets that have the second form of the behaviour of the .align + directive. + +2000-04-24 Mark Klein + + * config/obj-som.c: Terminate obj_pseudo_table. + +2000-04-24 Clinton Popetz + + * as.c (parse_args): Allow md_parse_option to override -a listing + option. + * config/obj-coff.c (add_lineno): Change type of offset parameter + from "int" to "bfd_vma." + * config/tc-ppc.c (md_pseudo_table): Add "llong" and "machine." + (ppc_mach, ppc_subseg_align, ppc_target_format): New. + (ppc_change_csect): Align correctly for XCOFF64. + (ppc_machine): New function, which discards "ppc_machine" line. + (ppc_tc): Cons for 8 when code is 64 bit. + (md_apply_fix3): Don't check operand->insert. Handle 64 bit + relocations. + (md_parse_option): Handle -a64 and -a32. + (ppc_xcoff64): New. + * config/tc-ppc.h (TARGET_MACH): Define. + (TARGET_FORMAT): Move to function. + (SUB_SEGMENT_ALIGN): Use ppc_subseg_align. + +2000-04-23 Denis Chertykov + + * config/tc-avr.c: New AVR_ISA_ defined. + (md_assemble): Handle opcodes with optional operands (lpm,elpm). + (avr_operand): Handle 'a', 'v' and 'z' constraint letters needed + for `fmul', `movw' and `lpm R,Z' instructions. + (avr_operands): Warn if current opcode is a two-word instruction + and previous opcode was cpse/sbic/sbis/sbrc/sbrs. + (avr_opcodes): New commands added. + (REGISTER_P): Check 'a' and 'v' constraint letters. + (mcu_types): New MCU added. + +2000-04-22 Timothy Wall + + * config/tc-ia64.c (pseudo_func[]): Add new "nat" entry equivalent + to "natval". + (operand_match): Conditionally insert default bit values for IMMU9. + +2000-04-14 Matthew Green + + * configure.in: Add NetBSD/sparc ELF and NetBSD/sparc64 support. + * configure: Rebuilt. + +2000-04-21 Jeffrey A Law (law@cygnus.com) + Jason Eckhardt + + * config/tc-hppa.c (md_apply_fix): Handle new PA2.0 formats. + + * config/tc-hppa.c (CHECK_ALIGN): New macro. + Added handling of new operand types l,y,&,fe,fE,fx. + +2000-04-21 Richard Henderson + David Mosberger + Timothy Wall + Andrew MacLeod + Jim Wilson + + * Makefile.am (CPU_TYPES): Add ia64. + (TARGET_CPU_CFILES): Add config/tc-ia64.c. + (TARGET_CPU_HFILES): Add config/tc-ia64.h. + * Makefile.in: Rebuild. + * app.c (do_scrub_chars): Handle DOUBLESLASH_COMMENTS. + * configure: Rebuild. + * configure.in: Recognize ia64 as cpu type. Set bfd_gas. + (ia64-*-elf*, ia64-*-linux-gnu*): New targets. + * expr.c (expr): Handle md_optimize_expr. + * read.c (LEX_HASH): Add comment. + * config/tc-ia64.c, config/tc-ia64.h: New files. + +2000-04-21 Richard Henderson + + * config/tc-d30v.c (write_2_short): Disregard opcode1->ecc when + bundling a non-delayed branch type instruction. + +2000-04-20 Alexandre Oliva + + * config/tc-mn10300.c (HAVE_AM30): Define. + (md_assemble): Use it. + +2000-04-19 Alan Modra + + * config/obj-elf.c (obj_elf_change_section): Check for changed + section attributes. + + * Makefile.am: (CPU_MULTI_VALID): Remove. + (MULTI_CPU_TYPES): Define. + (MULTI_CPU_OBJ_VALID): Define. + (DEPTC): Use the above. + (DEPOBJ): Same here. + (DEP2): And here. + Regenerate dependencies. + * Makefile.in: Regenerate. + +2000-04-19 Michael Sokolov + + * Makefile.am (YACC, LEX): Get them from configure. + +2000-04-18 H.J. Lu (hjl@gnu.org) + + * config/tc-i386.c (offset_in_range): Use addressT instead of + bfd_vma for non-bfd assemblers. + +2000-04-17 Alan Modra + + * config/tc-i386.c (offset_in_range): Sign extend val so BFD64 + doesn't give spurious errors. + +2000-04-14 Michael Sokolov + + * as.h (SEEK_SET): Define if undefined. + +2000-04-13 Alan Modra + + * config/tc-arm.c (md_apply_fix3): Don't use UL suffix on + constants, and don't assume offsetT is 32 bits. + +2000-04-12 Andrew Cagney + + * config/tc-d10v.h: Include "write.h" to get definition of fixS. + (md_pcrel_from_section): Add prototype. + (d10v_fix_adjustable): Add prototype. + (d10v_force_relocation): Replace 'struct fix' with 'fixS'. + + * config/tc-d10v.c (md_apply_fix3): Add paren around &&. + +2000-04-12 Nick Clifton + + * config/tc-d10v.c (find_opcode): Correctly calculate position of + symbol in frag chain. + +2000-04-10 Alan Modra + + * config/tc-i386.c (fits_in_signed_byte): Change arg to offsetT. + (fits_in_unsigned_byte, fits_in_unsigned_word): Ditto. + (fits_in_signed_word, smallest_imm_type): Ditto. + (md_assemble): Use an offsetT var to hold offsetT values, not a + long. + (offset_in_range): New. + (md_assemble): Use it. + (md_convert_frag): Change type of target_address, opcode_address, + and displacement_from_opcode_start to offsetT. + (md_create_short_jump): Change type of offset to offsetT. + (md_create_long_jump): Ditto. + (md_apply_fix3): Use -4, not 0xfffffffc for BFD_RELOC_386_PLT32. + (md_chars_to_number): Remove. + (output_invalid): Remove duplicate prototype. + +2000-04-09 Nick Clifton + + * Makefile.am (CPU_TYPES): Add 'avr'. + (TARGET_CPU_CFILES): Add 'tc-avr.c'. + (TARGET_CPU_HFILES): Add 'tc-avr.h'. + + * Makefile.in: Regenerate. + + * doc/as.texinfo: Add M32R documentation. + +2000-04-07 Andrew Cagney + + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add + --enable-build-warnings option. + * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. + * Makefile.in, configure: Re-generate. + +2000-04-07 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Treat BFD_RELOC_ARM_PCREL_BLX + in the same way as BFD_RELOC_ARM_PCREL_BRANCH, and + BFD_RELOC_THUMB_PCREL_BLX lie BFD_RELOC_THUMB_PCREL_BRANCH. + (tc_gen_reloc): Accept BFD_RELOC_{ARM|THUMB}_PCREL_BLX. + (arm_force_relocation): Force relocations for + BFD_RELOC_{ARM|THUMB}_PCREL_BLX as well. + +2000-04-05 J"orn Rennecke + + * config/tc-sh.c (get_operands): There's no third operand if the + first operand is an immediate. + +2000-04-05 J"orn Rennecke + + * config/tc-sh.c (immediate): Delete. + (sh_operand_info): Add immediate member. + (parse_reg): Use A_PC for pc. + (parse_exp): Add second argument 'op'. All callers changed. + (parse_at): Expect pc to be coded as A_PC. + Use immediate field in *op. + (insert): Add fourth argument 'op'. All callers changed. + (build_relax): Add second argument 'op'. All callers changed. + (insert_loop_bounds): New function. + (build_Mytes): Remove DISP_4. + Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT. + (assemble_ppi): Use immediate field in *operand. + (sh_force_relocation): Handle BFD_RELOC_SH_LOOP_{START,END}. + (md_apply_fix): Likewise. + (tc_gen_reloc): Likewise. Check for a pcrel BFD_RELOC_SH_LABEL. + +2000-04-05 Alexandre Oliva + + * config/tc-sparc.c (sparc_ip): Avoid string pasting. + +2000-04-04 Hans-Peter Nilsson + + * internals.texi (CPU backend): Document + TC_CHECK_ADJUSTED_BROKEN_DOT_WORD. + +2000-04-04 Alan Modra + + * po/gas.pot: Regenerate. + + * as.c (show_usage): Restore translated part of bug string. + * gasp.c (show_usage): Likewise. + + * Makefile.am (MKDEP): Use gcc -MM rather than ../mkdep. + (DEP): Quote when passing vars to sub-make. Use "mv -f" rather + than move-if-change. + (DEP1): Modify for "gcc -MM". + (DEPTC): Likewise. + (DEPOBJ): Likewise. + (DEP2): Likewise. + (CLEANFILES): Add DEPTCA, DEPOBJA, DEP2a, DEPA. + Update dependencies. + * Makefile.in: Regenerate. + +2000-04-03 Alexandre Oliva + + * config/tc-mn10300.c (md_pseudo_table): Use constant names. + (md_begin): Likewise. + (HAVE_AM33): New macro. + (md_assemble): Use it. Match r_regs and xr_regs only if + HAVE_AM33. + +2000-04-03 Alan Modra + + * as.h: #include "bin-bugs.h" + * as.c (show_usage): Use REPORT_BUGS_TO. + * gasp.c: #include "bin-bugs.h" + (show_usage): Use REPORT_BUGS_TO. + + * config/tc-sparc.c (md_show_usage): Add a trailing newline. + +2000-04-03 Hans-Peter Nilsson + + * write.c (write_object_file) [! WORKING_DOT_WORD]: If defined, + call TC_CHECK_ADJUSTED_BROKEN_DOT_WORD for each word after + adjustments. + +2000-04-03 Alan Modra + + * config/tc-i386.c (i386_immediate): Don't assume a constant + immediate is necessarily 16 bits when in 16 bit code mode. + (md_assemble): Instead set guess_suffix here after we have checked + registers. + +2000-04-02 Richard Henderson + + * config/tc-d30v.c (check_range): Allow signed or unsigned 32-bit + quantities. Correct right shift sign extension. + (build_insn): Make `number' unsigned long. Mask top 6 bits of + 32-bit value when shifting into place. + +2000-04-01 Ian Lance Taylor + + * app.c: Add ATTRIBUTE_UNUSED as needed. + * config/tc-ppc.c: Likewise. + (ppc_size): Make unsigned long. + (ppc_insert_operand): Add casts to avoid warnings. + +2000-03-31 Nick Clifton + + * config/tc-d10v.h (md_flush_pending_output): Define. + +2000-03-29 Nick Clifton + + * config/tc-sh.h (SEG_NAME): New macro: return the name of a + segment. Works for both BFD_ASSEMBLER and others. + (SUB_SEGMENT_ALIGN): Use SEG_NAME. + +2000-03-29 Nick Clifton + + * listing.c (LISTING_LHS_WIDTH): Default depends on + LISTING_WORD_SIZE. + (LISTING_LHS_WIDTH_SECOND): Default to LISTING_LHS_WIDTH. + +2000-03-27 Ian Lance Taylor + + * config/tc-sh.c (md_show_usage): Use backslash before newline in + string literal. + +2000-03-27 Alan Modra + + * config/tc-avr.h (TC_HANDLES_FX_DONE): Define. + + * config/tc-avr.c (mcu_types): Add missing initialiser. + (md_pcrel_from_section): Add prototype. + (avr_operand): Remove redundant test of unsigned < 0. + (avr_cons_fix_new): Ensure exp_mod_pm zero on function exit. + +2000-03-27 Denis Chertykov + + * config/tc-avr.c: New file for AVR support. + * config/tc-avr.h: Likewise. + * configure.in: Add AVR support. + * configure: Regenerate. + +2000-03-26 Timothy Wall + + * gasp.c (macro_op): Add new argument to check_macro call. + Macro structure definitions moved to macro.h + * sb.h: Add argument to prototype for input_scrub_include_sb. + * input-scrub.c (input_scrub_include_sb): Allow disabling of sb + nesting checks with an additional flag. + (struct input_save): Add flag to indicate whether current sb + should be checked for proper macro/conditional nesting. + (input_scrub_push/pop): Save/restore nest check flag. + (input_scrub_next_buffer): Ditto. Also call end of macro hook if + defined. + * macro.c (check_macro): Allow caller to retrieve parsed macro + information if a pointer is provided. This information may be + used by the new macro hooks. + * macro.h: Update prototype for check_macro. Macro struct + definitions moved here from macro.c/gasp.c. + * read.c (read_a_source_file): Add parameter to check_macro call, + and pass macro info to the macro hook, if defined. + (input_scrub_insert_line): New. Allow insertion of a line of + characters into the input stream. + (input_scrub_insert_file): New. Allow insertion of an arbitrary + file into the input stream. + (s_include): Use input_scrub_insert_file. + * internals.texi: Document new macro hooks. + * as.h: New prototypes added. + +2000-03-26 Alan Modra + + * config/tc-i386.c: Don't start any as_bad or as_warn message with + an initial capital letter. + (i386_index_check): Reindent. + +2000-03-19 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Fix bug detecting overflow of pc + relative branches. + +2000-03-17 Thomas de Lellis + + * config/tc-arm.c (do_t_adr): Flag "adr Rd,label" + instruction operand bad if Rd > 7 when generating + thumb instructions. Prevents for example, + "adr r12,label" from silently failing and generating + the wrong instruction. + +2000-03-17 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Handle same-section relocations + that have a destingation >= 0x400000. + Fix compile time warning messages. + +2000-03-16 J"orn Rennecke + + * config/tc-sh.c (md_begin): When encountering insn that are + not supported by the current arch, only change the name if + its contents are the same as prev_name. + (get_specific): If the the architecture doesn't match, fail. + +2000-03-16 J"orn Rennecke + + * config/tc-sh.c (IDENT_CHAR): Define. + (parse_reg): Use it instead of isalnum. Put r[0..7]_bank operand + matching back where it came from. + +2000-03-16 J"orn Rennecke + + * config/tc-sh.c (md_show_usage): Add description of -dsp. + +2000-03-15 Jonathan Larmour + + * config/tc-sh.c (parse_reg): Match r[0..7]_bank operands before + normal operands. + +2000-03-15 Kazu Hirata + + * config/tc-h8300.c: Add ATTRIBUTE_UNUSED as appropriate. + +2000-03-13 Hans-Peter Nilsson + + * expr.c (operand) [case 'f']: When testing if '0f' can start a + floating-point-number, make sure 'f' is in FLT_CHARS. + +2000-03-11 Hans-Peter Nilsson + + * read.c (TC_IMPLICIT_LCOMM_ALIGNMENT): New default-definition. + (s_lcomm_internal): Use it. + * doc/internals.texi (CPU backend): Document it. + * config/obj-evax.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Set to 2**3 + bytes. + +2000-03-10 Geoffrey Keating + + * config/tc-mips.c (mips_ip): Don't put stuff in .rodata + when embedded-pic. + + * config/tc-mips.c (SWITCH_TABLE): The ELF embedded-pic + implementation doesn't have special handling for switch + statements. + (macro_build): Allow for code in sections other than .text. + (macro): Likewise. + (mips_ip): Likewise. + (md_apply_fix): Do pc-relative relocation madness for MIPS ELF. + Don't perform relocs if we will be outputting them. + (tc_gen_reloc): For ELF, just use fx_addnumber for pc-relative + relocations. Allow BFD_RELOC_16_PCREL_S2 relocs when + embedded-pic. + +2000-03-09 Catherine Moore + + * config/tc-m32r.c (m32r_fix_adjustable): Look up the + relocation type based on the entry in the fixup structure. + Put S_IS_EXTERN processing back in. + +2000-03-08 H.J. Lu (hjl@gnu.org) + + * Makefile.am (install-exec-tooldir): Depend on + install-exec-bindir for parallel make. + * Makefile.in: Regenerated. + +2000-03-06 Nick Clifton + + * config/tc-m32r.c (struct md_longopts): Add -m32r command line + switch. + (md_parse_option): Parse -m32r command line switch - disable m32rx + compatability. + (md_show_usage): Document new option. + + * doc/Makefile.am (CPU_DOCS): Add c-m32r.texi. + * doc/Makefile.in: Regenerate. + * doc/c-m32r.texi (M32R-Opts): Document new command line switch. + +2000-03-02 Michael Meissner + + * config/tc-d30v.c (check_range): Remove code that incorrectly + sign extended values where bits < 32. + +2000-03-02 H.J. Lu (hjl@gnu.org) + + * configure.in: Support --enable-targets=all on ia32. + * configure: Regenerated. + +2000-03-01 Nick Clifton + + * gasp.c (do_align): Remove bogus check of alignment value. + +2000-02-27 Thomas de Lellis + + * config/obj-elf.c (elf_frob_symbol): Remove code which when + TC_PPC was defined forced the type of a symbol with no other type + to be BSF_OBJECT. + +2000-02-27 Hans-Peter Nilsson + + * doc/internals.texi (CPU backend): Mention that + line_separator_chars do not break up comments. Fix typos for + LEX_AT and LEX_NAME descriptions. Document operands for + TC_EQUAL_IN_INSN, md_operand and md_section_align. Correct + description of md_create_short_jump usage. Document argument for + md_undefined_symbol. + +2000-02-27 Jakub Jelinek + + * config/tc-sparc.c (OPTION_UNDECLARED_REGS): New option. + (md_parse_option): Handle it. + (md_show_usage): Document it. + +2000-02-27 Ian Lance Taylor + + * config/tc-alpha.c (md_assemble): Accept `1' and `9' in an + opcode, for the instruction `pal19'. From Andrea Arcangeli + . + +2000-02-26 Alan Modra + + * config/tc-i386.c (i386_immediate): Move constant operand sizing + from here.. + (md_assemble): To here, before template operands are matched. + Also ensure a constant immediate is sign extended when we know the + size is at most 16 bits. This is to catch cases like "add + $0xffc0,%ax" where we don't know the size, and thus that the + immediate can be represented as Imm8S until after parsing the + register operand. + (i386_displacement): Similarly sign extend 16 bit constant + displacements. + (md_assemble): Relax 16-bit jump constant range check to suit sign + extended displacements. + +2000-02-26 Andreas Jaeger + + * doc/c-mips.texi (MIPS Opts): Fix typo in last patch. + +2000-02-25 Alan Modra + + * config/tc-i386.c (md_assemble): Don't swap intersegment jmp and + call operands when intel_syntax. + (intel_float_operand): Return 2 for "fi...". + (i386_operand_modifier): Change "DWORD PTR" test to suit above. + Return SHORT_MNEM_SUFFIX for "WORD PTR" when "fi...". Revert + earlier "SHORT" change. + (md_assemble): When determining suffix from Regs, exclude + InOutPortReg. + +2000-02-24 Nick Clifton + + * configure: Add arm-wince, mips-pe and sh-pe targets. + * configure: Regenerate. + + * config/obj-coff.h (COFF_WITH_PE): Define for mips-pe and + sh-pe targets. + (TARGET_FORMAT): Set to "pe-shl" for the sh-pe target and to + "pe-mips" for the mips-pe target. + + * config/tc-arm.c (insns): Change displacement encoded in BL + and B instructions if the target port is arm-wince. + (do_ldst): Do not bias the relocation offset if the target + port is arm-wince. + (md_pcrel_from): Add in missing relocation offset bias if the + target os arm-wince. + + * config/tc-mips.c (mips_target_format): Support COFF flavour. + (md_begin): Disable -G support for mips-pe target. + (md_apply_fix): Treat BFD_RELOC_RVA reloc as BFD_RELOC_32. + * config/tc-mips.h (USE_GLOBAL_POINTER_OPT): Add support for + COFF flavour. + + * config/tc-sh.c (md_begin): sh-pe target is little endian. + * config/tc-sh.h (SUB_SEGMENT_ALIGN): If using a BFD + assembler, just set the alignment to 4. + + * config/te-wince-pe.h: New file for WinCE targets. Define + TE_WINCE. + +2000-02-25 Alan Modra + + * config/tc-i386.c (md_assemble): Swap segments too for intel mode + string instructions. + (i386_operand_modifier): Set i.suffix = WORD_MNEM_SUFFIX for SHORT. + (i386_intel_memory_operand): After finding a segment override, + check again for no `[' before looking for a displacement. Bomb if + more than one displacement rather than silently discarding the + second and subsequent ones. Free strings malloc'd by + build_displacement_string. + +2000-02-24 Catherine Moore + + * config/obj-som.c (obj_pseudo_table): Add "weak". + (obj_som_weak): New routine. + +2000-02-24 Alan Modra + + * config/tc-i386.c (union i386_op): New. + (struct _i386_insn): Delete disps[], imms[], regs[]. Add op[]. + Throughout file replace occurences of disps[n], imms[n], regs[n] + with equivalent op[n].disps, op[n].imms, op[n].regs. Simplify + intel mode operand swapping. Add assert in regKludge and + fake_zero_displacement code. Test i.types[n] when outputting + displacements and immediates. Combine output of Disp16 with + Disp32. + (md_assemble): Don't try to fix broken UNIXWARE_COMPAT opcodes + when in intel mode by (not) reversing fsub and fdiv operands + before the template search. This fails for single operand + shorthand forms of the instruction, and if UNIXWARE_COMPAT is + undefined. Instead fix the base_opcode after we've found the + template. Move base_opcode xor with found_reverse_match from + opcode output code to before this fix so we test for the correct + opcodes. + (md_assemble): Don't use strcmp when deciding to ignore the suffix + check in intel mode. Instead compare opcodes. + + * config/tc-i386.h (TC_RELOC): Delete. + * config/tc-i386.c (TC_RELOC): Delete. Replace usage of TC_RELOC + with equivalent call to reloc. + + * as.h (flag_m68k_mri): Move declaration after target include, and + only declare when TC_M68K defined. Define as zero otherwise. + (LABELS_WITHOUT_COLONS, NO_PSEUDO_DOT): If undefined, define as 0. + * app.c (scrub_m68k_mri): Declare only when TC_M68K defined. + Define as zero otherwise. + (do_scrub_begin): Use m68k_mri parameter only when TC_M68K defined. + (struct app_save): Declare scrub_m68k_mri only when TC_M68K. + (app_push, app_pop): Save scrub_m68k_mri only when TC_M68K. + (do_scrub_chars): Use LABELS_WITHOUT_COLONS directly rather than + testing whether defined. + * cond.c (ignore_input): Use NO_PSEUDO_DOT directly. + * expr.c (operand): #ifdef unused case labels when TC_M68K undefined. + * read.c: Use LABELS_WITHOUT_COLONS and NO_PSEUDO_DOT directly + rather than testing whether defined. + (s_mri): Set flag_m68k_mri only when TC_M68K defined. + (parse_mri_cons): Declare and use only when TC_M68K. + * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define as 1. + * config/tc-m68k.h (NO_PSEUDO_DOT): Define as 1. + * config/tc-m88k.h (NO_PSEUDO_DOT): Define as 1. + + * NEWS: Mention IBM 370 support. + +2000-02-23 Richard Henderson + + * config/tc-i386.c (md_assemble): When swapping operands for + intel_syntax, assume everything that's not Imm or Disp is a + register. + +2000-02-23 Linas Vepstas + + * config/tc-i370.c, config/tc-i370.h: New files. + * Makefile.am: Add support for Linux/IBM 370. + * configure.in: Likewise. + * app.c (do_scrub_begin): Don't lex single quote when TC_I370. + * config/obj-elf.c: Include elf/i370.h + (obj_elf_section): Don't do anything special for flag_mri if TC_I370. + + * Makefile.in: Regenerate. + * configure: Regenerate. + + * doc/c-i370.texi: New file. + * doc/all.texi: Include it. + * doc/as.texinfo: And here. + * doc/Makefile.am(CPU_DOCS): Add c-i370.texi. + * doc/Makefile.in: Regenerate. + +2000-02-19 Michael Meissner + + * config/tc-d30v.c (parallel_ok): Use FLAG_NOT_WITH_ADDSUBppp to + determine if an instruction can be used in parallel with an ADDppp + or SUBppp instruction. + +2000-02-22 Andrew Haley + + * doc/c-mips.texi (MIPS Opts): Document -mgp32 and -mgp64. + +2000-02-22 Andrew Haley + + * config/tc-mips.c (mips_gp32): New variable. + (macro_build) Use mips_gp32. + (mips_ip): Ditto. + (md_longopts): Add "-mgp32" and "-mgp64". + (md_parse_option): Add OPTION_GP32 and OPTION_GP64. + + (OPTION_M7900): Change offset + (OPTION_NO_M7900): Ditto. + +2000-02-22 Alexandre Oliva + + * config/obj-coff.c (add_lineno): Accept non-positive lineno with + warning, and bump it to 1. + +2000-02-22 Ian Lance Taylor + + From Brad Lucier : + * dwarf2dbg.c (print_stats): Add cast to force printf argument to + match format. + +2000-02-21 Catherine Moore + + * config/tc-mips.c (MF_HILO_INSN): Define. + (mips_7000_hilo_fix): Declare. + (append_insn): Conditionally insert nops after an mfhi/mflo insn. + (md_parse_option): Check for 7000_HILO_FIX options. + (OPTION_M7000_HILO_FIX): Define. + (OPTION_NO_M7000_HILO_FIX): Define. + * doc/c-mips.texi (-mfix7000): Describe. + +2000-02-21 Alan Modra + + * listing.c (print_lines): Remove unused variable `end'. + + * config/tc-i386.c (md_assemble): Use `reloc()' to select reloc + type for JumpInterSegment output. Use enum bfd_reloc_code_real for + reloc_type when BFD_ASSEMBLER. + (md_estimate_size_before_relax): Use enum bfd_reloc_code_real for + reloc_type when BFD_ASSEMBLER. Move common code out of switch + statement and quell signed vs. unsigned comparison warning. + +2000-02-18 Nick Clifton + + * config/tc-d10v.c (find_opcode): Add a symbol's value to + the computed frag offset, rather than overwriting it. + +2000-02-17 J"orn Rennecke + + * config/tc-sh.c ("elf/sh.h"): Include. + (sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables. + (md.begin): Initialize target_arch. + Only include opcodes in has table that match selected architecture. + (parse_reg): Recognize register names for sh-dsp. + (parse_at): Recognize post-modify addressing. + (get_operands): The leading space is now optional. + (get_specific): Remove FDREG_N support. Add support for sh-dsp + arguments. Update valid_arch. + (build_Mytes): Add support for SDT_REG_N. + (find_cooked_opcode): New function, broken out of md_assemble. + (assemble_ppi, sh_elf_final_processing): New functions. + (md_assemble): Use find_cooked_opcode and assemble_ppi. + (md_longopts, md_parse_option): New option: -dsp. + * config/tc-sh.h (elf_tc_final_processing): Define. + (sh_elf_final_processing): Declare. + +2000-02-11 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_build_unwind_subspace): Use subseg_new to create + the unwinder subspace. Save the current seg/subseg before creating + the new seg/subseg. + +2000-02-10 Nick Clifton + + * config/tc-mcore.c (INST_BYTE0): Redefine to handle big and + little endian targets. + (INST_BYTE1): Redefine to handle big and little endian + targets. + (cpu_type): New type: Select between M340 and M210. + (parse_psrmod): New function: Parse the PSRCLR and PSRSET + instructions of the M340. + (md_assemble): Add support for the MULSH and OPSR classes of + instructions. + (md_atof): Add support for little endian targets. + (md_parse_option): Add support for -EL, -EB and -mcpu command + line switches. + (md_convert_frag): Add support for little endian targets. + (md_apply_fix3): Add support for little endian targets. + (md_number_to_chars): Add support for little endian targets. + +2000-02-10 Timothy Wall + + * read.c (read_a_source_file): If TC_START_LABEL_WITHOUT_COLON is + defined, use it to verify the symbol just read should be a label. + +2000-02-10 Timothy Wall + + * app.c (do_scrub_chars): Handle "||" for parallel instructions + when DOUBLEBAR_PARALLEL is defined. Avoid stripping whitespace + around colons when KEEP_WHITE_AROUND_COLON is defined. + * doc/internals.texi (CPU backend): Document DOUBLEBAR_PARALLEL + and KEEP_WHITE_AROUND_COLON. + +2000-02-08 Timothy Wall + + * read.c (s_rept): Call do_repeat, which abstracts the repeat + logic. + (do_repeat): New. Abstract repeat logic so that a "break" can be + implemented. + (end_repeat): New. Provide support for a "break" out of the + repeat loop. + * read.h: Add prototypes for new functions. + +2000-02-08 Timothy Wall + + * doc/internals.texi: Document NUMBERS_WITH_SUFFIX macro. + * as.h: Provide a default NUMBERS_WITH_SUFFIX definition (zero). + * expr.c: Handle numbers with suffixes if NUMBERS_WITH_SUFFIX is + non-zero. + +2000-02-08 Timothy Wall + + * read.c: Added elseif to directives table. + * read.h: Added prototype for s_elseif. + * doc/as.texinfo: Added description for elseif. + * cond.c (s_elseif): New function + +2000-02-04 Timothy Wall + + * listing.c (print_lines): Remove conditionals causing bug in + listings. + +2000-02-03 Timothy Wall + + * as.h: Define OCTETS_PER_BYTE and OCTETS_PER_BYTE_POWER + default values. + * frags.c (frag_new): Calculate fr_fix in octets + (frag_now_fix) Return offset as target address offset (bytes). + (frag_now_fix_octets) New - Return offset in octets (8-bit + quantities). + * frags.h: Added prototype for frag_now_fix_octets(). + Distinguish between octets and bytes in field descriptions. + * listing.c (calc_hex): Account for octets vs bytes when + printing addresses/offsets. + (print_lines) Ditto. Also, if LISTING_WORD_SIZE is not 1, and + target is little-endian, print the octets in a word in big-endian + order so that the display looks like a proper hexadecimal number, + instead of having the octets reversed. + * read.c (do_align): When recording alignment, alignment power + should be in terms of target bytes (minimum addressible unit) + instead of octets. + (do_org) Convert ORG target address (byte) argument into an + octet offset when generating a variable fragment. + * symbols.c (resolve_symbol_value): Symbol final value + converted to a target address offset (bytes) from its octet offset. + * config/obj-coff.c (coff_frob_symbol): Symbol target address + offset (bytes) is adjusted by the frag offset (octets) converted + to bytes. + (coff_frob_section) Section alignment power is in terms of bytes; + convert it to an octet alignment power when calculating size (and + size mask) in octets. Don't modify the section size in order to + "align" it for TI COFF, since that format has a different method + for storing alignment information. + +2000-02-01 Timothy Wall + + * stabs.c (generate_asm_file): Escape backslashes in stabs file + entries, matching the way GCC generates them. If not escaped, the + filename is encoded incorrectly. + +2000-01-31 Nick Clifton + + * config/tc-arm.c (reg_table): Add support for ATPCS register + naming conventions. + +2000-01-31 Geoff Keating + + * config/obj-coff.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Don't define if + already defined. + * config/tc-ppc.h [OBJ_XCOFF] (OBJ_COPY_SYMBOL_ATTRIBUTES): + New macro. + * config/tc-ppc.c (ppc_fix_adjustable): Don't look at the frag + of a symbol when we really care about its value. + +2000-01-19 Chandra Chavva + + * config/tc-mcore.c (md_assemble): Give warning message if + operands passes to instruction are more than the spec. + +2000-01-27 Thomas de Lellis + + * config/tc-arm.c (armadjust_symtab): If the assembler is in + Thumb mode but the label seen was not declared as '.thumb_func' + then set the ST_INFO type to STT_ARM_16BIT mode. This allows + correct disassembly of Thumb code bounded by non function labels. + +2000-01-27 Alan Modra + + * Makefile.am (MULTI_CFILES): Add config/e-i386aout.c + Add dependencies for e-i386aout.o. Fix 2 comment lines. + + * Makefile.in: Same here. + Update copyright. + + * configure.in: Set bfd_gas for i386-aout when primary target + is bfd. Handle i386aout emulation. Don't use te_file=multi, as + we may need the primary te_file. Remove incorrect comment. + + * configure: Regenerate. + + * config/e-i386aout.c: New file. + + * as.c (USE_EMULATIONS): Move to before print_version_id. + (struct emulation): Add i386aout. + (show_usage): Split text strings. Reformat -a text. Add --em + help. + Update copyright. + + * obj.h (struct format_ops): Add s_get_other and s_get_desc. + (aout_format_ops): New. + Update copyright. + + * read.c (s_lcomm_internal): Rewrite OBJ_AOUT,OBJ_BOUT + preprocessor conditional and add aout USE_EMULATIONS tests. + (read_a_source_file): Don't pass error strings to printf as + format arg. + Update copyright. + + * gasp.c (exp_get_abs): Don't pass error strings to printf as + format arg. + (do_data): Same here. + (process_file): And here. + Update copyright. + + * symbols.c (colon): Rewrite "already defined" fatal message + code for aout with USE_EMULATIONS. + Update copyright. + + * config/obj-aout.c (OBJ_HEADER): Define. + (obj_pseudo_table): Rename to aout_pseudo_table. Init all + fields of sentinel. + (obj_aout_frob_symbol): Expand S_GET_DESC, S_GET_TYPE, + S_GET_OTHER, S_SET_TYPE macros since we don't need obj-multi + forms here. + (obj_aout_type): Expand S_SET_OTHER here too. + (obj_read_begin_hook): Remove. + (aout_pop_insert): New. + (obj_aout_s_get_other): New. + (obj_aout_s_get_desc): New. + (aout_format_ops): New. + Update copyright. + + * config/obj-aout.h (obj_pop_insert): Define so non-multi usage + gets aout_pseudo_table. + (aout_pseudo_table): Declare. + (obj_read_begin_hook): Define. + Update copyright. + + * config/obj-coff.c (obj_pseudo_table): Rename to + coff_pseudo_table. + (coff_pop_insert): Use coff_pseudo_table. + (coff_sec_sym_ok_for_reloc): Remove. + (coff_format_ops): Add 0 entries for s_get_size, s_set_size, + and comment all zero entries and remove #if 0 code. + Update copyright. + + * config/obj-coff.h (obj_pop_insert): Define. + (coff_pseudo_table): Declare. + Update copyright. + + * config/obj-ecoff.c (ecoff_format_ops): Add 0 entries for + s_get_size, s_set_size. Comment all zero entries. + Update copyright. + + * config/obj-elf.c (elf_s_get_other): New function. + (obj_read_begin_hook): Rename to elf_obj_read_begin_hook. + (obj_symbol_new_hook): Rename to elf_obj_symbol_new_hook. + (elf_format_ops): Add elf_s_get_other, 0 s_get_size entry, and + comment. + (obj_elf_parse_section_letters): Don't pass error strings to + printf as format arg. + Update copyright. + + * config/obj-elf.h (ECOFF_DEBUGGING): Define when + OBJ_MAYBE_ECOFF. + (elf_s_get_other): Declare. + (S_GET_OTHER) Define as elf_s_get_other if not already + defined. + (S_SET_OTHER): Only define when not already defined. + (elf_obj_read_begin_hook): Declare. + (obj_read_begin_hook): Define. + (elf_obj_symbol_new_hook): Declare. + (obj_symbol_new_hook): Define. + Update copyright. + + * config/obj-multi.h: Add copyright header and protect against + multiple inclusion. Add * to all function pointers. + (OBJ_HEADER): If defined, include it rather than other defines + in this file. + (obj_frob_file_after_relocs): Test for NULL. + (obj_symbol_new_hook): Here too. + (obj_sec_sym_ok_for_reloc): And here. + (S_GET_OTHER): Define. + (S_GET_DESC): Define. + (ECOFF_DEBUGGING): Remove as it's done in obj-elf.h + (OBJ_MAYBE_ELF): Update comment. + + * config/tc-i386.c (i386_immediate): Add OBJ_MAYBE_AOUT to + OBJ_AOUT preprocessor conditional and handle emulation by + testing OUTPUT_FLAVOR. + (i386_displacement): Here too. + (md_section_align): Similarly here. + (i386_target_format): Conditionally compile when more than one + of OBJ_MAYBE_{ELF,COFF,AOUT} defined. Add aout case. + (i386_immediate): Fix error message for aout BFD_ASSMBLER. + (i386_displacement): Here too. + Update copyright. + + * config/tc-i386.h (AOUT_TARGET_FORMAT): Define for each TE_*. + Define TARGET_FORMAT for aout only when not multi. + Update copyright. + + * config/te-multi.h: Delete file as it's identical to te-generic.h + +2000-01-15 Alan Modra + + * config/tc-i386.h (DWORD_MNEM_SUFFIX): Delete. + * config/tc-i386.c (DWORD_MNEM_SUFFIX): Rename all occurrences to + LONG_MNEM_SUFFIX. + + * config/tc-i386.h (INTEL_DWORD_MNEM_SUFFIX): Rename to + DWORD_MNEM_SUFFIX. + * config/tc-i386.c (INTEL_DWORD_MNEM_SUFFIX): Here too. Fix some + comments. + +2000-01-13 Clinton Popetz + + * config/tc-mips.c (mips_do_align): New function. + * config/tc-mips.h (md_do_align): Define. + +2000-01-10 Philip Blundell + + * doc/c-arm.texi (ARM Options): Fix typo. + (ARM-Chars): Correct description of `#'. Mention that `;' is a + line separator for Linux. + * doc/as.texinfo (Comments): Mention the ARM. + +2000-01-10 Philip Blundell + + * configure.in (arm*-*-conix*): New target. + (arm*-*-linux-gnu*): Match instead of arm-*-linux* and + armv*-*-linux-gnu. + * configure: Regenerate. + +2000-01-03 Martin v. Loewis + + * config/obj-elf.c (elf_pseudo_table): Define visibility pseudos. + (obj_elf_visibility): New function. + + * doc/as.texinfo (Visibility): New node: document visibility + pseudo ops. + +For older changes see ChangeLog-9899 diff --git a/contrib/binutils/gas/ChangeLog-9295 b/contrib/binutils/gas/ChangeLog-9295 index 7ea48e6..a761ea1 100644 --- a/contrib/binutils/gas/ChangeLog-9295 +++ b/contrib/binutils/gas/ChangeLog-9295 @@ -151,8 +151,8 @@ Tue Nov 28 10:42:36 1995 Ken Raeburn (fix_new_internal): Increment it. * read.c (read_print_statistics): New function. * read.h (read_print_statistics): Declare. - * symbol.c (symbol_print_statistics): New function. - * symbol.h (symbol_print_statistics): Declare. + * symbols.c (symbol_print_statistics): New function. + * symbols.h (symbol_print_statistics): Declare. * hash.c (hash_print_statistics): New function. * hash.h (hash_print_statistics): Declare. * config/tc-i386.c (i386_print_statistics): New function. @@ -458,8 +458,8 @@ Thu Oct 26 19:18:27 1995 Ken Raeburn Thu Oct 26 11:45:03 1995 Richard Earnshaw (rearnsha@armltd.co.uk) - * tc-arm.c (do_ldst): Assemble ldr/str r0, [r1] as a pre-increment - instruction. + * config/tc-arm.c (do_ldst): Assemble ldr/str r0, [r1] as a + pre-increment instruction. Wed Oct 25 11:59:24 1995 Per Bothner @@ -1930,8 +1930,8 @@ Tue Aug 1 17:35:26 1995 Ian Lance Taylor Tue Aug 1 11:35:18 1995 steve chamberlain - * tc-sh.c (md_convert_frag): Make some error messages more - explict. + * config/tc-sh.c (md_convert_frag): Make some error messages + more explict. Mon Jul 31 21:40:47 1995 Ken Raeburn @@ -2392,7 +2392,7 @@ Wed Jul 5 12:01:49 1995 Ian Lance Taylor (s_stringer, s_mips_space): Remove unneeded declarations. (md_parse_option): In case 'g', set mips_debug to debugging level. (mips_local_label): New function. - * tc-mips.h (LOCAL_LABEL): Call mips_local_label. + * config/tc-mips.h (LOCAL_LABEL): Call mips_local_label. (mips_local_label): Declare. Wed Jul 5 00:59:22 1995 Fred Fish (fnf@cygnus.com) @@ -3143,10 +3143,10 @@ Thu Apr 13 18:18:08 1995 Ken Raeburn Thu Apr 13 14:34:36 1995 Torbjorn Granlund - * tc-m68k.c (m68k_init_after_args): Test for m68360. + * config/tc-m68k.c (m68k_init_after_args): Test for m68360. (md_parse_option): Likewise. (md_show_usage): Mention m68360. - * tc-m68k.h (TARGET_WORD_SIZE): Define. + * config/tc-m68k.h (TARGET_WORD_SIZE): Define. (TARGET_ARCH): Define. * expr.c (integer_constant): If TARGET_WORD_SIZE is defined, @@ -3714,7 +3714,8 @@ Thu Jan 26 11:35:33 1995 Michael Meissner Wed Jan 25 16:23:13 1995 Jim Wilson - * tc-sh.c (little): Add argument IGNORE to avoid compiler warnings. + * config/tc-sh.c (little): Add argument IGNORE to avoid + compiler warnings. (md_pseudo_table): Add space for consistent formatting. (COND8_RANGE, COND12_RANGE): Delete unused macros. (COND8_F, COND8_M, COND12_F, COND12_M, UNCOND12_F, UNCOND12_M): @@ -3878,7 +3879,7 @@ Wed Jan 18 12:16:07 1995 Ian Lance Taylor (clever_message): Remove unused variable scan. (md_assemble): Remove unused variable i. (tc_coff_sizemachdep): Remove unused function. - * tc-h8300.h (tc_reloc_mangle): Declare. + * config/tc-h8300.h (tc_reloc_mangle): Declare. Tue Jan 17 10:58:06 1995 Ian Lance Taylor @@ -7482,7 +7483,7 @@ Mon Jan 24 19:18:23 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) of unused functions. (obj_frob_symbol): Define if ECOFF_DEBUGGING. - * tc-mips.c (g_switch_seen): New static variable. + * config/tc-mips.c (g_switch_seen): New static variable. (md_parse_option): Set g_switch_seen for -G option. (s_option): If creating PIC code, force the GP size to be 0. Warn if -G switch used with a non-zero value. @@ -7515,7 +7516,7 @@ Tue Jan 18 16:19:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu) * config/tc-hppa.c: Disable multiple $CODE$ subspace code. It confuses GDB for some unknown reason. - * cofnig/obj-som.c: Likewise. + * config/obj-som.c: Likewise. Tue Jan 18 19:05:32 1994 Ken Raeburn (raeburn@cujo.cygnus.com) @@ -7758,7 +7759,7 @@ Wed Dec 29 14:37:26 1993 Ken Raeburn (raeburn@cujo.cygnus.com) Sun Dec 26 14:31:47 1993 Torbjorn Granlund (tege@adder.cygnus.com) - * tc-hppa.c (pre_defined_registers): Convert to lower case. + * config/tc-hppa.c (pre_defined_registers): Convert to lower case. Delete spurious register names "%r4L", etc. (selector_table): Sort and convert to lower case. (cons_fix_new_hppa): `reloc_type' => `rel_type'. @@ -7953,7 +7954,7 @@ Fri Dec 3 10:56:40 1993 Jeffrey A. Law (law@snake.cs.utah.edu) Fri Dec 3 09:47:30 1993 Pete Hoogenboom (hoogen@cs.utah.edu) - * tc-hppa.c: (tc_gen_reloc): Addend for a plabel relocation should + * config/tc-hppa.c: (tc_gen_reloc): Addend for a plabel relocation should be either 0 or 2 (no static link or static link required). Always assume no static link. @@ -8480,7 +8481,7 @@ Tue Nov 2 18:04:11 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Tue Nov 2 15:07:07 1993 Jeffrey A. Law (law@snake.cs.utah.edu) - * tc-hppa.c: Add %dp and %rp as synonyms for %r27 and %r2 in the + * config/tc-hppa.c: Add %dp and %rp as synonyms for %r27 and %r2 in the predefined register table. (pa_parse_number): Handle %rp in common register shortcut code. Consistently set return value to -1 for an error. Clean up error @@ -8849,7 +8850,7 @@ Mon Oct 25 10:20:31 1993 Ken Raeburn (raeburn@rover.cygnus.com) Sun Oct 24 16:49:00 1993 Jim Wilson (wilson@x1.cygnus.com) - * tc-mips.c (md_pseudo_table): Add dword pseudo op. + * config/tc-mips.c (md_pseudo_table): Add dword pseudo op. Fri Oct 22 20:40:56 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) @@ -8946,7 +8947,7 @@ Thu Oct 21 12:52:01 1993 Ken Raeburn (raeburn@cygnus.com) * write.c (adjust_reloc_syms): Provide a hook so that a target cpu configuration can reject certain relocation reductions. - * tc-hppa.h (tc_fix_adjustable): New macro. Only accept relocations + * config/tc-hppa.h (tc_fix_adjustable): New macro. Only accept relocations which do not involve function symbols. * config/tc-hppa.h: Reindent with GNU-indent. Delete references @@ -9701,7 +9702,7 @@ Wed Aug 25 13:37:46 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) mirror that of pa_parse_nonneg_cmpsub_cmpltr. (pa_parse_nonneg_add_cmpltr): Likewise. (pa_parse_neg_add_cmpltr): Likewise. - * tc-hppa.h (pa_param): Declare. + * config/tc-hppa.h (pa_param): Declare. Tue Aug 24 15:41:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -10200,7 +10201,7 @@ Mon Jul 19 15:21:20 1993 Ken Raeburn (raeburn@rtl.cygnus.com) * config/obj-elf.h: Don't include struc-symbol.h. (obj_elf_frob_symbol): Declare arg as struct symbol *. - * tc-sparc.h (LOCAL_LABEL) [OBJ_ELF]: Local labels can start with + * config/tc-sparc.h (LOCAL_LABEL) [OBJ_ELF]: Local labels can start with "L" or "_.L_". * write.c (write_relocs): New function, split off from @@ -11126,7 +11127,7 @@ Wed Apr 28 13:40:29 1993 Ian Lance Taylor (ian@rtl.cygnus.com) Mon Apr 26 18:29:05 1993 Steve Chamberlain (sac@thepub.cygnus.com) - * config/tc-sh.ch, config/tc-sh.h: New files supporting Hitachi + * config/tc-sh.c, config/tc-sh.h: New files supporting Hitachi SH. Mon Apr 26 12:28:27 1993 Ian Lance Taylor (ian@cygnus.com) @@ -11620,7 +11621,7 @@ Mon Mar 8 14:57:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) Fri Mar 5 09:05:55 1993 Ian Lance Taylor (ian@cygnus.com) * read.h: Define stringer here. - read.c, config/obj-ieee.c, config/obj-tcm88k.c: Not any of these + * read.c, config/obj-ieee.c, config/obj-tcm88k.c: Not any of these places. Thu Mar 4 11:52:23 1993 Steve Chamberlain (sac@thepub.cygnus.com) @@ -11847,8 +11848,8 @@ Mon Feb 8 13:56:17 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) Thu Feb 4 12:45:16 1993 Steve Chamberlain (sac@thepub.cygnus.com) - * config/{h8500.mt, tc-h8500.c, tc-h8500.h, obj-coffbfd.c, - obj-coffbfd.h}: support for the H8/500 + * config/{h8500.mt, config/tc-h8500.c, config/tc-h8500.h, + config/obj-coffbfd.c, obj-coffbfd.h}: support for the H8/500. Wed Feb 3 19:28:18 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -11994,25 +11995,25 @@ Tue Jan 5 08:42:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) * config-gas.com: New file. Script for VMS systems to set up the configuration to build gas for VMS, and create config.status. * make-gas.com: Redone to work with new scheme. - * obj-vms.c: Patch to fix bug where we were not correctly parsing the + * config/obj-vms.c: Patch to fix bug where we were not correctly parsing the stabs directives. - * obj-vms.c: Define macros COPY_LONG and COPY_SHORT which + * config/obj-vms.c: Define macros COPY_LONG and COPY_SHORT which will swap bytes if needed on a big endian system. Use throughout as needed. - * obj-vms.c (obj_aout_stab): Add code to generate listing file. - * obj-vms.c (VMS_typedef_parse): Add alias to correctly handle certain + * config/obj-vms.c (obj_aout_stab): Add code to generate listing file. + * config/obj-vms.c (VMS_typedef_parse): Add alias to correctly handle certain types of malformed stabs. Change parsing algorithm so that we are more certain of having all of the information that we need on hand. - * obj-vms.c (final_forward_reference): New function, used to help + * config/obj-vms.c (final_forward_reference): New function, used to help resolve the data types of as many struct elements as possible when some part of the struct is not fully defined by the compiler. - * obj-vms.c (VMS_LSYM_Parse): Correctly handle case of continuation + * config/obj-vms.c (VMS_LSYM_Parse): Correctly handle case of continuation stabs directives. - * obj-vms.c (VMS_write_object_file): Define all vtable psects + * config/obj-vms.c (VMS_write_object_file): Define all vtable psects as symbols as well in the object file. Look for external functions that start with "__vt.", and turn them into variables, since the g++ compiler is incapable of doing this. - * tc-vax.c: Add '1' option for backward compatibility with older GCC + * config/tc-vax.c: Add '1' option for backward compatibility with older GCC versions. * bignum-copy.c (bignum_copy): Fix bug where we pad with zeroes. * input-scrub.c (as_where): Fix bug where as would crash if we did not @@ -12148,8 +12149,8 @@ Mon Dec 28 10:32:05 1992 Ken Raeburn (raeburn@cygnus.com) Wed Dec 16 12:12:33 1992 Ian Lance Taylor (ian@cygnus.com) - * write.c, obj-ieee.c: don't define SUB_SEGMENT_ALIGN if it is - already defined. + * write.c, config/obj-ieee.c: don't define SUB_SEGMENT_ALIGN + if it is already defined. Tue Dec 15 12:40:11 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -12191,9 +12192,9 @@ Sat Dec 12 15:26:34 1992 Ian Lance Taylor (ian@cygnus.com) used in AT&T i386 syntax. (fixup_segment): Take segment as argument. On the i386, adjust PC relative addends by the segment vaddr. - * tc-i386.h: Define SUB_SEGMENT_ALIGN. - * tc-a29k.h: Define ZERO_BASED_SEGMENTS. - * tc-i386.c: (i386_operand): If I386COFF, accept any segment type. + * config/tc-i386.h: Define SUB_SEGMENT_ALIGN. + * config/tc-a29k.h: Define ZERO_BASED_SEGMENTS. + * config/tc-i386.c: (i386_operand): If I386COFF, accept any segment type. Tue Dec 8 00:06:48 1992 Ken Raeburn (raeburn@rtl.cygnus.com) @@ -12327,9 +12328,9 @@ Mon Nov 23 11:00:16 1992 Ken Raeburn (raeburn@cygnus.com) * configure.in: No te-386bsd.h file exists; don't try to use it. - * obj-coff.c (obj_coff_endef): Use as_warn, not fprintf. + * config/obj-coff.c (obj_coff_endef): Use as_warn, not fprintf. - * tc-m68k.c (md_assemble): Don't complain about 68000 with 68881; + * config/tc-m68k.c (md_assemble): Don't complain about 68000 with 68881; could be doing emulation. Thu Nov 19 11:47:19 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -12349,45 +12350,46 @@ Tue Nov 10 09:49:24 1992 Ian Lance Taylor (ian@cygnus.com) read.c, app.c: removed definitions of comment_chars, line_comment_chars, and line_separator_chars. - * tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined, + * config/tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined, still accept (but don't require) OPTIONAL_REGISTER_PREFIX before the register name. (insert_reg): put REGISTER_PREFIX before register names before putting them in the symbol table. - * tc-m68k.h (OPTIONAL_REGISTER_PREFIX): Define to be "%", if not + * config/tc-m68k.h (OPTIONAL_REGISTER_PREFIX): Define to be "%", if not M68KCOFF. - * obj-coffbfd.c (fill_section): set STYP_NOLOAD bit for .bss + * config/obj-coffbfd.c (fill_section): set STYP_NOLOAD bit for .bss section. - * atof-ieee.c, atof-ns32k.c, tc-*.c: made EXP_CHARS, FLT_CHARS, - comment_chars, line_comment_chars and line_seperator_chars - consistently const, and always initialized them. Included read.h. + * config/atof-ieee.c, config/atof-ns32k.c, config/tc-*.c: made + EXP_CHARS, FLT_CHARS, comment_chars, line_comment_chars and + line_seperator_chars consistently const, and always + initialized them. Included read.h. Thu Nov 5 17:55:41 1992 Jim Wilson (wilson@sphagnum.cygnus.com) - * tc-sparc.c (sparc_ip): Add code to flag error if an absolute + * config/tc-sparc.c (sparc_ip): Add code to flag error if an absolute constant will not fit in an immediate field. (md_apply_fix, RELOC_BASE13 case): Check for relocation overflow. Wed Nov 4 07:50:46 1992 Ken Raeburn (raeburn@cygnus.com) - * obj-coff.c (callj_table): Delete global variable. + * config/obj-coff.c (callj_table): Delete global variable. (obj_emit_relocations): Define it locally here, and only if TC_I960 is defined. - * tc-m68k.c (m68k_reg_parse): Underscore is part of a symbol name. + * config/tc-m68k.c (m68k_reg_parse): Underscore is part of a symbol name. (m68k_ip): Don't warn about bignum used as float bit-pattern. - * obj-coff.c: Replaced ANSI and non-ANSI function declarations + * config/obj-coff.c: Replaced ANSI and non-ANSI function declarations with a single set using PARAMS macro. - * tc-i960.c (tc_bout_fix_to_chars): Bit-field fixups want a length + * config/tc-i960.c (tc_bout_fix_to_chars): Bit-field fixups want a length of 2. - * tc-i960.c: Missed a couple of 0->NO_RELOC conversions. + * config/tc-i960.c: Missed a couple of 0->NO_RELOC conversions. - * tc-i960.h (N_BALNAME, N_CALLNAME): Define as char-type values, + * config/tc-i960.h (N_BALNAME, N_CALLNAME): Define as char-type values, so widening works consistently. Wed Oct 28 08:52:34 1992 Ken Raeburn (raeburn@cygnus.com) @@ -12400,7 +12402,7 @@ Wed Oct 28 08:52:34 1992 Ken Raeburn (raeburn@cygnus.com) Fri Oct 23 14:40:38 1992 Ian Lance Taylor (ian@cygnus.com) - * obj-coffbfd.c (write_object_file): check return value of + * config/obj-coffbfd.c (write_object_file): check return value of bfd_close_all_done. Tue Oct 20 12:18:08 1992 Ian Lance Taylor (ian@cygnus.com) @@ -12426,11 +12428,11 @@ Sat Oct 10 12:33:45 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Mon Oct 5 09:28:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) fix i960+non-bfd coff bit rot. - * obj-coff.c (c_dot_file_symbol, obj_coff_ln, obj_coff_line): + * config/obj-coff.c (c_dot_file_symbol, obj_coff_ln, obj_coff_line): support for C source listings. (obj_coff_endef): look in the right part of the symbol for the symbol name - * tc-m68k.c (get_num): make it work for all segments, not just the + * config/tc-m68k.c (get_num): make it work for all segments, not just the first three. Mon Oct 5 03:30:36 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) @@ -12443,25 +12445,26 @@ Thu Oct 1 23:05:12 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Tue Sep 29 12:22:52 1992 Steve Chamberlain (sac@thepub.cygnus.com) - * obj-coffbfd.c (write_object_file): don't fixup for the z8k - * tc-z8k.c: lots of bug fixes + * config/obj-coffbfd.c (write_object_file): don't fixup for the z8k + * config/tc-z8k.c: lots of bug fixes Tue Sep 29 10:51:55 1992 Ian Lance Taylor (ian@cygnus.com) - * tc-i960.h, tc-i960.c: avoid the ANSI preprocessor addition - #elif, since it is not supported by old compilers. - ho-rs6000.h, tc-m68k.c: the native RS/6000 compiler miscompiles a - couple of expressions in tc-m68k.c. + * config/tc-i960.h, config/tc-i960.c: avoid the ANSI + preprocessor addition #elif, since it is not supported by old + compilers. + config/ho-rs6000.h, config/tc-m68k.c: the native RS/6000 + compiler miscompiles a couple of expressions in tc-m68k.c. Mon Sep 28 21:18:24 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) * read.c (cons): If NO_RELOC is defined, use it. - * tc-i960.c (get_cdisp): Use NO_RELOC, not 0, in call to fix_new. + * config/tc-i960.c (get_cdisp): Use NO_RELOC, not 0, in call to fix_new. Fri Sep 25 18:18:52 1992 Ian Lance Taylor (ian@cygnus.com) - * tc-m68k.h: if M68KCOFF, define DOT_LABEL_PREFIX (to require + * config/tc-m68k.h: if M68KCOFF, define DOT_LABEL_PREFIX (to require local labels to start with a .) and set REGISTER_PREFIX to %. tc-m68k.c (m68k_reg_parse): accept REGISTER_PREFIX if defined. @@ -12481,7 +12484,7 @@ Thu Sep 24 12:42:32 1992 Brendan Kehoe (brendan@rtl.cygnus.com) Tue Sep 22 13:02:07 1992 Sean Eric Fagan (sef@cygnus.com) - * obj-coffbfd.c (do_relocs_for,fill_section): now allocate all + * config/obj-coffbfd.c (do_relocs_for,fill_section): now allocate all sections starting from zero, rather than making them consecutive. This makes subsequent reloc calculations easier, esp if the object format doesn't understand addends. (obj_coff_lcomm): (maybe temporarily) @@ -12490,17 +12493,17 @@ Tue Sep 22 13:02:07 1992 Sean Eric Fagan (sef@cygnus.com) Tue Sep 22 15:10:51 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) - * tc-m68k.c: Replace "enum m68k_architecture" with "int" + * config/tc-m68k.c: Replace "enum m68k_architecture" with "int" throughout. That enum no longer means what we thought it meant. - * tc-m68k.c (md_assemble, md_parse_option): Handle new + * config/tc-m68k.c (md_assemble, md_parse_option): Handle new "-mno-688[58]1" options. - * tc-m68k.c: Added CPU32 support. + * config/tc-m68k.c: Added CPU32 support. Fri Sep 18 08:02:18 1992 Steve Chamberlain (sac@thepub.cygnus.com) - * tc-m68k.c (m68k_ip): An(disp) is not pc relative. + * config/tc-m68k.c (m68k_ip): An(disp) is not pc relative. Tue Sep 15 17:25:05 1992 Jim Wilson (wilson@sphagnum.cygnus.com) @@ -12525,19 +12528,19 @@ Sun Sep 13 20:30:10 1992 Ian Lance Taylor (ian@cygnus.com) * write.c (fixup_segment): fixed missing parens in expression checking for byte or word overflow. - * obj-coffbfd.h: define WARN_SIGNED_OVERFLOW_WORD. + * config/obj-coffbfd.h: define WARN_SIGNED_OVERFLOW_WORD. obj-coffbfd.c (fixup_segment): check for signed .word overflow if WARN_SIGNED_OVERFLOW_WORD. - * obj-coffbfd.c (fixup_segment): fixed missing parens in + * config/obj-coffbfd.c (fixup_segment): fixed missing parens in expression checking for byte or word overflow. Fri Sep 11 10:21:04 1992 Steve Chamberlain (sac@thepub.cygnus.com) Support for i386 coff - * obj-coffbfd.h : added stuff - * tc-i386.c (tc_coff_fix2rtype): new function - * tc-i386.h : new coff defines + * config/obj-coffbfd.h : added stuff + * config/tc-i386.c (tc_coff_fix2rtype): new function + * config/tc-i386.h : new coff defines Thu Sep 10 09:23:15 1992 Ian Lance Taylor (ian@cygnus.com) @@ -12553,21 +12556,23 @@ Wed Sep 9 11:06:25 1992 Ian Lance Taylor (ian@cygnus.com) Makefile.in: Handle m68*-*-coff*. read.c, read.h: add mult argument to s_space - * tc-m68k.c (m68k_ip, m68k_ip_op, get_num, try_moto_index): merge + * config/tc-m68k.c (m68k_ip, m68k_ip_op, get_num, try_moto_index): merge Motorola and MIT syntax; gas can now assemble either type of file. - tc-m68kmote.c, tc-m68kmote.h: removed now superfluous files. + * config/tc-m68kmote.c, config/tc-m68kmote.h: removed now + superfluous files. + From Steve Chamberlain: - m68kcoff.mt: for m68k COFF. - obj-coffbfd.c: (fixup_mdeps) added + * config/m68kcoff.mt: for m68k COFF. + * config/obj-coffbfd.c: (fixup_mdeps) added (size_section) removed bad sanity check (fill_section) added rs_machine_dependent case (write_object_file) call fixup_mdeps (fixup_segment) set fx_subsy to 0. - obj-coffbfd.h: define WORKING_DOT_WORD (too hard to support) and - handle m68k. - tc-m68k.c, config/tc-m68k.h: added m68k COFF support and Motorala - pseudo ops. + * config/ obj-coffbfd.h: define WORKING_DOT_WORD (too hard to + support) and handle m68k. + * config/tc-m68k.c, config/tc-m68k.h: added m68k COFF support + and Motorala pseudo ops. Tue Sep 8 17:10:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -12592,9 +12597,11 @@ Sat Aug 29 12:11:12 1992 Jim Wilson (wilson@sphagnum.cygnus.com) Fri Aug 28 16:25:22 1992 Ian Lance Taylor (ian@cygnus.com) - * obj-bout.h, obj-bout.c (obj_header_append, obj_symbol_to_chars), - tc-i960.c (md_ri_to_chars): Always output bout object file in - little endian byte order (used to use endianness of host). + * config/obj-bout.h, config/obj-bout.c (obj_header_append, + obj_symbol_to_chars). + * config/tc-i960.c (md_ri_to_chars): Always output bout object + file in little endian byte order (used to use endianness of + host). Tue Aug 25 15:50:48 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -12623,9 +12630,9 @@ Mon Aug 24 12:45:43 1992 Ian Lance Taylor (ian@cygnus.com) * Makefile.in: defined TARGET_CPU for C code so that it can choose one element of a family. - * tc-m68k.c: use TARGET_CPU to choose default cpu type. + * config/tc-m68k.c: use TARGET_CPU to choose default cpu type. - * te-generic.h: default to LOCAL_LABELS_DOLLAR and LOCAL_LABELS_FB + * config/te-generic.h: default to LOCAL_LABELS_DOLLAR and LOCAL_LABELS_FB so that we can assemble hand-written libgcc code. Fri Aug 21 14:38:44 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -12636,7 +12643,7 @@ Fri Aug 21 14:38:44 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) Wed Aug 19 11:20:59 1992 Ian Lance Taylor (ian@cygnus.com) - * tc-m68k.c, tc-m68kmote.c: the cas2 instruction is supposed to be + * config/tc-m68k.c, tc-m68kmote.c: the cas2 instruction is supposed to be written with indirection on the last two operands, which can be either data or address registers. Added a new operand type 'r' which accepts either register type. Added '(' to notend stuff in @@ -12658,16 +12665,16 @@ Wed Aug 19 09:25:09 1992 Ken Raeburn (raeburn@cygnus.com) defined, call it. Change segments before calling fixup_segment. (relax_align): If linkrelax, provide extra padding. - * obj-bout.c (obj_emit_relocations): Emit alignment relocs despite + * config/obj-bout.c (obj_emit_relocations): Emit alignment relocs despite their not having symbols associated. - * tc-i960.c (norelax, instrument_branches): Default initializer is + * config/tc-i960.c (norelax, instrument_branches): Default initializer is sufficient. (linkrelax): Delete variable definition. (mem_fmt): Call fix_new with NO_RELOC. (tc_bout_fix_to_chars): Handle alignment relocs. (i960_handle_align): New function. - * tc-i960.h (linkrelax): Delete declaration. + * config/tc-i960.h (linkrelax): Delete declaration. (HANDLE_ALIGN): New macro; calls i960_handle_align. (NEED_FX_R_TYPE, NO_RELOC): New macros. @@ -12716,7 +12723,7 @@ Tue Aug 11 12:58:14 1992 Ken Raeburn (raeburn@cygnus.com) Mon Aug 10 14:37:08 1992 Per Bothner (bothner@cygnus.com) - * tc-m68k.c: ".align N" means align to N-byte boundary *only* + * config/tc-m68k.c: ".align N" means align to N-byte boundary *only* if TN_SUN3; otherwise align to 2**N-byte bounary. Thu Aug 6 12:10:39 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -12734,7 +12741,7 @@ Wed Aug 5 12:02:40 1992 Steve Chamberlain (sac@thepub.cygnus.com) Wed Aug 5 01:54:34 1992 John Gilmore (gnu at cygnus.com) - * tc-m68k.c (try_index): Error if index scaling specified and + * config/tc-m68k.c (try_index): Error if index scaling specified and assembling for an older CPU than a 68020. Sat Aug 1 19:10:13 1992 Ken Raeburn (raeburn@cygnus.com) @@ -12785,7 +12792,7 @@ Mon Jul 13 14:11:36 1992 Steve Chamberlain (sac@thepub.cygnus.com) Mon Jul 6 17:09:32 1992 Steve Chamberlain (sac@cygnus.com) - * obj-coffbfd.c (fill_section): mark .lit sections as STYP_LIT + * config/obj-coffbfd.c (fill_section): mark .lit sections as STYP_LIT Mon Jun 1 16:20:22 1992 Michael Tiemann (tiemann@cygnus.com) @@ -12814,7 +12821,7 @@ Tue Jun 9 07:54:54 1992 Steve Chamberlain (sac@thepub.cygnus.com) * write.c (write_object_file): various changes to handle data in the BSS segment in much the same was as stuff in the DATA segment. - * tc-m68k.c (m68kip): Fix typo so that only arch's >=68020 do + * config/tc-m68k.c (m68kip): Fix typo so that only arch's >=68020 do pcrel data stuff. (md_estimate_size_before_relax): when relaxing a 68010 bxx into a bra+6 jmpxx, put the bytes of the jmp opcode into the right place. (s_bss): Don't put .bss stuff into SEG_DATA, put @@ -12853,7 +12860,7 @@ Thu May 28 11:22:02 1992 Jim Wilson (wilson@sphagnum.cygnus.com) * configure.in: Recognize sparclite as a sparc variant. - * tc-sparc.c: Use new ARCHITECTURES_CONFLICT_P macro. Mention new + * config/tc-sparc.c: Use new ARCHITECTURES_CONFLICT_P macro. Mention new -Asparclite flag. Tue May 26 16:47:56 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -12867,9 +12874,9 @@ Thu May 14 17:22:48 1992 K. Richard Pixley (rich@rtl.cygnus.com) Mon May 4 18:56:19 1992 Steve Chamberlain (sac@thepub.cygnus.com) - * obj-coffbfd.c: use is a synonym for section, (do_relocs_for): + * config/obj-coffbfd.c: use is a synonym for section, (do_relocs_for): calc the base of relocs correctly. - * tc-a29k.c (parse_operand): allow expressions to be in any section. + * config/tc-a29k.c (parse_operand): allow expressions to be in any section. Mon Apr 27 13:13:31 1992 K. Richard Pixley (rich@cygnus.com) @@ -12923,8 +12930,8 @@ Fri Mar 13 08:03:03 1992 Steve Chamberlain (sac@thepub.cygnus.com) Thu Mar 12 04:42:38 1992 K. Richard Pixley (rich@cygnus.com) - * tc-m68k.h, te-sun3.h: moved LOCAL_LABELS_FB definition from - tc-m68k.h to te-sun3.h. + * config/tc-m68k.h, config/te-sun3.h: moved LOCAL_LABELS_FB + definition from tc-m68k.h to te-sun3.h. Wed Mar 11 23:32:42 1992 K. Richard Pixley (rich@cygnus.com) @@ -12936,7 +12943,7 @@ Wed Mar 11 23:32:42 1992 K. Richard Pixley (rich@cygnus.com) * symbols.c: remove local_labels_dollar, replace with a function interface for a sparse array. All users adjusted. - * te-sun3.h: add LOCAL_LABELS_DOLLAR. + * config/te-sun3.h: add LOCAL_LABELS_DOLLAR. Sat Mar 7 00:06:25 1992 K. Richard Pixley (rich@rtl.cygnus.com) @@ -13024,9 +13031,9 @@ Fri Feb 21 06:21:07 1992 K. Richard Pixley (rich@rtl.cygnus.com) * read.c, write.c subsegs.c: back out the .bss changes. - * obj-aout.c: do not include stab.gnu.h if NO_LISTING. + * config/obj-aout.c: do not include stab.gnu.h if NO_LISTING. - * tc-i860.c, a.out.gnu.h: move i860 relocs to a proper place. + * config/tc-i860.c, a.out.gnu.h: move i860 relocs to a proper place. * a.out.h: removed. @@ -13045,11 +13052,11 @@ Fri Feb 21 01:08:48 1992 Minh Tran-Le (TRANLE@INTELLICORP.COM) * as.c (perform_an_assembly_pass): zero bss_fix_root, too. - * tc-i386.c: tc-i386.c: added handling of the following opcodes: + * config/tc-i386.c: tc-i386.c: added handling of the following opcodes: i/o opcodes - inb, inw, outb and outw. string manipulation with att syntax - scmp, slod, smov, ssca, ssto. - * obj-coff.c: (for aix386) Moved the symbols .text, .data and .bss + * config/obj-coff.c: (for aix386) Moved the symbols .text, .data and .bss to just after .file . In obj_crawl_symbol_chain() where it tries to put the external @@ -13085,18 +13092,18 @@ Tue Feb 18 02:21:25 1992 K. Richard Pixley (rich at cygnus.com) * write.c: comment change only. - * tc-m88k.[hc]: pulled in from hack's unfinished work. These + * config/tc-m88k.[hc]: pulled in from hack's unfinished work. These aren't yet integrated. - * tc-i860.[hc]: blew off the dust. Something must still be done + * config/tc-i860.[hc]: blew off the dust. Something must still be done about conflicting relocation types. - * tc-ns32k.c: Replaced previous tc_aout_fix_to_chars stub with the + * config/tc-ns32k.c: Replaced previous tc_aout_fix_to_chars stub with the real thing. - * tc-i960.c, tc-sparc.c: white space and comments only. + * config/tc-i960.c, config/tc-sparc.c: white space and comments only. - * tc-a29k.h: delete duplicate macro definition. + * config/tc-a29k.h: delete duplicate macro definition. * new file atof-ns32k.c copied from hack's last unreleased gas. diff --git a/contrib/binutils/gas/ChangeLog-9697 b/contrib/binutils/gas/ChangeLog-9697 index 7b93733..7ffff3e 100644 --- a/contrib/binutils/gas/ChangeLog-9697 +++ b/contrib/binutils/gas/ChangeLog-9697 @@ -145,7 +145,7 @@ Mon Dec 1 20:24:18 1997 J"orn Rennecke Sat Nov 22 16:19:22 1997 Richard Henderson - * tc-alpha.c (range_signed_16, range_signed_32): Work around an + * config/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 @@ -171,7 +171,7 @@ Thu Nov 20 15:06:08 1997 Richard Earnshaw Wed Nov 19 17:44:42 1997 Richard Henderson - * tc-sh.c (parse_reg): Properly quote for fv4. + * config/tc-sh.c (parse_reg): Properly quote for fv4. Wed Nov 19 23:46:18 1997 Ian Lance Taylor @@ -287,7 +287,7 @@ Tue Nov 4 16:35:57 1997 Ian Dall Mon Nov 3 13:30:17 1997 Gavin Koch - * tc-mips.c (md_begin): Reorganize setting of default values so + * config/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 @@ -499,7 +499,7 @@ Thu Oct 9 15:17:50 1997 Ian Lance Taylor Thu Oct 9 01:44:36 1997 J"orn Rennecke - * tc-d10v.h (TC_START_LABEL): Don't define. + * config/tc-d10v.h (TC_START_LABEL): Don't define. (tc_frob_label): Define. Thu Oct 9 00:07:23 1997 J"orn Rennecke @@ -941,7 +941,7 @@ Thu Aug 21 00:59:53 1997 Doug Evans Wed Aug 20 00:45:20 1997 J"orn Rennecke - * tc-sh.c (parse_reg, get_specific, build_Mytes): Add SH4 + * config/tc-sh.c (parse_reg, get_specific, build_Mytes): Add SH4 floating point extensions. (parse_reg): parse sgr and dbr. @@ -1165,14 +1165,14 @@ Mon Jul 28 18:41:41 1997 Rob Savoye 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 + * config/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 - * tc-sparc.c (md_begin): Cast sparc_opcodes to PTR for hash_insert. + * config/tc-sparc.c (md_begin): Cast sparc_opcodes to PTR for hash_insert. Thu Jul 24 17:51:29 1997 Ian Lance Taylor @@ -1462,7 +1462,7 @@ Wed May 14 09:54:53 1997 Nick Clifton options -mapcs-32, -mapcs-26, -marmv2, -marmv2a, -marmv3, -marmv3m, -marmv4, -marmv4t. - * tc-arm.h (LOCAL_LABEL): Removed the definition of this macro + * config/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) @@ -2197,9 +2197,9 @@ Wed Feb 26 18:19:00 1997 Stan Shebs * configure.in (mips*-*-lnews*): New target, also make empty emulation list for this target. * configure: Update. - * tc-mips.c (ECOFF_LITTLE_FORMAT): Define. + * config/tc-mips.c (ECOFF_LITTLE_FORMAT): Define. (mips_target_format): Use. - * te-lnews.h: New file. + * config/te-lnews.h: New file. Wed Feb 26 15:33:46 1997 Fred Fish @@ -2387,7 +2387,7 @@ Fri Feb 21 14:34:31 1997 Martin M. Hunt Fri Feb 21 10:08:25 1997 Jim Wilson - * tc-mips.c (mips_ip): If configured for an embedded ELF system, + * config/tc-mips.c (mips_ip): If configured for an embedded ELF system, don't set the section alignment to 2**4. Fri Feb 21 11:55:03 1997 Ian Lance Taylor @@ -3713,12 +3713,12 @@ Thu Oct 3 00:16:50 1996 Jeffrey A Law (law@cygnus.com) Wed Oct 2 15:54:03 1996 Klaus Kaempf - * obj-evax.h: move openvms definitions from here to tc-alpha.c. - * tc-alpha.c: add support for vms_case_hack like in vax/vms. + * config/obj-evax.h: move openvms definitions from here to tc-alpha.c. + * config/tc-alpha.c: add support for vms_case_hack like in vax/vms. (load_expression): track clobbering of base reg before jmp/jsr. (s_alpha_file): pass case_hack flags and source filename via symbol table to bfd. - * tc-alpha.h (TC_CONS_FIX_NEW): define + * config/tc-alpha.h (TC_CONS_FIX_NEW): define Tue Oct 1 16:16:01 1996 Joel Sherrill @@ -3749,7 +3749,7 @@ Tue Oct 1 12:37:48 1996 Ian Lance Taylor Tue Oct 1 09:36:19 1996 Stu Grossman (grossman@critters.cygnus.com) - * tc-v850.h: Define LOCAL_LABEL to recognise _.L_* symbols + * config/tc-v850.h: Define LOCAL_LABEL to recognise _.L_* symbols generated by DWARF. Sat Sep 28 03:38:08 1996 Ian Lance Taylor @@ -4142,7 +4142,7 @@ Thu Aug 15 17:01:31 1996 James G. Smith Thu Aug 15 16:12:00 1996 Richard Earnshaw (rearnsha@armltd.co.uk) - * tc-arm.c (md_apply_fix3): Also set fixP->fx_done if fx_addsy is + * config/tc-arm.c (md_apply_fix3): Also set fixP->fx_done if fx_addsy is non-null, but is a constant. (fix_new_arm): Call make_expr_symbol to make the expression symbol so that error reporting will work correctly. @@ -4337,7 +4337,7 @@ Mon Jul 22 14:01:33 1996 Ian Lance Taylor Mon Jul 22 12:46:55 1996 Richard Henderson - * tc-alpha.c: Patches to track current minimum alignment to reduce + * config/tc-alpha.c: Patches to track current minimum alignment to reduce the number of fragments created with frag_align. (alpha_current_align): New static variable. (s_alpha_text): Reset alignment to 0. @@ -4357,10 +4357,10 @@ Mon Jul 22 12:46:55 1996 Richard Henderson s_alpha_stringer and s_alpha_space pseudo-ops. (alpha_align): Skip if less than current default alignment. Set default alignment. - * tc-alpha.h (md_flush_pending_output): Remove. + * config/tc-alpha.h (md_flush_pending_output): Remove. (md_cons_align): Add. - * tc-alpha.c: Add oodles of function description comments. + * config/tc-alpha.c: Add oodles of function description comments. (md_bignum_to_chars): Remove; there are no callers. (md_show_usage): Mention some more variants. @@ -5320,7 +5320,7 @@ Mon Mar 11 09:59:53 1996 Steve Chamberlain * as.h (SEG_NORMAL, SEG_LIST): Bump segment limit from 10 to 40. (SEG_LAST): New. * subsegs.c (MANY_SEGMENTS): Increase segment limit. - * obj-coff.c (seg_N_TYPE, seg_info_off_by_4): Likewise. + * config/obj-coff.c (seg_N_TYPE, seg_info_off_by_4): Likewise. (do_relocs_for, w_symbols, obj_coff_add_segment, do_linenos_for, crawl_symbols, coff_header_append): Loop to SEG_LAST rather than SEG_E9. diff --git a/contrib/binutils/gas/ChangeLog-9899 b/contrib/binutils/gas/ChangeLog-9899 index a853b88..c2e4d89 100644 --- a/contrib/binutils/gas/ChangeLog-9899 +++ b/contrib/binutils/gas/ChangeLog-9899 @@ -1,3 +1,9 @@ +1999-12-27 Alan Modra + + * config/tc-i386.c (MATCH): Relax JumpAbsolute check. Emit a + warning for absolute jump/call without `*' in non-intel mode. No + need to set i.types[0] JumpAbsolute in intel mode. + 1999-12-22 Philip Blundell * config/tc-arm.c (arm_s_text): If OBJ_ELF, call the appropriate @@ -174,8 +180,8 @@ Wed Oct 27 16:50:44 1999 Don Lindsay Mon Oct 18 18:11:10 MDT 1999 Diego Novillo - * tc_d10v.c (find_opcode): Allow ATSIGN to match expressions of the - form @abs16, @(abs16) and @(abs16 + imm). + * config/tc-d10v.c (find_opcode): Allow ATSIGN to match + expressions of the form @abs16, @(abs16) and @(abs16 + imm). 1999-10-21 Gavin Romig-Koch @@ -379,7 +385,7 @@ Wed Sep 15 05:14:32 1999 Jeffrey A Law (law@cygnus.com) (md_assemble): Call dwarf2_where for OBJ_ELF. (pa_ip): Call dwarf2_gen_line_info for OBJ_ELF. (pa_end_of_source): New function. - * tc-hppa.h (md_end): Define for OBJ_ELF. + * config/tc-hppa.h (md_end): Define for OBJ_ELF. 1999-09-14 Michael Meissner @@ -1074,10 +1080,10 @@ Thu Jul 1 15:33:10 1999 Jeffrey A Law (law@cygnus.com) Mon Jun 21 16:45:19 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (elf_hppa_reloc_type): Renamed from elf32_hppa_reloc_type. + * config/tc-hppa.c (elf_hppa_reloc_type): Renamed from elf32_hppa_reloc_type. (hppa_gen_reloc_type): Conditionalize on BFD64. (tc_gen_reloc): Re-enable ELF relocations. - * tc-hppa.h (TARGET_FORMAT): Handle elf64-hppa format. + * config/tc-hppa.h (TARGET_FORMAT): Handle elf64-hppa format. 1999-06-21 Ian Lance Taylor @@ -1099,7 +1105,7 @@ Mon Jun 21 16:45:19 1999 Jeffrey A Law (law@cygnus.com) Fri Jun 18 14:34:18 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c: General cleanups of ELF support. No more spaces + * config/tc-hppa.c: General cleanups of ELF support. No more spaces and subspaces for ELF. (GDB_DEBUG_SPACE_NAME): Delete definition for ELF. (GDB_STRINGS_SUBSPACE_NAME): Likewise. @@ -1670,9 +1676,9 @@ Thu May 6 19:50:14 1999 Richard Henderson 1999-05-05 Catherine Moore - * tc-m68k.c: Include elf/m68k.h. + * config/tc-m68k.c: Include elf/m68k.h. (m68k_elf_final_processing): New routine. - * tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing): + * config/tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing): Define. Mon May 3 10:26:03 1999 Jeffrey A Law (law@cygnus.com) @@ -1772,7 +1778,7 @@ Fri Apr 16 12:26:39 1999 Bob Manson Thu Apr 15 16:52:09 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_get_absolute_exression): Try to handle "5 %r3" + * config/tc-hppa.c (pa_get_absolute_exression): Try to handle "5 %r3" expressions correctly. @@ -1782,7 +1788,7 @@ Thu Apr 15 16:52:09 1999 Jeffrey A Law (law@cygnus.com) Mon Apr 12 23:45:07 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_ip, case '3'): New case for PA2.0 fmpyfadd + * config/tc-hppa.c (pa_ip, case '3'): New case for PA2.0 fmpyfadd and fmpynfadd instructions. 1999-04-11 Richard Henderson @@ -1805,7 +1811,7 @@ Mon Apr 12 23:45:07 1999 Jeffrey A Law (law@cygnus.com) Sat Apr 10 20:10:02 1999 Richard Henderson - * tc-alpha.c (load_expression): Call as_bad instead of abort. + * config/tc-alpha.c (load_expression): Call as_bad instead of abort. 1999-04-08 Nick Clifton @@ -1869,18 +1875,18 @@ Sat Apr 10 20:10:02 1999 Richard Henderson Mon Mar 29 10:15:40 CST 1999 Catherine Moore - * tc-mips.c (md_apply_fix): Adjust value for linkonce sections. + * config/tc-mips.c (md_apply_fix): Adjust value for linkonce sections. Wed Mar 24 14:11:10 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_parse_nonneg_cmpsub_cmpltr): Clean up code to + * config/tc-hppa.c (pa_parse_nonneg_cmpsub_cmpltr): Clean up code to detect ",n" without a condition. (pa_parse_neg_cmpsub_cmpltr): Likewise. Tue Mar 23 11:28:23 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_ip, case '~'): The condition for a branch on bit + * config/tc-hppa.c (pa_ip, case '~'): The condition for a branch on bit instruction is encoded with one bit. @@ -1897,16 +1903,16 @@ Tue Mar 23 11:28:23 1999 Jeffrey A Law (law@cygnus.com) Sun Mar 21 18:08:18 1999 Richard Henderson - * tc-alpha.c (md_assemble): Allow '6' in an opcode. + * config/tc-alpha.c (md_assemble): Allow '6' in an opcode. Thu Mar 18 10:55:30 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_ip, case 'a'): Do not call pa_parse_..._cmpsub_cmpltr. + * config/tc-hppa.c (pa_ip, case 'a'): Do not call pa_parse_..._cmpsub_cmpltr. Thu Mar 18 02:30:07 1999 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (pa_ip, case 'd'): Do not allow ",n". + * config/tc-hppa.c (pa_ip, case 'd'): Do not allow ",n". 1999-03-15 Martin Hunt @@ -2602,9 +2608,9 @@ Wed Oct 7 14:09:14 1998 Nick Clifton Tue Oct 6 09:31:15 1998 Catherine Moore - * tc-sparc.h (TC_FORCE_RELOCATION): Define. + * config/tc-sparc.h (TC_FORCE_RELOCATION): Define. (elf32_sparc_force_relocation): Declare. - * tc-sparc.c (md_apply_fix3): Handle vtable relocs. + * config/tc-sparc.c (md_apply_fix3): Handle vtable relocs. (tc_gen_reloc): Handle vtable relocs. (elf32_sparc_force_relocation): New. @@ -2622,7 +2628,7 @@ Mon Oct 5 09:25:32 1998 Catherine Moore Mon Oct 5 00:48:52 1998 Jeffrey A Law (law@cygnus.com) - * tc-hppa.c (fp_operand_format): Add some additional formats. + * config/tc-hppa.c (fp_operand_format): Add some additional formats. (pa_ip): Do not automatically promote into pa2.0 mode. (pa_level): Handle ".level 2.0". @@ -2843,8 +2849,8 @@ Wed Aug 19 09:30:16 1998 Nick Clifton Tue Aug 18 11:59:43 1998 Catherine Moore - * tc-arm.h: Define obj_fix_adjustable for OBJ_ELF. - * tc-arm.c (arm_fix_adjustable): New routine. + * config/tc-arm.h: Define obj_fix_adjustable for OBJ_ELF. + * config/tc-arm.c (arm_fix_adjustable): New routine. 1998-08-13 Vladimir N. Makarov @@ -3194,7 +3200,7 @@ Thu Jul 2 16:24:58 1998 Ian Lance Taylor Thu Jul 2 14:06:22 1998 Klaus Kaempf - * obj-vms.c: Add C++ support with ctors/dtors sections. Add weak + * config/obj-vms.c: Add C++ support with ctors/dtors sections. Add weak symbol definitions. (Ctors_Symbols, Dtors_Symbols): New symbol chains. (ps_CTORS, ps_DTORS): New section types. @@ -3207,7 +3213,7 @@ Thu Jul 2 14:06:22 1998 Klaus Kaempf (vms_write_object_file): Write Ctors_Symbols/Dtors_Symbols to appropriate section. - * tc-alpha.h (TARGET_FORMAT): Rename "evax-alpha" to "vms-alpha". + * config/tc-alpha.h (TARGET_FORMAT): Rename "evax-alpha" to "vms-alpha". * makefile.vms: Merge vax/vms support. Wed Jul 1 20:06:20 1998 Richard Henderson @@ -3232,7 +3238,7 @@ Wed Jul 1 16:35:32 1998 Doug Evans Wed Jul 1 21:38:56 1998 J"orn Rennecke - * config/tc-sh (COND_JUMP_DELAY, COND12_DELAY_LENGTH): Define. + * config/tc-sh.c (COND_JUMP_DELAY, COND12_DELAY_LENGTH): Define. Changed all users of COND12_DELAY. Fri Jun 26 11:21:11 1998 Jeffrey A Law (law@cygnus.com) @@ -4414,7 +4420,7 @@ Fri Feb 20 15:03:13 1998 Ian Lance Taylor Thu Feb 19 22:25:42 1998 Richard Henderson - * tc-ppc.c (ppc_biei): Cache the last symbol we inserted + * config/tc-ppc.c (ppc_biei): Cache the last symbol we inserted so we don't have to scan the entire list. Tue Feb 17 17:02:15 1998 Fred Fish @@ -4487,7 +4493,7 @@ Wed Feb 11 23:26:28 1998 Jeffrey A Law (law@cygnus.com) Thu Feb 12 03:41:00 1998 J"orn Rennecke Fix rac to accept only a0: - * tc-d10v.c (parallel_ok, find_opcode): + * config/tc-d10v.c (parallel_ok, find_opcode): Split OPERAND_ACC into OPERAND_ACC0 and OPERAND_ACC1. Introduce OPERAND_GPR. @@ -4685,9 +4691,9 @@ Thu Jan 29 18:48:19 1998 Bill Moyer Wed Jan 28 14:35:00 1998 Bill Moyer * as.h (flag_warn_suppress_instructionswap): added new flag. - * tc-d10v.c (md_parse_option,md_longopts): added "--nowarnswap" + * config/tc-d10v.c (md_parse_option,md_longopts): added "--nowarnswap" command line argument. - * tc-d10v.c (write_2_short): emit "Swapping instructions" + * config/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 @@ -4797,20 +4803,20 @@ Fri Jan 16 14:51:48 1998 Ian Lance Taylor Fri Jan 16 11:30:37 1998 Richard Henderson - * tc-m68k.c (m68k_ip): Remove absl->reglst MRI hack. + * config/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 - * tc-sh.c (get_specific): Handle SGR & DBR. + * config/tc-sh.c (get_specific): Handle SGR & DBR. Thu Jan 15 13:46:48 1998 Richard Henderson - * tc-h8300.c (parse_reg): Take the length of the symbol into + * config/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. + * config/tc-h8500.c (parse_reg): Likewise. Wed Jan 14 17:52:33 1998 Nick Clifton @@ -4838,7 +4844,7 @@ Mon Jan 12 13:04:57 1998 Doug Evans (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. + * config/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 diff --git a/contrib/binutils/gas/Makefile.am b/contrib/binutils/gas/Makefile.am index 357f3cf..304189d 100644 --- a/contrib/binutils/gas/Makefile.am +++ b/contrib/binutils/gas/Makefile.am @@ -60,11 +60,15 @@ CPU_TYPES = \ m88k \ mcore \ mips \ + mmix \ mn10200 \ mn10300 \ ns32k \ + openrisc \ + pdp11 \ pj \ ppc \ + s390 \ sh \ sparc \ tahoe \ @@ -74,6 +78,7 @@ CPU_TYPES = \ vax \ w65 \ v850 \ + xstormy16 \ z8k # Object format types. This is only used for dependency information. @@ -100,7 +105,7 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | mips | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ @@ -109,7 +114,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860) \ + cris | i860 | mmix) \ valid= ;; \ esac ;; \ ecoff) \ @@ -241,11 +246,15 @@ TARGET_CPU_CFILES = \ config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ + config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ config/tc-ns32k.c \ + config/tc-openrisc.c \ + config/tc-pdp11.c \ config/tc-pj.c \ config/tc-ppc.c \ + config/tc-s390.c \ config/tc-sh.c \ config/tc-sparc.c \ config/tc-tahoe.c \ @@ -255,6 +264,7 @@ TARGET_CPU_CFILES = \ config/tc-vax.c \ config/tc-w65.c \ config/tc-v850.c \ + config/tc-xstormy16.c \ config/tc-z8k.c TARGET_CPU_HFILES = \ @@ -281,11 +291,15 @@ TARGET_CPU_HFILES = \ config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ + config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ config/tc-ns32k.h \ + config/tc-openrisc.h \ + config/tc-pdp11.h \ config/tc-pj.h \ config/tc-ppc.h \ + config/tc-s390.h \ config/tc-sh.h \ config/tc-sparc.h \ config/tc-tahoe.h \ @@ -295,6 +309,7 @@ TARGET_CPU_HFILES = \ config/tc-vax.h \ config/tc-w65.h \ config/tc-v850.h \ + config/tc-xstormy16.h \ config/tc-z8k.h # OBJ files in config @@ -340,6 +355,7 @@ TARG_ENV_HFILES = \ config/te-hppa64.h \ config/te-hppalinux64.h \ config/te-i386aix.h \ + config/te-ia64aix.h \ config/te-ic960.h \ config/te-linux.h \ config/te-lnews.h \ @@ -425,10 +441,8 @@ stamp-mk.com: vmsconf.sh Makefile $(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 +EXTRA_DIST = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c +diststuff: $(EXTRA_DIST) info DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h @@ -451,6 +465,9 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) # in a subdirectory. DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" +DEP_FLAGS = -DBFD_ASSEMBLER -DOBJ_MAYBE_ELF \ + -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) + # How to link with both our special library facilities # and the system's installed libraries. @@ -742,6 +759,8 @@ de-stage3: DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) +Makefile: $(BFDDIR)/configure.in + # Automatic dependency computation. This is a real pain, because the # dependencies change based on target_cpu_type and obj_format. # Just to make things even more complicated, automake separates the @@ -779,7 +798,7 @@ DEP1: $(CFILES) $(MULTI_CFILES) echo '' > targ-env.h; \ echo '' > itbl-cpu.h; \ echo '' > itbl-parse.h; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? > DEP + $(MKDEP) $(DEP_FLAGS) $? > DEP mv -f DEPDIR/DEP $@ # Work out the special dependencies for the tc-*.c files. @@ -800,7 +819,7 @@ DEPTC: $(TARGET_CPU_CFILES) echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \ rm -f dummy.c; \ cp $${srcdir}/config/tc-$${c}.c dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEPTC_$${c}_$${o} =/" >> ../DEPTCA; \ rm -f dummy.c; \ else true; fi; \ @@ -838,7 +857,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) echo '' > itbl-parse.h; \ rm -f dummy.c; \ cp $${srcdir}/config/obj-$${o}.c dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEPOBJ_$${c}_$${o} =/" >> ../DEPOBJA; \ rm -f dummy.c; \ else true; fi; \ @@ -873,7 +892,7 @@ DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) if [ x$${valid} = xyes ]; then \ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \ echo '#include "obj-'"$${o}"'.h"' > dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \ else true; fi; \ done; \ @@ -921,359 +940,491 @@ dep-am: DEP .PHONY: dep dep-in dep-am AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/a29k.h -DEPTC_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 -DEPTC_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 -DEPTC_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 struc-symbol.h ecoff.h \ - $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c -DEPTC_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 struc-symbol.h $(INCDIR)/opcode/alpha.h \ +DEPTC_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h +DEPTC_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h +DEPTC_a29k_elf = $(INCDIR)/symcat.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-a29k.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h +DEPTC_alpha_coff = $(INCDIR)/symcat.h $(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 \ + struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ $(srcdir)/config/atof-vax.c -DEPTC_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 struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(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 \ + struc-symbol.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c +DEPTC_alpha_elf = $(INCDIR)/symcat.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-alpha.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - struc-symbol.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(srcdir)/../opcodes/arc-ext.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_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 struc-symbol.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(srcdir)/../opcodes/arc-ext.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h -DEPTC_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 -DEPTC_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)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h -DEPTC_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c +DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ + $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c +DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_arc_elf = $(INCDIR)/symcat.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-arc.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h +DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h +DEPTC_arm_elf = $(INCDIR)/symcat.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-arm.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_avr_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-avr.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_avr_elf = $(INCDIR)/symcat.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-avr.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/avr.h +DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_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-cris.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_cris_elf = $(INCDIR)/symcat.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-cris.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/cris.h dwarf2dbg.h +DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_d10v_elf = $(INCDIR)/symcat.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-d10v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h +DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_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-d30v.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/symcat.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h -DEPTC_fr30_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-fr30.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/symcat.h $(srcdir)/../opcodes/fr30-desc.h \ +DEPTC_d30v_elf = $(INCDIR)/symcat.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-d30v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/d30v.h +DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ cgen.h -DEPTC_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 -DEPTC_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 -DEPTC_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 -DEPTC_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 -DEPTC_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_fr30_elf = $(INCDIR)/symcat.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-fr30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/fr30-opc.h cgen.h +DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + $(INCDIR)/safe-ctype.h +DEPTC_h8300_elf = $(INCDIR)/symcat.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-h8300.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h +DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ + $(INCDIR)/safe-ctype.h +DEPTC_h8500_elf = $(INCDIR)/symcat.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-h8500.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ + $(INCDIR)/safe-ctype.h +DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h -DEPTC_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 $(INCDIR)/elf/reloc-macros.h \ +DEPTC_hppa_elf = $(INCDIR)/symcat.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-hppa.h \ + $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ dwarf2dbg.h -DEPTC_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_ia64_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-ia64.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h -DEPTC_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_ia64_elf = $(INCDIR)/symcat.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-ia64.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h +DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i370_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-i370.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h \ - $(INCDIR)/elf/i370.h -DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_i370_elf = $(INCDIR)/symcat.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-i370.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h +DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_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 dwarf2dbg.h \ - $(INCDIR)/opcode/i386.h -DEPTC_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 \ +DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_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)/opcode/i860.h $(INCDIR)/elf/i860.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_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 -DEPTC_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 \ +DEPTC_i386_elf = $(INCDIR)/symcat.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-i386.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/i386.h +DEPTC_i860_elf = $(INCDIR)/symcat.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-i860.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ + $(srcdir)/config/tc-i960.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_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 $(srcdir)/../opcodes/m32r-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h -DEPTC_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 $(srcdir)/../opcodes/m32r-desc.h \ +DEPTC_i960_coff = $(INCDIR)/symcat.h $(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)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_i960_elf = $(INCDIR)/symcat.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-i960.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ cgen.h -DEPTC_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h \ - dwarf2dbg.h -DEPTC_m68hc11_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-m68hc11.h subsegs.h \ +DEPTC_m32r_elf = $(INCDIR)/symcat.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-m32r.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/m32r-opc.h cgen.h +DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h -DEPTC_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 -DEPTC_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 -DEPTC_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 \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \ +DEPTC_m68hc11_elf = $(INCDIR)/symcat.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-m68hc11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h +DEPTC_m68k_aout = $(INCDIR)/symcat.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 \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ + dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h +DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h +DEPTC_m68k_elf = $(INCDIR)/symcat.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-m68k.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ + dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \ + $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h +DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ + $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_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 -DEPTC_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 \ +DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h -DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h -DEPTC_mcore_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-mcore.h subsegs.h \ - $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_m88k_elf = $(INCDIR)/symcat.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-m88k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/config/m88k-opcode.h +DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h +DEPTC_mcore_elf = $(INCDIR)/symcat.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-mcore.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h +DEPTC_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/mips.h itbl-ops.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \ - itbl-ops.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_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 $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h +DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(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)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.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 \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h +DEPTC_mips_elf = $(INCDIR)/symcat.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-mips.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h +DEPTC_mmix_elf = $(INCDIR)/symcat.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-mmix.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h +DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h -DEPTC_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 -DEPTC_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_mn10200_elf = $(INCDIR)/symcat.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-mn10200.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10200.h +DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ dwarf2dbg.h -DEPTC_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 dwarf2dbg.h -DEPTC_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 -DEPTC_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_mn10300_elf = $(INCDIR)/symcat.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-mn10300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_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 \ +DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(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 -DEPTC_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_ns32k_elf = $(INCDIR)/symcat.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-ns32k.h \ + $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h +DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/openrisc-opc.h cgen.h +DEPTC_openrisc_elf = $(INCDIR)/symcat.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-openrisc.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ + cgen.h +DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h +DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h +DEPTC_pdp11_elf = $(INCDIR)/symcat.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-pdp11.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h +DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/pj.h -DEPTC_pj_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-pj.h $(INCDIR)/opcode/pj.h -DEPTC_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 -DEPTC_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 \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \ +DEPTC_pj_elf = $(INCDIR)/symcat.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-pj.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h +DEPTC_ppc_coff = $(INCDIR)/symcat.h $(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)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/ppc.h +DEPTC_ppc_elf = $(INCDIR)/symcat.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-ppc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/ppc.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/s390.h \ + $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h +DEPTC_s390_elf = $(INCDIR)/symcat.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-s390.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/reloc-macros.h +DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - struc-symbol.h dwarf2dbg.h -DEPTC_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 struc-symbol.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_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 -DEPTC_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 -DEPTC_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 \ + $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h +DEPTC_sh_elf = $(INCDIR)/symcat.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-sh.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ + $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_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 -DEPTC_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h +DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h +DEPTC_sparc_elf = $(INCDIR)/symcat.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-sparc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h +DEPTC_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_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 -DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h -DEPTC_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 -DEPTC_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 -DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h sb.h macro.h \ +DEPTC_tahoe_elf = $(INCDIR)/symcat.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-tahoe.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h +DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h +DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h +DEPTC_tic30_elf = $(INCDIR)/symcat.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-tic30.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h +DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h -DEPTC_tic54x_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-tic54x.h sb.h \ - macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ - $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ +DEPTC_tic54x_elf = $(INCDIR)/symcat.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-tic54x.h \ + $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(BFDDIR)/libcoff.h -DEPTC_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic80.h -DEPTC_tic80_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-tic80.h $(INCDIR)/opcode/tic80.h -DEPTC_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 -DEPTC_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 -DEPTC_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 -DEPTC_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 -DEPTC_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \ +DEPTC_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h +DEPTC_tic80_elf = $(INCDIR)/symcat.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-tic80.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h +DEPTC_vax_aout = $(INCDIR)/symcat.h $(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 \ + $(INCDIR)/safe-ctype.h +DEPTC_vax_coff = $(INCDIR)/symcat.h $(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 $(INCDIR)/safe-ctype.h +DEPTC_vax_elf = $(INCDIR)/symcat.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-vax.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h \ + $(INCDIR)/safe-ctype.h +DEPTC_vax_vms = $(INCDIR)/symcat.h $(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 $(INCDIR)/safe-ctype.h +DEPTC_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_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 -DEPTC_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_w65_elf = $(INCDIR)/symcat.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-w65.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h +DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ dwarf2dbg.h -DEPTC_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 dwarf2dbg.h -DEPTC_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-coff.h \ +DEPTC_v850_elf = $(INCDIR)/symcat.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-v850.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/v850.h dwarf2dbg.h +DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/xstormy16-opc.h cgen.h +DEPTC_xstormy16_elf = $(INCDIR)/symcat.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-xstormy16.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h +DEPTC_z8k_coff = $(INCDIR)/symcat.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 -DEPTC_z8k_elf = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-elf.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h +DEPTC_z8k_elf = $(INCDIR)/symcat.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 + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ $(BFDDIR)/som.h @@ -1282,322 +1433,441 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_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 -DEPOBJ_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ +DEPOBJ_a29k_elf = $(INCDIR)/symcat.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-a29k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(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 +DEPOBJ_alpha_elf = $(INCDIR)/symcat.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-alpha.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(BFDDIR)/libecoff.h -DEPOBJ_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)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEPOBJ_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - struc-symbol.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 struc-symbol.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_avr_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-avr.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/obstack.h -DEPOBJ_cris_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-cris.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ + $(srcdir)/config/tc-alpha.h +DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ $(INCDIR)/obstack.h subsegs.h -DEPOBJ_d30v_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-d30v.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_fr30_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-fr30.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \ +DEPOBJ_arc_elf = $(INCDIR)/symcat.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-arc.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \ +DEPOBJ_arm_elf = $(INCDIR)/symcat.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-arm.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_avr_elf = $(INCDIR)/symcat.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-avr.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_cris_elf = $(INCDIR)/symcat.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-cris.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_d10v_elf = $(INCDIR)/symcat.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-d10v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_d30v_elf = $(INCDIR)/symcat.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-d30v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_fr30_elf = $(INCDIR)/symcat.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-fr30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 $(INCDIR)/elf/reloc-macros.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_ia64_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-ia64.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i370_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-i370.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h \ +DEPOBJ_h8300_elf = $(INCDIR)/symcat.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-h8300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/obstack.h -DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ +DEPOBJ_h8500_elf = $(INCDIR)/symcat.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-h8500.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_hppa_elf = $(INCDIR)/symcat.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-hppa.h \ + $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_ia64_elf = $(INCDIR)/symcat.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-ia64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_i370_elf = $(INCDIR)/symcat.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-i370.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h +DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPOBJ_i386_elf = $(INCDIR)/symcat.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-i386.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_i860_elf = $(INCDIR)/symcat.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-i860.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ + $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h +DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 -DEPOBJ_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68hc11_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-m68hc11.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_i960_elf = $(INCDIR)/symcat.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-i960.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_m32r_elf = $(INCDIR)/symcat.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-m32r.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(srcdir)/config/obj-aout.h \ +DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.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-m68hc11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mcore_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-mcore.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \ +DEPOBJ_m68k_elf = $(INCDIR)/symcat.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-m68k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/obstack.h -DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ +DEPOBJ_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_m88k_elf = $(INCDIR)/symcat.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-m88k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_mcore_elf = $(INCDIR)/symcat.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-mcore.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ +DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(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 +DEPOBJ_mips_elf = $(INCDIR)/symcat.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-mips.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(BFDDIR)/libecoff.h -DEPOBJ_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)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPOBJ_mmix_elf = $(INCDIR)/symcat.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-mmix.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_mn10200_elf = $(INCDIR)/symcat.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-mn10200.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_mn10300_elf = $(INCDIR)/symcat.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-mn10300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_ns32k_elf = $(INCDIR)/symcat.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-ns32k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_openrisc_elf = $(INCDIR)/symcat.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-openrisc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_pdp11_elf = $(INCDIR)/symcat.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-pdp11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_pj_elf = $(INCDIR)/symcat.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-pj.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_pj_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-pj.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ +DEPOBJ_ppc_elf = $(INCDIR)/symcat.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-ppc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_s390_elf = $(INCDIR)/symcat.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-s390.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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)/elf/reloc-macros.h \ +DEPOBJ_sh_elf = $(INCDIR)/symcat.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-sh.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \ +DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h \ +DEPOBJ_sparc_elf = $(INCDIR)/symcat.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-sparc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_tahoe_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_tahoe_elf = $(INCDIR)/symcat.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-tahoe.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \ +DEPOBJ_tic30_elf = $(INCDIR)/symcat.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-tic30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ +DEPOBJ_tic54x_elf = $(INCDIR)/symcat.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-tic54x.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_tic80_elf = $(INCDIR)/symcat.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-tic80.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_tic54x_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-tic54x.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic80_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-tic80.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_vax_vms = $(srcdir)/config/obj-vms.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def subsegs.h \ +DEPOBJ_vax_elf = $(INCDIR)/symcat.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-vax.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_vax_vms = $(INCDIR)/symcat.h $(srcdir)/config/obj-vms.h \ + $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h -DEPOBJ_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \ +DEPOBJ_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_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 -DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_w65_elf = $(INCDIR)/symcat.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-w65.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(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 +DEPOBJ_v850_elf = $(INCDIR)/symcat.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-v850.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.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-xstormy16.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_z8k_elf = $(INCDIR)/symcat.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 \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_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 @@ -1609,241 +1879,287 @@ DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_a29k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_avr_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-avr.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_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-cris.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_d30v_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-d30v.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_fr30_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-fr30.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)/symcat.h $(INCDIR)/coff/internal.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_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h +DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 \ + $(INCDIR)/elf/reloc-macros.h DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_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-ia64.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i370_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-i370.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.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_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)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_m68hc11_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-m68hc11.h +DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_m88k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_mcore_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-mcore.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.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 $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ + $(INCDIR)/coff/external.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_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h +DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h +DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_pj_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-pj.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.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)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.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_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_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-tic54x.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ + $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h DEP_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_tic80_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-tic80.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_tic80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_w65_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.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_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h +DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_aout) $(DEP_i386_coff) \ $(DEP_i386_elf) @@ -1852,49 +2168,62 @@ DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf) BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c -as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ - sb.h macro.h dwarf2dbg.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 -dwarf2dbg.o: dwarf2dbg.c dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c $(INCDIR)/symcat.h +as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ + output-file.h sb.h macro.h dwarf2dbg.h +atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h +bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h +cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h +depend.o: depend.c $(INCDIR)/symcat.h +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h +ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c ecoff.h -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 +expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h 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 $(INCDIR)/obstack.h -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 +frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h +input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ + $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ + sb.h +listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c $(INCDIR)/symcat.h +output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h +read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + 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 \ - struc-symbol.h -write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ - dwarf2dbg.h -gasp.o: gasp.c sb.h macro.h -itbl-ops.o: itbl-ops.c itbl-ops.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h +stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ + subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h struc-symbol.h +write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ + output-file.h dwarf2dbg.h +gasp.o: gasp.c $(INCDIR)/safe-ctype.h sb.h macro.h +itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ + emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ + emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ + emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ + emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/contrib/binutils/gas/Makefile.in b/contrib/binutils/gas/Makefile.in index 0e001a6..5664979 100644 --- a/contrib/binutils/gas/Makefile.in +++ b/contrib/binutils/gas/Makefile.in @@ -171,11 +171,15 @@ CPU_TYPES = \ m88k \ mcore \ mips \ + mmix \ mn10200 \ mn10300 \ ns32k \ + openrisc \ + pdp11 \ pj \ ppc \ + s390 \ sh \ sparc \ tahoe \ @@ -185,6 +189,7 @@ CPU_TYPES = \ vax \ w65 \ v850 \ + xstormy16 \ z8k @@ -213,7 +218,7 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | mips | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ @@ -222,7 +227,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860) \ + cris | i860 | mmix) \ valid= ;; \ esac ;; \ ecoff) \ @@ -358,11 +363,15 @@ TARGET_CPU_CFILES = \ config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ + config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ config/tc-ns32k.c \ + config/tc-openrisc.c \ + config/tc-pdp11.c \ config/tc-pj.c \ config/tc-ppc.c \ + config/tc-s390.c \ config/tc-sh.c \ config/tc-sparc.c \ config/tc-tahoe.c \ @@ -372,6 +381,7 @@ TARGET_CPU_CFILES = \ config/tc-vax.c \ config/tc-w65.c \ config/tc-v850.c \ + config/tc-xstormy16.c \ config/tc-z8k.c @@ -399,11 +409,15 @@ TARGET_CPU_HFILES = \ config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ + config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ config/tc-ns32k.h \ + config/tc-openrisc.h \ + config/tc-pdp11.h \ config/tc-pj.h \ config/tc-ppc.h \ + config/tc-s390.h \ config/tc-sh.h \ config/tc-sparc.h \ config/tc-tahoe.h \ @@ -413,6 +427,7 @@ TARGET_CPU_HFILES = \ config/tc-vax.h \ config/tc-w65.h \ config/tc-v850.h \ + config/tc-xstormy16.h \ config/tc-z8k.h @@ -461,6 +476,7 @@ TARG_ENV_HFILES = \ config/te-hppa64.h \ config/te-hppalinux64.h \ config/te-i386aix.h \ + config/te-ia64aix.h \ config/te-ic960.h \ config/te-linux.h \ config/te-lnews.h \ @@ -542,9 +558,7 @@ noinst_PROGRAMS = as-new gasp-new noinst_SCRIPTS = $(GDBINIT) EXTRA_SCRIPTS = .gdbinit -EXTRA_DIST = make-gas.com - -DISTSTUFF = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c +EXTRA_DIST = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h @@ -567,6 +581,10 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) # in a subdirectory. DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" +DEP_FLAGS = -DBFD_ASSEMBLER -DOBJ_MAYBE_ELF \ + -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) + + # How to link with both our special library facilities # and the system's installed libraries. @@ -628,449 +646,591 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/a29k.h - -DEPTC_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 +DEPTC_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h -DEPTC_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 +DEPTC_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h -DEPTC_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 struc-symbol.h ecoff.h \ - $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c +DEPTC_a29k_elf = $(INCDIR)/symcat.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-a29k.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h -DEPTC_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 struc-symbol.h $(INCDIR)/opcode/alpha.h \ +DEPTC_alpha_coff = $(INCDIR)/symcat.h $(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 \ + struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ $(srcdir)/config/atof-vax.c -DEPTC_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 struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/atof-vax.c +DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(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 \ + struc-symbol.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_elf = $(INCDIR)/symcat.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-alpha.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c - -DEPTC_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - struc-symbol.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(srcdir)/../opcodes/arc-ext.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_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 struc-symbol.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(srcdir)/../opcodes/arc-ext.h $(INCDIR)/elf/arc.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ + $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c -DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h +DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_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 +DEPTC_arc_elf = $(INCDIR)/symcat.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-arc.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + +DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h + +DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h -DEPTC_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)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h +DEPTC_arm_elf = $(INCDIR)/symcat.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-arm.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_avr_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-avr.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h +DEPTC_avr_elf = $(INCDIR)/symcat.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-avr.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/avr.h -DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_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-cris.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h dwarf2dbg.h +DEPTC_cris_elf = $(INCDIR)/symcat.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-cris.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 \ - $(INCDIR)/elf/reloc-macros.h +DEPTC_d10v_elf = $(INCDIR)/symcat.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-d10v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_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-d30v.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h - -DEPTC_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/symcat.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h - -DEPTC_fr30_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-fr30.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/symcat.h $(srcdir)/../opcodes/fr30-desc.h \ +DEPTC_d30v_elf = $(INCDIR)/symcat.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-d30v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/d30v.h + +DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ cgen.h -DEPTC_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 - -DEPTC_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 +DEPTC_fr30_elf = $(INCDIR)/symcat.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-fr30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/fr30-opc.h cgen.h + +DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + $(INCDIR)/safe-ctype.h + +DEPTC_h8300_elf = $(INCDIR)/symcat.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-h8300.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 +DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ + $(INCDIR)/safe-ctype.h -DEPTC_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 +DEPTC_h8500_elf = $(INCDIR)/symcat.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-h8500.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ + $(INCDIR)/safe-ctype.h -DEPTC_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h -DEPTC_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 $(INCDIR)/elf/reloc-macros.h \ +DEPTC_hppa_elf = $(INCDIR)/symcat.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-hppa.h \ + $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ dwarf2dbg.h -DEPTC_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_ia64_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-ia64.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h +DEPTC_ia64_elf = $(INCDIR)/symcat.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-ia64.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i370_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-i370.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h \ - $(INCDIR)/elf/i370.h +DEPTC_i370_elf = $(INCDIR)/symcat.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-i370.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h -DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_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 dwarf2dbg.h \ - $(INCDIR)/opcode/i386.h - -DEPTC_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 \ +DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_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)/opcode/i860.h $(INCDIR)/elf/i860.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_i386_elf = $(INCDIR)/symcat.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-i386.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_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 +DEPTC_i860_elf = $(INCDIR)/symcat.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-i860.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 \ +DEPTC_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ + $(srcdir)/config/tc-i960.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_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 $(srcdir)/../opcodes/m32r-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h +DEPTC_i960_coff = $(INCDIR)/symcat.h $(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)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h + +DEPTC_i960_elf = $(INCDIR)/symcat.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-i960.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_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 $(srcdir)/../opcodes/m32r-desc.h \ +DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ cgen.h -DEPTC_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h \ - dwarf2dbg.h - -DEPTC_m68hc11_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-m68hc11.h subsegs.h \ +DEPTC_m32r_elf = $(INCDIR)/symcat.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-m32r.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/m32r-opc.h cgen.h + +DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h -DEPTC_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 +DEPTC_m68hc11_elf = $(INCDIR)/symcat.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-m68hc11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h -DEPTC_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 +DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ + dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h -DEPTC_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 \ +DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h + +DEPTC_m68k_elf = $(INCDIR)/symcat.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-m68k.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ + dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 \ +DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ + $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_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 - -DEPTC_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 \ +DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h -DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h +DEPTC_m88k_elf = $(INCDIR)/symcat.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-m88k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/config/m88k-opcode.h + +DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h -DEPTC_mcore_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-mcore.h subsegs.h \ - $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h +DEPTC_mcore_elf = $(INCDIR)/symcat.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-mcore.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/mips.h itbl-ops.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \ - itbl-ops.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h +DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(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)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.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 \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h -DEPTC_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 $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_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 $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h - -DEPTC_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_mips_elf = $(INCDIR)/symcat.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-mips.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h + +DEPTC_mmix_elf = $(INCDIR)/symcat.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-mmix.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h + +DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h -DEPTC_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 +DEPTC_mn10200_elf = $(INCDIR)/symcat.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-mn10200.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ dwarf2dbg.h -DEPTC_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 dwarf2dbg.h +DEPTC_mn10300_elf = $(INCDIR)/symcat.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-mn10300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h + +DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(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 -DEPTC_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_ns32k_elf = $(INCDIR)/symcat.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-ns32k.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_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 +DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/openrisc-opc.h cgen.h -DEPTC_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_openrisc_elf = $(INCDIR)/symcat.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-openrisc.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ + cgen.h + +DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h + +DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h + +DEPTC_pdp11_elf = $(INCDIR)/symcat.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-pdp11.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h + +DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/pj.h -DEPTC_pj_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-pj.h $(INCDIR)/opcode/pj.h +DEPTC_pj_elf = $(INCDIR)/symcat.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-pj.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h -DEPTC_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 +DEPTC_ppc_coff = $(INCDIR)/symcat.h $(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)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/ppc.h -DEPTC_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 \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_ppc_elf = $(INCDIR)/symcat.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-ppc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/ppc.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h + +DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/s390.h \ + $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_s390_elf = $(INCDIR)/symcat.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-s390.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/reloc-macros.h -DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \ +DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - struc-symbol.h dwarf2dbg.h + $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h -DEPTC_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 struc-symbol.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_sh_elf = $(INCDIR)/symcat.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-sh.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ + $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/sparc.h -DEPTC_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 +DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h -DEPTC_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 \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_sparc_elf = $(INCDIR)/symcat.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-sparc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h -DEPTC_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 +DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_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 +DEPTC_tahoe_elf = $(INCDIR)/symcat.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-tahoe.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h +DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_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 +DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_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 +DEPTC_tic30_elf = $(INCDIR)/symcat.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-tic30.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h sb.h macro.h \ +DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h -DEPTC_tic54x_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-tic54x.h sb.h \ - macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ - $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ +DEPTC_tic54x_elf = $(INCDIR)/symcat.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-tic54x.h \ + $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(BFDDIR)/libcoff.h -DEPTC_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic80.h - -DEPTC_tic80_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-tic80.h $(INCDIR)/opcode/tic80.h +DEPTC_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h -DEPTC_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 - -DEPTC_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 +DEPTC_tic80_elf = $(INCDIR)/symcat.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-tic80.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h -DEPTC_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 +DEPTC_vax_aout = $(INCDIR)/symcat.h $(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 \ + $(INCDIR)/safe-ctype.h -DEPTC_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 +DEPTC_vax_coff = $(INCDIR)/symcat.h $(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 $(INCDIR)/safe-ctype.h -DEPTC_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \ +DEPTC_vax_elf = $(INCDIR)/symcat.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-vax.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h \ + $(INCDIR)/safe-ctype.h + +DEPTC_vax_vms = $(INCDIR)/symcat.h $(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 $(INCDIR)/safe-ctype.h + +DEPTC_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_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 +DEPTC_w65_elf = $(INCDIR)/symcat.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-w65.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ dwarf2dbg.h -DEPTC_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 dwarf2dbg.h +DEPTC_v850_elf = $(INCDIR)/symcat.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-v850.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/v850.h dwarf2dbg.h + +DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/xstormy16-opc.h cgen.h + +DEPTC_xstormy16_elf = $(INCDIR)/symcat.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-xstormy16.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h -DEPTC_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-coff.h \ +DEPTC_z8k_coff = $(INCDIR)/symcat.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 + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h -DEPTC_z8k_elf = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-elf.h \ +DEPTC_z8k_elf = $(INCDIR)/symcat.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 + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ @@ -1083,411 +1243,541 @@ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_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 +DEPOBJ_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_a29k_elf = $(INCDIR)/symcat.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-a29k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 \ +DEPOBJ_alpha_elf = $(INCDIR)/symcat.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-alpha.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEPOBJ_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - struc-symbol.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ + $(srcdir)/config/tc-alpha.h -DEPOBJ_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 struc-symbol.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ + $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_arc_elf = $(INCDIR)/symcat.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-arc.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h \ +DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h + +DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_arm_elf = $(INCDIR)/symcat.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-arm.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h +DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_avr_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-avr.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_avr_elf = $(INCDIR)/symcat.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-avr.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/obstack.h +DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_cris_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-cris.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_cris_elf = $(INCDIR)/symcat.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-cris.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_d10v_elf = $(INCDIR)/symcat.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-d10v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h +DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_d30v_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-d30v.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_d30v_elf = $(INCDIR)/symcat.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-d30v.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h +DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_fr30_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-fr30.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_fr30_elf = $(INCDIR)/symcat.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-fr30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \ +DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_h8300_elf = $(INCDIR)/symcat.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-h8300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \ +DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_h8500_elf = $(INCDIR)/symcat.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-h8500.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 $(INCDIR)/elf/reloc-macros.h \ +DEPOBJ_hppa_elf = $(INCDIR)/symcat.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-hppa.h \ + $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h +DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_ia64_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-ia64.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_ia64_elf = $(INCDIR)/symcat.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-ia64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h +DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_i370_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-i370.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h +DEPOBJ_i370_elf = $(INCDIR)/symcat.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-i370.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h \ +DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_i386_elf = $(INCDIR)/symcat.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-i386.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_i860_elf = $(INCDIR)/symcat.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-i860.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/obstack.h +DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ + $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h -DEPOBJ_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 +DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_i960_elf = $(INCDIR)/symcat.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-i960.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_m32r_elf = $(INCDIR)/symcat.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-m32r.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68hc11_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-m68hc11.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.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-m68hc11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_m68k_elf = $(INCDIR)/symcat.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-m68k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h -DEPOBJ_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_m88k_elf = $(INCDIR)/symcat.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-m88k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ +DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mcore_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-mcore.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_mcore_elf = $(INCDIR)/symcat.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-mcore.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ +DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 \ +DEPOBJ_mips_elf = $(INCDIR)/symcat.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-mips.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_mmix_elf = $(INCDIR)/symcat.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-mmix.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_mn10200_elf = $(INCDIR)/symcat.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-mn10200.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_mn10300_elf = $(INCDIR)/symcat.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-mn10300.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_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 +DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(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 + +DEPOBJ_ns32k_elf = $(INCDIR)/symcat.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-ns32k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h + +DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ +DEPOBJ_openrisc_elf = $(INCDIR)/symcat.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-openrisc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h + +DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h + +DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h + +DEPOBJ_pdp11_elf = $(INCDIR)/symcat.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-pdp11.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h + +DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h + +DEPOBJ_pj_elf = $(INCDIR)/symcat.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-pj.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h + +DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_pj_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-pj.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_ppc_elf = $(INCDIR)/symcat.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-ppc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h -DEPOBJ_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)/elf/reloc-macros.h \ +DEPOBJ_s390_elf = $(INCDIR)/symcat.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-s390.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \ +DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_sh_elf = $(INCDIR)/symcat.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-sh.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h \ +DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_sparc_elf = $(INCDIR)/symcat.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-sparc.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_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 +DEPOBJ_tahoe_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_tahoe_elf = $(INCDIR)/symcat.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-tahoe.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \ +DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_tic30_elf = $(INCDIR)/symcat.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-tic30.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h +DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic54x_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-tic54x.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_tic54x_elf = $(INCDIR)/symcat.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-tic54x.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ +DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic80_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-tic80.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h +DEPOBJ_tic80_elf = $(INCDIR)/symcat.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-tic80.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ + $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_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 +DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_vax_elf = $(INCDIR)/symcat.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-vax.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_vax_vms = $(srcdir)/config/obj-vms.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def subsegs.h \ +DEPOBJ_vax_vms = $(INCDIR)/symcat.h $(srcdir)/config/obj-vms.h \ + $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h -DEPOBJ_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \ +DEPOBJ_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_w65_elf = $(INCDIR)/symcat.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-w65.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_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 +DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(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 -DEPOBJ_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 +DEPOBJ_v850_elf = $(INCDIR)/symcat.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-v850.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \ +DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h + +DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.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-xstormy16.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h + +DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_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 +DEPOBJ_z8k_elf = $(INCDIR)/symcat.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 \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ @@ -1504,328 +1794,384 @@ 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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h \ + $(INCDIR)/coff/external.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_a29k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.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_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_avr_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-avr.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_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-cris.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.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_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_d30v_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-d30v.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_fr30_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-fr30.h +DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ + $(INCDIR)/coff/external.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_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h \ + $(INCDIR)/coff/external.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_h8500_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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 $(INCDIR)/elf/reloc-macros.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 \ + $(INCDIR)/elf/reloc-macros.h DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_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-ia64.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_i370_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-i370.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ + $(INCDIR)/coff/external.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_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_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_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68hc11_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-m68hc11.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/external.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_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/external.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_m88k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_mcore_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-mcore.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.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 $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ + $(INCDIR)/coff/external.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_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.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_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h + +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h + +DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h + +DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h + +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_pj_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-pj.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.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)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.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_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.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_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ + $(INCDIR)/coff/external.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_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_tahoe_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ + $(INCDIR)/coff/external.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_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ + $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_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-tic54x.h +DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h DEP_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic80_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-tic80.h +DEP_tic80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.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 + $(INCDIR)/symcat.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_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h \ + $(INCDIR)/coff/external.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_w65_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 + $(INCDIR)/symcat.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_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 \ +DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.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_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h + +DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ + $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + +DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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_aout) $(DEP_i386_coff) \ @@ -2281,7 +2627,7 @@ 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 +diststuff: $(EXTRA_DIST) info $(OBJS): @ALL_OBJ_DEPS@ @@ -2520,6 +2866,8 @@ de-stage3: - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..) - rmdir stage3 +Makefile: $(BFDDIR)/configure.in + # Automatic dependency computation. This is a real pain, because the # dependencies change based on target_cpu_type and obj_format. # Just to make things even more complicated, automake separates the @@ -2557,7 +2905,7 @@ DEP1: $(CFILES) $(MULTI_CFILES) echo '' > targ-env.h; \ echo '' > itbl-cpu.h; \ echo '' > itbl-parse.h; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? > DEP + $(MKDEP) $(DEP_FLAGS) $? > DEP mv -f DEPDIR/DEP $@ # Work out the special dependencies for the tc-*.c files. @@ -2578,7 +2926,7 @@ DEPTC: $(TARGET_CPU_CFILES) echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \ rm -f dummy.c; \ cp $${srcdir}/config/tc-$${c}.c dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEPTC_$${c}_$${o} =/" >> ../DEPTCA; \ rm -f dummy.c; \ else true; fi; \ @@ -2616,7 +2964,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) echo '' > itbl-parse.h; \ rm -f dummy.c; \ cp $${srcdir}/config/obj-$${o}.c dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEPOBJ_$${c}_$${o} =/" >> ../DEPOBJA; \ rm -f dummy.c; \ else true; fi; \ @@ -2651,7 +2999,7 @@ DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) if [ x$${valid} = xyes ]; then \ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \ echo '#include "obj-'"$${o}"'.h"' > dummy.c; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c | \ + $(MKDEP) $(DEP_FLAGS) dummy.c | \ sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \ else true; fi; \ done; \ @@ -2698,49 +3046,62 @@ dep-am: DEP # ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY. .PHONY: dep dep-in dep-am #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c -as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ - sb.h macro.h dwarf2dbg.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 -dwarf2dbg.o: dwarf2dbg.c dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c $(INCDIR)/symcat.h +as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ + output-file.h sb.h macro.h dwarf2dbg.h +atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h +bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h +cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h +depend.o: depend.c $(INCDIR)/symcat.h +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h +ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c ecoff.h -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 +expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h 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 $(INCDIR)/obstack.h -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 +frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h +input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ + $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ + sb.h +listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c $(INCDIR)/symcat.h +output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h +read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + 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 \ - struc-symbol.h -write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ - dwarf2dbg.h -gasp.o: gasp.c sb.h macro.h -itbl-ops.o: itbl-ops.c itbl-ops.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h +stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ + subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h struc-symbol.h +write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ + output-file.h dwarf2dbg.h +gasp.o: gasp.c $(INCDIR)/safe-ctype.h sb.h macro.h +itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ + emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ + emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ + emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ + emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ + emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/contrib/binutils/gas/NEWS b/contrib/binutils/gas/NEWS index 6c3439d..950f63b 100644 --- a/contrib/binutils/gas/NEWS +++ b/contrib/binutils/gas/NEWS @@ -1,4 +1,21 @@ -*- text -*- +The ARM assembler now accepts -march=..., -mcpu=... and -mfpu=... for +specifying the target instruction set. The old method of specifying the +target processor has been deprecated, but is still accepted for +compatibility. + +Support for the VFP floating-point instruction set has been added to +the ARM assembler. + +New psuedo op: .incbin to include a set of binary data at a given point +in the assembly. Contributed by Anders Norlander. + +The MIPS assembler now accepts -march/-mtune. -mcpu has been deprecated +but still works for compatability. + +The MIPS assembler no longer issues a warning by default when it +generates a nop instruction from a macro. The new command line option +-n will turn on the warning. Changes in 2.11: diff --git a/contrib/binutils/gas/README b/contrib/binutils/gas/README index 87666df..ef12d3f 100644 --- a/contrib/binutils/gas/README +++ b/contrib/binutils/gas/README @@ -1,10 +1,10 @@ README for GAS -A number of things have changed since version 1 and the wonderful world of gas -looks very different. There's still a lot of irrelevant garbage lying around -that will be cleaned up in time. Documentation is scarce, as are logs of the -changes made since the last gas release. My apologies, and I'll try to get -something useful. +A number of things have changed since version 1 and the wonderful +world of gas looks very different. There's still a lot of irrelevant +garbage lying around that will be cleaned up in time. Documentation +is scarce, as are logs of the changes made since the last gas release. +My apologies, and I'll try to get something useful. Unpacking and Installation - Summary ==================================== @@ -31,7 +31,7 @@ system. You can rebuild it by typing: make as.dvi The Info form is viewable with the GNU Emacs `info' subsystem, or the -standalone `info' program, available as part of the GNU Texinfo distribution. +stand-alone `info' program, available as part of the GNU Texinfo distribution. To build the info files, you will need the `makeinfo' program. Type: cd gas/doc @@ -142,7 +142,7 @@ The `--enable' options recognized by software in the gas distribution are: Supported platforms =================== -At this point I believe gas to be ansi only code for most target cpu's. That +At this point I believe gas to be ANSI only code for most target cpu's. That is, there should be relatively few, if any host system dependencies. So porting (as a cross-assembler) to hosts not yet supported should be fairly easy. Porting to a new target shouldn't be too tough if it's a variant of one @@ -173,9 +173,10 @@ Native assembling should work on: sparc solaris ns32k (netbsd, lites) -I believe that gas as a cross-assembler can currently be targetted for +I believe that gas as a cross-assembler can currently be targeted for most of the above hosts, plus + arm decstation-bsd (a.out format, to be used in BSD 4.4) ebmon29k go32 (DOS on i386, with DJGPP -- old a.out version) @@ -202,7 +203,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 sequent (ns32k), tahoe, i860, m88k may be suffering from bitrot. +Support for sequent (ns32k), tahoe, i860 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. @@ -229,10 +230,13 @@ warning message when this happens. REPORTING BUGS IN GAS ===================== -Bugs in gas should be reported to bug-binutils@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. +Bugs in gas should be reported to: + + bug-gnu-utils@gnu.org. + +They may be cross-posted to gcc-bugs@gnu.org if they affect the use of +gas with gcc. They should not be reported just to gcc-bugs, since not +all of the maintainers read that list. If you report a bug in GAS, please remember to include: @@ -265,7 +269,7 @@ does demonstrate the problem; but if paring it down would cause large delays in filing the bug report, don't bother. If the input file is very large, and you are on the internet, you may want to -make it avaliable for anonymous FTP instead of mailing it. If you do, include +make it available for anonymous FTP instead of mailing it. If you do, include instructions for FTP'ing it in your bug report. If you expect to be contributing a large number of test cases, it would be diff --git a/contrib/binutils/gas/app.c b/contrib/binutils/gas/app.c index 5111598..ba587d4 100644 --- a/contrib/binutils/gas/app.c +++ b/contrib/binutils/gas/app.c @@ -78,9 +78,11 @@ static const char symbol_chars[] = #ifdef DOUBLEBAR_PARALLEL #define LEX_IS_DOUBLEBAR_1ST 13 #endif +#define LEX_IS_PARALLEL_SEPARATOR 14 #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) +#define IS_PARALLEL_SEPARATOR(c) (lex[c] == LEX_IS_PARALLEL_SEPARATOR) #define IS_COMMENT(c) (lex[c] == LEX_IS_COMMENT_START) #define IS_LINE_COMMENT(c) (lex[c] == LEX_IS_LINE_COMMENT_START) #define IS_NEWLINE(c) (lex[c] == LEX_IS_NEWLINE) @@ -164,6 +166,15 @@ do_scrub_begin (m68k_mri) lex[(unsigned char) *p] = LEX_IS_LINE_SEPARATOR; } /* declare line separators */ +#ifdef tc_parallel_separator_chars + /* This macro permits the processor to specify all characters which + separate parallel insns on the same line. */ + for (p = tc_parallel_separator_chars; *p; p++) + { + lex[(unsigned char) *p] = LEX_IS_PARALLEL_SEPARATOR; + } /* declare parallel separators */ +#endif + /* Only allow slash-star comments if slash is not in use. FIXME: This isn't right. We should always permit them. */ if (lex['/'] == 0) @@ -376,7 +387,7 @@ do_scrub_chars (get, tostart, tolen) /* I added states 9 and 10 because the MIPS ECOFF assembler uses constructs like ``.loc 1 20''. This was turning into ``.loc 120''. States 9 and 10 ensure that a space is never dropped in - between characters which could appear in a identifier. Ian + between characters which could appear in an identifier. Ian Taylor, ian@cygnus.com. I added state 11 so that something like "Lfoo add %r25,%r26,%r27" works @@ -555,7 +566,7 @@ do_scrub_chars (get, tostart, tolen) ch = GET (); if (ch == EOF) { - as_warn (_("end of file in string: inserted '\"'")); + as_warn (_("end of file in string; inserted '\"'")); state = old_state; UNGET ('\n'); PUT ('"'); @@ -621,7 +632,7 @@ do_scrub_chars (get, tostart, tolen) break; #if defined(IGNORE_NONSTANDARD_ESCAPES) | defined(ONLY_STANDARD_ESCAPES) default: - as_warn (_("Unknown escape '\\%c' in string: Ignored"), ch); + as_warn (_("unknown escape '\\%c' in string; ignored"), ch); break; #else /* ONLY_STANDARD_ESCAPES */ default: @@ -630,7 +641,7 @@ do_scrub_chars (get, tostart, tolen) #endif /* ONLY_STANDARD_ESCAPES */ case EOF: - as_warn (_("End of file in string: '\"' inserted")); + as_warn (_("end of file in string; '\"' inserted")); PUT ('"'); continue; } @@ -796,7 +807,8 @@ do_scrub_chars (get, tostart, tolen) #endif if (IS_COMMENT (ch) || ch == '/' - || IS_LINE_SEPARATOR (ch)) + || IS_LINE_SEPARATOR (ch) + || IS_PARALLEL_SEPARATOR (ch)) { if (scrub_m68k_mri) { @@ -992,7 +1004,7 @@ do_scrub_chars (get, tostart, tolen) if ((ch = GET ()) != '\'') { #ifdef REQUIRE_CHAR_CLOSE_QUOTE - as_warn (_("Missing close quote: (assumed)")); + as_warn (_("missing close quote; (assumed)")); #else if (ch != EOF) UNGET (ch); @@ -1039,6 +1051,11 @@ do_scrub_chars (get, tostart, tolen) PUT (ch); break; + case LEX_IS_PARALLEL_SEPARATOR: + state = 1; + PUT (ch); + break; + #ifdef TC_V850 case LEX_IS_DOUBLEDASH_1ST: ch2 = GET (); @@ -1119,7 +1136,7 @@ do_scrub_chars (get, tostart, tolen) while (ch != EOF && !IS_NEWLINE (ch)) ch = GET (); if (ch == EOF) - as_warn (_("EOF in Comment: Newline inserted")); + as_warn (_("end of file in comment; newline inserted")); state = 0; PUT ('\n'); break; diff --git a/contrib/binutils/gas/as.c b/contrib/binutils/gas/as.c index e8c2212..dab04e9 100644 --- a/contrib/binutils/gas/as.c +++ b/contrib/binutils/gas/as.c @@ -1,6 +1,6 @@ /* as.c - GAS main program. Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -208,7 +208,7 @@ print_version_id () #ifdef BFD_ASSEMBLER fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s"), - VERSION, TARGET_ALIAS, BFD_VERSION); + VERSION, TARGET_ALIAS, BFD_VERSION_STRING); #else fprintf (stderr, _("GNU assembler version %s (%s)"), VERSION, TARGET_ALIAS); #endif @@ -524,8 +524,8 @@ parse_args (pargc, pargv) case OPTION_VERSION: /* This output is intended to follow the GNU standards document. */ - printf (_("GNU assembler %s\n"), VERSION); - printf (_("Copyright 2001 Free Software Foundation, Inc.\n")); + printf (_("GNU assembler %s\n"), BFD_VERSION_STRING); + printf (_("Copyright 2002 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); @@ -587,7 +587,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); if (optarg == NULL) { - as_warn (_("No file name following -t option\n")); + as_warn (_("no file name following -t option")); break; } @@ -602,11 +602,8 @@ the GNU General Public License. This program has absolutely no warranty.\n")); internal table. */ itbl_files->name = xstrdup (optarg); if (itbl_parse (itbl_files->name) != 0) - { - fprintf (stderr, _("Failed to read instruction table %s\n"), - itbl_files->name); - exit (EXIT_SUCCESS); - } + as_fatal (_("failed to read instruction table %s\n"), + itbl_files->name); } break; @@ -765,10 +762,16 @@ the GNU General Public License. This program has absolutely no warranty.\n")); *pargc = new_argc; *pargv = new_argv; + +#ifdef md_after_parse_args + md_after_parse_args (); +#endif } static long start_time; +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -783,6 +786,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/contrib/binutils/gas/as.h b/contrib/binutils/gas/as.h index 75abfa9..ed82574 100644 --- a/contrib/binutils/gas/as.h +++ b/contrib/binutils/gas/as.h @@ -43,28 +43,19 @@ /* This is the code recommended in the autoconf documentation, almost verbatim. If it doesn't work for you, let me know, and notify djm@gnu.ai.mit.edu as well. */ -/* Added #undef for DJ Delorie. The right fix is to ensure that as.h - is included first, before even any system header files, in all files - that use it. KR 1994.11.03 */ /* Added void* version for STDC case. This is to be compatible with the declaration in bison.simple, used for m68k operand parsing. --KR 1995.08.08 */ /* Force void* decl for hpux. This is what Bison uses. --KR 1995.08.16 */ -/* 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 +#ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ @@ -76,13 +67,12 @@ extern void *alloca (); # endif /* alloca */ # endif /* _AIX */ # endif /* HAVE_ALLOCA_H */ -#endif +#endif /* __GNUC__ */ /* Now, tend to the rest of the configuration. */ /* System include files first... */ #include -#include #ifdef HAVE_STRING_H #include #else diff --git a/contrib/binutils/gas/atof-generic.c b/contrib/binutils/gas/atof-generic.c index 1309566..c5d10d4 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 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,10 +19,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include "as.h" +#include "safe-ctype.h" #ifndef FALSE #define FALSE (0) @@ -171,7 +171,7 @@ atof_generic (address_of_string_pointer, && (!c || !strchr (string_of_decimal_exponent_marks, c))); p++) { - if (isdigit ((unsigned char) c)) + if (ISDIGIT (c)) { if (seen_significant_digit || c > '0') { @@ -200,7 +200,7 @@ atof_generic (address_of_string_pointer, { unsigned int zeros = 0; /* Length of current string of zeros */ - for (p++; (c = *p) && isdigit ((unsigned char) c); p++) + for (p++; (c = *p) && ISDIGIT (c); p++) { if (c == '0') { @@ -221,7 +221,7 @@ atof_generic (address_of_string_pointer, && (!c || !strchr (string_of_decimal_exponent_marks, c))); p++) { - if (isdigit ((unsigned char) c)) + if (ISDIGIT (c)) { /* This may be retracted below. */ number_of_digits_after_decimal++; @@ -275,7 +275,7 @@ atof_generic (address_of_string_pointer, for (; (c); c = *++p) { - if (isdigit ((unsigned char) c)) + if (ISDIGIT (c)) { decimal_exponent = decimal_exponent * 10 + c - '0'; /* @@ -400,7 +400,7 @@ atof_generic (address_of_string_pointer, for (p = first_digit, count = number_of_digits_to_use; count; p++, --count) { c = *p; - if (isdigit ((unsigned char) c)) + if (ISDIGIT (c)) { /* * Multiply by 10. Assume can never overflow. @@ -434,7 +434,7 @@ atof_generic (address_of_string_pointer, * We have a GROSS internal error. * This should never happen. */ - as_fatal (_("failed sanity check.")); + as_fatal (_("failed sanity check")); } } else diff --git a/contrib/binutils/gas/bit_fix.h b/contrib/binutils/gas/bit_fix.h index 3eedb3c..80c0022 100644 --- a/contrib/binutils/gas/bit_fix.h +++ b/contrib/binutils/gas/bit_fix.h @@ -1,5 +1,5 @@ /* bit_fix.h - Copyright 1987, 1992, 2000 Free Software Foundation, Inc. + Copyright 1987, 1992, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,8 +26,8 @@ The or-mask is used to set the huffman bits in displacements for the ns32k port. The acbi, addqi, movqi, cmpqi instruction requires an assembler that - can handle bitfields. Ie handle an expression, evaluate it and insert - the result in an some bitfield. ( ex: 5 bits in a short field of a opcode) + can handle bitfields. Ie. handle an expression, evaluate it and insert + the result in some bitfield. (eg: 5 bits in a short field of an opcode) */ #ifndef __bit_fix_h__ diff --git a/contrib/binutils/gas/cgen.c b/contrib/binutils/gas/cgen.c index 759b382..75138a45 100644 --- a/contrib/binutils/gas/cgen.c +++ b/contrib/binutils/gas/cgen.c @@ -29,6 +29,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "cgen.h" #include "dwarf2dbg.h" +static void queue_fixup PARAMS ((int, int, expressionS *)); + /* Opcode table descriptor, must be set by md_begin. */ CGEN_CPU_DESC gas_cgen_cpu_desc; @@ -94,61 +96,118 @@ queue_fixup (opindex, opinfo, expP) ++ 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. */ -/* ??? I think with cgen_asm_finish_insn (or something else) there is no - more need for this. */ +/* The following functions allow fixup chains to be stored, retrieved, + and swapped. They are a generalization of a pre-existing scheme + for storing, restoring and swapping fixup chains that was used by + the m32r port. The functionality is essentially the same, only + instead of only being able to store a single fixup chain, an entire + array of fixup chains can be stored. It is the user's responsibility + to keep track of how many fixup chains have been stored and which + elements of the array they are in. + + The algorithms used are the same as in the old scheme. Other than the + "array-ness" of the whole thing, the functionality is identical to the + old scheme. + + gas_cgen_initialize_saved_fixups_array(): + Sets num_fixups_in_chain to 0 for each element. Call this from + md_begin() if you plan to use these functions and you want the + fixup count in each element to be set to 0 intially. This is + not necessary, but it's included just in case. It performs + the same function for each element in the array of fixup chains + that gas_init_parse() performs for the current fixups. + + gas_cgen_save_fixups (element): + element - element number of the array you wish to store the fixups + to. No mechanism is built in for tracking what element + was last stored to. + + gas_cgen_restore_fixups (element): + element - element number of the array you wish to restore the fixups + from. + + gas_cgen_swap_fixups(int element): + element - swap the current fixups with those in this element number. +*/ + +struct saved_fixups { + struct fixup fixup_chain[GAS_CGEN_MAX_FIXUPS]; + int num_fixups_in_chain; +}; -static struct fixup saved_fixups[GAS_CGEN_MAX_FIXUPS]; -static int saved_num_fixups; +static struct saved_fixups stored_fixups[MAX_SAVED_FIXUP_CHAINS]; void -gas_cgen_save_fixups () +gas_cgen_initialize_saved_fixups_array () { - saved_num_fixups = num_fixups; - - memcpy (saved_fixups, fixups, sizeof (fixups[0]) * num_fixups); + int i = 0; - num_fixups = 0; + while (i < MAX_SAVED_FIXUP_CHAINS) + stored_fixups[i++].num_fixups_in_chain = 0; } void -gas_cgen_restore_fixups () +gas_cgen_save_fixups (i) + int i; { - num_fixups = saved_num_fixups; - - memcpy (fixups, saved_fixups, sizeof (fixups[0]) * num_fixups); + if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) + { + as_fatal ("index into stored_fixups[] out of bounds"); + return; + } - saved_num_fixups = 0; + stored_fixups[i].num_fixups_in_chain = num_fixups; + memcpy (stored_fixups[i].fixup_chain, fixups, + sizeof (fixups[0]) * num_fixups); + num_fixups = 0; } void -gas_cgen_swap_fixups () +gas_cgen_restore_fixups (i) + int i; { - int tmp; - struct fixup tmp_fixup; - - if (num_fixups == 0) + if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) { - gas_cgen_restore_fixups (); + as_fatal ("index into stored_fixups[] out of bounds"); + return; } - else if (saved_num_fixups == 0) + + num_fixups = stored_fixups[i].num_fixups_in_chain; + memcpy (fixups,stored_fixups[i].fixup_chain, + (sizeof (stored_fixups[i].fixup_chain[0])) * num_fixups); + stored_fixups[i].num_fixups_in_chain = 0; +} + +void +gas_cgen_swap_fixups (i) + int i; +{ + if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) { - gas_cgen_save_fixups (); + as_fatal ("index into stored_fixups[] out of bounds"); + return; } + + if (num_fixups == 0) + gas_cgen_restore_fixups (i); + + else if (stored_fixups[i].num_fixups_in_chain == 0) + gas_cgen_save_fixups (i); + else { - tmp = saved_num_fixups; - saved_num_fixups = num_fixups; + int tmp; + struct fixup tmp_fixup; + + tmp = stored_fixups[i].num_fixups_in_chain; + stored_fixups[i].num_fixups_in_chain = num_fixups; num_fixups = tmp; for (tmp = GAS_CGEN_MAX_FIXUPS; tmp--;) { - tmp_fixup = saved_fixups [tmp]; - saved_fixups [tmp] = fixups [tmp]; - fixups [tmp] = tmp_fixup; + tmp_fixup = stored_fixups[i].fixup_chain [tmp]; + stored_fixups[i].fixup_chain[tmp] = fixups [tmp]; + fixups [tmp] = tmp_fixup; } } } @@ -164,7 +223,7 @@ gas_cgen_swap_fixups () At this point we do not use a bfd_reloc_code_real_type for operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any - operand type. We pick a BFD reloc type in md_apply_fix. */ + operand type. We pick a BFD reloc type in md_apply_fix3. */ fixS * gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offset) @@ -204,7 +263,7 @@ gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offse At this point we do not use a bfd_reloc_code_real_type for operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any - operand type. We pick a BFD reloc type in md_apply_fix. */ + operand type. We pick a BFD reloc type in md_apply_fix3. */ fixS * gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) @@ -265,7 +324,7 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) static char *hold; static enum cgen_parse_operand_result *resultP_1; #endif - const char *errmsg = NULL; + const char *errmsg; expressionS exp; if (want == CGEN_PARSE_OPERAND_INIT) @@ -285,12 +344,13 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) expr_jmp_buf_p = 0; input_line_pointer = (char *) hold; *resultP_1 = CGEN_PARSE_OPERAND_RESULT_ERROR; - return "illegal operand"; + return _("illegal operand"); } expr_jmp_buf_p = 1; expression (&exp); expr_jmp_buf_p = 0; + errmsg = NULL; *strP = input_line_pointer; input_line_pointer = hold; @@ -509,14 +569,14 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) handles the rest. bfd_install_relocation (or some other bfd function) should handle them all. */ -int -gas_cgen_md_apply_fix3 (fixP, valueP, seg) +void +gas_cgen_md_apply_fix3 (fixP, valP, seg) fixS * fixP; - valueT * valueP; + valueT * valP; segT seg ATTRIBUTE_UNUSED; { char *where = fixP->fx_frag->fr_literal + fixP->fx_where; - valueT value; + valueT value = * valP; /* Canonical name, since used a lot. */ CGEN_CPU_DESC cd = gas_cgen_cpu_desc; @@ -532,15 +592,15 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) result of md_pcrel_from. This is confusing. */ if (fixP->fx_addsy == (symbolS *) NULL) - { - value = *valueP; - fixP->fx_done = 1; - } + 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) @@ -594,7 +654,7 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) } if (fixP->fx_done) - return 1; + return; /* The operand isn't fully resolved. Determine a BFD reloc value based on the operand information and leave it to @@ -602,16 +662,15 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) partial_inplace == false. */ reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); + if (reloc_type != BFD_RELOC_NONE) - { - fixP->fx_r_type = reloc_type; - } + fixP->fx_r_type = reloc_type; else { as_bad_where (fixP->fx_file, fixP->fx_line, _("unresolved expression that must be resolved")); fixP->fx_done = 1; - return 1; + return; } } else if (fixP->fx_done) @@ -639,17 +698,13 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) break; } } - else - { - /* bfd_install_relocation will be called to finish things up. */ - } + /* else + bfd_install_relocation will be called to finish things up. */ /* Tuck `value' away for use by tc_gen_reloc. See the comment describing fx_addnumber in write.h. This field is misnamed (or misused :-). */ fixP->fx_addnumber = value; - - return 1; } /* Translate internal representation of relocation info to BFD target format. diff --git a/contrib/binutils/gas/cgen.h b/contrib/binutils/gas/cgen.h index b09ccaa..97cd38d 100644 --- a/contrib/binutils/gas/cgen.h +++ b/contrib/binutils/gas/cgen.h @@ -53,9 +53,12 @@ extern const char * gas_cgen_parse_operand /* Call this from md_assemble to initialize the assembler callback. */ extern void gas_cgen_init_parse PARAMS ((void)); -extern void gas_cgen_save_fixups PARAMS ((void)); -extern void gas_cgen_restore_fixups PARAMS ((void)); -extern void gas_cgen_swap_fixups PARAMS ((void)); +/* Routines and macros for saving fixup chains. */ +extern void gas_cgen_save_fixups PARAMS ((int)); +extern void gas_cgen_restore_fixups PARAMS ((int)); +extern void gas_cgen_swap_fixups PARAMS ((int)); +extern void gas_cgen_initialize_saved_fixups_array PARAMS ((void)); +#define MAX_SAVED_FIXUP_CHAINS 50 /* Add a register to the assembler's hash table. This makes lets GAS parse registers for us. @@ -77,7 +80,7 @@ extern fixS * gas_cgen_record_fixup_exp PARAMS ((fragS *, int, const CGEN_INSN * expressionS *)); /* md_apply_fix3 handler */ -extern int gas_cgen_md_apply_fix3 PARAMS ((fixS *, valueT *, segT)); +extern void gas_cgen_md_apply_fix3 PARAMS ((fixS *, valueT *, segT)); /* tc_gen_reloc handler */ extern arelent *gas_cgen_tc_gen_reloc PARAMS ((asection *, fixS *)); @@ -93,4 +96,6 @@ md_cgen_record_fixup_exp PARAMS ((fragS *, int, const CGEN_INSN *, int, const CGEN_OPERAND *, int, expressionS *)); +extern void gas_cgen_md_operand PARAMS ((expressionS *)); + #endif /* GAS_CGEN_H */ diff --git a/contrib/binutils/gas/cond.c b/contrib/binutils/gas/cond.c index 6c6e8ad..73304cb 100644 --- a/contrib/binutils/gas/cond.c +++ b/contrib/binutils/gas/cond.c @@ -257,11 +257,11 @@ s_elseif (arg) { if (current_cframe == NULL) { - as_bad (_("\".elseif\" without matching \".if\" - ignored")); + as_bad (_("\".elseif\" without matching \".if\"")); } else if (current_cframe->else_seen) { - as_bad (_("\".elseif\" after \".else\" - ignored")); + as_bad (_("\".elseif\" after \".else\"")); as_bad_where (current_cframe->else_file_line.file, current_cframe->else_file_line.line, _("here is the previous \"else\"")); @@ -365,11 +365,11 @@ s_else (arg) { if (current_cframe == NULL) { - as_bad (_(".else without matching .if - ignored")); + as_bad (_("\".else\" without matching \".if\"")); } else if (current_cframe->else_seen) { - as_bad (_("duplicate \"else\" - ignored")); + as_bad (_("duplicate \"else\"")); as_bad_where (current_cframe->else_file_line.file, current_cframe->else_file_line.line, _("here is the previous \"else\"")); diff --git a/contrib/binutils/gas/config.in b/contrib/binutils/gas/config.in index e2a6003..6f1311f 100644 --- a/contrib/binutils/gas/config.in +++ b/contrib/binutils/gas/config.in @@ -154,20 +154,14 @@ /* Using strict COFF? */ #undef STRICTCOFF -/* Use ELF stabs for MIPS, not ECOFF stabs */ -#undef MIPS_STABS_ELF - -/* Use ELF stabs for MIPS, not ECOFF stabs */ -#undef MIPS_STABS_ELF - /* Define if default target is PowerPC Solaris. */ #undef TARGET_SOLARIS_COMMENT /* Define as 1 if big endian. */ #undef TARGET_BYTES_BIG_ENDIAN -/* Default architecture. */ -#undef DEFAULT_ARCH +/* Use ELF stabs for MIPS, not ECOFF stabs */ +#undef MIPS_STABS_ELF /* Default architecture. */ #undef DEFAULT_ARCH diff --git a/contrib/binutils/gas/config/e-i386aout.c b/contrib/binutils/gas/config/e-i386aout.c index 18fdf68..f8435ab 100644 --- a/contrib/binutils/gas/config/e-i386aout.c +++ b/contrib/binutils/gas/config/e-i386aout.c @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386aout_bfd_name PARAMS ((void)); + static const char * i386aout_bfd_name () { diff --git a/contrib/binutils/gas/config/e-i386coff.c b/contrib/binutils/gas/config/e-i386coff.c index afed728..f6510a4 100644 --- a/contrib/binutils/gas/config/e-i386coff.c +++ b/contrib/binutils/gas/config/e-i386coff.c @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386coff_bfd_name PARAMS ((void)); + static const char * i386coff_bfd_name () { diff --git a/contrib/binutils/gas/config/e-i386elf.c b/contrib/binutils/gas/config/e-i386elf.c index a16701e..e11fc3d 100644 --- a/contrib/binutils/gas/config/e-i386elf.c +++ b/contrib/binutils/gas/config/e-i386elf.c @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386elf_bfd_name PARAMS ((void)); + static const char * i386elf_bfd_name () { diff --git a/contrib/binutils/gas/config/obj-aout.c b/contrib/binutils/gas/config/obj-aout.c index 9d4f24a..a394306 100644 --- a/contrib/binutils/gas/config/obj-aout.c +++ b/contrib/binutils/gas/config/obj-aout.c @@ -466,7 +466,7 @@ obj_crawl_symbol_chain (headers) S_SET_SEGMENT (symbolP, SEG_TEXT); } /* if pusing data into text */ - resolve_symbol_value (symbolP, 1); + resolve_symbol_value (symbolP); /* Skip symbols which were equated to undefined or common symbols. */ @@ -755,4 +755,4 @@ const struct format_ops aout_format_ops = 0, /* read_begin_hook */ 0 /* symbol_new_hook */ }; -#endif BFD_ASSEMBLER +#endif /* BFD_ASSEMBLER */ diff --git a/contrib/binutils/gas/config/obj-coff.c b/contrib/binutils/gas/config/obj-coff.c index 69e5558..759389a 100644 --- a/contrib/binutils/gas/config/obj-coff.c +++ b/contrib/binutils/gas/config/obj-coff.c @@ -38,7 +38,29 @@ #define TC_COFF_SECTION_DEFAULT_ATTRIBUTES (SEC_LOAD | SEC_DATA) #endif +/* This is used to hold the symbol built by a sequence of pseudo-ops + from .def and .endef. */ +static symbolS *def_symbol_in_progress; + +typedef struct + { + unsigned long chunk_size; + unsigned long element_size; + unsigned long size; + char *data; + unsigned long pointer; + } +stack; + +static stack *stack_init PARAMS ((unsigned long, unsigned long)); +static char *stack_push PARAMS ((stack *, char *)); +static char *stack_pop PARAMS ((stack *)); +static void tag_init PARAMS ((void)); +static void tag_insert PARAMS ((const char *, symbolS *)); +static symbolS *tag_find PARAMS ((char *)); +static symbolS *tag_find_or_make PARAMS ((char *)); static void obj_coff_bss PARAMS ((int)); +static void obj_coff_weak PARAMS ((int)); const char *s_get_name PARAMS ((symbolS * s)); static void obj_coff_ln PARAMS ((int)); static void obj_coff_def PARAMS ((int)); @@ -54,21 +76,8 @@ static void obj_coff_ident PARAMS ((int)); #ifdef BFD_ASSEMBLER static void obj_coff_loc PARAMS((int)); #endif - -/* This is used to hold the symbol built by a sequence of pseudo-ops - from .def and .endef. */ -static symbolS *def_symbol_in_progress; /* stack stuff */ -typedef struct - { - unsigned long chunk_size; - unsigned long element_size; - unsigned long size; - char *data; - unsigned long pointer; - } -stack; static stack * stack_init (chunk_size, element_size) @@ -246,7 +255,11 @@ obj_coff_weak (ignore) #ifdef BFD_ASSEMBLER +static segT fetch_coff_debug_section PARAMS ((void)); static void SA_SET_SYM_TAGNDX PARAMS ((symbolS *, symbolS *)); +static int S_GET_DATA_TYPE PARAMS ((symbolS *)); +void c_symbol_merge PARAMS ((symbolS *, symbolS *)); +static void add_lineno PARAMS ((fragS *, addressT, int)); #define GET_FILENAME_STRING(X) \ ((char*) (&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1]) @@ -493,13 +506,13 @@ obj_coff_ln (appline) } l = get_absolute_expression (); - if (!appline) - { - add_lineno (frag_now, frag_now_fix (), l); - } - if (appline) + /* If there is no lineno symbol, treat a .ln + directive as if it were a .appline directive. */ + if (appline || current_lineno_sym == NULL) new_logical_line ((char *) NULL, l - 1); + else + add_lineno (frag_now, frag_now_fix (), l); #ifndef NO_LISTING { @@ -1174,18 +1187,21 @@ coff_frob_symbol (symp, punt) if (!SF_GET_DEBUG (symp)) { - symbolS *real; + symbolS * real; + if (!SF_GET_LOCAL (symp) && !SF_GET_STATICS (symp) && S_GET_STORAGE_CLASS (symp) != C_LABEL && symbol_constant_p(symp) && (real = symbol_find_base (S_GET_NAME (symp), DO_NOT_STRIP)) + && S_GET_STORAGE_CLASS (real) == C_NULL && real != symp) { c_symbol_merge (symp, real); *punt = 1; return; } + if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp)) { assert (S_GET_VALUE (symp) == 0); @@ -1199,6 +1215,7 @@ coff_frob_symbol (symp, punt) else S_SET_STORAGE_CLASS (symp, C_STAT); } + if (SF_GET_PROCESS (symp)) { if (S_GET_STORAGE_CLASS (symp) == C_BLOCK) @@ -1208,6 +1225,7 @@ coff_frob_symbol (symp, punt) else { symbolS *begin; + begin = *(symbolS **) stack_pop (block_stack); if (begin == 0) as_warn (_("mismatched .eb")); @@ -1215,9 +1233,11 @@ coff_frob_symbol (symp, punt) next_set_end = begin; } } + if (coff_last_function == 0 && SF_GET_FUNCTION (symp)) { union internal_auxent *auxp; + coff_last_function = symp; if (S_GET_NUMBER_AUXILIARY (symp) < 1) S_SET_NUMBER_AUXILIARY (symp, 1); @@ -1225,6 +1245,7 @@ coff_frob_symbol (symp, punt) memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0, sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen)); } + if (S_GET_STORAGE_CLASS (symp) == C_EFCN) { if (coff_last_function == 0) @@ -1236,6 +1257,7 @@ coff_frob_symbol (symp, punt) coff_last_function = 0; } } + if (S_IS_EXTERNAL (symp)) S_SET_STORAGE_CLASS (symp, C_EXT); else if (SF_GET_LOCAL (symp)) @@ -1287,6 +1309,7 @@ coff_frob_symbol (symp, punt) set_end = next_set_end; } +#ifndef OBJ_XCOFF if (! *punt && S_GET_STORAGE_CLASS (symp) == C_FCN && strcmp (S_GET_NAME (symp), ".bf") == 0) @@ -1295,7 +1318,7 @@ coff_frob_symbol (symp, punt) SA_SET_SYM_ENDNDX (coff_last_bf, symp); coff_last_bf = symp; } - +#endif if (coffsymbol (symbol_get_bfdsym (symp))->lineno) { int i; @@ -1608,7 +1631,7 @@ obj_coff_init_stab_section (seg) /* Zero it out. */ memset (p, 0, 12); as_where (&file, (unsigned int *) NULL); - stabstr_name = (char *) alloca (strlen (seg->name) + 4); + stabstr_name = (char *) xmalloc (strlen (seg->name) + 4); strcpy (stabstr_name, seg->name); strcat (stabstr_name, "str"); stroff = get_stab_string_offset (file, stabstr_name); @@ -1824,7 +1847,6 @@ size_section (abfd, idx) break; #endif case rs_space: - assert (frag->fr_symbol == 0); case rs_fill: case rs_org: size += frag->fr_fix; @@ -1977,7 +1999,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, 1); + resolve_symbol_value (symbol_ptr); if (! symbol_ptr->sy_resolved) { char *file; @@ -2038,8 +2060,8 @@ do_relocs_for (abfd, h, file_cursor) #endif /* Write out the reloc table */ - bfd_write ((PTR) external_reloc_vec, 1, external_reloc_size, - abfd); + bfd_bwrite ((PTR) external_reloc_vec, + (bfd_size_type) external_reloc_size, abfd); free (external_reloc_vec); /* Fill in section header info. */ @@ -2138,7 +2160,6 @@ fill_section (abfd, h, file_cursor) break; case rs_space: - assert (frag->fr_symbol == 0); case rs_fill: case rs_align: case rs_align_code: @@ -2182,7 +2203,7 @@ fill_section (abfd, h, file_cursor) { if (s->s_scnptr != 0) { - bfd_write (buffer, s->s_size, 1, abfd); + bfd_bwrite (buffer, s->s_size, abfd); *file_cursor += s->s_size; } free (buffer); @@ -2206,7 +2227,7 @@ coff_header_append (abfd, h) unsigned long string_size = 4; #endif - bfd_seek (abfd, 0, 0); + bfd_seek (abfd, (file_ptr) 0, 0); #ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER H_SET_MAGIC_NUMBER (h, COFF_MAGIC); @@ -2222,8 +2243,8 @@ coff_header_append (abfd, h) i = bfd_coff_swap_filehdr_out (abfd, &h->filehdr, buffer); - bfd_write (buffer, i, 1, abfd); - bfd_write (buffero, H_GET_SIZEOF_OPTIONAL_HEADER (h), 1, abfd); + bfd_bwrite (buffer, (bfd_size_type) i, abfd); + bfd_bwrite (buffero, (bfd_size_type) H_GET_SIZEOF_OPTIONAL_HEADER (h), abfd); for (i = SEG_E0; i < SEG_LAST; i++) { @@ -2248,7 +2269,7 @@ coff_header_append (abfd, h) buffer); if (size == 0) as_bad (_("bfd_coff_swap_scnhdr_out failed")); - bfd_write (buffer, size, 1, abfd); + bfd_bwrite (buffer, (bfd_size_type) size, abfd); } } } @@ -2958,7 +2979,7 @@ yank_symbols () S_SET_SEGMENT (symbolP, SEG_E0); } /* push data into text */ - resolve_symbol_value (symbolP, 1); + resolve_symbol_value (symbolP); if (S_GET_STORAGE_CLASS (symbolP) == C_NULL) { @@ -3375,7 +3396,7 @@ do_linenos_for (abfd, h, file_cursor) s->scnhdr.s_lnnoptr = *file_cursor; - bfd_write (buffer, 1, s->scnhdr.s_nlnno * LINESZ, abfd); + bfd_bwrite (buffer, (bfd_size_type) s->scnhdr.s_nlnno * LINESZ, abfd); free (buffer); *file_cursor += s->scnhdr.s_nlnno * LINESZ; @@ -3473,6 +3494,9 @@ write_object_file () relax_segment (segment_info[i].frchainP->frch_root, i); } + /* Relaxation has completed. Freeze all syms. */ + finalize_syms = 1; + H_SET_NUMBER_OF_SECTIONS (&headers, 0); /* Find out how big the sections are, and set the addresses. */ @@ -3595,7 +3619,8 @@ write_object_file () w_symbols (abfd, buffer1, symbol_rootP); if (string_byte_count > 0) w_strings (buffer1 + symtable_size); - bfd_write (buffer1, 1, symtable_size + string_byte_count, abfd); + bfd_bwrite (buffer1, (bfd_size_type) symtable_size + string_byte_count, + abfd); free (buffer1); } @@ -4191,7 +4216,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, 1); + resolve_symbol_value (add_symbolP); if (add_symbolP != NULL) { @@ -4221,7 +4246,7 @@ fixup_segment (segP, this_segment_type) } if (sub_symbolP != NULL && ! sub_symbolP->sy_resolved) - resolve_symbol_value (sub_symbolP, 1); + resolve_symbol_value (sub_symbolP); if (add_symbolP != NULL && add_symbolP->sy_mri_common) @@ -4471,11 +4496,7 @@ fixup_segment (segP, this_segment_type) #endif } /* if pcrel */ -#ifdef MD_APPLY_FIX3 - md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type); -#else - md_apply_fix (fixP, add_number); -#endif + md_apply_fix3 (fixP, (valueT *) & add_number, this_segment_type); if (!fixP->fx_bit_fixP && ! fixP->fx_no_overflow) { diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h index f862f77..98948be 100644 --- a/contrib/binutils/gas/config/obj-coff.h +++ b/contrib/binutils/gas/config/obj-coff.h @@ -121,10 +121,17 @@ #ifdef TE_PE #define TARGET_FORMAT "pe-shl" #else + +#if 0 /* FIXME: The "shl" varaible does not appear to exist. What happened to it ? */ #define TARGET_FORMAT \ (shl \ ? (sh_small ? "coff-shl-small" : "coff-shl") \ : (sh_small ? "coff-sh-small" : "coff-sh")) +#else +#define TARGET_FORMAT \ + (sh_small ? "coff-shl-small" : "coff-shl") +#endif + #endif #endif diff --git a/contrib/binutils/gas/config/obj-ecoff.c b/contrib/binutils/gas/config/obj-ecoff.c index d1eabce..4d055cb 100644 --- a/contrib/binutils/gas/config/obj-ecoff.c +++ b/contrib/binutils/gas/config/obj-ecoff.c @@ -106,7 +106,7 @@ ecoff_frob_file () const struct ecoff_debug_swap * const debug_swap = &ecoff_backend (stdoutput)->debug_swap; bfd_vma addr; - asection *sec; + asection **sec; HDRR *hdr; char *buf; char *set; @@ -143,53 +143,39 @@ ecoff_frob_file () }; #define n_names ((int) (sizeof (names) / sizeof (names[0]))) + /* Sections that match names, order to be straightened out later. */ + asection *secs[n_names]; + int i; + addr = 0; - { - /* Sections that match names, order to be straightened out later. */ - asection *secs[n_names]; - /* Linked list of sections with non-matching names. Random ordering. */ - asection *other_sections = 0; - /* Pointer to next section, since we're destroying the original - ordering. */ - asection *next; - - int i; - - for (i = 0; i < n_names; i++) - secs[i] = 0; - for (sec = stdoutput->sections; sec != (asection *) NULL; sec = next) - { - next = sec->next; - for (i = 0; i < n_names; i++) - if (!strcmp (sec->name, names[i])) - { - secs[i] = sec; - break; - } - if (i == n_names) + for (i = 0; i < n_names; i++) + secs[i] = 0; + + for (sec = &stdoutput->sections; *sec != (asection *) NULL; ) + { + for (i = 0; i < n_names; i++) + if (!strcmp ((*sec)->name, names[i])) { - bfd_set_section_vma (stdoutput, sec, addr); - addr += bfd_section_size (stdoutput, sec); - sec->next = other_sections; - other_sections = sec; + secs[i] = *sec; + bfd_section_list_remove (stdoutput, sec); + break; } - } - for (i = 0; i < n_names; i++) - if (secs[i]) + if (i == n_names) { - sec = secs[i]; - bfd_set_section_vma (stdoutput, sec, addr); - addr += bfd_section_size (stdoutput, sec); + bfd_set_section_vma (stdoutput, *sec, addr); + addr += bfd_section_size (stdoutput, *sec); + sec = &(*sec)->next; } - for (i = n_names - 1; i >= 0; i--) - if (secs[i]) - { - sec = secs[i]; - sec->next = other_sections; - other_sections = sec; - } - stdoutput->sections = other_sections; - } + } + for (i = 0; i < n_names; i++) + if (secs[i]) + { + bfd_set_section_vma (stdoutput, secs[i], addr); + addr += bfd_section_size (stdoutput, secs[i]); + } + for (i = n_names - 1; i >= 0; i--) + if (secs[i]) + bfd_section_list_insert (stdoutput, &stdoutput->sections, secs[i]); /* Build the ECOFF debugging information. */ assert (ecoff_data (stdoutput) != 0); diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c index 162f02f..6ec0882 100644 --- a/contrib/binutils/gas/config/obj-elf.c +++ b/contrib/binutils/gas/config/obj-elf.c @@ -1,5 +1,5 @@ /* ELF object file format - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,6 +21,7 @@ #define OBJ_HEADER "obj-elf.h" #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "obstack.h" @@ -55,9 +56,9 @@ static void elf_s_set_size PARAMS ((symbolS *, bfd_vma)); static bfd_vma elf_s_get_align PARAMS ((symbolS *)); static void elf_s_set_align PARAMS ((symbolS *, bfd_vma)); static void elf_s_set_other PARAMS ((symbolS *, int)); -static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); static int elf_sec_sym_ok_for_reloc PARAMS ((asection *)); static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR)); +static void build_group_lists PARAMS ((bfd *, asection *, PTR)); static int elf_separate_stab_sections PARAMS ((void)); static void elf_init_stab_section PARAMS ((segT)); @@ -74,6 +75,12 @@ static void obj_elf_ident PARAMS ((int)); static void obj_elf_weak PARAMS ((int)); static void obj_elf_local PARAMS ((int)); static void obj_elf_visibility PARAMS ((int)); +static void obj_elf_change_section + PARAMS ((const char *, int, int, int, const char *, int)); +static int obj_elf_parse_section_letters PARAMS ((char *, size_t)); +static int obj_elf_section_word PARAMS ((char *, size_t)); +static char *obj_elf_section_name PARAMS ((void)); +static int obj_elf_section_type PARAMS ((char *, size_t)); static void obj_elf_symver PARAMS ((int)); static void obj_elf_subsection PARAMS ((int)); static void obj_elf_popsection PARAMS ((int)); @@ -242,13 +249,6 @@ elf_s_set_other (sym, other) S_SET_OTHER (sym, other); } -static void -elf_copy_symbol_attributes (dest, src) - symbolS *dest, *src; -{ - OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src); -} - static int elf_sec_sym_ok_for_reloc (sec) asection *sec; @@ -305,7 +305,7 @@ obj_elf_common (is_common) SKIP_WHITESPACE (); if (*input_line_pointer != ',') { - as_bad (_("Expected comma after symbol-name")); + as_bad (_("expected comma after symbol-name")); ignore_rest_of_line (); return; } @@ -322,7 +322,7 @@ obj_elf_common (is_common) *p = c; if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP)) { - as_bad (_("Ignoring attempt to re-define symbol")); + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); ignore_rest_of_line (); return; } @@ -330,7 +330,7 @@ obj_elf_common (is_common) { if (S_GET_VALUE (symbolP) != (valueT) size) { - as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."), + as_warn (_("length of .comm \"%s\" is already %ld; not changed to %d"), S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); } } @@ -353,7 +353,7 @@ obj_elf_common (is_common) if (temp < 0) { temp = 0; - as_warn (_("Common alignment negative; 0 assumed")); + as_warn (_("common alignment negative; 0 assumed")); } } if (symbol_get_obj (symbolP)->local) @@ -372,7 +372,7 @@ obj_elf_common (is_common) for (align = 0; (temp & 1) == 0; temp >>= 1, ++align); if (temp != 1) { - as_bad (_("Common alignment not a power of 2")); + as_bad (_("common alignment not a power of 2")); ignore_rest_of_line (); return; } @@ -619,10 +619,14 @@ static struct special_section const special_sections[] = { NULL, 0, 0 } }; -void -obj_elf_change_section (name, type, attr, push) - char *name; - int type, attr, push; +static void +obj_elf_change_section (name, type, attr, entsize, group_name, push) + const char *name; + int type; + int attr; + int entsize; + const char *group_name; + int push; { asection *old_sec; segT sec; @@ -661,11 +665,11 @@ obj_elf_change_section (name, type, attr, push) { if (old_sec == NULL) { - as_warn (_("Setting incorrect section type for %s"), name); + as_warn (_("setting incorrect section type for %s"), name); } else { - as_warn (_("Ignoring incorrect section type for %s"), name); + as_warn (_("ignoring incorrect section type for %s"), name); type = special_sections[i].type; } } @@ -678,7 +682,7 @@ obj_elf_change_section (name, type, attr, push) file. */ if (strcmp (name, ".note") != 0 || attr != SHF_ALLOC) - as_warn (_("Setting incorrect section attributes for %s"), + as_warn (_("setting incorrect section attributes for %s"), name); } attr |= special_sections[i].attributes; @@ -690,7 +694,9 @@ obj_elf_change_section (name, type, attr, push) | ((attr & SHF_WRITE) ? 0 : SEC_READONLY) | ((attr & SHF_ALLOC) ? SEC_ALLOC : 0) | (((attr & SHF_ALLOC) && type != SHT_NOBITS) ? SEC_LOAD : 0) - | ((attr & SHF_EXECINSTR) ? SEC_CODE : 0)); + | ((attr & SHF_EXECINSTR) ? SEC_CODE : 0) + | ((attr & SHF_MERGE) ? SEC_MERGE : 0) + | ((attr & SHF_STRINGS) ? SEC_STRINGS : 0)); #ifdef md_elf_section_flags flags = md_elf_section_flags (flags, attr, type); #endif @@ -704,6 +710,9 @@ obj_elf_change_section (name, type, attr, push) seg_info (sec)->bss = 1; bfd_set_section_flags (stdoutput, sec, flags); + if (flags & SEC_MERGE) + sec->entsize = entsize; + elf_group_name (sec) = group_name; /* Add a symbol for this section to the symbol table. */ secsym = symbol_find (name); @@ -719,8 +728,13 @@ obj_elf_change_section (name, type, attr, push) saw the first time. */ if ((old_sec->flags ^ flags) & (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE - | SEC_EXCLUDE | SEC_SORT_ENTRIES)) - as_warn (_("Ignoring changed section attributes for %s"), name); + | SEC_EXCLUDE | SEC_SORT_ENTRIES | SEC_MERGE | SEC_STRINGS)) + as_warn (_("ignoring changed section attributes for %s"), name); + else if ((flags & SEC_MERGE) && old_sec->entsize != (unsigned) entsize) + as_warn (_("ignoring changed section entity size for %s"), name); + else if ((attr & SHF_GROUP) != 0 + && strcmp (elf_group_name (old_sec), group_name) != 0) + as_warn (_("ignoring new section group for %s"), name); } #ifdef md_elf_section_change_hook @@ -728,7 +742,7 @@ obj_elf_change_section (name, type, attr, push) #endif } -int +static int obj_elf_parse_section_letters (str, len) char *str; size_t len; @@ -748,9 +762,30 @@ obj_elf_parse_section_letters (str, len) case 'x': attr |= SHF_EXECINSTR; break; + case 'M': + attr |= SHF_MERGE; + break; + case 'S': + attr |= SHF_STRINGS; + break; + case 'G': + attr |= SHF_GROUP; + break; + /* Compatibility. */ + case 'm': + if (*(str - 1) == 'a') + { + attr |= SHF_MERGE; + if (len > 1 && str[1] == 's') + { + attr |= SHF_STRINGS; + str++, len--; + } + break; + } default: { - char *bad_msg = _("Unrecognized .section attribute: want a,w,x"); + char *bad_msg = _("unrecognized .section attribute: want a,w,x,M,S,G"); #ifdef md_elf_section_letter int md_attr = md_elf_section_letter (*str, &bad_msg); if (md_attr >= 0) @@ -770,7 +805,7 @@ obj_elf_parse_section_letters (str, len) return attr; } -int +static int obj_elf_section_word (str, len) char *str; size_t len; @@ -790,11 +825,11 @@ obj_elf_section_word (str, len) } #endif - as_warn (_("Unrecognized section attribute")); + as_warn (_("unrecognized section attribute")); return 0; } -int +static int obj_elf_section_type (str, len) char *str; size_t len; @@ -812,16 +847,57 @@ obj_elf_section_type (str, len) } #endif - as_warn (_("Unrecognized section type")); + as_warn (_("unrecognized section type")); return 0; } +/* Get name of section. */ +static char * +obj_elf_section_name () +{ + char *name; + + SKIP_WHITESPACE (); + if (*input_line_pointer == '"') + { + int dummy; + + name = demand_copy_C_string (&dummy); + if (name == NULL) + { + ignore_rest_of_line (); + return NULL; + } + } + else + { + char *end = input_line_pointer; + + while (0 == strchr ("\n\t,; ", *end)) + end++; + if (end == input_line_pointer) + { + as_warn (_("missing name")); + ignore_rest_of_line (); + return NULL; + } + + name = xmalloc (end - input_line_pointer + 1); + memcpy (name, input_line_pointer, end - input_line_pointer); + name[end - input_line_pointer] = '\0'; + input_line_pointer = end; + } + SKIP_WHITESPACE (); + return name; +} + void obj_elf_section (push) int push; { - char *name, *beg, *end; + char *name, *group_name, *beg; int type, attr, dummy; + int entsize; #ifndef TC_I370 if (flag_mri) @@ -845,38 +921,13 @@ obj_elf_section (push) } #endif /* ! defined (TC_I370) */ - /* Get name of section. */ - SKIP_WHITESPACE (); - if (*input_line_pointer == '"') - { - name = demand_copy_C_string (&dummy); - if (name == NULL) - { - ignore_rest_of_line (); - return; - } - } - else - { - end = input_line_pointer; - while (0 == strchr ("\n\t,; ", *end)) - end++; - if (end == input_line_pointer) - { - as_warn (_("Missing section name")); - ignore_rest_of_line (); - return; - } - - name = xmalloc (end - input_line_pointer + 1); - memcpy (name, input_line_pointer, end - input_line_pointer); - name[end - input_line_pointer] = '\0'; - input_line_pointer = end; - } - SKIP_WHITESPACE (); - + name = obj_elf_section_name (); + if (name == NULL) + return; type = SHT_NULL; attr = 0; + group_name = NULL; + entsize = 0; if (*input_line_pointer == ',') { @@ -898,6 +949,8 @@ obj_elf_section (push) if (*input_line_pointer == ',') { char c; + char *save = input_line_pointer; + ++input_line_pointer; SKIP_WHITESPACE (); c = *input_line_pointer; @@ -918,6 +971,41 @@ obj_elf_section (push) *input_line_pointer = c; type = obj_elf_section_type (beg, input_line_pointer - beg); } + else + input_line_pointer = save; + } + + SKIP_WHITESPACE (); + if ((attr & SHF_MERGE) != 0 && *input_line_pointer == ',') + { + ++input_line_pointer; + SKIP_WHITESPACE (); + entsize = get_absolute_expression (); + SKIP_WHITESPACE (); + if (entsize < 0) + { + as_warn (_("invalid merge entity size")); + attr &= ~SHF_MERGE; + entsize = 0; + } + } + else if ((attr & SHF_MERGE) != 0) + { + as_warn (_("entity size for SHF_MERGE not specified")); + attr &= ~SHF_MERGE; + } + + if ((attr & SHF_GROUP) != 0 && *input_line_pointer == ',') + { + ++input_line_pointer; + group_name = obj_elf_section_name (); + if (group_name == NULL) + attr &= ~SHF_GROUP; + } + else if ((attr & SHF_GROUP) != 0) + { + as_warn (_("group name for SHF_GROUP not specified")); + attr &= ~SHF_GROUP; } } else @@ -929,7 +1017,7 @@ obj_elf_section (push) SKIP_WHITESPACE (); if (*input_line_pointer != '#') { - as_warn (_("Bad .section directive - character following name is not '#'")); + as_warn (_("character following name is not '#'")); ignore_rest_of_line (); return; } @@ -948,7 +1036,7 @@ obj_elf_section (push) demand_empty_rest_of_line (); - obj_elf_change_section (name, type, attr, push); + obj_elf_change_section (name, type, attr, entsize, group_name, push); } /* Change to the .data section. */ @@ -1030,7 +1118,7 @@ obj_elf_previous (ignore) if (previous_section == 0) { - as_bad (_(".previous without corresponding .section; ignored")); + as_warn (_(".previous without corresponding .section; ignored")); return; } @@ -1057,7 +1145,7 @@ obj_elf_popsection (xxx) if (top == NULL) { - as_bad (_(".popsection without corresponding .pushsection; ignored")); + as_warn (_(".popsection without corresponding .pushsection; ignored")); return; } @@ -1098,6 +1186,7 @@ obj_elf_symver (ignore) { char *name; char c; + char old_lexat; symbolS *sym; name = input_line_pointer; @@ -1117,13 +1206,12 @@ obj_elf_symver (ignore) ++input_line_pointer; name = input_line_pointer; - while (1) - { - c = get_symbol_end (); - if (c != ELF_VER_CHR) - break; - *input_line_pointer++ = c; - } + + /* Temporarily include '@' in symbol names. */ + old_lexat = lex_type[(unsigned char) '@']; + lex_type[(unsigned char) '@'] |= LEX_NAME; + c = get_symbol_end (); + lex_type[(unsigned char) '@'] = old_lexat; if (symbol_get_obj (sym)->versioned_name == NULL) { @@ -1206,7 +1294,7 @@ obj_elf_vtable_inherit (ignore) if (input_line_pointer[0] == '0' && (input_line_pointer[1] == '\0' - || isspace ((unsigned char) input_line_pointer[1]))) + || ISSPACE (input_line_pointer[1]))) { psym = section_symbol (absolute_section); ++input_line_pointer; @@ -1296,20 +1384,46 @@ elf_obj_symbol_new_hook (symbolP) #endif } +/* 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. */ + +void +elf_copy_symbol_attributes (dest, src) + symbolS *dest, *src; +{ + struct elf_obj_sy *srcelf = symbol_get_obj (src); + struct elf_obj_sy *destelf = symbol_get_obj (dest); + if (srcelf->size) + { + if (destelf->size == NULL) + destelf->size = + (expressionS *) xmalloc (sizeof (expressionS)); + *destelf->size = *srcelf->size; + } + else + { + if (destelf->size != NULL) + free (destelf->size); + destelf->size = NULL; + } + S_SET_SIZE (dest, S_GET_SIZE (src)); + S_SET_OTHER (dest, S_GET_OTHER (src)); +} + void obj_elf_version (ignore) int ignore ATTRIBUTE_UNUSED; { char *name; unsigned int c; - char ch; char *p; asection *seg = now_seg; subsegT subseg = now_subseg; Elf_Internal_Note i_note; Elf_External_Note e_note; asection *note_secp = (asection *) NULL; - int i, len; + int len; SKIP_WHITESPACE (); if (*input_line_pointer == '\"') @@ -1339,26 +1453,21 @@ obj_elf_version (ignore) i_note.descsz = 0; /* no description */ i_note.type = NT_VERSION; p = frag_more (sizeof (e_note.namesz)); - md_number_to_chars (p, (valueT) i_note.namesz, 4); + md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz)); p = frag_more (sizeof (e_note.descsz)); - md_number_to_chars (p, (valueT) i_note.descsz, 4); + md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.type)); - md_number_to_chars (p, (valueT) i_note.type, 4); + md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type)); + p = frag_more (len + 1); + strcpy (p, name); - for (i = 0; i < len; i++) - { - ch = *(name + i); - { - FRAG_APPEND_1_CHAR (ch); - } - } frag_align (2, 0, 0); subseg_set (seg, subseg); } else { - as_bad (_("Expected quoted string")); + as_bad (_("expected quoted string")); } demand_empty_rest_of_line (); } @@ -1396,7 +1505,14 @@ obj_elf_size (ignore) sym = symbol_find_or_make (name); *p = c; if (exp.X_op == O_constant) - S_SET_SIZE (sym, exp.X_add_number); + { + S_SET_SIZE (sym, exp.X_add_number); + if (symbol_get_obj (sym)->size) + { + xfree (symbol_get_obj (sym)->size); + symbol_get_obj (sym)->size = NULL; + } + } else { symbol_get_obj (sym)->size = @@ -1464,7 +1580,7 @@ obj_elf_type (ignore) ; #endif else - as_bad (_("ignoring unrecognized symbol type \"%s\""), typename); + as_bad (_("unrecognized symbol type \"%s\""), typename); *input_line_pointer = c; @@ -1525,7 +1641,7 @@ obj_elf_init_stab_section (seg) /* Zero it out. */ memset (p, 0, 12); as_where (&file, (unsigned int *) NULL); - stabstr_name = (char *) alloca (strlen (segment_name (seg)) + 4); + stabstr_name = (char *) xmalloc (strlen (segment_name (seg)) + 4); strcpy (stabstr_name, segment_name (seg)); strcat (stabstr_name, "str"); stroff = get_stab_string_offset (file, stabstr_name); @@ -1736,7 +1852,7 @@ elf_frob_symbol (symp, puntp) if (S_IS_WEAK (symp)) { if (S_IS_COMMON (symp)) - as_bad (_("Symbol `%s' can not be both weak and common"), + as_bad (_("symbol `%s' can not be both weak and common"), S_GET_NAME (symp)); } @@ -1769,11 +1885,101 @@ elf_frob_symbol (symp, puntp) #endif } +struct group_list +{ + asection **head; /* Section lists. */ + unsigned int *elt_count; /* Number of sections in each list. */ + unsigned int num_group; /* Number of lists. */ +}; + +/* Called via bfd_map_over_sections. If SEC is a member of a group, + add it to a list of sections belonging to the group. INF is a + pointer to a struct group_list, which is where we store the head of + each list. */ + +static void +build_group_lists (abfd, sec, inf) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + PTR inf; +{ + struct group_list *list = (struct group_list *) inf; + const char *group_name = elf_group_name (sec); + unsigned int i; + + if (group_name == NULL) + return; + + /* If this group already has a list, add the section to the head of + the list. */ + for (i = 0; i < list->num_group; i++) + { + if (strcmp (group_name, elf_group_name (list->head[i])) == 0) + { + elf_next_in_group (sec) = list->head[i]; + list->head[i] = sec; + list->elt_count[i] += 1; + return; + } + } + + /* New group. Make the arrays bigger in chunks to minimize calls to + realloc. */ + i = list->num_group; + if ((i & 127) == 0) + { + unsigned int newsize = i + 128; + list->head = xrealloc (list->head, newsize * sizeof (*list->head)); + list->elt_count = xrealloc (list->elt_count, + newsize * sizeof (*list->elt_count)); + } + list->head[i] = sec; + list->elt_count[i] = 1; + list->num_group += 1; +} + void elf_frob_file () { + struct group_list list; + unsigned int i; + bfd_map_over_sections (stdoutput, adjust_stab_sections, (PTR) 0); + /* Go find section groups. */ + list.num_group = 0; + list.head = NULL; + list.elt_count = NULL; + bfd_map_over_sections (stdoutput, build_group_lists, (PTR) &list); + + /* Make the SHT_GROUP sections that describe each section group. We + can't set up the section contents here yet, because elf section + indices have yet to be calculated. elf.c:set_group_contents does + the rest of the work. */ + for (i = 0; i < list.num_group; i++) + { + const char *group_name = elf_group_name (list.head[i]); + asection *s; + flagword flags; + + s = subseg_force_new (group_name, 0); + flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP; + if (s == NULL + || !bfd_set_section_flags (stdoutput, s, flags) + || !bfd_set_section_alignment (stdoutput, s, 2)) + { + as_fatal (_("can't create group: %s"), + bfd_errmsg (bfd_get_error ())); + } + + /* Pass a pointer to the first section in this group. */ + elf_next_in_group (s) = list.head[i]; + + s->_raw_size = 4 * (list.elt_count[i] + 1); + s->contents = frag_more (s->_raw_size); + frag_now->fr_fix = frag_now_fix_octets (); + } + #ifdef elf_tc_final_processing elf_tc_final_processing (); #endif @@ -1859,7 +2065,7 @@ elf_frob_file_after_relocs () debug.external_ext = debug.external_ext_end = NULL; if (! bfd_ecoff_debug_externals (stdoutput, &debug, debug_swap, true, elf_get_extr, elf_set_index)) - as_fatal (_("Failed to set up debugging information: %s"), + as_fatal (_("failed to set up debugging information: %s"), bfd_errmsg (bfd_get_error ())); sec = bfd_get_section_by_name (stdoutput, ".mdebug"); @@ -1879,7 +2085,7 @@ elf_frob_file_after_relocs () pointer will not be used. */ if (! bfd_set_section_contents (stdoutput, sec, (PTR) buf, (file_ptr) 0, (bfd_size_type) 0)) - as_fatal (_("Can't start writing .mdebug section: %s"), + as_fatal (_("can't start writing .mdebug section: %s"), bfd_errmsg (bfd_get_error ())); know (stdoutput->output_has_begun == true); @@ -1887,7 +2093,7 @@ elf_frob_file_after_relocs () if (! bfd_ecoff_write_debug (stdoutput, &debug, debug_swap, sec->filepos)) - as_fatal (_("Could not write .mdebug section: %s"), + as_fatal (_("could not write .mdebug section: %s"), bfd_errmsg (bfd_get_error ())); } #endif /* NEED_ECOFF_DEBUG */ diff --git a/contrib/binutils/gas/config/obj-elf.h b/contrib/binutils/gas/config/obj-elf.h index 8e3ce7d..33c5f43 100644 --- a/contrib/binutils/gas/config/obj-elf.h +++ b/contrib/binutils/gas/config/obj-elf.h @@ -182,32 +182,10 @@ void elf_obj_symbol_new_hook PARAMS ((symbolS *)); #define obj_symbol_new_hook elf_obj_symbol_new_hook #endif -/* 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. */ +void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES -#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \ -do \ - { \ - struct elf_obj_sy *srcelf = symbol_get_obj (SRC); \ - struct elf_obj_sy *destelf = symbol_get_obj (DEST); \ - if (srcelf->size) \ - { \ - if (destelf->size == NULL) \ - destelf->size = \ - (expressionS *) xmalloc (sizeof (expressionS)); \ - *destelf->size = *srcelf->size; \ - } \ - else \ - { \ - if (destelf->size != NULL) \ - free (destelf->size); \ - destelf->size = NULL; \ - } \ - S_SET_SIZE ((DEST), S_GET_SIZE (SRC)); \ - S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \ - } \ -while (0) +#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ + (elf_copy_symbol_attributes (DEST, SRC)) #endif #ifndef SEPARATE_STAB_SECTIONS diff --git a/contrib/binutils/gas/config/obj-ieee.c b/contrib/binutils/gas/config/obj-ieee.c index 521a0d7..505bb35 100644 --- a/contrib/binutils/gas/config/obj-ieee.c +++ b/contrib/binutils/gas/config/obj-ieee.c @@ -292,7 +292,7 @@ do_symbols (abfd) { ptr->sy_symbol.sy.section = (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); - S_SET_VALUE (ptr, S_GET_VALUE (ptr) + ptr->sy_frag->fr_address); + S_SET_VALUE (ptr, S_GET_VALUE (ptr)); if (ptr->sy_symbol.sy.flags == 0) ptr->sy_symbol.sy.flags = BSF_LOCAL; } @@ -558,6 +558,9 @@ write_object_file () for (i = SEG_E0; i < SEG_UNKNOWN; i++) relax_segment (segment_info[i].frag_root, i); + /* Relaxation has completed. Freeze all syms. */ + finalize_syms = 1; + /* Now the addresses of the frags are correct within the segment. */ bfd_as_write_hook (); diff --git a/contrib/binutils/gas/config/tc-alpha.c b/contrib/binutils/gas/config/tc-alpha.c index ba42aaa..b1a3471 100644 --- a/contrib/binutils/gas/config/tc-alpha.c +++ b/contrib/binutils/gas/config/tc-alpha.c @@ -62,7 +62,7 @@ #include "dwarf2dbg.h" #endif -#include +#include "safe-ctype.h" /* Local types */ @@ -81,7 +81,7 @@ struct alpha_insn { unsigned insn; int nfixups; struct alpha_fixup fixups[MAX_INSN_FIXUPS]; - unsigned sequence[MAX_INSN_FIXUPS]; + long sequence; }; enum alpha_macro_arg { @@ -92,10 +92,6 @@ enum alpha_macro_arg { MACRO_CPIR, MACRO_FPR, MACRO_EXP, - MACRO_LITERAL, - MACRO_BASE, - MACRO_BYTOFF, - MACRO_JSR }; struct alpha_macro { @@ -110,19 +106,29 @@ struct alpha_macro { #define O_pregister O_md1 /* O_register, in parentheses */ #define O_cpregister O_md2 /* + a leading comma */ -#ifdef RELOC_OP_P /* Note, the alpha_reloc_op table below depends on the ordering - of O_literal .. O_gprelow. */ + of O_literal .. O_gpre16. */ #define O_literal O_md3 /* !literal relocation */ -#define O_lituse_base O_md4 /* !lituse_base relocation */ -#define O_lituse_bytoff O_md5 /* !lituse_bytoff relocation */ -#define O_lituse_jsr O_md6 /* !lituse_jsr relocation */ -#define O_gpdisp O_md7 /* !gpdisp relocation */ -#define O_gprelhigh O_md8 /* !gprelhigh relocation */ -#define O_gprellow O_md9 /* !gprellow relocation */ - -#define USER_RELOC_P(R) ((R) >= O_literal && (R) <= O_gprellow) -#endif +#define O_lituse_addr O_md4 /* !lituse_addr relocation */ +#define O_lituse_base O_md5 /* !lituse_base relocation */ +#define O_lituse_bytoff O_md6 /* !lituse_bytoff relocation */ +#define O_lituse_jsr O_md7 /* !lituse_jsr relocation */ +#define O_gpdisp O_md8 /* !gpdisp relocation */ +#define O_gprelhigh O_md9 /* !gprelhigh relocation */ +#define O_gprellow O_md10 /* !gprellow relocation */ +#define O_gprel O_md11 /* !gprel relocation */ + +#define DUMMY_RELOC_LITUSE_ADDR (BFD_RELOC_UNUSED + 1) +#define DUMMY_RELOC_LITUSE_BASE (BFD_RELOC_UNUSED + 2) +#define DUMMY_RELOC_LITUSE_BYTOFF (BFD_RELOC_UNUSED + 3) +#define DUMMY_RELOC_LITUSE_JSR (BFD_RELOC_UNUSED + 4) + +#define LITUSE_ADDR 0 +#define LITUSE_BASE 1 +#define LITUSE_BYTOFF 2 +#define LITUSE_JSR 3 + +#define USER_RELOC_P(R) ((R) >= O_literal && (R) <= O_gprel) /* Macros for extracting the type and number of encoded register tokens */ @@ -188,6 +194,9 @@ struct alpha_macro { /* Prototypes for all local functions */ +static struct alpha_reloc_tag *get_alpha_reloc_tag PARAMS ((long)); +static void alpha_adjust_symtab_relocs PARAMS ((bfd *, asection *, PTR)); + static int tokenize_arguments PARAMS ((char *, expressionS *, int)); static const struct alpha_opcode *find_opcode_match PARAMS ((const struct alpha_opcode *, const expressionS *, int *, int *)); @@ -197,16 +206,15 @@ static unsigned insert_operand PARAMS ((unsigned, const struct alpha_operand *, offsetT, char *, unsigned)); static void assemble_insn PARAMS ((const struct alpha_opcode *, const expressionS *, int, - struct alpha_insn *)); + struct alpha_insn *, bfd_reloc_code_real_type)); static void emit_insn PARAMS ((struct alpha_insn *)); static void assemble_tokens_to_insn PARAMS ((const char *, const expressionS *, int, struct alpha_insn *)); static void assemble_tokens PARAMS ((const char *, const expressionS *, int, int)); -static int load_expression - PARAMS ((int, const expressionS *, int *, expressionS *, - const expressionS *)); +static long load_expression + PARAMS ((int, const expressionS *, int *, expressionS *)); static void emit_ldgp PARAMS ((const expressionS *, int, const PTR)); static void emit_division PARAMS ((const expressionS *, int, const PTR)); @@ -257,16 +265,14 @@ static void s_alpha_base PARAMS ((int)); static void s_alpha_align PARAMS ((int)); static void s_alpha_stringer PARAMS ((int)); static void s_alpha_space PARAMS ((int)); +static void s_alpha_ucons PARAMS ((int)); +static void s_alpha_arch PARAMS ((int)); 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 *, int)); - -#ifdef RELOC_OP_P -static void alpha_adjust_symtab_relocs PARAMS ((bfd *, asection *, PTR)); -#endif /* Generic assembler global variables which must be defined by all targets. */ @@ -469,103 +475,58 @@ static int alpha_flag_show_after_trunc = 0; /* -H */ that op-O_literal indexes into it. */ #define ALPHA_RELOC_TABLE(op) \ -&alpha_reloc_op[ ((!USER_RELOC_P (op)) \ +(&alpha_reloc_op[ ((!USER_RELOC_P (op)) \ ? (abort (), 0) \ - : (int) (op) - (int) O_literal) ] + : (int) (op) - (int) O_literal) ]) -#define LITUSE_BASE 1 -#define LITUSE_BYTOFF 2 -#define LITUSE_JSR 3 +#define DEF(NAME, RELOC, REQ, ALLOW) \ + { #NAME, sizeof(#NAME)-1, O_##NAME, RELOC, REQ, ALLOW} static const struct alpha_reloc_op_tag { const char *name; /* string to lookup */ size_t length; /* size of the string */ - bfd_reloc_code_real_type reloc; /* relocation before frob */ operatorT op; /* which operator to use */ - int lituse; /* addened to specify lituse */ + bfd_reloc_code_real_type reloc; /* relocation before frob */ + unsigned int require_seq : 1; /* require a sequence number */ + unsigned int allow_seq : 1; /* allow a sequence number */ } alpha_reloc_op[] = { - - { - "literal", /* name */ - sizeof ("literal")-1, /* length */ - BFD_RELOC_ALPHA_USER_LITERAL, /* reloc */ - O_literal, /* op */ - 0, /* lituse */ - }, - - { - "lituse_base", /* name */ - sizeof ("lituse_base")-1, /* length */ - BFD_RELOC_ALPHA_USER_LITUSE_BASE, /* reloc */ - O_lituse_base, /* op */ - LITUSE_BASE, /* lituse */ - }, - - { - "lituse_bytoff", /* name */ - sizeof ("lituse_bytoff")-1, /* length */ - BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, /* reloc */ - O_lituse_bytoff, /* op */ - LITUSE_BYTOFF, /* lituse */ - }, - - { - "lituse_jsr", /* name */ - sizeof ("lituse_jsr")-1, /* length */ - BFD_RELOC_ALPHA_USER_LITUSE_JSR, /* reloc */ - O_lituse_jsr, /* op */ - LITUSE_JSR, /* lituse */ - }, - - { - "gpdisp", /* name */ - sizeof ("gpdisp")-1, /* length */ - BFD_RELOC_ALPHA_USER_GPDISP, /* reloc */ - O_gpdisp, /* op */ - 0, /* lituse */ - }, - - { - "gprelhigh", /* name */ - sizeof ("gprelhigh")-1, /* length */ - BFD_RELOC_ALPHA_USER_GPRELHIGH, /* reloc */ - O_gprelhigh, /* op */ - 0, /* lituse */ - }, - - { - "gprellow", /* name */ - sizeof ("gprellow")-1, /* length */ - BFD_RELOC_ALPHA_USER_GPRELLOW, /* reloc */ - O_gprellow, /* op */ - 0, /* lituse */ - }, + DEF(literal, BFD_RELOC_ALPHA_ELF_LITERAL, 0, 1), + DEF(lituse_addr, DUMMY_RELOC_LITUSE_ADDR, 1, 1), + DEF(lituse_base, DUMMY_RELOC_LITUSE_BASE, 1, 1), + DEF(lituse_bytoff, DUMMY_RELOC_LITUSE_BYTOFF, 1, 1), + DEF(lituse_jsr, DUMMY_RELOC_LITUSE_JSR, 1, 1), + DEF(gpdisp, BFD_RELOC_ALPHA_GPDISP, 1, 1), + DEF(gprelhigh, BFD_RELOC_ALPHA_GPREL_HI16, 0, 0), + DEF(gprellow, BFD_RELOC_ALPHA_GPREL_LO16, 0, 0), + DEF(gprel, BFD_RELOC_GPREL16, 0, 0) }; +#undef DEF + static const int alpha_num_reloc_op = sizeof (alpha_reloc_op) / sizeof (*alpha_reloc_op); +#endif /* RELOC_OP_P */ /* Maximum # digits needed to hold the largest sequence # */ #define ALPHA_RELOC_DIGITS 25 -/* Whether a sequence number is valid. */ -#define ALPHA_RELOC_SEQUENCE_OK(X) ((X) > 0 && ((unsigned) (X)) == (X)) - /* Structure to hold explict sequence information. */ -struct alpha_literal_tag +struct alpha_reloc_tag { - fixS *lituse; /* head of linked list of !literals */ + fixS *slaves; /* head of linked list of !literals */ segT segment; /* segment relocs are in or undefined_section*/ - int multi_section_p; /* True if more than one section was used */ - unsigned sequence; /* sequence # */ - unsigned n_literals; /* # of literals */ - unsigned n_lituses; /* # of lituses */ + long sequence; /* sequence # */ + unsigned n_master; /* # of literals */ + unsigned n_slaves; /* # of lituses */ + char multi_section_p; /* True if more than one section was used */ char string[1]; /* printable form of sequence to hash with */ }; /* Hash table to link up literals with the appropriate lituse */ static struct hash_control *alpha_literal_hash; -#endif + +/* Sequence numbers for internal use by macros. */ +static long next_sequence_num = -1; /* A table of CPU names and opcode sets. */ @@ -606,48 +567,48 @@ static const struct cpu_type { static const struct alpha_macro alpha_macros[] = { /* Load/Store macros */ { "lda", emit_lda, NULL, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_LITERAL, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldah", emit_ldah, NULL, { MACRO_IR, MACRO_EXP, MACRO_EOA } }, { "ldl", emit_ir_load, "ldl", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldl_l", emit_ir_load, "ldl_l", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldq", emit_ir_load, "ldq", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_LITERAL, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldq_l", emit_ir_load, "ldq_l", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldq_u", emit_ir_load, "ldq_u", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldf", emit_loadstore, "ldf", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldg", emit_loadstore, "ldg", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "lds", emit_loadstore, "lds", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldt", emit_loadstore, "ldt", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldb", emit_ldX, (PTR) 0, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldbu", emit_ldXu, (PTR) 0, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldw", emit_ldX, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldwu", emit_ldXu, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "uldw", emit_uldX, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "uldwu", emit_uldXu, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "uldl", emit_uldX, (PTR) 2, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "uldlu", emit_uldXu, (PTR) 2, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "uldq", emit_uldXu, (PTR) 3, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ldgp", emit_ldgp, NULL, { MACRO_IR, MACRO_EXP, MACRO_PIR, MACRO_EOA } }, @@ -672,34 +633,34 @@ static const struct alpha_macro alpha_macros[] = { #endif { "stl", emit_loadstore, "stl", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stl_c", emit_loadstore, "stl_c", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stq", emit_loadstore, "stq", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stq_c", emit_loadstore, "stq_c", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stq_u", emit_loadstore, "stq_u", - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stf", emit_loadstore, "stf", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stg", emit_loadstore, "stg", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "sts", emit_loadstore, "sts", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stt", emit_loadstore, "stt", - { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_FPR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stb", emit_stX, (PTR) 0, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "stw", emit_stX, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ustw", emit_ustX, (PTR) 1, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ustl", emit_ustX, (PTR) 2, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, { "ustq", emit_ustX, (PTR) 3, - { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_BASE, MACRO_EOA } }, + { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, /* Arithmetic macros */ #if 0 @@ -762,15 +723,15 @@ static const struct alpha_macro alpha_macros[] = { MACRO_IR, MACRO_EXP, MACRO_EOA */ } }, { "jsr", emit_jsrjmp, "jsr", - { MACRO_PIR, MACRO_EXP, MACRO_JSR, MACRO_EOA, - MACRO_PIR, MACRO_JSR, MACRO_EOA, - MACRO_IR, MACRO_EXP, MACRO_JSR, MACRO_EOA, - MACRO_EXP, MACRO_JSR, MACRO_EOA } }, + { MACRO_PIR, MACRO_EXP, MACRO_EOA, + MACRO_PIR, MACRO_EOA, + MACRO_IR, MACRO_EXP, MACRO_EOA, + MACRO_EXP, MACRO_EOA } }, { "jmp", emit_jsrjmp, "jmp", - { MACRO_PIR, MACRO_EXP, MACRO_JSR, MACRO_EOA, - MACRO_PIR, MACRO_JSR, MACRO_EOA, - MACRO_IR, MACRO_EXP, MACRO_JSR, MACRO_EOA, - MACRO_EXP, MACRO_JSR, MACRO_EOA } }, + { MACRO_PIR, MACRO_EXP, MACRO_EOA, + MACRO_PIR, MACRO_EOA, + MACRO_IR, MACRO_EXP, MACRO_EOA, + MACRO_EXP, MACRO_EOA } }, { "ret", emit_retjcr, "ret", { MACRO_IR, MACRO_EXP, MACRO_EOA, MACRO_IR, MACRO_EOA, @@ -825,7 +786,8 @@ md_begin () 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); + as_fatal (_("internal error: can't hash opcode `%s': %s"), + name, retval); /* Some opcodes include modifiers of various sorts with a "/mod" syntax, like the architecture manual suggests. However, for @@ -912,12 +874,10 @@ md_begin () } #endif /* OBJ_ELF */ - subseg_set (text_section, 0); - -#ifdef RELOC_OP_P /* Create literal lookup hash table. */ alpha_literal_hash = hash_new (); -#endif + + subseg_set (text_section, 0); } /* The public interface to the instruction assembler. */ @@ -1158,13 +1118,14 @@ md_pcrel_from (fixP) the distance to the "lda" instruction for setting the addend to GPDISP. */ -int -md_apply_fix (fixP, valueP) +void +md_apply_fix3 (fixP, valP, seg) fixS *fixP; - valueT *valueP; + valueT * valP; + segT seg; { char * const fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; - valueT value = *valueP; + valueT value = * valP; unsigned image, size; switch (fixP->fx_r_type) @@ -1176,10 +1137,13 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_ALPHA_GPDISP_HI16: { fixS *next = fixP->fx_next; - assert (next->fx_r_type == BFD_RELOC_ALPHA_GPDISP_LO16); - fixP->fx_offset = (next->fx_frag->fr_address + next->fx_where - - fixP->fx_frag->fr_address - fixP->fx_where); + /* With user-specified !gpdisp relocations, we can be missing + the matching LO16 reloc. We will have already issued an + error message. */ + if (next) + fixP->fx_offset = (next->fx_frag->fr_address + next->fx_where + - fixP->fx_frag->fr_address - fixP->fx_where); value = (value - sign_extend_16 (value)) >> 16; } @@ -1196,7 +1160,7 @@ md_apply_fix (fixP, valueP) #endif do_reloc_gp: - fixP->fx_addsy = section_symbol (now_seg); + fixP->fx_addsy = section_symbol (seg); md_number_to_chars (fixpos, value, 2); break; @@ -1220,7 +1184,7 @@ md_apply_fix (fixP, valueP) md_number_to_chars (fixpos, value, size); goto done; } - return 1; + return; #ifdef OBJ_ECOFF case BFD_RELOC_GPREL32: @@ -1229,11 +1193,13 @@ md_apply_fix (fixP, valueP) /* FIXME: inherited this obliviousness of `value' -- why? */ md_number_to_chars (fixpos, -alpha_gp_value, 4); break; -#endif -#ifdef OBJ_ELF +#else case BFD_RELOC_GPREL32: - return 1; #endif + case BFD_RELOC_GPREL16: + case BFD_RELOC_ALPHA_GPREL_HI16: + case BFD_RELOC_ALPHA_GPREL_LO16: + return; case BFD_RELOC_23_PCREL_S2: if (fixP->fx_pcrel == 0 && fixP->fx_addsy == 0) @@ -1242,7 +1208,7 @@ md_apply_fix (fixP, valueP) image = (image & ~0x1FFFFF) | ((value >> 2) & 0x1FFFFF); goto write_done; } - return 1; + return; case BFD_RELOC_ALPHA_HINT: if (fixP->fx_pcrel == 0 && fixP->fx_addsy == 0) @@ -1251,43 +1217,22 @@ md_apply_fix (fixP, valueP) image = (image & ~0x3FFF) | ((value >> 2) & 0x3FFF); goto write_done; } - return 1; + return; #ifdef OBJ_ECOFF case BFD_RELOC_ALPHA_LITERAL: md_number_to_chars (fixpos, value, 2); - return 1; - - case BFD_RELOC_ALPHA_LITUSE: - return 1; + return; #endif -#ifdef OBJ_ELF case BFD_RELOC_ALPHA_ELF_LITERAL: case BFD_RELOC_ALPHA_LITUSE: - return 1; -#endif -#ifdef OBJ_EVAX case BFD_RELOC_ALPHA_LINKAGE: case BFD_RELOC_ALPHA_CODEADDR: - return 1; -#endif - -#ifdef RELOC_OP_P - case BFD_RELOC_ALPHA_USER_LITERAL: - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - return 1; - - case BFD_RELOC_ALPHA_USER_GPDISP: - case BFD_RELOC_ALPHA_USER_GPRELHIGH: - case BFD_RELOC_ALPHA_USER_GPRELLOW: - abort (); -#endif + return; case BFD_RELOC_VTABLE_INHERIT: case BFD_RELOC_VTABLE_ENTRY: - return 1; + return; default: { @@ -1317,7 +1262,7 @@ md_apply_fix (fixP, valueP) } if (fixP->fx_addsy != 0 || fixP->fx_pcrel != 0) - return 1; + return; else { as_warn_where (fixP->fx_file, fixP->fx_line, @@ -1330,12 +1275,9 @@ write_done: done: fixP->fx_done = 1; - return 0; } -/* - * Look for a register name in the given symbol. - */ +/* Look for a register name in the given symbol. */ symbolS * md_undefined_symbol (name) @@ -1354,7 +1296,7 @@ md_undefined_symbol (name) /* FALLTHRU */ case 'r': - if (!isdigit (*++name)) + if (!ISDIGIT (*++name)) break; /* FALLTHRU */ @@ -1362,7 +1304,7 @@ md_undefined_symbol (name) case '5': case '6': case '7': case '8': case '9': if (name[1] == '\0') num = name[0] - '0'; - else if (name[0] != '0' && isdigit (name[1]) && name[2] == '\0') + else if (name[0] != '0' && ISDIGIT (name[1]) && name[2] == '\0') { num = (name[0] - '0') * 10 + name[1] - '0'; if (num >= 32) @@ -1423,7 +1365,7 @@ alpha_define_label (sym) } /* Return true if we must always emit a reloc for a type and false if - there is some hope of resolving it a assembly time. */ + there is some hope of resolving it at assembly time. */ int alpha_force_relocation (f) @@ -1437,27 +1379,15 @@ alpha_force_relocation (f) case BFD_RELOC_ALPHA_GPDISP_HI16: case BFD_RELOC_ALPHA_GPDISP_LO16: case BFD_RELOC_ALPHA_GPDISP: -#ifdef OBJ_ECOFF case BFD_RELOC_ALPHA_LITERAL: -#endif -#ifdef OBJ_ELF case BFD_RELOC_ALPHA_ELF_LITERAL: -#endif case BFD_RELOC_ALPHA_LITUSE: + case BFD_RELOC_GPREL16: case BFD_RELOC_GPREL32: -#ifdef OBJ_EVAX + case BFD_RELOC_ALPHA_GPREL_HI16: + case BFD_RELOC_ALPHA_GPREL_LO16: case BFD_RELOC_ALPHA_LINKAGE: case BFD_RELOC_ALPHA_CODEADDR: -#endif -#ifdef RELOC_OP_P - case BFD_RELOC_ALPHA_USER_LITERAL: - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - case BFD_RELOC_ALPHA_USER_GPDISP: - case BFD_RELOC_ALPHA_USER_GPRELHIGH: - case BFD_RELOC_ALPHA_USER_GPRELLOW: -#endif case BFD_RELOC_VTABLE_INHERIT: case BFD_RELOC_VTABLE_ENTRY: return 1; @@ -1496,35 +1426,21 @@ alpha_fix_adjustable (f) case BFD_RELOC_ALPHA_GPDISP: return 0; -#ifdef OBJ_ECOFF case BFD_RELOC_ALPHA_LITERAL: -#endif -#ifdef OBJ_ELF case BFD_RELOC_ALPHA_ELF_LITERAL: -#endif -#ifdef RELOC_OP_P - case BFD_RELOC_ALPHA_USER_LITERAL: -#endif -#ifdef OBJ_EVAX + case BFD_RELOC_ALPHA_LITUSE: case BFD_RELOC_ALPHA_LINKAGE: case BFD_RELOC_ALPHA_CODEADDR: -#endif return 1; - case BFD_RELOC_ALPHA_LITUSE: -#ifdef RELOC_OP_P - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - case BFD_RELOC_ALPHA_USER_GPDISP: - case BFD_RELOC_ALPHA_USER_GPRELHIGH: - case BFD_RELOC_ALPHA_USER_GPRELLOW: -#endif case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: return 0; + case BFD_RELOC_GPREL16: case BFD_RELOC_GPREL32: + case BFD_RELOC_ALPHA_GPREL_HI16: + case BFD_RELOC_ALPHA_GPREL_LO16: case BFD_RELOC_23_PCREL_S2: case BFD_RELOC_32: case BFD_RELOC_64: @@ -1591,7 +1507,8 @@ tc_gen_reloc (sec, fixp) * at assembly time. bfd_perform_reloc doesn't know about this sort * of thing, and as a result we need to fake it out here. */ - if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)) + if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy) + || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE)) && !S_IS_COMMON (fixp->fx_addsy)) reloc->addend -= symbol_get_bfdsym (fixp->fx_addsy)->value; #endif @@ -1649,31 +1566,45 @@ alpha_frob_file_before_adjust () #endif /* OBJ_ECOFF */ -#ifdef RELOC_OP_P +static struct alpha_reloc_tag * +get_alpha_reloc_tag (sequence) + long sequence; +{ + char buffer[ALPHA_RELOC_DIGITS]; + struct alpha_reloc_tag *info; + + sprintf (buffer, "!%ld", sequence); + + info = (struct alpha_reloc_tag *) hash_find (alpha_literal_hash, buffer); + if (! info) + { + size_t len = strlen (buffer); + const char *errmsg; + + info = (struct alpha_reloc_tag *) + xcalloc (sizeof (struct alpha_reloc_tag) + len, 1); + + info->segment = now_seg; + info->sequence = sequence; + strcpy (info->string, buffer); + errmsg = hash_insert (alpha_literal_hash, info->string, (PTR) info); + if (errmsg) + as_fatal (errmsg); + } + + return info; +} /* Before the relocations are written, reorder them, so that user supplied !lituse relocations follow the appropriate !literal - relocations. Also convert the gas-internal relocations to the - appropriate linker relocations. */ + relocations, and similarly for !gpdisp relocations. */ void alpha_adjust_symtab () { if (alpha_literal_hash) - { -#ifdef DEBUG2_ALPHA - fprintf (stderr, "alpha_adjust_symtab called\n"); -#endif - - /* Go over each section, reordering the relocations so that all - of the explicit LITUSE's are adjacent to the explicit - LITERAL's. */ - bfd_map_over_sections (stdoutput, alpha_adjust_symtab_relocs, - (char *) 0); - } + bfd_map_over_sections (stdoutput, alpha_adjust_symtab_relocs, NULL); } - -/* Inner function to move LITUSE's next to the LITERAL. */ static void alpha_adjust_symtab_relocs (abfd, sec, ptr) @@ -1685,14 +1616,8 @@ alpha_adjust_symtab_relocs (abfd, sec, ptr) fixS **prevP; fixS *fixp; fixS *next; - fixS *lituse; - int n_lituses = 0; - -#ifdef DEBUG2_ALPHA - int n = 0; - int n_literals = 0; - int n_dup_literals = 0; -#endif + fixS *slave; + unsigned long n_slaves = 0; /* If seginfo is NULL, we did not create this section; don't do anything with it. By using a pointer to a pointer, we can update @@ -1704,121 +1629,94 @@ alpha_adjust_symtab_relocs (abfd, sec, ptr) if (! seginfo->fix_root) return; - /* First rebuild the fixup chain without the expicit lituse's. */ - prevP = &(seginfo->fix_root); + /* First rebuild the fixup chain without the expicit lituse and + gpdisp_lo16 relocs. */ + prevP = &seginfo->fix_root; for (fixp = seginfo->fix_root; fixp; fixp = next) { next = fixp->fx_next; fixp->fx_next = (fixS *) 0; -#ifdef DEBUG2_ALPHA - n++; -#endif switch (fixp->fx_r_type) { - default: - *prevP = fixp; - prevP = &(fixp->fx_next); -#ifdef DEBUG2_ALPHA - fprintf (stderr, - "alpha_adjust_symtab_relocs: 0x%lx, other relocation %s\n", - (long) fixp, - bfd_get_reloc_code_name (fixp->fx_r_type)); -#endif - break; - - case BFD_RELOC_ALPHA_USER_LITERAL: - *prevP = fixp; - prevP = &(fixp->fx_next); - /* prevent assembler from trying to adjust the offset */ -#ifdef DEBUG2_ALPHA - n_literals++; - if (fixp->tc_fix_data.info->n_literals != 1) - n_dup_literals++; - fprintf (stderr, - "alpha_adjust_symtab_relocs: 0x%lx, !literal!%.6d, # literals = %2d\n", - (long) fixp, - fixp->tc_fix_data.info->sequence, - fixp->tc_fix_data.info->n_literals); -#endif + case BFD_RELOC_ALPHA_LITUSE: + n_slaves++; + if (fixp->tc_fix_data.info->n_master == 0) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("No !literal!%ld was found"), + fixp->tc_fix_data.info->sequence); break; - /* do not link in lituse's */ - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - n_lituses++; - if (fixp->tc_fix_data.info->n_literals == 0) + case BFD_RELOC_ALPHA_GPDISP_LO16: + n_slaves++; + if (fixp->tc_fix_data.info->n_master == 0) as_bad_where (fixp->fx_file, fixp->fx_line, - _("No !literal!%d was found"), + _("No ldah !gpdisp!%ld was found"), fixp->tc_fix_data.info->sequence); -#ifdef DEBUG2_ALPHA - fprintf (stderr, - "alpha_adjust_symtab_relocs: 0x%lx, !lituse !%.6d, # lituses = %2d, next_lituse = 0x%lx\n", - (long) fixp, - fixp->tc_fix_data.info->sequence, - fixp->tc_fix_data.info->n_lituses, - (long) fixp->tc_fix_data.next_lituse); -#endif + break; + + default: + *prevP = fixp; + prevP = &fixp->fx_next; break; } } - /* If there were any lituses, go and add them to the chain, unless there is - more than one !literal for a given sequence number. They are linked - through the next_lituse field in reverse order, so as we go through the - next_lituse chain, we effectively reverse the chain once again. If there - was more than one !literal, we fall back to loading up the address w/o - optimization. Also, if the !literals/!lituses are spread in different - segments (happens in the Linux kernel semaphores), suppress the - optimization. */ - if (n_lituses) + /* If there were any dependent relocations, go and add them back to + the chain. They are linked through the next_reloc field in + reverse order, so as we go through the next_reloc chain, we + effectively reverse the chain once again. + + Except if there is more than one !literal for a given sequence + number. In that case, the programmer and/or compiler is not sure + how control flows from literal to lituse, and we can't be sure to + get the relaxation correct. + + ??? Well, actually we could, if there are enough lituses such that + we can make each literal have at least one of each lituse type + present. Not implemented. + + Also suppress the optimization if the !literals/!lituses are spread + in different segments. This can happen with "intersting" uses of + inline assembly; examples are present in the Linux kernel semaphores. */ + + for (fixp = seginfo->fix_root; fixp; fixp = next) { - for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next) + next = fixp->fx_next; + switch (fixp->fx_r_type) { - switch (fixp->fx_r_type) + case BFD_RELOC_ALPHA_ELF_LITERAL: + if (fixp->tc_fix_data.info->n_master == 1 + && ! fixp->tc_fix_data.info->multi_section_p) { - default: - break; - - case BFD_RELOC_ALPHA_USER_LITERAL: -#ifdef OBJ_ELF - fixp->fx_r_type = BFD_RELOC_ALPHA_ELF_LITERAL; -#else - fixp->fx_r_type = BFD_RELOC_ALPHA_LITERAL; /* XXX check this */ -#endif - if (fixp->tc_fix_data.info->n_literals == 1 - && ! fixp->tc_fix_data.info->multi_section_p) + for (slave = fixp->tc_fix_data.info->slaves; + slave != (fixS *) 0; + slave = slave->tc_fix_data.next_reloc) { - for (lituse = fixp->tc_fix_data.info->lituse; - lituse != (fixS *) 0; - lituse = lituse->tc_fix_data.next_lituse) - { - lituse->fx_next = fixp->fx_next; - fixp->fx_next = lituse; - } + slave->fx_next = fixp->fx_next; + fixp->fx_next = slave; } - break; + } + break; - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - fixp->fx_r_type = BFD_RELOC_ALPHA_LITUSE; - break; + case BFD_RELOC_ALPHA_GPDISP_HI16: + if (fixp->tc_fix_data.info->n_slaves == 0) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("No lda !gpdisp!%ld was found"), + fixp->tc_fix_data.info->sequence); + else + { + slave = fixp->tc_fix_data.info->slaves; + slave->fx_next = next; + fixp->fx_next = slave; } + break; + + default: + break; } } - -#ifdef DEBUG2_ALPHA - fprintf (stderr, "alpha_adjust_symtab_relocs: %s, %d literal%s, %d duplicate literal%s, %d lituse%s\n\n", - sec->name, - n_literals, (n_literals == 1) ? "" : "s", - n_dup_literals, (n_dup_literals == 1) ? "" : "s", - n_lituses, (n_lituses == 1) ? "" : "s"); -#endif } - -#endif /* RELOC_OP_P */ #ifdef DEBUG_ALPHA static void @@ -1875,7 +1773,7 @@ debug_exp (tok, ntok) case O_gpdisp: name = "O_gpdisp"; break; case O_gprelhigh: name = "O_gprelhigh"; break; case O_gprellow: name = "O_gprellow"; break; - case O_md10: name = "O_md10"; break; + case O_gprel: name = "O_gprel"; break; case O_md11: name = "O_md11"; break; case O_md12: name = "O_md12"; break; case O_md13: name = "O_md13"; break; @@ -1908,13 +1806,11 @@ tokenize_arguments (str, tok, ntok) #ifdef DEBUG_ALPHA expressionS *orig_tok = tok; #endif -#ifdef RELOC_OP_P char *p; const struct alpha_reloc_op_tag *r; int c, i; size_t len; int reloc_found_p = 0; -#endif memset (tok, 0, sizeof (*tok) * ntok); @@ -1922,6 +1818,11 @@ tokenize_arguments (str, tok, ntok) old_input_line_pointer = input_line_pointer; input_line_pointer = str; +#ifdef RELOC_OP_P + /* ??? Wrest control of ! away from the regular expression parser. */ + is_end_of_line[(unsigned char) '!'] = 1; +#endif + while (tok < end_tok && *input_line_pointer) { SKIP_WHITESPACE (); @@ -1944,59 +1845,66 @@ tokenize_arguments (str, tok, ntok) if (!saw_arg) goto err; - for (p = ++input_line_pointer; - ((c = *p) != '!' && c != ';' && c != '#' && c != ',' - && !is_end_of_line[c]); - p++) - ; + ++input_line_pointer; + SKIP_WHITESPACE (); + p = input_line_pointer; + c = get_symbol_end (); /* Parse !relocation_type */ - len = p - input_line_pointer; + len = input_line_pointer - p; if (len == 0) { as_bad (_("No relocation operand")); goto err_report; } - if (c != '!') - { - as_bad (_("No !sequence-number after !%s"), input_line_pointer); - goto err_report; - } - r = &alpha_reloc_op[0]; for (i = alpha_num_reloc_op - 1; i >= 0; i--, r++) - { - if (len == r->length - && memcmp (input_line_pointer, r->name, len) == 0) - break; - } + if (len == r->length && memcmp (p, r->name, len) == 0) + break; if (i < 0) { - as_bad (_("Unknown relocation operand: !%s"), - input_line_pointer); + as_bad (_("Unknown relocation operand: !%s"), p); goto err_report; } - input_line_pointer = ++p; - - /* Parse !sequence_number */ - memset (tok, '\0', sizeof (expressionS)); - expression (tok); + *input_line_pointer = c; + SKIP_WHITESPACE (); + if (*input_line_pointer != '!') + { + if (r->require_seq) + { + as_bad (_("no sequence number after !%s"), p); + goto err_report; + } - if (tok->X_op != O_constant - || ! ALPHA_RELOC_SEQUENCE_OK (tok->X_add_number)) + tok->X_add_number = 0; + } + else { - as_bad (_("Bad sequence number: !%s!%s"), - r->name, input_line_pointer); - goto err_report; + if (! r->allow_seq) + { + as_bad (_("!%s does not use a sequence number"), p); + goto err_report; + } + + input_line_pointer++; + + /* Parse !sequence_number */ + expression (tok); + if (tok->X_op != O_constant || tok->X_add_number <= 0) + { + as_bad (_("Bad sequence number: !%s!%s"), + r->name, input_line_pointer); + goto err_report; + } } tok->X_op = r->op; reloc_found_p = 1; ++tok; break; -#endif +#endif /* RELOC_OP_P */ case ',': ++input_line_pointer; @@ -2048,18 +1956,25 @@ fini: #ifdef DEBUG_ALPHA debug_exp (orig_tok, ntok - (end_tok - tok)); #endif +#ifdef RELOC_OP_P + is_end_of_line[(unsigned char) '!'] = 0; +#endif return ntok - (end_tok - tok); err: +#ifdef RELOC_OP_P + is_end_of_line[(unsigned char) '!'] = 0; +#endif input_line_pointer = old_input_line_pointer; return TOKENIZE_ERROR; -#ifdef RELOC_OP_P err_report: +#ifdef RELOC_OP_P + is_end_of_line[(unsigned char) '!'] = 0; +#endif input_line_pointer = old_input_line_pointer; return TOKENIZE_ERROR_REPORT; -#endif } /* Search forward through all variants of an opcode looking for a @@ -2247,7 +2162,6 @@ find_macro_match (first_macro, tok, pntok) case O_register: case O_pregister: case O_cpregister: -#ifdef RELOC_OP_P case O_literal: case O_lituse_base: case O_lituse_bytoff: @@ -2255,7 +2169,7 @@ find_macro_match (first_macro, tok, pntok) case O_gpdisp: case O_gprelhigh: case O_gprellow: -#endif + case O_gprel: goto match_failed; default: @@ -2264,38 +2178,6 @@ find_macro_match (first_macro, tok, pntok) ++tokidx; break; - /* optional !literal! */ - case MACRO_LITERAL: -#ifdef RELOC_OP_P - if (tokidx < ntok && tok[tokidx].X_op == O_literal) - tokidx++; -#endif - break; - - /* optional !lituse_base! */ - case MACRO_BASE: -#ifdef RELOC_OP_P - if (tokidx < ntok && tok[tokidx].X_op == O_lituse_base) - tokidx++; -#endif - break; - - /* optional !lituse_bytoff! */ - case MACRO_BYTOFF: -#ifdef RELOC_OP_P - if (tokidx < ntok && tok[tokidx].X_op == O_lituse_bytoff) - tokidx++; -#endif - break; - - /* optional !lituse_jsr! */ - case MACRO_JSR: -#ifdef RELOC_OP_P - if (tokidx < ntok && tok[tokidx].X_op == O_lituse_jsr) - tokidx++; -#endif - break; - match_failed: while (*arg != MACRO_EOA) ++arg; @@ -2370,12 +2252,15 @@ insert_operand (insn, operand, val, file, line) */ static void -assemble_insn (opcode, tok, ntok, insn) +assemble_insn (opcode, tok, ntok, insn, reloc) const struct alpha_opcode *opcode; const expressionS *tok; int ntok; struct alpha_insn *insn; + bfd_reloc_code_real_type reloc; { + const struct alpha_operand *reloc_operand = NULL; + const expressionS *reloc_exp = NULL; const unsigned char *argidx; unsigned image; int tokidx = 0; @@ -2431,24 +2316,85 @@ assemble_insn (opcode, tok, ntok, insn) case O_constant: image = insert_operand (image, operand, t->X_add_number, NULL, 0); + assert (reloc_operand == NULL); + reloc_operand = operand; + reloc_exp = t; break; default: - { - struct alpha_fixup *fixup; + /* This is only 0 for fields that should contain registers, + which means this pattern shouldn't have matched. */ + if (operand->default_reloc == 0) + abort (); - if (insn->nfixups >= MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); + /* There is one special case for which an insn receives two + relocations, and thus the user-supplied reloc does not + override the operand reloc. */ + if (operand->default_reloc == BFD_RELOC_ALPHA_HINT) + { + struct alpha_fixup *fixup; - fixup = &insn->fixups[insn->nfixups++]; + if (insn->nfixups >= MAX_INSN_FIXUPS) + as_fatal (_("too many fixups")); - fixup->exp = *t; - fixup->reloc = operand->default_reloc; - } + fixup = &insn->fixups[insn->nfixups++]; + fixup->exp = *t; + fixup->reloc = BFD_RELOC_ALPHA_HINT; + } + else + { + if (reloc == BFD_RELOC_UNUSED) + reloc = operand->default_reloc; + + assert (reloc_operand == NULL); + reloc_operand = operand; + reloc_exp = t; + } break; } } + if (reloc != BFD_RELOC_UNUSED) + { + struct alpha_fixup *fixup; + + if (insn->nfixups >= MAX_INSN_FIXUPS) + as_fatal (_("too many fixups")); + + /* ??? My but this is hacky. But the OSF/1 assembler uses the same + relocation tag for both ldah and lda with gpdisp. Choose the + correct internal relocation based on the opcode. */ + if (reloc == BFD_RELOC_ALPHA_GPDISP) + { + if (strcmp (opcode->name, "ldah") == 0) + reloc = BFD_RELOC_ALPHA_GPDISP_HI16; + else if (strcmp (opcode->name, "lda") == 0) + reloc = BFD_RELOC_ALPHA_GPDISP_LO16; + else + as_bad (_("invalid relocation for instruction")); + } + + /* If this is a real relocation (as opposed to a lituse hint), then + the relocation width should match the operand width. */ + else if (reloc < BFD_RELOC_UNUSED) + { + reloc_howto_type *reloc_howto + = bfd_reloc_type_lookup (stdoutput, reloc); + if (reloc_howto->bitsize != reloc_operand->bits) + { + as_bad (_("invalid relocation for field")); + return; + } + } + + fixup = &insn->fixups[insn->nfixups++]; + if (reloc_exp) + fixup->exp = *reloc_exp; + else + fixup->exp.X_op = O_absent; + fixup->reloc = reloc; + } + insn->insn = image; } @@ -2483,12 +2429,9 @@ emit_insn (insn) { const struct alpha_operand *operand = (const struct alpha_operand *) 0; struct alpha_fixup *fixup = &insn->fixups[i]; + struct alpha_reloc_tag *info; int size, pcrel; fixS *fixP; -#ifdef RELOC_OP_P - char buffer[ALPHA_RELOC_DIGITS]; - struct alpha_literal_tag *info; -#endif /* Some fixups are only used internally and so have no howto */ if ((int) fixup->reloc < 0) @@ -2497,43 +2440,24 @@ emit_insn (insn) size = 4; pcrel = ((operand->flags & AXP_OPERAND_RELATIVE) != 0); } + else if (fixup->reloc > BFD_RELOC_UNUSED + || fixup->reloc == BFD_RELOC_ALPHA_GPDISP_HI16 + || fixup->reloc == BFD_RELOC_ALPHA_GPDISP_LO16) + { + size = 2; + pcrel = 0; + } else - switch (fixup->reloc) - { -#ifdef OBJ_ELF - /* These relocation types are only used internally. */ - case BFD_RELOC_ALPHA_GPDISP_HI16: - case BFD_RELOC_ALPHA_GPDISP_LO16: - size = 2; - pcrel = 0; - break; -#endif -#ifdef RELOC_OP_P - /* and these also are internal only relocations */ - case BFD_RELOC_ALPHA_USER_LITERAL: - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - case BFD_RELOC_ALPHA_USER_GPDISP: - case BFD_RELOC_ALPHA_USER_GPRELHIGH: - case BFD_RELOC_ALPHA_USER_GPRELLOW: - size = 2; - pcrel = 0; - break; -#endif + { + reloc_howto_type *reloc_howto + = bfd_reloc_type_lookup (stdoutput, fixup->reloc); + assert (reloc_howto); - default: - { - reloc_howto_type *reloc_howto - = bfd_reloc_type_lookup (stdoutput, fixup->reloc); - assert (reloc_howto); + size = bfd_get_reloc_size (reloc_howto); + assert (size >= 1 && size <= 4); - size = bfd_get_reloc_size (reloc_howto); - pcrel = reloc_howto->pc_relative; - } - assert (size >= 1 && size <= 4); - break; - } + pcrel = reloc_howto->pc_relative; + } fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, size, &fixup->exp, pcrel, fixup->reloc); @@ -2542,79 +2466,75 @@ emit_insn (insn) and copy in the sequence number for the explicit relocations. */ switch (fixup->reloc) { - case BFD_RELOC_ALPHA_GPDISP_LO16: -#ifdef OBJ_ECOFF - case BFD_RELOC_ALPHA_LITERAL: -#endif -#ifdef OBJ_ELF - case BFD_RELOC_ALPHA_ELF_LITERAL: -#endif + case BFD_RELOC_ALPHA_HINT: case BFD_RELOC_GPREL32: + case BFD_RELOC_GPREL16: + case BFD_RELOC_ALPHA_GPREL_HI16: + case BFD_RELOC_ALPHA_GPREL_LO16: fixP->fx_no_overflow = 1; break; -#ifdef RELOC_OP_P - case BFD_RELOC_ALPHA_USER_LITERAL: + case BFD_RELOC_ALPHA_GPDISP_HI16: fixP->fx_no_overflow = 1; - sprintf (buffer, "!%u", insn->sequence[i]); - info = ((struct alpha_literal_tag *) - hash_find (alpha_literal_hash, buffer)); + fixP->fx_addsy = section_symbol (now_seg); + fixP->fx_offset = 0; - if (! info) - { - size_t len = strlen (buffer); - const char *errmsg; - - info = ((struct alpha_literal_tag *) - xcalloc (sizeof (struct alpha_literal_tag) + len, 1)); - - info->segment = now_seg; - info->sequence = insn->sequence[i]; - strcpy (info->string, buffer); - errmsg = hash_insert (alpha_literal_hash, info->string, (PTR) info); - if (errmsg) - as_bad (errmsg); - } + info = get_alpha_reloc_tag (insn->sequence); + if (++info->n_master > 1) + as_bad (_("too many ldah insns for !gpdisp!%ld"), insn->sequence); + if (info->segment != now_seg) + as_bad (_("both insns for !gpdisp!%ld must be in the same section"), + insn->sequence); + fixP->tc_fix_data.info = info; + break; - ++info->n_literals; + case BFD_RELOC_ALPHA_GPDISP_LO16: + fixP->fx_no_overflow = 1; + info = get_alpha_reloc_tag (insn->sequence); + if (++info->n_slaves > 1) + as_bad (_("too many lda insns for !gpdisp!%ld"), insn->sequence); if (info->segment != now_seg) - info->multi_section_p = 1; - + as_bad (_("both insns for !gpdisp!%ld must be in the same section"), + insn->sequence); fixP->tc_fix_data.info = info; + info->slaves = fixP; break; - case BFD_RELOC_ALPHA_USER_LITUSE_BASE: - case BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: - case BFD_RELOC_ALPHA_USER_LITUSE_JSR: - sprintf (buffer, "!%u", insn->sequence[i]); - info = ((struct alpha_literal_tag *) - hash_find (alpha_literal_hash, buffer)); + case BFD_RELOC_ALPHA_LITERAL: + case BFD_RELOC_ALPHA_ELF_LITERAL: + fixP->fx_no_overflow = 1; - if (! info) - { - size_t len = strlen (buffer); - const char *errmsg; - - info = ((struct alpha_literal_tag *) - xcalloc (sizeof (struct alpha_literal_tag) + len, 1)); - - info->segment = now_seg; - info->sequence = insn->sequence[i]; - strcpy (info->string, buffer); - errmsg = hash_insert (alpha_literal_hash, info->string, (PTR) info); - if (errmsg) - as_bad (errmsg); - } - info->n_lituses++; - fixP->tc_fix_data.info = info; - fixP->tc_fix_data.next_lituse = info->lituse; - info->lituse = fixP; + info = get_alpha_reloc_tag (insn->sequence); + info->n_master++; if (info->segment != now_seg) info->multi_section_p = 1; + fixP->tc_fix_data.info = info; + break; + case DUMMY_RELOC_LITUSE_ADDR: + fixP->fx_offset = LITUSE_ADDR; + goto do_lituse; + case DUMMY_RELOC_LITUSE_BASE: + fixP->fx_offset = LITUSE_BASE; + goto do_lituse; + case DUMMY_RELOC_LITUSE_BYTOFF: + fixP->fx_offset = LITUSE_BYTOFF; + goto do_lituse; + case DUMMY_RELOC_LITUSE_JSR: + fixP->fx_offset = LITUSE_JSR; + do_lituse: + fixP->fx_addsy = section_symbol (now_seg); + fixP->fx_r_type = BFD_RELOC_ALPHA_LITUSE; + + info = get_alpha_reloc_tag (insn->sequence); + info->n_slaves++; + fixP->tc_fix_data.info = info; + fixP->tc_fix_data.next_reloc = info->slaves; + info->slaves = fixP; + if (info->segment != now_seg) + info->multi_section_p = 1; break; -#endif default: if ((int) fixup->reloc < 0) @@ -2650,7 +2570,7 @@ assemble_tokens_to_insn (opname, tok, ntok, insn) opcode = find_opcode_match (opcode, tok, &ntok, &cpumatch); if (opcode) { - assemble_insn (opcode, tok, ntok, insn); + assemble_insn (opcode, tok, ntok, insn, BFD_RELOC_UNUSED); return; } else if (cpumatch) @@ -2677,9 +2597,15 @@ assemble_tokens (opname, tok, ntok, local_macros_on) const struct alpha_opcode *opcode; const struct alpha_macro *macro; int cpumatch = 1; + bfd_reloc_code_real_type reloc = BFD_RELOC_UNUSED; - /* search macros */ - if (local_macros_on) + /* If a user-specified relocation is present, this is not a macro. */ + if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) + { + reloc = ALPHA_RELOC_TABLE (tok[ntok - 1].X_op)->reloc; + ntok--; + } + else if (local_macros_on) { macro = ((const struct alpha_macro *) hash_find (alpha_macro_hash, opname)); @@ -2695,17 +2621,6 @@ assemble_tokens (opname, tok, ntok, local_macros_on) } } -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, opname); - ntok--; - } -#endif - /* search opcodes */ opcode = (const struct alpha_opcode *) hash_find (alpha_opcode_hash, opname); if (opcode) @@ -2715,18 +2630,25 @@ assemble_tokens (opname, tok, ntok, local_macros_on) if (opcode) { struct alpha_insn insn; - assemble_insn (opcode, tok, ntok, &insn); + assemble_insn (opcode, tok, ntok, &insn, reloc); + + /* Copy the sequence number for the reloc from the reloc token. */ + if (reloc != BFD_RELOC_UNUSED) + insn.sequence = tok[ntok].X_add_number; + emit_insn (&insn); return; } } if (found_something) - if (cpumatch) - as_bad (_("inappropriate arguments for opcode `%s'"), opname); - else - as_bad (_("opcode `%s' not supported for target %s"), opname, - alpha_target_name); + { + if (cpumatch) + as_bad (_("inappropriate arguments for opcode `%s'"), opname); + else + as_bad (_("opcode `%s' not supported for target %s"), opname, + alpha_target_name); + } else as_bad (_("unknown opcode `%s'"), opname); } @@ -2761,17 +2683,6 @@ FIXME expressionS newtok[3]; expressionS addend; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, "ldgp"); - ntok--; - } -#endif - #ifdef OBJ_ECOFF if (regno (tok[2].X_add_number) == AXP_REG_PV) ecoff_set_gp_prolog_size (0); @@ -2795,6 +2706,7 @@ FIXME insn.nfixups = 1; insn.fixups[0].exp = addend; insn.fixups[0].reloc = BFD_RELOC_ALPHA_GPDISP_HI16; + insn.sequence = next_sequence_num; emit_insn (&insn); @@ -2809,6 +2721,7 @@ FIXME insn.nfixups = 1; insn.fixups[0].exp = addend; insn.fixups[0].reloc = BFD_RELOC_ALPHA_GPDISP_LO16; + insn.sequence = next_sequence_num--; emit_insn (&insn); #endif /* OBJ_ECOFF || OBJ_ELF */ @@ -2888,18 +2801,18 @@ add_to_link_pool (basesym, sym, addend) If explicit relocations of the form !literal! are allowed, and used, then explict_reloc with be an expression pointer. - Finally, the return value is true if the calling macro may emit a - LITUSE reloc if otherwise appropriate. */ + Finally, the return value is nonzero if the calling macro may emit + a LITUSE reloc if otherwise appropriate; the return value is the + sequence number to use. */ -static int -load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) +static long +load_expression (targreg, exp, pbasereg, poffset) int targreg; const expressionS *exp; int *pbasereg; expressionS *poffset; - const expressionS *explicit_reloc; { - int emit_lituse = 0; + long emit_lituse = 0; offsetT addend = exp->X_add_number; int basereg = *pbasereg; struct alpha_insn insn; @@ -2949,9 +2862,9 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) assemble_tokens_to_insn ("ldq", newtok, 3, &insn); - assert (explicit_reloc == (const expressionS *) 0); assert (insn.nfixups == 1); insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL; + insn.sequence = emit_lituse = next_sequence_num--; #endif /* OBJ_ECOFF */ #ifdef OBJ_ELF /* emit "ldq r, gotoff(gp)" */ @@ -2988,25 +2901,14 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) assemble_tokens_to_insn ("ldq", newtok, 3, &insn); assert (insn.nfixups == 1); - if (!explicit_reloc) - insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL; - else - { -#ifdef RELOC_OP_P - insn.fixups[0].reloc - = (ALPHA_RELOC_TABLE (explicit_reloc->X_op))->reloc; - insn.sequence[0] = explicit_reloc->X_add_number; -#else - abort (); -#endif - } + insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL; + insn.sequence = emit_lituse = next_sequence_num--; #endif /* OBJ_ELF */ #ifdef OBJ_EVAX offsetT link; /* Find symbol or symbol pointer in link section. */ - assert (explicit_reloc == (const expressionS *) 0); if (exp->X_add_symbol == alpha_evax_proc.symbol) { if (range_signed_16 (addend)) @@ -3048,8 +2950,6 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) emit_insn (&insn); #ifndef OBJ_EVAX - emit_lituse = 1; - if (basereg != alpha_gp_register && basereg != AXP_REG_ZERO) { /* emit "addq r, base, r" */ @@ -3065,14 +2965,12 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) break; case O_constant: - assert (explicit_reloc == (const expressionS *) 0); break; case O_subtract: /* Assume that this difference expression will be resolved to an absolute value and that that value will fit in 16 bits. */ - assert (explicit_reloc == (const expressionS *) 0); set_tok_reg (newtok[0], targreg); newtok[1] = *exp; set_tok_preg (newtok[2], basereg); @@ -3099,8 +2997,9 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) if (!range_signed_32 (addend)) { offsetT lit; + long seq_num = next_sequence_num--; - /* for 64-bit addends, just put it in the literal pool */ + /* For 64-bit addends, just put it in the literal pool. */ #ifdef OBJ_EVAX /* emit "ldq targreg, lit(basereg)" */ @@ -3160,6 +3059,7 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) #ifdef OBJ_ELF insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL; #endif + insn.sequence = seq_num; emit_insn (&insn); @@ -3171,16 +3071,10 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) assemble_tokens_to_insn ("ldq", newtok, 3, &insn); assert (insn.nfixups < MAX_INSN_FIXUPS); - if (insn.nfixups > 0) - { - memmove (&insn.fixups[1], &insn.fixups[0], - sizeof (struct alpha_fixup) * insn.nfixups); - } + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; insn.nfixups++; - insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE; - insn.fixups[0].exp.X_op = O_symbol; - insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[0].exp.X_add_number = LITUSE_BASE; + insn.sequence = seq_num; emit_lituse = 0; emit_insn (&insn); @@ -3260,66 +3154,19 @@ load_expression (targreg, exp, pbasereg, poffset, explicit_reloc) large constants. */ static void -emit_lda (tok, ntok, opname) +emit_lda (tok, ntok, unused) const expressionS *tok; int ntok; - const PTR opname; + const PTR unused ATTRIBUTE_UNUSED; { int basereg; - const expressionS *reloc = (const expressionS *) 0; - -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const struct alpha_reloc_op_tag *r; - - reloc = &tok[ntok - 1]; - r = ALPHA_RELOC_TABLE (reloc->X_op); - switch (reloc->X_op) - { - default: - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc->X_add_number, (const char *) opname); - - reloc = (const expressionS *) 0; - ntok--; - break; - - case O_literal: - ntok--; - break; - - /* For lda $x,0($x)!lituse_base!y, don't use load_expression, since - it is really too general for our needs. Instead just generate the - lda directly. */ - case O_lituse_base: - if (ntok != 4 - || tok[0].X_op != O_register - || !is_ir_num (tok[0].X_add_number) - || tok[1].X_op != O_constant - || tok[2].X_op != O_pregister - || !is_ir_num (tok[2].X_add_number)) - { - as_bad (_("bad instruction format for lda !%s!%ld"), r->name, - (long) reloc->X_add_number); - - reloc = (const expressionS *) 0; - ntok--; - break; - } - - emit_loadstore (tok, ntok, "lda"); - return; - } - } -#endif if (ntok == 2) basereg = (tok[1].X_op == O_constant ? AXP_REG_ZERO : alpha_gp_register); else basereg = tok[2].X_add_number; - (void) load_expression (tok[0].X_add_number, &tok[1], &basereg, NULL, reloc); + (void) load_expression (tok[0].X_add_number, &tok[1], &basereg, NULL); } /* The ldah macro differs from the ldah instruction in that it has $31 @@ -3333,17 +3180,6 @@ emit_ldah (tok, ntok, unused) { expressionS newtok[3]; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, "ldah"); - ntok--; - } -#endif - newtok[0] = tok[0]; newtok[1] = tok[1]; set_tok_preg (newtok[2], AXP_REG_ZERO); @@ -3361,83 +3197,31 @@ emit_ir_load (tok, ntok, opname) int ntok; const PTR opname; { - int basereg, lituse; + int basereg; + long lituse; expressionS newtok[3]; struct alpha_insn insn; -#ifdef RELOC_OP_P - const expressionS *reloc = (const expressionS *) 0; - - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const struct alpha_reloc_op_tag *r; - - reloc = &tok[ntok - 1]; - switch (reloc->X_op) - { - case O_lituse_base: - ntok--; - break; - - case O_literal: - if (strcmp ((const char *) opname, "ldq") == 0) - { - emit_lda (tok, ntok, opname); - return; - } - - /* fall through */ - default: - ntok--; - r = ALPHA_RELOC_TABLE (reloc->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc->X_add_number, (const char *) opname); - } - } -#endif - if (ntok == 2) basereg = (tok[1].X_op == O_constant ? AXP_REG_ZERO : alpha_gp_register); else basereg = tok[2].X_add_number; lituse = load_expression (tok[0].X_add_number, &tok[1], &basereg, - &newtok[1], (const expressionS *) 0); + &newtok[1]); newtok[0] = tok[0]; set_tok_preg (newtok[2], basereg); assemble_tokens_to_insn ((const char *) opname, newtok, 3, &insn); -#ifdef RELOC_OP_P - if (reloc) - { - int nfixups = insn.nfixups; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc->X_op); - - assert (nfixups < MAX_INSN_FIXUPS); - insn.fixups[nfixups].reloc = r->reloc; - insn.fixups[nfixups].exp.X_op = O_symbol; - insn.fixups[nfixups].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[nfixups].exp.X_add_number = r->lituse; - insn.sequence[nfixups] = reloc->X_add_number; - insn.nfixups++; - } -#endif - if (lituse) { assert (insn.nfixups < MAX_INSN_FIXUPS); - if (insn.nfixups > 0) - { - memmove (&insn.fixups[1], &insn.fixups[0], - sizeof (struct alpha_fixup) * insn.nfixups); - } + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; insn.nfixups++; - insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE; - insn.fixups[0].exp.X_op = O_symbol; - insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[0].exp.X_add_number = LITUSE_BASE; + insn.sequence = lituse; } emit_insn (&insn); @@ -3452,25 +3236,11 @@ emit_loadstore (tok, ntok, opname) int ntok; const PTR opname; { - int basereg, lituse; + int basereg; + long lituse; expressionS newtok[3]; struct alpha_insn insn; -#ifdef RELOC_OP_P - const expressionS *reloc = (const expressionS *) 0; - - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - reloc = &tok[--ntok]; - if (reloc->X_op != O_lituse_base) - { - const struct alpha_reloc_op_tag *r = &alpha_reloc_op[reloc->X_md]; - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc->X_add_number, (const char *) opname); - } - } -#endif - if (ntok == 2) basereg = (tok[1].X_op == O_constant ? AXP_REG_ZERO : alpha_gp_register); else @@ -3481,8 +3251,7 @@ emit_loadstore (tok, ntok, opname) if (alpha_noat_on) as_bad (_("macro requires $at register while noat in effect")); - lituse = load_expression (AXP_REG_AT, &tok[1], &basereg, &newtok[1], - (const expressionS *) 0); + lituse = load_expression (AXP_REG_AT, &tok[1], &basereg, &newtok[1]); } else { @@ -3495,35 +3264,13 @@ emit_loadstore (tok, ntok, opname) assemble_tokens_to_insn ((const char *) opname, newtok, 3, &insn); -#ifdef RELOC_OP_P - if (reloc) - { - int nfixups = insn.nfixups; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc->X_op); - - assert (nfixups < MAX_INSN_FIXUPS); - insn.fixups[nfixups].reloc = r->reloc; - insn.fixups[nfixups].exp.X_op = O_symbol; - insn.fixups[nfixups].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[nfixups].exp.X_add_number = r->lituse; - insn.sequence[nfixups] = reloc->X_add_number; - insn.nfixups++; - } -#endif - if (lituse) { assert (insn.nfixups < MAX_INSN_FIXUPS); - if (insn.nfixups > 0) - { - memmove (&insn.fixups[1], &insn.fixups[0], - sizeof (struct alpha_fixup) * insn.nfixups); - } + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; insn.nfixups++; - insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE; - insn.fixups[0].exp.X_op = O_symbol; - insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[0].exp.X_add_number = LITUSE_BASE; + insn.sequence = lituse; } emit_insn (&insn); @@ -3542,41 +3289,57 @@ emit_ldXu (tok, ntok, vlgsize) else { expressionS newtok[3]; - -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r - = ALPHA_RELOC_TABLE (reloc_exp->X_op); - - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, "ldbu/ldwu"); - ntok--; - } -#endif + struct alpha_insn insn; + int basereg; + long lituse; if (alpha_noat_on) as_bad (_("macro requires $at register while noat in effect")); + if (ntok == 2) + basereg = (tok[1].X_op == O_constant + ? AXP_REG_ZERO : alpha_gp_register); + else + basereg = tok[2].X_add_number; + /* emit "lda $at, exp" */ - memcpy (newtok, tok, sizeof (expressionS) * ntok); - newtok[0].X_add_number = AXP_REG_AT; - assemble_tokens ("lda", newtok, ntok, 1); + lituse = load_expression (AXP_REG_AT, &tok[1], &basereg, NULL); /* emit "ldq_u targ, 0($at)" */ newtok[0] = tok[0]; set_tok_const (newtok[1], 0); - set_tok_preg (newtok[2], AXP_REG_AT); - assemble_tokens ("ldq_u", newtok, 3, 1); + set_tok_preg (newtok[2], basereg); + assemble_tokens_to_insn ("ldq_u", newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); /* emit "extXl targ, $at, targ" */ - set_tok_reg (newtok[1], AXP_REG_AT); + set_tok_reg (newtok[1], basereg); newtok[2] = newtok[0]; - assemble_tokens (extXl_op[(long) vlgsize], newtok, 3, 1); + assemble_tokens_to_insn (extXl_op[(long) vlgsize], newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); } } @@ -3671,17 +3434,6 @@ emit_ldil (tok, ntok, unused) { expressionS newtok[2]; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, "ldil"); - ntok--; - } -#endif - memcpy (newtok, tok, sizeof (newtok)); newtok[1].X_add_number = sign_extend_32 (tok[1].X_add_number); @@ -3703,35 +3455,75 @@ emit_stX (tok, ntok, vlgsize) else { expressionS newtok[3]; + struct alpha_insn insn; + int basereg; + long lituse; if (alpha_noat_on) as_bad (_("macro requires $at register while noat in effect")); + if (ntok == 2) + basereg = (tok[1].X_op == O_constant + ? AXP_REG_ZERO : alpha_gp_register); + else + basereg = tok[2].X_add_number; + /* emit "lda $at, exp" */ - memcpy (newtok, tok, sizeof (expressionS) * ntok); - newtok[0].X_add_number = AXP_REG_AT; - assemble_tokens ("lda", newtok, ntok, 1); + lituse = load_expression (AXP_REG_AT, &tok[1], &basereg, NULL); /* emit "ldq_u $t9, 0($at)" */ set_tok_reg (newtok[0], AXP_REG_T9); set_tok_const (newtok[1], 0); - set_tok_preg (newtok[2], AXP_REG_AT); - assemble_tokens ("ldq_u", newtok, 3, 1); + set_tok_preg (newtok[2], basereg); + assemble_tokens_to_insn ("ldq_u", newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); /* emit "insXl src, $at, $t10" */ newtok[0] = tok[0]; - set_tok_reg (newtok[1], AXP_REG_AT); + set_tok_reg (newtok[1], basereg); set_tok_reg (newtok[2], AXP_REG_T10); - assemble_tokens (insXl_op[lgsize], newtok, 3, 1); + assemble_tokens_to_insn (insXl_op[lgsize], newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); /* emit "mskXl $t9, $at, $t9" */ set_tok_reg (newtok[0], AXP_REG_T9); newtok[2] = newtok[0]; - assemble_tokens (mskXl_op[lgsize], newtok, 3, 1); + assemble_tokens_to_insn (mskXl_op[lgsize], newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); /* emit "or $t9, $t10, $t9" */ @@ -3740,9 +3532,20 @@ emit_stX (tok, ntok, vlgsize) /* emit "stq_u $t9, 0($at) */ - set_tok_const (newtok[1], 0); + set_tok_const(newtok[1], 0); set_tok_preg (newtok[2], AXP_REG_AT); - assemble_tokens ("stq_u", newtok, 3, 1); + assemble_tokens_to_insn ("stq_u", newtok, 3, &insn); + + if (lituse) + { + assert (insn.nfixups < MAX_INSN_FIXUPS); + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE; + insn.fixups[insn.nfixups].exp.X_op = O_absent; + insn.nfixups++; + insn.sequence = lituse; + } + + emit_insn (&insn); } } @@ -3846,19 +3649,6 @@ emit_sextX (tok, ntok, vlgsize) int bitshift = 64 - 8 * (1 << lgsize); expressionS newtok[3]; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r - = ALPHA_RELOC_TABLE (reloc_exp->X_op); - - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, "setxt"); - ntok--; - } -#endif - /* emit "sll src,bits,dst" */ newtok[0] = tok[0]; @@ -3905,17 +3695,6 @@ emit_division (tok, ntok, symname) symbolS *sym; expressionS newtok[3]; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, (char char *) symname); - ntok--; - } -#endif - xr = regno (tok[0].X_add_number); yr = regno (tok[1].X_add_number); @@ -4015,17 +3794,6 @@ emit_division (tok, ntok, symname) symbolS *sym; expressionS newtok[3]; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, (const char *) symname); - ntok--; - } -#endif - xr = regno (tok[0].X_add_number); yr = regno (tok[1].X_add_number); @@ -4120,18 +3888,8 @@ emit_jsrjmp (tok, ntok, vopname) const char *opname = (const char *) vopname; struct alpha_insn insn; expressionS newtok[3]; - int r, tokidx = 0, lituse = 0; - -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, opname); - ntok--; - } -#endif + int r, tokidx = 0; + long lituse = 0; if (tokidx < ntok && tok[tokidx].X_op == O_register) r = regno (tok[tokidx++].X_add_number); @@ -4149,8 +3907,7 @@ emit_jsrjmp (tok, ntok, vopname) else { int basereg = alpha_gp_register; - lituse = load_expression (r = AXP_REG_PV, &tok[tokidx], &basereg, NULL, - (const expressionS *) 0); + lituse = load_expression (r = AXP_REG_PV, &tok[tokidx], &basereg, NULL); } #endif @@ -4167,20 +3924,13 @@ emit_jsrjmp (tok, ntok, vopname) assemble_tokens_to_insn (opname, newtok, 3, &insn); - /* add the LITUSE fixup */ if (lituse) { assert (insn.nfixups < MAX_INSN_FIXUPS); - if (insn.nfixups > 0) - { - memmove (&insn.fixups[1], &insn.fixups[0], - sizeof (struct alpha_fixup) * insn.nfixups); - } + insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_JSR; + insn.fixups[insn.nfixups].exp.X_op = O_absent; insn.nfixups++; - insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITUSE; - insn.fixups[0].exp.X_op = O_symbol; - insn.fixups[0].exp.X_add_symbol = section_symbol (now_seg); - insn.fixups[0].exp.X_add_number = LITUSE_JSR; + insn.sequence = lituse; } emit_insn (&insn); @@ -4199,17 +3949,6 @@ emit_retjcr (tok, ntok, vopname) expressionS newtok[3]; int r, tokidx = 0; -#ifdef RELOC_OP_P - if (ntok && USER_RELOC_P (tok[ntok - 1].X_op)) - { - const expressionS *reloc_exp = &tok[ntok - 1]; - const struct alpha_reloc_op_tag *r = ALPHA_RELOC_TABLE (reloc_exp->X_op); - as_bad (_("Cannot use !%s!%d with %s"), r->name, - (int) reloc_exp->X_add_number, opname); - ntok--; - } -#endif - if (tokidx < ntok && tok[tokidx].X_op == O_register) r = regno (tok[tokidx++].X_add_number); else @@ -4472,7 +4211,7 @@ s_alpha_ent (dummy) input_line_pointer++; SKIP_WHITESPACE (); } - if (isdigit (*input_line_pointer) || *input_line_pointer == '-') + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') (void) get_absolute_expression (); } demand_empty_rest_of_line (); @@ -5657,6 +5396,34 @@ select_gp_value () } #endif /* OBJ_ECOFF */ +#ifdef OBJ_ELF +/* Map 's' to SHF_ALPHA_GPREL. */ + +int +alpha_elf_section_letter (letter, ptr_msg) + int letter; + char **ptr_msg; +{ + if (letter == 's') + return SHF_ALPHA_GPREL; + + *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S in string"); + return 0; +} + +/* Map SHF_ALPHA_GPREL to SEC_SMALL_DATA. */ + +flagword +alpha_elf_section_flags (flags, attr, type) + flagword flags; + int attr, type ATTRIBUTE_UNUSED; +{ + if (attr & SHF_ALPHA_GPREL) + flags |= SEC_SMALL_DATA; + return flags; +} +#endif /* OBJ_ELF */ + /* Called internally to handle all alignment needs. This takes care of eliding calls to frag_align if'n the cached current alignment says we've already got it, as well as taking care of the auto-align @@ -5703,10 +5470,10 @@ void alpha_handle_align (fragp) fragS *fragp; { - static char const unop[4] = { 0x00, 0x00, 0xe0, 0x2f }; + static char const unop[4] = { 0x00, 0x00, 0xfe, 0x2f }; static char const nopunop[8] = { 0x1f, 0x04, 0xff, 0x47, - 0x00, 0x00, 0xe0, 0x2f + 0x00, 0x00, 0xfe, 0x2f }; int bytes, fix; diff --git a/contrib/binutils/gas/config/tc-alpha.h b/contrib/binutils/gas/config/tc-alpha.h index 2fe20b7..fb428f9 100644 --- a/contrib/binutils/gas/config/tc-alpha.h +++ b/contrib/binutils/gas/config/tc-alpha.h @@ -1,5 +1,5 @@ /* This file is tc-alpha.h - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ken Raeburn . @@ -37,7 +37,6 @@ : "unknown-format") #define NEED_LITERAL_POOL -#define TC_HANDLES_FX_DONE #define REPEAT_CONS_EXPRESSIONS extern int alpha_force_relocation PARAMS ((struct fix *)); @@ -64,7 +63,7 @@ extern valueT alpha_gp_value; #define md_convert_frag(b,s,f) as_fatal ("alpha convert_frag\n") #define md_estimate_size_before_relax(f,s) \ - (as_fatal("estimate_size_before_relax called"),1) + (as_fatal ("estimate_size_before_relax called"),1) #define md_operand(x) #ifdef OBJ_EVAX @@ -107,6 +106,11 @@ extern void alpha_frob_file_before_adjust PARAMS ((void)); #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 }, + +#define md_elf_section_letter alpha_elf_section_letter +extern int alpha_elf_section_letter PARAMS ((int, char **)); +#define md_elf_section_flags alpha_elf_section_flags +extern flagword alpha_elf_section_flags PARAMS ((flagword, int, int)); #endif /* Whether to add support for explict !relocation_op!sequence_number. At the @@ -116,11 +120,10 @@ extern void alpha_frob_file_before_adjust PARAMS ((void)); #define RELOC_OP_P #endif -#ifdef RELOC_OP_P -/* Before the relocations are written, reorder them, so that user supplied - !lituse relocations follow the appropriate !literal relocations. Also - convert the gas-internal relocations to the appropriate linker relocations. - */ +/* Before the relocations are written, reorder them, so that user + supplied !lituse relocations follow the appropriate !literal + relocations. Also convert the gas-internal relocations to the + appropriate linker relocations. */ #define tc_adjust_symtab() alpha_adjust_symtab () extern void alpha_adjust_symtab PARAMS ((void)); @@ -132,14 +135,14 @@ extern void alpha_adjust_symtab PARAMS ((void)); struct alpha_fix_tag { - struct fix *next_lituse; /* next !lituse */ - struct alpha_literal_tag *info; /* other members with same sequence */ + struct fix *next_reloc; /* next !lituse or !gpdisp */ + struct alpha_reloc_tag *info; /* other members with same sequence */ }; /* Initialize the TC_FIX_TYPE field. */ #define TC_INIT_FIX_DATA(fixP) \ do { \ - fixP->tc_fix_data.next_lituse = (struct fix *)0; \ + fixP->tc_fix_data.next_reloc = (struct fix *)0; \ fixP->tc_fix_data.info = (struct alpha_literal_tag *)0; \ } while (0) @@ -147,10 +150,9 @@ do { \ #define TC_FIX_DATA_PRINT(stream,fixP) \ do { \ if (fixP->tc_fix_data.info) \ - fprintf (stderr, "\tinfo = 0x%lx, next_lituse = 0x%lx\n", \ + fprintf (stderr, "\tinfo = 0x%lx, next_reloc = 0x%lx\n", \ (long)fixP->tc_fix_data.info, \ - (long)fixP->tc_fix_data.next_lituse); \ + (long)fixP->tc_fix_data.next_reloc); \ } while (0) -#endif #define DWARF2_LINE_MIN_INSN_LENGTH 4 diff --git a/contrib/binutils/gas/config/tc-arc.c b/contrib/binutils/gas/config/tc-arc.c index 45f54ac..3e829fa 100644 --- a/contrib/binutils/gas/config/tc-arc.c +++ b/contrib/binutils/gas/config/tc-arc.c @@ -21,9 +21,9 @@ 02111-1307, USA. */ #include -#include #include "libiberty.h" #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "opcode/arc.h" #include "../opcodes/arc-ext.h" @@ -46,9 +46,11 @@ static void arc_common PARAMS ((int)); static void arc_extinst PARAMS ((int)); static void arc_extoper PARAMS ((int)); static void arc_option PARAMS ((int)); -static int get_arc_exp_reloc_type PARAMS ((int, int, expressionS *, +static int get_arc_exp_reloc_type PARAMS ((int, int, expressionS *, expressionS *)); +static void init_opcode_tables PARAMS ((int)); + const struct suffix_classes { char *name; int len; @@ -393,7 +395,7 @@ md_assemble (str) } /* Skip leading white space. */ - while (isspace (*str)) + while (ISSPACE (*str)) str++; /* The instructions are stored in lists hashed by the first letter (though @@ -544,7 +546,7 @@ md_assemble (str) } /* Pick the suffix out and look it up via the hash table. */ - for (t = s; *t && isalnum (*t); ++t) + for (t = s; *t && ISALNUM (*t); ++t) continue; c = *t; *t = '\0'; @@ -736,7 +738,7 @@ md_assemble (str) 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)) + while (ISSPACE (*str)) ++str; if (!is_end_of_line[(unsigned char) *str]) @@ -832,7 +834,7 @@ md_assemble (str) operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting - feature. We pick a BFD reloc type in md_apply_fix. + feature. We pick a BFD reloc type in md_apply_fix3. Limm values (4 byte immediate "constants") must be treated normally because they're not part of the actual insn word @@ -913,8 +915,7 @@ arc_extoper (opertype) p = name; while (*p) { - if (isupper (*p)) - *p = tolower (*p); + *p = TOLOWER (*p); p++; } @@ -1538,7 +1539,7 @@ arc_option (ignore) char * md_atof (type, litP, sizeP) - char type; + int type; char *litP; int *sizeP; { @@ -1546,7 +1547,7 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE *wordP; char *t; - char *atof_ieee (); + char * atof_ieee PARAMS ((char *, int, LITTLENUM_TYPE *)); switch (type) { @@ -1631,9 +1632,7 @@ void arc_code_symbol (expressionP) expressionS *expressionP; { - 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) + if (expressionP->X_op == O_symbol && expressionP->X_add_number == 0) { expressionS two; expressionP->X_op = O_right_shift; @@ -1703,7 +1702,7 @@ md_operand (expressionP) while (ext_oper) { l = strlen (ext_oper->operand.name); - if (!strncmp (p, ext_oper->operand.name, l) && !isalnum(*(p + l))) + if (!strncmp (p, ext_oper->operand.name, l) && !ISALNUM (*(p + l))) { input_line_pointer += l + 1; expressionP->X_op = O_register; @@ -1715,7 +1714,7 @@ md_operand (expressionP) for (i = 0; i < arc_reg_names_count; i++) { l = strlen (arc_reg_names[i].name); - if (!strncmp (p, arc_reg_names[i].name, l) && !isalnum (*(p + l))) + if (!strncmp (p, arc_reg_names[i].name, l) && !ISALNUM (*(p + l))) { input_line_pointer += l + 1; expressionP->X_op = O_register; @@ -1881,16 +1880,16 @@ get_arc_exp_reloc_type (data_p, default_type, exp, expnew) 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) +void +md_apply_fix3 (fixP, valP, seg) fixS *fixP; - valueT *valueP; + valueT * valP; segT seg; { #if 0 char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; #endif - valueT value; + valueT value = * valP; /* FIXME FIXME FIXME: The value we are passed in *valueP includes the symbol values. Since we are using BFD_ASSEMBLER, if we are @@ -1904,13 +1903,10 @@ md_apply_fix3 (fixP, valueP, seg) result of md_pcrel_from. This is confusing. */ if (fixP->fx_addsy == (symbolS *) NULL) - { - value = *valueP; - fixP->fx_done = 1; - } + 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, @@ -1963,7 +1959,7 @@ md_apply_fix3 (fixP, valueP, seg) if (fixP->fx_done) { /* Nothing else to do here. */ - return 1; + return; } /* Determine a BFD reloc value based on the operand information. @@ -1998,7 +1994,7 @@ md_apply_fix3 (fixP, valueP, seg) as_bad_where (fixP->fx_file, fixP->fx_line, "unresolved expression that must be resolved"); fixP->fx_done = 1; - return 1; + return; } } else @@ -2038,8 +2034,6 @@ md_apply_fix3 (fixP, valueP, seg) } fixP->fx_addnumber = value; - - return 1; } /* Translate internal representation of relocation info to BFD target diff --git a/contrib/binutils/gas/config/tc-arc.h b/contrib/binutils/gas/config/tc-arc.h index 463400c..f144271 100644 --- a/contrib/binutils/gas/config/tc-arc.h +++ b/contrib/binutils/gas/config/tc-arc.h @@ -53,17 +53,13 @@ extern const char *arc_target_format; #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 (); +extern void arc_parse_cons_expression PARAMS ((struct expressionS *, unsigned)); #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \ arc_parse_cons_expression (EXP, NBYTES) -extern void arc_cons_fix_new (); +extern void arc_cons_fix_new PARAMS ((struct frag *, int, int, struct expressionS *)); #define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP) diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c index a6e13a9..456e8c5 100644 --- a/contrib/binutils/gas/config/tc-arm.c +++ b/contrib/binutils/gas/config/tc-arm.c @@ -1,8 +1,9 @@ /* tc-arm.c -- Assemble for the ARM - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) + Cirrus coprocessor mods by Aldy Hernandez (aldyh@redhat.com) This file is part of GAS, the GNU Assembler. @@ -21,10 +22,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #define NO_RELOC 0 #include "as.h" +#include "safe-ctype.h" /* Need TARGET_CPU. */ #include "config.h" @@ -38,84 +39,132 @@ #include "dwarf2dbg.h" #endif -/* Types of processor to assemble for. */ -#define ARM_1 0x00000001 -#define ARM_2 0x00000002 -#define ARM_3 0x00000004 -#define ARM_250 ARM_3 -#define ARM_6 0x00000008 -#define ARM_7 ARM_6 /* Same core instruction set. */ -#define ARM_8 ARM_6 /* Same core instruction set. */ -#define ARM_9 ARM_6 /* Same core instruction set. */ -#define ARM_CPU_MASK 0x0000000f - -/* The following bitmasks control CPU extensions (ARM7 onwards): */ -#define ARM_EXT_LONGMUL 0x00000010 /* Allow long multiplies. */ -#define ARM_EXT_HALFWORD 0x00000020 /* Allow half word loads. */ -#define ARM_EXT_THUMB 0x00000040 /* Allow BX instruction. */ -#define ARM_EXT_V5 0x00000080 /* Allow CLZ, etc. */ -#define ARM_EXT_V5E 0x00000100 /* "El Segundo". */ -#define ARM_EXT_XSCALE 0x00000200 /* Allow MIA etc. */ - -/* Architectures are the sum of the base and extensions. */ -#define ARM_ARCH_V3M ARM_EXT_LONGMUL -#define ARM_ARCH_V4 (ARM_ARCH_V3M | ARM_EXT_HALFWORD) -#define ARM_ARCH_V4T (ARM_ARCH_V4 | ARM_EXT_THUMB) -#define ARM_ARCH_V5 (ARM_ARCH_V4 | ARM_EXT_V5) -#define ARM_ARCH_V5T (ARM_ARCH_V5 | ARM_EXT_THUMB) -#define ARM_ARCH_V5TE (ARM_ARCH_V5T | ARM_EXT_V5E) -#define ARM_ARCH_XSCALE (ARM_ARCH_V5TE | ARM_EXT_XSCALE) +/* XXX Set this to 1 after the next binutils release */ +#define WARN_DEPRECATED 0 + +/* The following bitmasks control CPU extensions: */ +#define ARM_EXT_V1 0x00000001 /* All processors (core set). */ +#define ARM_EXT_V2 0x00000002 /* Multiply instructions. */ +#define ARM_EXT_V2S 0x00000004 /* SWP instructions. */ +#define ARM_EXT_V3 0x00000008 /* MSR MRS. */ +#define ARM_EXT_V3M 0x00000010 /* Allow long multiplies. */ +#define ARM_EXT_V4 0x00000020 /* Allow half word loads. */ +#define ARM_EXT_V4T 0x00000040 /* Thumb v1. */ +#define ARM_EXT_V5 0x00000080 /* Allow CLZ, etc. */ +#define ARM_EXT_V5T 0x00000100 /* Thumb v2. */ +#define ARM_EXT_V5ExP 0x00000200 /* DSP core set. */ +#define ARM_EXT_V5E 0x00000400 /* DSP Double transfers. */ +#define ARM_EXT_V5J 0x00000800 /* Jazelle extension. */ + +/* Co-processor space extensions. */ +#define ARM_CEXT_XSCALE 0x00800000 /* Allow MIA etc. */ +#define ARM_CEXT_MAVERICK 0x00400000 /* Use Cirrus/DSP coprocessor. */ + +/* Architectures are the sum of the base and extensions. The ARM ARM (rev E) + defines the following: ARMv3, ARMv3M, ARMv4xM, ARMv4, ARMv4TxM, ARMv4T, + ARMv5xM, ARMv5, ARMv5TxM, ARMv5T, ARMv5TExP, ARMv5TE. To these we add + three more to cover cores prior to ARM6. Finally, there are cores which + implement further extensions in the co-processor space. */ +#define ARM_ARCH_V1 ARM_EXT_V1 +#define ARM_ARCH_V2 (ARM_ARCH_V1 | ARM_EXT_V2) +#define ARM_ARCH_V2S (ARM_ARCH_V2 | ARM_EXT_V2S) +#define ARM_ARCH_V3 (ARM_ARCH_V2S | ARM_EXT_V3) +#define ARM_ARCH_V3M (ARM_ARCH_V3 | ARM_EXT_V3M) +#define ARM_ARCH_V4xM (ARM_ARCH_V3 | ARM_EXT_V4) +#define ARM_ARCH_V4 (ARM_ARCH_V3M | ARM_EXT_V4) +#define ARM_ARCH_V4TxM (ARM_ARCH_V4xM | ARM_EXT_V4T) +#define ARM_ARCH_V4T (ARM_ARCH_V4 | ARM_EXT_V4T) +#define ARM_ARCH_V5xM (ARM_ARCH_V4xM | ARM_EXT_V5) +#define ARM_ARCH_V5 (ARM_ARCH_V4 | ARM_EXT_V5) +#define ARM_ARCH_V5TxM (ARM_ARCH_V5xM | ARM_EXT_V4T | ARM_EXT_V5T) +#define ARM_ARCH_V5T (ARM_ARCH_V5 | ARM_EXT_V4T | ARM_EXT_V5T) +#define ARM_ARCH_V5TExP (ARM_ARCH_V5T | ARM_EXT_V5ExP) +#define ARM_ARCH_V5TE (ARM_ARCH_V5TExP | ARM_EXT_V5E) +#define ARM_ARCH_V5TEJ (ARM_ARCH_V5TE | ARM_EXT_V5J) + +/* Processors with specific extensions in the co-processor space. */ +#define ARM_ARCH_XSCALE (ARM_ARCH_V5TE | ARM_CEXT_XSCALE) /* Some useful combinations: */ -#define ARM_ANY 0x00ffffff -#define ARM_2UP (ARM_ANY - ARM_1) -#define ARM_ALL ARM_2UP /* Not arm1 only. */ -#define ARM_3UP 0x00fffffc -#define ARM_6UP 0x00fffff8 /* Includes ARM7. */ +#define ARM_ANY 0x0000ffff /* Any basic core. */ +#define ARM_ALL 0x00ffffff /* Any core + co-processor */ +#define CPROC_ANY 0x00ff0000 /* Any co-processor */ +#define FPU_ANY 0xff000000 /* Note this is ~ARM_ALL. */ + + +#define FPU_FPA_EXT_V1 0x80000000 /* Base FPA instruction set. */ +#define FPU_FPA_EXT_V2 0x40000000 /* LFM/SFM. */ +#define FPU_VFP_EXT_NONE 0x20000000 /* Use VFP word-ordering. */ +#define FPU_VFP_EXT_V1xD 0x10000000 /* Base VFP instruction set. */ +#define FPU_VFP_EXT_V1 0x08000000 /* Double-precision insns. */ +#define FPU_VFP_EXT_V2 0x04000000 /* ARM10E VFPr1. */ +#define FPU_NONE 0 + +#define FPU_ARCH_FPE FPU_FPA_EXT_V1 +#define FPU_ARCH_FPA (FPU_ARCH_FPE | FPU_FPA_EXT_V2) -#define FPU_CORE 0x80000000 -#define FPU_FPA10 0x40000000 -#define FPU_FPA11 0x40000000 -#define FPU_NONE 0 +#define FPU_ARCH_VFP FPU_VFP_EXT_NONE +#define FPU_ARCH_VFP_V1xD (FPU_VFP_EXT_V1xD | FPU_VFP_EXT_NONE) +#define FPU_ARCH_VFP_V1 (FPU_ARCH_VFP_V1xD | FPU_VFP_EXT_V1) +#define FPU_ARCH_VFP_V2 (FPU_ARCH_VFP_V1 | FPU_VFP_EXT_V2) -/* Some useful combinations. */ -#define FPU_ALL 0xff000000 /* Note this is ~ARM_ANY. */ -#define FPU_MEMMULTI 0x7f000000 /* Not fpu_core. */ +/* Types of processor to assemble for. */ +#define ARM_1 ARM_ARCH_V1 +#define ARM_2 ARM_ARCH_V2 +#define ARM_3 ARM_ARCH_V2S +#define ARM_250 ARM_ARCH_V2S +#define ARM_6 ARM_ARCH_V3 +#define ARM_7 ARM_ARCH_V3 +#define ARM_8 ARM_ARCH_V4 +#define ARM_9 ARM_ARCH_V4T +#define ARM_STRONG ARM_ARCH_V4 +#define ARM_CPU_MASK 0x0000000f /* XXX? */ #ifndef CPU_DEFAULT #if defined __XSCALE__ -#define CPU_DEFAULT (ARM_9 | ARM_ARCH_XSCALE) +#define CPU_DEFAULT (ARM_ARCH_XSCALE) #else #if defined __thumb__ -#define CPU_DEFAULT (ARM_7 | ARM_ARCH_V4T) +#define CPU_DEFAULT (ARM_ARCH_V5T) #else -#define CPU_DEFAULT ARM_ALL +#define CPU_DEFAULT ARM_ANY #endif #endif #endif +/* For backwards compatibility we default to the FPA. */ #ifndef FPU_DEFAULT -#define FPU_DEFAULT FPU_ALL +#define FPU_DEFAULT FPU_ARCH_FPA #endif #define streq(a, b) (strcmp (a, b) == 0) #define skip_whitespace(str) while (*(str) == ' ') ++(str) -static unsigned long cpu_variant = CPU_DEFAULT | FPU_DEFAULT; +static unsigned long cpu_variant; static int target_oabi = 0; -#if defined OBJ_COFF || defined OBJ_ELF /* Flags stored in private area of BFD structure. */ -static boolean uses_apcs_26 = false; -static boolean atpcs = false; -static boolean support_interwork = false; -static boolean uses_apcs_float = false; -static boolean pic_code = false; -#endif +static int uses_apcs_26 = false; +static int atpcs = false; +static int support_interwork = false; +static int uses_apcs_float = false; +static int pic_code = false; + +/* Variables that we set while parsing command-line options. Once all + options have been read we re-process these values to set the real + assembly flags. */ +static int legacy_cpu = -1; +static int legacy_fpu = -1; + +static int mcpu_cpu_opt = -1; +static int mcpu_fpu_opt = -1; +static int march_cpu_opt = -1; +static int march_fpu_opt = -1; +static int mfpu_opt = -1; /* 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[] = "@"; +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' @@ -124,19 +173,19 @@ CONST char comment_chars[] = "@"; first line of the input file. This is because the compiler outputs #NO_APP at the beginning of its output. */ /* Also note that comments like this one will always work. */ -CONST char line_comment_chars[] = "#"; +const char line_comment_chars[] = "#"; -CONST char line_separator_chars[] = ";"; +const char line_separator_chars[] = ";"; /* Chars that can be used to separate mant from exp in floating point numbers. */ -CONST char EXP_CHARS[] = "eE"; +const char EXP_CHARS[] = "eE"; /* Chars that mean this number is a floating point constant. */ /* As in 0f12.456 */ /* or 0d1.2345e12 */ -CONST char FLT_CHARS[] = "rRsSfFdDxXeEpP"; +const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; /* Prefix characters that indicate the start of an immediate value. */ @@ -148,7 +197,7 @@ symbolS * GOT_symbol; #endif /* Size of relocation record. */ -CONST int md_reloc_size = 8; +const int md_reloc_size = 8; /* 0: assemble for ARM, 1: assemble for Thumb, @@ -163,9 +212,8 @@ typedef struct arm_fix struct arm_it { - CONST char * error; + const char * error; unsigned long instruction; - int suffix; int size; struct { @@ -230,7 +278,7 @@ static const struct asm_shift_name shift_names [] = #define NUM_FLOAT_VALS 8 -CONST char * fp_const[] = +const char * fp_const[] = { "0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0", 0 }; @@ -243,6 +291,10 @@ LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS]; #define FAIL (-1) #define SUCCESS (0) +/* Whether a Co-processor load/store operation accepts write-back forms. */ +#define CP_WB_OK 1 +#define CP_NO_WB 0 + #define SUFF_S 1 #define SUFF_D 2 #define SUFF_E 3 @@ -256,20 +308,19 @@ LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS]; #define CONDS_BIT 0x00100000 #define LOAD_BIT 0x00100000 -#define TRANS_BIT 0x00200000 #define DOUBLE_LOAD_FLAG 0x00000001 struct asm_cond { - CONST char * template; + const char * template; unsigned long value; }; -/* This is to save a hash look-up in the common case. */ #define COND_ALWAYS 0xe0000000 +#define COND_MASK 0xf0000000 -static CONST struct asm_cond conds[] = +static const struct asm_cond conds[] = { {"eq", 0x00000000}, {"ne", 0x10000000}, @@ -289,140 +340,9 @@ static CONST struct asm_cond conds[] = {"nv", 0xf0000000} }; -/* Warning: If the top bit of the set_bits is set, then the standard - instruction bitmask is ignored, and the new bitmask is taken from - the set_bits: */ -struct asm_flg -{ - CONST char * template; /* Basic flag string. */ - unsigned long set_bits; /* Bits to set. */ -}; - -static CONST struct asm_flg s_flag[] = -{ - {"s", CONDS_BIT}, - {NULL, 0} -}; - -static CONST struct asm_flg ldr_flags[] = -{ - {"d", DOUBLE_LOAD_FLAG}, - {"b", 0x00400000}, - {"t", TRANS_BIT}, - {"bt", 0x00400000 | TRANS_BIT}, - {"h", 0x801000b0}, - {"sh", 0x801000f0}, - {"sb", 0x801000d0}, - {NULL, 0} -}; - -static CONST struct asm_flg str_flags[] = -{ - {"d", DOUBLE_LOAD_FLAG}, - {"b", 0x00400000}, - {"t", TRANS_BIT}, - {"bt", 0x00400000 | TRANS_BIT}, - {"h", 0x800000b0}, - {NULL, 0} -}; - -static CONST struct asm_flg byte_flag[] = -{ - {"b", 0x00400000}, - {NULL, 0} -}; - -static CONST struct asm_flg cmp_flags[] = -{ - {"s", CONDS_BIT}, - {"p", 0x0010f000}, - {NULL, 0} -}; - -static CONST struct asm_flg ldm_flags[] = -{ - {"ed", 0x01800000}, - {"fd", 0x00800000}, - {"ea", 0x01000000}, - {"fa", 0x00000000}, - {"ib", 0x01800000}, - {"ia", 0x00800000}, - {"db", 0x01000000}, - {"da", 0x00000000}, - {NULL, 0} -}; - -static CONST struct asm_flg stm_flags[] = -{ - {"ed", 0x00000000}, - {"fd", 0x01000000}, - {"ea", 0x00800000}, - {"fa", 0x01800000}, - {"ib", 0x01800000}, - {"ia", 0x00800000}, - {"db", 0x01000000}, - {"da", 0x00000000}, - {NULL, 0} -}; - -static CONST struct asm_flg lfm_flags[] = -{ - {"fd", 0x00800000}, - {"ea", 0x01000000}, - {NULL, 0} -}; - -static CONST struct asm_flg sfm_flags[] = -{ - {"fd", 0x01000000}, - {"ea", 0x00800000}, - {NULL, 0} -}; - -static CONST struct asm_flg round_flags[] = -{ - {"p", 0x00000020}, - {"m", 0x00000040}, - {"z", 0x00000060}, - {NULL, 0} -}; - -/* The implementation of the FIX instruction is broken on some assemblers, - in that it accepts a precision specifier as well as a rounding specifier, - despite the fact that this is meaningless. To be more compatible, we - accept it as well, though of course it does not set any bits. */ -static CONST struct asm_flg fix_flags[] = -{ - {"p", 0x00000020}, - {"m", 0x00000040}, - {"z", 0x00000060}, - {"sp", 0x00000020}, - {"sm", 0x00000040}, - {"sz", 0x00000060}, - {"dp", 0x00000020}, - {"dm", 0x00000040}, - {"dz", 0x00000060}, - {"ep", 0x00000020}, - {"em", 0x00000040}, - {"ez", 0x00000060}, - {NULL, 0} -}; - -static CONST struct asm_flg except_flag[] = -{ - {"e", 0x00400000}, - {NULL, 0} -}; - -static CONST struct asm_flg cplong_flag[] = -{ - {"l", 0x00400000}, - {NULL, 0} -}; - struct asm_psr { - CONST char * template; + const char * template; boolean cpsr; unsigned long field; }; @@ -438,7 +358,7 @@ struct asm_psr #define PSR_s (1 << 2) #define PSR_f (1 << 3) -static CONST struct asm_psr psrs[] = +static const struct asm_psr psrs[] = { {"CPSR", true, PSR_c | PSR_f}, {"CPSR_all", true, PSR_c | PSR_f}, @@ -579,77 +499,395 @@ static CONST struct asm_psr psrs[] = {"SPSR_cxsf", false, PSR_c | PSR_x | PSR_s | PSR_f}, }; +enum vfp_dp_reg_pos +{ + VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn +}; + +enum vfp_sp_reg_pos +{ + VFP_REG_Sd, VFP_REG_Sm, VFP_REG_Sn +}; + +enum vfp_ldstm_type +{ + VFP_LDSTMIA, VFP_LDSTMDB, VFP_LDSTMIAX, VFP_LDSTMDBX +}; + +/* VFP system registers. */ +struct vfp_reg +{ + const char *name; + unsigned long regno; +}; + +static const struct vfp_reg vfp_regs[] = +{ + {"fpsid", 0x00000000}, + {"FPSID", 0x00000000}, + {"fpscr", 0x00010000}, + {"FPSCR", 0x00010000}, + {"fpexc", 0x00080000}, + {"FPEXC", 0x00080000} +}; + +/* Structure for a hash table entry for a register. */ +struct reg_entry +{ + const char * name; + int number; +}; + +/* Some well known registers that we refer to directly elsewhere. */ +#define REG_SP 13 +#define REG_LR 14 +#define REG_PC 15 + +/* These are the standard names. Users can add aliases with .req. */ +/* Integer Register Numbers. */ +static const struct reg_entry rn_table[] = +{ + {"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, + {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, + {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, + {"r12", 12}, {"r13", REG_SP}, {"r14", REG_LR}, {"r15", REG_PC}, + /* ATPCS Synonyms. */ + {"a1", 0}, {"a2", 1}, {"a3", 2}, {"a4", 3}, + {"v1", 4}, {"v2", 5}, {"v3", 6}, {"v4", 7}, + {"v5", 8}, {"v6", 9}, {"v7", 10}, {"v8", 11}, + /* Well-known aliases. */ + {"wr", 7}, + {"sb", 9}, {"sl", 10}, {"fp", 11}, + {"ip", 12}, {"sp", REG_SP}, {"lr", REG_LR}, {"pc", REG_PC}, + {NULL, 0} +}; + +/* Co-processor Numbers. */ +static const struct reg_entry cp_table[] = +{ + {"p0", 0}, {"p1", 1}, {"p2", 2}, {"p3", 3}, + {"p4", 4}, {"p5", 5}, {"p6", 6}, {"p7", 7}, + {"p8", 8}, {"p9", 9}, {"p10", 10}, {"p11", 11}, + {"p12", 12}, {"p13", 13}, {"p14", 14}, {"p15", 15}, + {NULL, 0} +}; + +/* Co-processor Register Numbers. */ +static const struct reg_entry cn_table[] = +{ + {"c0", 0}, {"c1", 1}, {"c2", 2}, {"c3", 3}, + {"c4", 4}, {"c5", 5}, {"c6", 6}, {"c7", 7}, + {"c8", 8}, {"c9", 9}, {"c10", 10}, {"c11", 11}, + {"c12", 12}, {"c13", 13}, {"c14", 14}, {"c15", 15}, + /* Not really valid, but kept for back-wards compatibility. */ + {"cr0", 0}, {"cr1", 1}, {"cr2", 2}, {"cr3", 3}, + {"cr4", 4}, {"cr5", 5}, {"cr6", 6}, {"cr7", 7}, + {"cr8", 8}, {"cr9", 9}, {"cr10", 10}, {"cr11", 11}, + {"cr12", 12}, {"cr13", 13}, {"cr14", 14}, {"cr15", 15}, + {NULL, 0} +}; + +/* FPA Registers. */ +static const struct reg_entry fn_table[] = +{ + {"f0", 0}, {"f1", 1}, {"f2", 2}, {"f3", 3}, + {"f4", 4}, {"f5", 5}, {"f6", 6}, {"f7", 7}, + {NULL, 0} +}; + +/* VFP SP Registers. */ +static const struct reg_entry sn_table[] = +{ + {"s0", 0}, {"s1", 1}, {"s2", 2}, {"s3", 3}, + {"s4", 4}, {"s5", 5}, {"s6", 6}, {"s7", 7}, + {"s8", 8}, {"s9", 9}, {"s10", 10}, {"s11", 11}, + {"s12", 12}, {"s13", 13}, {"s14", 14}, {"s15", 15}, + {"s16", 16}, {"s17", 17}, {"s18", 18}, {"s19", 19}, + {"s20", 20}, {"s21", 21}, {"s22", 22}, {"s23", 23}, + {"s24", 24}, {"s25", 25}, {"s26", 26}, {"s27", 27}, + {"s28", 28}, {"s29", 29}, {"s30", 30}, {"s31", 31}, + {NULL, 0} +}; + +/* VFP DP Registers. */ +static const struct reg_entry dn_table[] = +{ + {"d0", 0}, {"d1", 1}, {"d2", 2}, {"d3", 3}, + {"d4", 4}, {"d5", 5}, {"d6", 6}, {"d7", 7}, + {"d8", 8}, {"d9", 9}, {"d10", 10}, {"d11", 11}, + {"d12", 12}, {"d13", 13}, {"d14", 14}, {"d15", 15}, + {NULL, 0} +}; + +/* Maverick DSP coprocessor registers. */ +static const struct reg_entry mav_mvf_table[] = +{ + {"mvf0", 0}, {"mvf1", 1}, {"mvf2", 2}, {"mvf3", 3}, + {"mvf4", 4}, {"mvf5", 5}, {"mvf6", 6}, {"mvf7", 7}, + {"mvf8", 8}, {"mvf9", 9}, {"mvf10", 10}, {"mvf11", 11}, + {"mvf12", 12}, {"mvf13", 13}, {"mvf14", 14}, {"mvf15", 15}, + {NULL, 0} +}; + +static const struct reg_entry mav_mvd_table[] = +{ + {"mvd0", 0}, {"mvd1", 1}, {"mvd2", 2}, {"mvd3", 3}, + {"mvd4", 4}, {"mvd5", 5}, {"mvd6", 6}, {"mvd7", 7}, + {"mvd8", 8}, {"mvd9", 9}, {"mvd10", 10}, {"mvd11", 11}, + {"mvd12", 12}, {"mvd13", 13}, {"mvd14", 14}, {"mvd15", 15}, + {NULL, 0} +}; + +static const struct reg_entry mav_mvfx_table[] = +{ + {"mvfx0", 0}, {"mvfx1", 1}, {"mvfx2", 2}, {"mvfx3", 3}, + {"mvfx4", 4}, {"mvfx5", 5}, {"mvfx6", 6}, {"mvfx7", 7}, + {"mvfx8", 8}, {"mvfx9", 9}, {"mvfx10", 10}, {"mvfx11", 11}, + {"mvfx12", 12}, {"mvfx13", 13}, {"mvfx14", 14}, {"mvfx15", 15}, + {NULL, 0} +}; + +static const struct reg_entry mav_mvdx_table[] = +{ + {"mvdx0", 0}, {"mvdx1", 1}, {"mvdx2", 2}, {"mvdx3", 3}, + {"mvdx4", 4}, {"mvdx5", 5}, {"mvdx6", 6}, {"mvdx7", 7}, + {"mvdx8", 8}, {"mvdx9", 9}, {"mvdx10", 10}, {"mvdx11", 11}, + {"mvdx12", 12}, {"mvdx13", 13}, {"mvdx14", 14}, {"mvdx15", 15}, + {NULL, 0} +}; + +static const struct reg_entry mav_mvax_table[] = +{ + {"mvax0", 0}, {"mvax1", 1}, {"mvax2", 2}, {"mvax3", 3}, + {NULL, 0} +}; + +static const struct reg_entry mav_dspsc_table[] = +{ + {"dspsc", 0}, + {NULL, 0} +}; + +struct reg_map +{ + const struct reg_entry *names; + int max_regno; + struct hash_control *htab; + const char *expected; +}; + +struct reg_map all_reg_maps[] = +{ + {rn_table, 15, NULL, N_("ARM register expected")}, + {cp_table, 15, NULL, N_("bad or missing co-processor number")}, + {cn_table, 15, NULL, N_("co-processor register expected")}, + {fn_table, 7, NULL, N_("FPA register expected")}, + {sn_table, 31, NULL, N_("VFP single precision register expected")}, + {dn_table, 15, NULL, N_("VFP double precision register expected")}, + {mav_mvf_table, 15, NULL, N_("Maverick MVF register expected")}, + {mav_mvd_table, 15, NULL, N_("Maverick MVD register expected")}, + {mav_mvfx_table, 15, NULL, N_("Maverick MVFX register expected")}, + {mav_mvdx_table, 15, NULL, N_("Maverick MVFX register expected")}, + {mav_mvax_table, 3, NULL, N_("Maverick MVAX register expected")}, + {mav_dspsc_table, 0, NULL, N_("Maverick DSPSC register expected")}, +}; + +/* Enumeration matching entries in table above. */ +enum arm_reg_type +{ + REG_TYPE_RN = 0, +#define REG_TYPE_FIRST REG_TYPE_RN + REG_TYPE_CP = 1, + REG_TYPE_CN = 2, + REG_TYPE_FN = 3, + REG_TYPE_SN = 4, + REG_TYPE_DN = 5, + REG_TYPE_MVF = 6, + REG_TYPE_MVD = 7, + REG_TYPE_MVFX = 8, + REG_TYPE_MVDX = 9, + REG_TYPE_MVAX = 10, + REG_TYPE_DSPSC = 11, + + REG_TYPE_MAX = 12 +}; + /* Functions called by parser. */ /* ARM instructions. */ -static void do_arit PARAMS ((char *, unsigned long)); -static void do_cmp PARAMS ((char *, unsigned long)); -static void do_mov PARAMS ((char *, unsigned long)); -static void do_ldst PARAMS ((char *, unsigned long)); -static void do_ldmstm PARAMS ((char *, unsigned long)); -static void do_branch PARAMS ((char *, unsigned long)); -static void do_swi PARAMS ((char *, unsigned long)); +static void do_arit PARAMS ((char *)); +static void do_cmp PARAMS ((char *)); +static void do_mov PARAMS ((char *)); +static void do_ldst PARAMS ((char *)); +static void do_ldstt PARAMS ((char *)); +static void do_ldmstm PARAMS ((char *)); +static void do_branch PARAMS ((char *)); +static void do_swi PARAMS ((char *)); + /* Pseudo Op codes. */ -static void do_adr PARAMS ((char *, unsigned long)); -static void do_adrl PARAMS ((char *, unsigned long)); -static void do_nop PARAMS ((char *, unsigned long)); -/* ARM 2. */ -static void do_mul PARAMS ((char *, unsigned long)); -static void do_mla PARAMS ((char *, unsigned long)); -/* ARM 3. */ -static void do_swap PARAMS ((char *, unsigned long)); -/* ARM 6. */ -static void do_msr PARAMS ((char *, unsigned long)); -static void do_mrs PARAMS ((char *, unsigned long)); -/* ARM 7M. */ -static void do_mull PARAMS ((char *, unsigned long)); -/* ARM THUMB. */ -static void do_bx PARAMS ((char *, unsigned long)); - -/* ARM_EXT_XScale. */ -static void do_mia PARAMS ((char *, unsigned long)); -static void do_mar PARAMS ((char *, unsigned long)); -static void do_mra PARAMS ((char *, unsigned long)); -static void do_pld PARAMS ((char *, unsigned long)); -static void do_ldrd PARAMS ((char *, unsigned long)); - -/* ARM_EXT_V5. */ -static void do_blx PARAMS ((char *, unsigned long)); -static void do_bkpt PARAMS ((char *, unsigned long)); -static void do_clz PARAMS ((char *, unsigned long)); -static void do_lstc2 PARAMS ((char *, unsigned long)); -static void do_cdp2 PARAMS ((char *, unsigned long)); -static void do_co_reg2 PARAMS ((char *, unsigned long)); +static void do_adr PARAMS ((char *)); +static void do_adrl PARAMS ((char *)); +static void do_empty PARAMS ((char *)); -static void do_t_blx PARAMS ((char *)); -static void do_t_bkpt PARAMS ((char *)); +/* ARM v2. */ +static void do_mul PARAMS ((char *)); +static void do_mla PARAMS ((char *)); + +/* ARM v2S. */ +static void do_swap PARAMS ((char *)); + +/* ARM v3. */ +static void do_msr PARAMS ((char *)); +static void do_mrs PARAMS ((char *)); -/* ARM_EXT_V5E. */ -static void do_smla PARAMS ((char *, unsigned long)); -static void do_smlal PARAMS ((char *, unsigned long)); -static void do_smul PARAMS ((char *, unsigned long)); -static void do_qadd PARAMS ((char *, unsigned long)); -static void do_co_reg2c PARAMS ((char *, unsigned long)); +/* ARM v3M. */ +static void do_mull PARAMS ((char *)); + +/* ARM v4. */ +static void do_ldstv4 PARAMS ((char *)); + +/* ARM v4T. */ +static void do_bx PARAMS ((char *)); + +/* ARM v5T. */ +static void do_blx PARAMS ((char *)); +static void do_bkpt PARAMS ((char *)); +static void do_clz PARAMS ((char *)); +static void do_lstc2 PARAMS ((char *)); +static void do_cdp2 PARAMS ((char *)); +static void do_co_reg2 PARAMS ((char *)); + +/* ARM v5TExP. */ +static void do_smla PARAMS ((char *)); +static void do_smlal PARAMS ((char *)); +static void do_smul PARAMS ((char *)); +static void do_qadd PARAMS ((char *)); + +/* ARM v5TE. */ +static void do_pld PARAMS ((char *)); +static void do_ldrd PARAMS ((char *)); +static void do_co_reg2c PARAMS ((char *)); + +/* ARM v5TEJ. */ +static void do_bxj PARAMS ((char *)); /* Coprocessor Instructions. */ -static void do_cdp PARAMS ((char *, unsigned long)); -static void do_lstc PARAMS ((char *, unsigned long)); -static void do_co_reg PARAMS ((char *, unsigned long)); -static void do_fp_ctrl PARAMS ((char *, unsigned long)); -static void do_fp_ldst PARAMS ((char *, unsigned long)); -static void do_fp_ldmstm PARAMS ((char *, unsigned long)); -static void do_fp_dyadic PARAMS ((char *, unsigned long)); -static void do_fp_monadic PARAMS ((char *, unsigned long)); -static void do_fp_cmp PARAMS ((char *, unsigned long)); -static void do_fp_from_reg PARAMS ((char *, unsigned long)); -static void do_fp_to_reg PARAMS ((char *, unsigned long)); - -static void fix_new_arm PARAMS ((fragS *, int, short, expressionS *, int, int)); -static int arm_reg_parse PARAMS ((char **)); -static CONST struct asm_psr * arm_psr_parse PARAMS ((char **)); -static void symbol_locate PARAMS ((symbolS *, CONST char *, segT, valueT, fragS *)); +static void do_cdp PARAMS ((char *)); +static void do_lstc PARAMS ((char *)); +static void do_co_reg PARAMS ((char *)); + +/* FPA instructions. */ +static void do_fpa_ctrl PARAMS ((char *)); +static void do_fpa_ldst PARAMS ((char *)); +static void do_fpa_ldmstm PARAMS ((char *)); +static void do_fpa_dyadic PARAMS ((char *)); +static void do_fpa_monadic PARAMS ((char *)); +static void do_fpa_cmp PARAMS ((char *)); +static void do_fpa_from_reg PARAMS ((char *)); +static void do_fpa_to_reg PARAMS ((char *)); + +/* VFP instructions. */ +static void do_vfp_sp_monadic PARAMS ((char *)); +static void do_vfp_dp_monadic PARAMS ((char *)); +static void do_vfp_sp_dyadic PARAMS ((char *)); +static void do_vfp_dp_dyadic PARAMS ((char *)); +static void do_vfp_reg_from_sp PARAMS ((char *)); +static void do_vfp_sp_from_reg PARAMS ((char *)); +static void do_vfp_sp_reg2 PARAMS ((char *)); +static void do_vfp_reg_from_dp PARAMS ((char *)); +static void do_vfp_reg2_from_dp PARAMS ((char *)); +static void do_vfp_dp_from_reg PARAMS ((char *)); +static void do_vfp_dp_from_reg2 PARAMS ((char *)); +static void do_vfp_reg_from_ctrl PARAMS ((char *)); +static void do_vfp_ctrl_from_reg PARAMS ((char *)); +static void do_vfp_sp_ldst PARAMS ((char *)); +static void do_vfp_dp_ldst PARAMS ((char *)); +static void do_vfp_sp_ldstmia PARAMS ((char *)); +static void do_vfp_sp_ldstmdb PARAMS ((char *)); +static void do_vfp_dp_ldstmia PARAMS ((char *)); +static void do_vfp_dp_ldstmdb PARAMS ((char *)); +static void do_vfp_xp_ldstmia PARAMS ((char *)); +static void do_vfp_xp_ldstmdb PARAMS ((char *)); +static void do_vfp_sp_compare_z PARAMS ((char *)); +static void do_vfp_dp_compare_z PARAMS ((char *)); +static void do_vfp_dp_sp_cvt PARAMS ((char *)); +static void do_vfp_sp_dp_cvt PARAMS ((char *)); + +/* XScale. */ +static void do_xsc_mia PARAMS ((char *)); +static void do_xsc_mar PARAMS ((char *)); +static void do_xsc_mra PARAMS ((char *)); + +/* Maverick. */ +static void do_mav_binops PARAMS ((char *, int, enum arm_reg_type, + enum arm_reg_type)); +static void do_mav_binops_1a PARAMS ((char *)); +static void do_mav_binops_1b PARAMS ((char *)); +static void do_mav_binops_1c PARAMS ((char *)); +static void do_mav_binops_1d PARAMS ((char *)); +static void do_mav_binops_1e PARAMS ((char *)); +static void do_mav_binops_1f PARAMS ((char *)); +static void do_mav_binops_1g PARAMS ((char *)); +static void do_mav_binops_1h PARAMS ((char *)); +static void do_mav_binops_1i PARAMS ((char *)); +static void do_mav_binops_1j PARAMS ((char *)); +static void do_mav_binops_1k PARAMS ((char *)); +static void do_mav_binops_1l PARAMS ((char *)); +static void do_mav_binops_1m PARAMS ((char *)); +static void do_mav_binops_1n PARAMS ((char *)); +static void do_mav_binops_1o PARAMS ((char *)); +static void do_mav_binops_2a PARAMS ((char *)); +static void do_mav_binops_2b PARAMS ((char *)); +static void do_mav_binops_2c PARAMS ((char *)); +static void do_mav_binops_3a PARAMS ((char *)); +static void do_mav_binops_3b PARAMS ((char *)); +static void do_mav_binops_3c PARAMS ((char *)); +static void do_mav_binops_3d PARAMS ((char *)); +static void do_mav_triple PARAMS ((char *, int, enum arm_reg_type, + enum arm_reg_type, + enum arm_reg_type)); +static void do_mav_triple_4a PARAMS ((char *)); +static void do_mav_triple_4b PARAMS ((char *)); +static void do_mav_triple_5a PARAMS ((char *)); +static void do_mav_triple_5b PARAMS ((char *)); +static void do_mav_triple_5c PARAMS ((char *)); +static void do_mav_triple_5d PARAMS ((char *)); +static void do_mav_triple_5e PARAMS ((char *)); +static void do_mav_triple_5f PARAMS ((char *)); +static void do_mav_triple_5g PARAMS ((char *)); +static void do_mav_triple_5h PARAMS ((char *)); +static void do_mav_quad PARAMS ((char *, int, enum arm_reg_type, + enum arm_reg_type, + enum arm_reg_type, + enum arm_reg_type)); +static void do_mav_quad_6a PARAMS ((char *)); +static void do_mav_quad_6b PARAMS ((char *)); +static void do_mav_dspsc_1 PARAMS ((char *)); +static void do_mav_dspsc_2 PARAMS ((char *)); +static void do_mav_shift PARAMS ((char *, enum arm_reg_type, + enum arm_reg_type)); +static void do_mav_shift_1 PARAMS ((char *)); +static void do_mav_shift_2 PARAMS ((char *)); +static void do_mav_ldst PARAMS ((char *, enum arm_reg_type)); +static void do_mav_ldst_1 PARAMS ((char *)); +static void do_mav_ldst_2 PARAMS ((char *)); +static void do_mav_ldst_3 PARAMS ((char *)); +static void do_mav_ldst_4 PARAMS ((char *)); + +static int mav_reg_required_here PARAMS ((char **, int, + enum arm_reg_type)); +static int mav_parse_offset PARAMS ((char **, int *)); + +static void fix_new_arm PARAMS ((fragS *, int, short, expressionS *, + int, int)); +static int arm_reg_parse PARAMS ((char **, struct hash_control *)); +static enum arm_reg_type arm_reg_parse_any PARAMS ((char *)); +static const struct asm_psr * arm_psr_parse PARAMS ((char **)); +static void symbol_locate PARAMS ((symbolS *, const char *, segT, valueT, + fragS *)); static int add_to_lit_pool PARAMS ((void)); static unsigned validate_immediate PARAMS ((unsigned)); -static unsigned validate_immediate_twopart PARAMS ((unsigned int, unsigned int *)); +static unsigned validate_immediate_twopart PARAMS ((unsigned int, + unsigned int *)); static int validate_offset_imm PARAMS ((unsigned int, int)); static void opcode_select PARAMS ((int)); static void end_of_line PARAMS ((char *)); @@ -659,8 +897,16 @@ static int co_proc_number PARAMS ((char **)); static int cp_opc_expr PARAMS ((char **, int, int)); static int cp_reg_required_here PARAMS ((char **, int)); static int fp_reg_required_here PARAMS ((char **, int)); +static int vfp_sp_reg_required_here PARAMS ((char **, enum vfp_sp_reg_pos)); +static int vfp_dp_reg_required_here PARAMS ((char **, enum vfp_dp_reg_pos)); +static void vfp_sp_ldstm PARAMS ((char *, enum vfp_ldstm_type)); +static void vfp_dp_ldstm PARAMS ((char *, enum vfp_ldstm_type)); +static long vfp_sp_reg_list PARAMS ((char **, enum vfp_sp_reg_pos)); +static long vfp_dp_reg_list PARAMS ((char **)); +static int vfp_psr_required_here PARAMS ((char **str)); +static const struct vfp_reg *vfp_psr_parse PARAMS ((char **str)); static int cp_address_offset PARAMS ((char **)); -static int cp_address_required_here PARAMS ((char **)); +static int cp_address_required_here PARAMS ((char **, int)); static int my_get_float_expression PARAMS ((char **)); static int skip_past_comma PARAMS ((char **)); static int walk_no_bignums PARAMS ((symbolS *)); @@ -670,15 +916,24 @@ static int fp_op2 PARAMS ((char **)); static long reg_list PARAMS ((char **)); static void thumb_load_store PARAMS ((char *, int, int)); static int decode_shift PARAMS ((char **, int)); -static int ldst_extend PARAMS ((char **, int)); +static int ldst_extend PARAMS ((char **)); +static int ldst_extend_v4 PARAMS ((char **)); static void thumb_add_sub PARAMS ((char *, int)); -static void insert_reg PARAMS ((int)); +static void insert_reg PARAMS ((const struct reg_entry *, + struct hash_control *)); static void thumb_shift PARAMS ((char *, int)); static void thumb_mov_compare PARAMS ((char *, int)); +static void build_arm_ops_hsh PARAMS ((void)); static void set_constant_flonums PARAMS ((void)); static valueT md_chars_to_number PARAMS ((char *, int)); -static void insert_reg_alias PARAMS ((char *, int)); -static void output_inst PARAMS ((void)); +static void build_reg_hsh PARAMS ((struct reg_map *)); +static void insert_reg_alias PARAMS ((char *, int, struct hash_control *)); +static int create_register_alias PARAMS ((char *, char *)); +static void output_inst PARAMS ((const char *)); +static int accum0_required_here PARAMS ((char **)); +static int ld_mode_required_here PARAMS ((char **)); +static void do_branch25 PARAMS ((char *)); +static symbolS * find_real_start PARAMS ((symbolS *)); #ifdef OBJ_ELF static bfd_reloc_code_real_type arm_parse_reloc PARAMS ((void)); #endif @@ -687,202 +942,869 @@ static bfd_reloc_code_real_type arm_parse_reloc PARAMS ((void)); take 2: */ #define INSN_SIZE 4 -/* LONGEST_INST is the longest basic instruction name without - conditions or flags. ARM7M has 4 of length 5. El Segundo - has one basic instruction name of length 7 (SMLALxy). */ -#define LONGEST_INST 7 +/* "INSN X,Y" where X:bit12, Y:bit16. */ +#define MAV_MODE1 0x100c + +/* "INSN X,Y" where X:bit16, Y:bit12. */ +#define MAV_MODE2 0x0c10 + +/* "INSN X,Y" where X:0, Y:bit16. */ +#define MAV_MODE3 0x1000 + +/* "INSN X,Y,Z" where X:16, Y:0, Z:12. */ +#define MAV_MODE4 0x0c0010 + +/* "INSN X,Y,Z" where X:12, Y:16, Z:0. */ +#define MAV_MODE5 0x00100c + +/* "INSN W,X,Y,Z" where W:5, X:12, Y:16, Z:0. */ +#define MAV_MODE6 0x00100c05 struct asm_opcode { /* Basic string to match. */ - CONST char * template; + const char * template; /* Basic instruction code. */ unsigned long value; - /* Compulsory suffix that must follow conds. If "", then the - instruction is not conditional and must have no suffix. */ - CONST char * comp_suffix; - - /* Bits to toggle if flag 'n' set. */ - CONST struct asm_flg * flags; + /* Offset into the template where the condition code (if any) will be. + If zero, then the instruction is never conditional. */ + unsigned cond_offset; - /* Which CPU variants this exists for. */ - unsigned long variants; + /* Which architecture variant provides this instruction. */ + unsigned long variant; /* Function to call to parse args. */ - void (* parms) PARAMS ((char *, unsigned long)); + void (* parms) PARAMS ((char *)); }; -static CONST struct asm_opcode insns[] = -{ -/* Intel XScale extensions to ARM V5 ISA. */ - {"mia", 0x0e200010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"miaph", 0x0e280010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"miabb", 0x0e2c0010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"miabt", 0x0e2d0010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"miatb", 0x0e2e0010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"miatt", 0x0e2f0010, NULL, NULL, ARM_EXT_XSCALE, do_mia}, - {"mar", 0x0c400000, NULL, NULL, ARM_EXT_XSCALE, do_mar}, - {"mra", 0x0c500000, NULL, NULL, ARM_EXT_XSCALE, do_mra}, - {"pld", 0xf450f000, "", NULL, ARM_EXT_XSCALE, do_pld}, - {"ldr", 0x000000d0, NULL, ldr_flags, ARM_ANY, do_ldrd}, - {"str", 0x000000f0, NULL, str_flags, ARM_ANY, do_ldrd}, - -/* ARM Instructions. */ - {"and", 0x00000000, NULL, s_flag, ARM_ANY, do_arit}, - {"eor", 0x00200000, NULL, s_flag, ARM_ANY, do_arit}, - {"sub", 0x00400000, NULL, s_flag, ARM_ANY, do_arit}, - {"rsb", 0x00600000, NULL, s_flag, ARM_ANY, do_arit}, - {"add", 0x00800000, NULL, s_flag, ARM_ANY, do_arit}, - {"adc", 0x00a00000, NULL, s_flag, ARM_ANY, do_arit}, - {"sbc", 0x00c00000, NULL, s_flag, ARM_ANY, do_arit}, - {"rsc", 0x00e00000, NULL, s_flag, ARM_ANY, do_arit}, - {"orr", 0x01800000, NULL, s_flag, ARM_ANY, do_arit}, - {"bic", 0x01c00000, NULL, s_flag, ARM_ANY, do_arit}, - {"tst", 0x01000000, NULL, cmp_flags, ARM_ANY, do_cmp}, - {"teq", 0x01200000, NULL, cmp_flags, ARM_ANY, do_cmp}, - {"cmp", 0x01400000, NULL, cmp_flags, ARM_ANY, do_cmp}, - {"cmn", 0x01600000, NULL, cmp_flags, ARM_ANY, do_cmp}, - {"mov", 0x01a00000, NULL, s_flag, ARM_ANY, do_mov}, - {"mvn", 0x01e00000, NULL, s_flag, ARM_ANY, do_mov}, - {"str", 0x04000000, NULL, str_flags, ARM_ANY, do_ldst}, - {"ldr", 0x04100000, NULL, ldr_flags, ARM_ANY, do_ldst}, - {"stm", 0x08000000, NULL, stm_flags, ARM_ANY, do_ldmstm}, - {"ldm", 0x08100000, NULL, ldm_flags, ARM_ANY, do_ldmstm}, - {"swi", 0x0f000000, NULL, NULL, ARM_ANY, do_swi}, +static const struct asm_opcode insns[] = +{ + /* Core ARM Instructions. */ + {"and", 0xe0000000, 3, ARM_EXT_V1, do_arit}, + {"ands", 0xe0100000, 3, ARM_EXT_V1, do_arit}, + {"eor", 0xe0200000, 3, ARM_EXT_V1, do_arit}, + {"eors", 0xe0300000, 3, ARM_EXT_V1, do_arit}, + {"sub", 0xe0400000, 3, ARM_EXT_V1, do_arit}, + {"subs", 0xe0500000, 3, ARM_EXT_V1, do_arit}, + {"rsb", 0xe0600000, 3, ARM_EXT_V1, do_arit}, + {"rsbs", 0xe0700000, 3, ARM_EXT_V1, do_arit}, + {"add", 0xe0800000, 3, ARM_EXT_V1, do_arit}, + {"adds", 0xe0900000, 3, ARM_EXT_V1, do_arit}, + {"adc", 0xe0a00000, 3, ARM_EXT_V1, do_arit}, + {"adcs", 0xe0b00000, 3, ARM_EXT_V1, do_arit}, + {"sbc", 0xe0c00000, 3, ARM_EXT_V1, do_arit}, + {"sbcs", 0xe0d00000, 3, ARM_EXT_V1, do_arit}, + {"rsc", 0xe0e00000, 3, ARM_EXT_V1, do_arit}, + {"rscs", 0xe0f00000, 3, ARM_EXT_V1, do_arit}, + {"orr", 0xe1800000, 3, ARM_EXT_V1, do_arit}, + {"orrs", 0xe1900000, 3, ARM_EXT_V1, do_arit}, + {"bic", 0xe1c00000, 3, ARM_EXT_V1, do_arit}, + {"bics", 0xe1d00000, 3, ARM_EXT_V1, do_arit}, + + {"tst", 0xe1100000, 3, ARM_EXT_V1, do_cmp}, + {"tsts", 0xe1100000, 3, ARM_EXT_V1, do_cmp}, + {"tstp", 0xe110f000, 3, ARM_EXT_V1, do_cmp}, + {"teq", 0xe1300000, 3, ARM_EXT_V1, do_cmp}, + {"teqs", 0xe1300000, 3, ARM_EXT_V1, do_cmp}, + {"teqp", 0xe130f000, 3, ARM_EXT_V1, do_cmp}, + {"cmp", 0xe1500000, 3, ARM_EXT_V1, do_cmp}, + {"cmps", 0xe1500000, 3, ARM_EXT_V1, do_cmp}, + {"cmpp", 0xe150f000, 3, ARM_EXT_V1, do_cmp}, + {"cmn", 0xe1700000, 3, ARM_EXT_V1, do_cmp}, + {"cmns", 0xe1700000, 3, ARM_EXT_V1, do_cmp}, + {"cmnp", 0xe170f000, 3, ARM_EXT_V1, do_cmp}, + + {"mov", 0xe1a00000, 3, ARM_EXT_V1, do_mov}, + {"movs", 0xe1b00000, 3, ARM_EXT_V1, do_mov}, + {"mvn", 0xe1e00000, 3, ARM_EXT_V1, do_mov}, + {"mvns", 0xe1f00000, 3, ARM_EXT_V1, do_mov}, + + {"ldr", 0xe4100000, 3, ARM_EXT_V1, do_ldst}, + {"ldrb", 0xe4500000, 3, ARM_EXT_V1, do_ldst}, + {"ldrt", 0xe4300000, 3, ARM_EXT_V1, do_ldstt}, + {"ldrbt", 0xe4700000, 3, ARM_EXT_V1, do_ldstt}, + {"str", 0xe4000000, 3, ARM_EXT_V1, do_ldst}, + {"strb", 0xe4400000, 3, ARM_EXT_V1, do_ldst}, + {"strt", 0xe4200000, 3, ARM_EXT_V1, do_ldstt}, + {"strbt", 0xe4600000, 3, ARM_EXT_V1, do_ldstt}, + + {"stmia", 0xe8800000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmib", 0xe9800000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmda", 0xe8000000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmdb", 0xe9000000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmfd", 0xe9000000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmfa", 0xe9800000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmea", 0xe8800000, 3, ARM_EXT_V1, do_ldmstm}, + {"stmed", 0xe8000000, 3, ARM_EXT_V1, do_ldmstm}, + + {"ldmia", 0xe8900000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmib", 0xe9900000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmda", 0xe8100000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmdb", 0xe9100000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmfd", 0xe8900000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmfa", 0xe8100000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmea", 0xe9100000, 3, ARM_EXT_V1, do_ldmstm}, + {"ldmed", 0xe9900000, 3, ARM_EXT_V1, do_ldmstm}, + + {"swi", 0xef000000, 3, ARM_EXT_V1, do_swi}, #ifdef TE_WINCE - {"bl", 0x0b000000, NULL, NULL, ARM_ANY, do_branch}, - {"b", 0x0a000000, NULL, NULL, ARM_ANY, do_branch}, + /* XXX This is the wrong place to do this. Think multi-arch. */ + {"bl", 0xeb000000, 2, ARM_EXT_V1, do_branch}, + {"b", 0xea000000, 1, ARM_EXT_V1, do_branch}, #else - {"bl", 0x0bfffffe, NULL, NULL, ARM_ANY, do_branch}, - {"b", 0x0afffffe, NULL, NULL, ARM_ANY, do_branch}, + {"bl", 0xebfffffe, 2, ARM_EXT_V1, do_branch}, + {"b", 0xeafffffe, 1, ARM_EXT_V1, do_branch}, #endif -/* Pseudo ops. */ - {"adr", 0x028f0000, NULL, NULL, ARM_ANY, do_adr}, - {"adrl", 0x028f0000, NULL, NULL, ARM_ANY, do_adrl}, - {"nop", 0x01a00000, NULL, NULL, ARM_ANY, do_nop}, - -/* ARM 2 multiplies. */ - {"mul", 0x00000090, NULL, s_flag, ARM_2UP, do_mul}, - {"mla", 0x00200090, NULL, s_flag, ARM_2UP, do_mla}, - -/* ARM 3 - swp instructions. */ - {"swp", 0x01000090, NULL, byte_flag, ARM_3UP, do_swap}, - -/* ARM 6 Coprocessor instructions. */ - {"mrs", 0x010f0000, NULL, NULL, ARM_6UP, do_mrs}, - {"msr", 0x0120f000, NULL, NULL, ARM_6UP, do_msr}, -/* ScottB: our code uses 0x0128f000 for msr. - NickC: but this is wrong because the bits 16 through 19 are - handled by the PSR_xxx defines above. */ - -/* ARM 7M long multiplies - need signed/unsigned flags! */ - {"smull", 0x00c00090, NULL, s_flag, ARM_EXT_LONGMUL, do_mull}, - {"umull", 0x00800090, NULL, s_flag, ARM_EXT_LONGMUL, do_mull}, - {"smlal", 0x00e00090, NULL, s_flag, ARM_EXT_LONGMUL, do_mull}, - {"umlal", 0x00a00090, NULL, s_flag, ARM_EXT_LONGMUL, do_mull}, - -/* ARM THUMB interworking. */ - {"bx", 0x012fff10, NULL, NULL, ARM_EXT_THUMB, do_bx}, - -/* Floating point instructions. */ - {"wfs", 0x0e200110, NULL, NULL, FPU_ALL, do_fp_ctrl}, - {"rfs", 0x0e300110, NULL, NULL, FPU_ALL, do_fp_ctrl}, - {"wfc", 0x0e400110, NULL, NULL, FPU_ALL, do_fp_ctrl}, - {"rfc", 0x0e500110, NULL, NULL, FPU_ALL, do_fp_ctrl}, - {"ldf", 0x0c100100, "sdep", NULL, FPU_ALL, do_fp_ldst}, - {"stf", 0x0c000100, "sdep", NULL, FPU_ALL, do_fp_ldst}, - {"lfm", 0x0c100200, NULL, lfm_flags, FPU_MEMMULTI, do_fp_ldmstm}, - {"sfm", 0x0c000200, NULL, sfm_flags, FPU_MEMMULTI, do_fp_ldmstm}, - {"mvf", 0x0e008100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"mnf", 0x0e108100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"abs", 0x0e208100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"rnd", 0x0e308100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"sqt", 0x0e408100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"log", 0x0e508100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"lgn", 0x0e608100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"exp", 0x0e708100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"sin", 0x0e808100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"cos", 0x0e908100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"tan", 0x0ea08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"asn", 0x0eb08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"acs", 0x0ec08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"atn", 0x0ed08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"urd", 0x0ee08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"nrm", 0x0ef08100, "sde", round_flags, FPU_ALL, do_fp_monadic}, - {"adf", 0x0e000100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"suf", 0x0e200100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"rsf", 0x0e300100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"muf", 0x0e100100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"dvf", 0x0e400100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"rdf", 0x0e500100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"pow", 0x0e600100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"rpw", 0x0e700100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"rmf", 0x0e800100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"fml", 0x0e900100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"fdv", 0x0ea00100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"frd", 0x0eb00100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"pol", 0x0ec00100, "sde", round_flags, FPU_ALL, do_fp_dyadic}, - {"cmf", 0x0e90f110, NULL, except_flag, FPU_ALL, do_fp_cmp}, - {"cnf", 0x0eb0f110, NULL, except_flag, FPU_ALL, do_fp_cmp}, -/* The FPA10 data sheet suggests that the 'E' of cmfe/cnfe should not - be an optional suffix, but part of the instruction. To be compatible, - we accept either. */ - {"cmfe", 0x0ed0f110, NULL, NULL, FPU_ALL, do_fp_cmp}, - {"cnfe", 0x0ef0f110, NULL, NULL, FPU_ALL, do_fp_cmp}, - {"flt", 0x0e000110, "sde", round_flags, FPU_ALL, do_fp_from_reg}, - {"fix", 0x0e100110, NULL, fix_flags, FPU_ALL, do_fp_to_reg}, - -/* Generic copressor instructions. */ - {"cdp", 0x0e000000, NULL, NULL, ARM_2UP, do_cdp}, - {"ldc", 0x0c100000, NULL, cplong_flag, ARM_2UP, do_lstc}, - {"stc", 0x0c000000, NULL, cplong_flag, ARM_2UP, do_lstc}, - {"mcr", 0x0e000010, NULL, NULL, ARM_2UP, do_co_reg}, - {"mrc", 0x0e100010, NULL, NULL, ARM_2UP, do_co_reg}, - -/* ARM ISA extension 5. */ -/* Note: blx is actually 2 opcodes, so the .value is set dynamically. - And it's sometimes conditional and sometimes not. */ - {"blx", 0, NULL, NULL, ARM_EXT_V5, do_blx}, - {"clz", 0x016f0f10, NULL, NULL, ARM_EXT_V5, do_clz}, - {"bkpt", 0xe1200070, "", NULL, ARM_EXT_V5, do_bkpt}, - {"ldc2", 0xfc100000, "", cplong_flag, ARM_EXT_V5, do_lstc2}, - {"stc2", 0xfc000000, "", cplong_flag, ARM_EXT_V5, do_lstc2}, - {"cdp2", 0xfe000000, "", NULL, ARM_EXT_V5, do_cdp2}, - {"mcr2", 0xfe000010, "", NULL, ARM_EXT_V5, do_co_reg2}, - {"mrc2", 0xfe100010, "", NULL, ARM_EXT_V5, do_co_reg2}, - -/* ARM ISA extension 5E, El Segundo. */ - {"smlabb", 0x01000080, NULL, NULL, ARM_EXT_V5E, do_smla}, - {"smlatb", 0x010000a0, NULL, NULL, ARM_EXT_V5E, do_smla}, - {"smlabt", 0x010000c0, NULL, NULL, ARM_EXT_V5E, do_smla}, - {"smlatt", 0x010000e0, NULL, NULL, ARM_EXT_V5E, do_smla}, - - {"smlawb", 0x01200080, NULL, NULL, ARM_EXT_V5E, do_smla}, - {"smlawt", 0x012000c0, NULL, NULL, ARM_EXT_V5E, do_smla}, - - {"smlalbb",0x01400080, NULL, NULL, ARM_EXT_V5E, do_smlal}, - {"smlaltb",0x014000a0, NULL, NULL, ARM_EXT_V5E, do_smlal}, - {"smlalbt",0x014000c0, NULL, NULL, ARM_EXT_V5E, do_smlal}, - {"smlaltt",0x014000e0, NULL, NULL, ARM_EXT_V5E, do_smlal}, - - {"smulbb", 0x01600080, NULL, NULL, ARM_EXT_V5E, do_smul}, - {"smultb", 0x016000a0, NULL, NULL, ARM_EXT_V5E, do_smul}, - {"smulbt", 0x016000c0, NULL, NULL, ARM_EXT_V5E, do_smul}, - {"smultt", 0x016000e0, NULL, NULL, ARM_EXT_V5E, do_smul}, - - {"smulwb", 0x012000a0, NULL, NULL, ARM_EXT_V5E, do_smul}, - {"smulwt", 0x012000e0, NULL, NULL, ARM_EXT_V5E, do_smul}, - - {"qadd", 0x01000050, NULL, NULL, ARM_EXT_V5E, do_qadd}, - {"qdadd", 0x01400050, NULL, NULL, ARM_EXT_V5E, do_qadd}, - {"qsub", 0x01200050, NULL, NULL, ARM_EXT_V5E, do_qadd}, - {"qdsub", 0x01600050, NULL, NULL, ARM_EXT_V5E, do_qadd}, - - {"mcrr", 0x0c400000, NULL, NULL, ARM_EXT_V5E, do_co_reg2c}, - {"mrrc", 0x0c500000, NULL, NULL, ARM_EXT_V5E, do_co_reg2c}, + /* Pseudo ops. */ + {"adr", 0xe28f0000, 3, ARM_EXT_V1, do_adr}, + {"adrl", 0xe28f0000, 3, ARM_EXT_V1, do_adrl}, + {"nop", 0xe1a00000, 3, ARM_EXT_V1, do_empty}, + + /* ARM 2 multiplies. */ + {"mul", 0xe0000090, 3, ARM_EXT_V2, do_mul}, + {"muls", 0xe0100090, 3, ARM_EXT_V2, do_mul}, + {"mla", 0xe0200090, 3, ARM_EXT_V2, do_mla}, + {"mlas", 0xe0300090, 3, ARM_EXT_V2, do_mla}, + + /* Generic copressor instructions. */ + {"cdp", 0xee000000, 3, ARM_EXT_V2, do_cdp}, + {"ldc", 0xec100000, 3, ARM_EXT_V2, do_lstc}, + {"ldcl", 0xec500000, 3, ARM_EXT_V2, do_lstc}, + {"stc", 0xec000000, 3, ARM_EXT_V2, do_lstc}, + {"stcl", 0xec400000, 3, ARM_EXT_V2, do_lstc}, + {"mcr", 0xee000010, 3, ARM_EXT_V2, do_co_reg}, + {"mrc", 0xee100010, 3, ARM_EXT_V2, do_co_reg}, + + /* ARM 3 - swp instructions. */ + {"swp", 0xe1000090, 3, ARM_EXT_V2S, do_swap}, + {"swpb", 0xe1400090, 3, ARM_EXT_V2S, do_swap}, + + /* ARM 6 Status register instructions. */ + {"mrs", 0xe10f0000, 3, ARM_EXT_V3, do_mrs}, + {"msr", 0xe120f000, 3, ARM_EXT_V3, do_msr}, + /* ScottB: our code uses 0xe128f000 for msr. + NickC: but this is wrong because the bits 16 through 19 are + handled by the PSR_xxx defines above. */ + + /* ARM 7M long multiplies. */ + {"smull", 0xe0c00090, 5, ARM_EXT_V3M, do_mull}, + {"smulls", 0xe0d00090, 5, ARM_EXT_V3M, do_mull}, + {"umull", 0xe0800090, 5, ARM_EXT_V3M, do_mull}, + {"umulls", 0xe0900090, 5, ARM_EXT_V3M, do_mull}, + {"smlal", 0xe0e00090, 5, ARM_EXT_V3M, do_mull}, + {"smlals", 0xe0f00090, 5, ARM_EXT_V3M, do_mull}, + {"umlal", 0xe0a00090, 5, ARM_EXT_V3M, do_mull}, + {"umlals", 0xe0b00090, 5, ARM_EXT_V3M, do_mull}, + + /* ARM Architecture 4. */ + {"ldrh", 0xe01000b0, 3, ARM_EXT_V4, do_ldstv4}, + {"ldrsh", 0xe01000f0, 3, ARM_EXT_V4, do_ldstv4}, + {"ldrsb", 0xe01000d0, 3, ARM_EXT_V4, do_ldstv4}, + {"strh", 0xe00000b0, 3, ARM_EXT_V4, do_ldstv4}, + + /* ARM Architecture 4T. */ + /* Note: bx (and blx) are required on V5, even if the processor does + not support Thumb. */ + {"bx", 0xe12fff10, 2, ARM_EXT_V4T | ARM_EXT_V5, do_bx}, + + /* ARM Architecture 5T. */ + /* Note: blx has 2 variants, so the .value is set dynamically. + Only one of the variants has conditional execution. */ + {"blx", 0xe0000000, 3, ARM_EXT_V5, do_blx}, + {"clz", 0xe16f0f10, 3, ARM_EXT_V5, do_clz}, + {"bkpt", 0xe1200070, 0, ARM_EXT_V5, do_bkpt}, + {"ldc2", 0xfc100000, 0, ARM_EXT_V5, do_lstc2}, + {"ldc2l", 0xfc500000, 0, ARM_EXT_V5, do_lstc2}, + {"stc2", 0xfc000000, 0, ARM_EXT_V5, do_lstc2}, + {"stc2l", 0xfc400000, 0, ARM_EXT_V5, do_lstc2}, + {"cdp2", 0xfe000000, 0, ARM_EXT_V5, do_cdp2}, + {"mcr2", 0xfe000010, 0, ARM_EXT_V5, do_co_reg2}, + {"mrc2", 0xfe100010, 0, ARM_EXT_V5, do_co_reg2}, + + /* ARM Architecture 5TExP. */ + {"smlabb", 0xe1000080, 6, ARM_EXT_V5ExP, do_smla}, + {"smlatb", 0xe10000a0, 6, ARM_EXT_V5ExP, do_smla}, + {"smlabt", 0xe10000c0, 6, ARM_EXT_V5ExP, do_smla}, + {"smlatt", 0xe10000e0, 6, ARM_EXT_V5ExP, do_smla}, + + {"smlawb", 0xe1200080, 6, ARM_EXT_V5ExP, do_smla}, + {"smlawt", 0xe12000c0, 6, ARM_EXT_V5ExP, do_smla}, + + {"smlalbb", 0xe1400080, 7, ARM_EXT_V5ExP, do_smlal}, + {"smlaltb", 0xe14000a0, 7, ARM_EXT_V5ExP, do_smlal}, + {"smlalbt", 0xe14000c0, 7, ARM_EXT_V5ExP, do_smlal}, + {"smlaltt", 0xe14000e0, 7, ARM_EXT_V5ExP, do_smlal}, + + {"smulbb", 0xe1600080, 6, ARM_EXT_V5ExP, do_smul}, + {"smultb", 0xe16000a0, 6, ARM_EXT_V5ExP, do_smul}, + {"smulbt", 0xe16000c0, 6, ARM_EXT_V5ExP, do_smul}, + {"smultt", 0xe16000e0, 6, ARM_EXT_V5ExP, do_smul}, + + {"smulwb", 0xe12000a0, 6, ARM_EXT_V5ExP, do_smul}, + {"smulwt", 0xe12000e0, 6, ARM_EXT_V5ExP, do_smul}, + + {"qadd", 0xe1000050, 4, ARM_EXT_V5ExP, do_qadd}, + {"qdadd", 0xe1400050, 5, ARM_EXT_V5ExP, do_qadd}, + {"qsub", 0xe1200050, 4, ARM_EXT_V5ExP, do_qadd}, + {"qdsub", 0xe1600050, 5, ARM_EXT_V5ExP, do_qadd}, + + /* ARM Architecture 5TE. */ + {"pld", 0xf450f000, 0, ARM_EXT_V5E, do_pld}, + {"ldrd", 0xe00000d0, 3, ARM_EXT_V5E, do_ldrd}, + {"strd", 0xe00000f0, 3, ARM_EXT_V5E, do_ldrd}, + + {"mcrr", 0xec400000, 4, ARM_EXT_V5E, do_co_reg2c}, + {"mrrc", 0xec500000, 4, ARM_EXT_V5E, do_co_reg2c}, + + /* ARM Architecture 5TEJ. */ + {"bxj", 0xe12fff20, 3, ARM_EXT_V5J, do_bxj}, + + /* Core FPA instruction set (V1). */ + {"wfs", 0xee200110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, + {"rfs", 0xee300110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, + {"wfc", 0xee400110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, + {"rfc", 0xee500110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, + + {"ldfs", 0xec100100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"ldfd", 0xec108100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"ldfe", 0xec500100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"ldfp", 0xec508100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + + {"stfs", 0xec000100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"stfd", 0xec008100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"stfe", 0xec400100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + {"stfp", 0xec408100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, + + {"mvfs", 0xee008100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfsp", 0xee008120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfsm", 0xee008140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfsz", 0xee008160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfd", 0xee008180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfdp", 0xee0081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfdm", 0xee0081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfdz", 0xee0081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfe", 0xee088100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfep", 0xee088120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfem", 0xee088140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mvfez", 0xee088160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"mnfs", 0xee108100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfsp", 0xee108120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfsm", 0xee108140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfsz", 0xee108160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfd", 0xee108180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfdp", 0xee1081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfdm", 0xee1081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfdz", 0xee1081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfe", 0xee188100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfep", 0xee188120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfem", 0xee188140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"mnfez", 0xee188160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"abss", 0xee208100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"abssp", 0xee208120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"abssm", 0xee208140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"abssz", 0xee208160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absd", 0xee208180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absdp", 0xee2081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absdm", 0xee2081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absdz", 0xee2081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"abse", 0xee288100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absep", 0xee288120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absem", 0xee288140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"absez", 0xee288160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"rnds", 0xee308100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndsp", 0xee308120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndsm", 0xee308140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndsz", 0xee308160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndd", 0xee308180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rnddp", 0xee3081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rnddm", 0xee3081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rnddz", 0xee3081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rnde", 0xee388100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndep", 0xee388120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndem", 0xee388140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"rndez", 0xee388160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"sqts", 0xee408100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtsp", 0xee408120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtsm", 0xee408140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtsz", 0xee408160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtd", 0xee408180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtdp", 0xee4081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtdm", 0xee4081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtdz", 0xee4081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqte", 0xee488100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtep", 0xee488120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtem", 0xee488140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sqtez", 0xee488160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"logs", 0xee508100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logsp", 0xee508120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logsm", 0xee508140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logsz", 0xee508160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logd", 0xee508180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logdp", 0xee5081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logdm", 0xee5081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logdz", 0xee5081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"loge", 0xee588100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logep", 0xee588120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logem", 0xee588140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"logez", 0xee588160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"lgns", 0xee608100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnsp", 0xee608120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnsm", 0xee608140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnsz", 0xee608160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnd", 0xee608180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgndp", 0xee6081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgndm", 0xee6081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgndz", 0xee6081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgne", 0xee688100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnep", 0xee688120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnem", 0xee688140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"lgnez", 0xee688160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"exps", 0xee708100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expsp", 0xee708120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expsm", 0xee708140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expsz", 0xee708160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expd", 0xee708180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expdp", 0xee7081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expdm", 0xee7081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expdz", 0xee7081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expe", 0xee788100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expep", 0xee788120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expem", 0xee788140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"expdz", 0xee788160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"sins", 0xee808100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinsp", 0xee808120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinsm", 0xee808140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinsz", 0xee808160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sind", 0xee808180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sindp", 0xee8081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sindm", 0xee8081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sindz", 0xee8081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sine", 0xee888100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinep", 0xee888120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinem", 0xee888140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"sinez", 0xee888160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"coss", 0xee908100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cossp", 0xee908120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cossm", 0xee908140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cossz", 0xee908160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosd", 0xee908180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosdp", 0xee9081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosdm", 0xee9081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosdz", 0xee9081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cose", 0xee988100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosep", 0xee988120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosem", 0xee988140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"cosez", 0xee988160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"tans", 0xeea08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tansp", 0xeea08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tansm", 0xeea08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tansz", 0xeea08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tand", 0xeea08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tandp", 0xeea081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tandm", 0xeea081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tandz", 0xeea081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tane", 0xeea88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tanep", 0xeea88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tanem", 0xeea88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"tanez", 0xeea88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"asns", 0xeeb08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnsp", 0xeeb08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnsm", 0xeeb08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnsz", 0xeeb08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnd", 0xeeb08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asndp", 0xeeb081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asndm", 0xeeb081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asndz", 0xeeb081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asne", 0xeeb88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnep", 0xeeb88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnem", 0xeeb88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"asnez", 0xeeb88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"acss", 0xeec08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acssp", 0xeec08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acssm", 0xeec08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acssz", 0xeec08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsd", 0xeec08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsdp", 0xeec081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsdm", 0xeec081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsdz", 0xeec081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acse", 0xeec88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsep", 0xeec88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsem", 0xeec88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"acsez", 0xeec88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"atns", 0xeed08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnsp", 0xeed08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnsm", 0xeed08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnsz", 0xeed08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnd", 0xeed08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atndp", 0xeed081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atndm", 0xeed081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atndz", 0xeed081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atne", 0xeed88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnep", 0xeed88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnem", 0xeed88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"atnez", 0xeed88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"urds", 0xeee08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdsp", 0xeee08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdsm", 0xeee08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdsz", 0xeee08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdd", 0xeee08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urddp", 0xeee081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urddm", 0xeee081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urddz", 0xeee081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urde", 0xeee88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdep", 0xeee88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdem", 0xeee88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"urdez", 0xeee88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"nrms", 0xeef08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmsp", 0xeef08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmsm", 0xeef08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmsz", 0xeef08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmd", 0xeef08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmdp", 0xeef081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmdm", 0xeef081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmdz", 0xeef081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrme", 0xeef88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmep", 0xeef88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmem", 0xeef88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + {"nrmez", 0xeef88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, + + {"adfs", 0xee000100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfsp", 0xee000120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfsm", 0xee000140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfsz", 0xee000160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfd", 0xee000180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfdp", 0xee0001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfdm", 0xee0001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfdz", 0xee0001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfe", 0xee080100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfep", 0xee080120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfem", 0xee080140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"adfez", 0xee080160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"sufs", 0xee200100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufsp", 0xee200120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufsm", 0xee200140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufsz", 0xee200160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufd", 0xee200180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufdp", 0xee2001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufdm", 0xee2001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufdz", 0xee2001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufe", 0xee280100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufep", 0xee280120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufem", 0xee280140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"sufez", 0xee280160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"rsfs", 0xee300100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfsp", 0xee300120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfsm", 0xee300140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfsz", 0xee300160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfd", 0xee300180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfdp", 0xee3001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfdm", 0xee3001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfdz", 0xee3001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfe", 0xee380100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfep", 0xee380120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfem", 0xee380140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rsfez", 0xee380160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"mufs", 0xee100100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufsp", 0xee100120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufsm", 0xee100140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufsz", 0xee100160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufd", 0xee100180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufdp", 0xee1001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufdm", 0xee1001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufdz", 0xee1001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufe", 0xee180100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufep", 0xee180120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufem", 0xee180140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"mufez", 0xee180160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"dvfs", 0xee400100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfsp", 0xee400120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfsm", 0xee400140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfsz", 0xee400160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfd", 0xee400180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfdp", 0xee4001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfdm", 0xee4001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfdz", 0xee4001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfe", 0xee480100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfep", 0xee480120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfem", 0xee480140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"dvfez", 0xee480160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"rdfs", 0xee500100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfsp", 0xee500120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfsm", 0xee500140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfsz", 0xee500160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfd", 0xee500180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfdp", 0xee5001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfdm", 0xee5001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfdz", 0xee5001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfe", 0xee580100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfep", 0xee580120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfem", 0xee580140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rdfez", 0xee580160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"pows", 0xee600100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powsp", 0xee600120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powsm", 0xee600140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powsz", 0xee600160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powd", 0xee600180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powdp", 0xee6001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powdm", 0xee6001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powdz", 0xee6001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powe", 0xee680100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powep", 0xee680120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powem", 0xee680140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"powez", 0xee680160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"rpws", 0xee700100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwsp", 0xee700120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwsm", 0xee700140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwsz", 0xee700160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwd", 0xee700180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwdp", 0xee7001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwdm", 0xee7001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwdz", 0xee7001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwe", 0xee780100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwep", 0xee780120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwem", 0xee780140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rpwez", 0xee780160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"rmfs", 0xee800100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfsp", 0xee800120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfsm", 0xee800140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfsz", 0xee800160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfd", 0xee800180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfdp", 0xee8001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfdm", 0xee8001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfdz", 0xee8001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfe", 0xee880100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfep", 0xee880120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfem", 0xee880140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"rmfez", 0xee880160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"fmls", 0xee900100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlsp", 0xee900120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlsm", 0xee900140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlsz", 0xee900160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmld", 0xee900180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmldp", 0xee9001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmldm", 0xee9001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmldz", 0xee9001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmle", 0xee980100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlep", 0xee980120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlem", 0xee980140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fmlez", 0xee980160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"fdvs", 0xeea00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvsp", 0xeea00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvsm", 0xeea00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvsz", 0xeea00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvd", 0xeea00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvdp", 0xeea001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvdm", 0xeea001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvdz", 0xeea001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdve", 0xeea80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvep", 0xeea80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvem", 0xeea80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"fdvez", 0xeea80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"frds", 0xeeb00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdsp", 0xeeb00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdsm", 0xeeb00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdsz", 0xeeb00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdd", 0xeeb00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frddp", 0xeeb001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frddm", 0xeeb001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frddz", 0xeeb001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frde", 0xeeb80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdep", 0xeeb80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdem", 0xeeb80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"frdez", 0xeeb80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"pols", 0xeec00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polsp", 0xeec00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polsm", 0xeec00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polsz", 0xeec00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"pold", 0xeec00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"poldp", 0xeec001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"poldm", 0xeec001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"poldz", 0xeec001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"pole", 0xeec80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polep", 0xeec80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polem", 0xeec80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + {"polez", 0xeec80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, + + {"cmf", 0xee90f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, + {"cmfe", 0xeed0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, + {"cnf", 0xeeb0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, + {"cnfe", 0xeef0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, + /* The FPA10 data sheet suggests that the 'E' of cmfe/cnfe should + not be an optional suffix, but part of the instruction. To be + compatible, we accept either. */ + {"cmfe", 0xeed0f110, 4, FPU_FPA_EXT_V1, do_fpa_cmp}, + {"cnfe", 0xeef0f110, 4, FPU_FPA_EXT_V1, do_fpa_cmp}, + + {"flts", 0xee000110, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltsp", 0xee000130, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltsm", 0xee000150, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltsz", 0xee000170, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltd", 0xee000190, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltdp", 0xee0001b0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltdm", 0xee0001d0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltdz", 0xee0001f0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"flte", 0xee080110, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltep", 0xee080130, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltem", 0xee080150, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + {"fltez", 0xee080170, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, + + /* The implementation of the FIX instruction is broken on some + assemblers, in that it accepts a precision specifier as well as a + rounding specifier, despite the fact that this is meaningless. + To be more compatible, we accept it as well, though of course it + does not set any bits. */ + {"fix", 0xee100110, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixsp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixsm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixsz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixdp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixdm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixdz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixep", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixem", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + {"fixez", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, + + /* Instructions that were new with the real FPA, call them V2. */ + {"lfm", 0xec100200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + {"lfmfd", 0xec900200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + {"lfmea", 0xed100200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + {"sfm", 0xec000200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + {"sfmfd", 0xed000200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + {"sfmea", 0xec800200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, + + /* VFP V1xD (single precision). */ + /* Moves and type conversions. */ + {"fcpys", 0xeeb00a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fmrs", 0xee100a10, 4, FPU_VFP_EXT_V1xD, do_vfp_reg_from_sp}, + {"fmsr", 0xee000a10, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_from_reg}, + {"fmstat", 0xeef1fa10, 6, FPU_VFP_EXT_V1xD, do_empty}, + {"fsitos", 0xeeb80ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fuitos", 0xeeb80a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"ftosis", 0xeebd0a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"ftosizs", 0xeebd0ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"ftouis", 0xeebc0a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"ftouizs", 0xeebc0ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fmrx", 0xeef00a10, 4, FPU_VFP_EXT_V1xD, do_vfp_reg_from_ctrl}, + {"fmxr", 0xeee00a10, 4, FPU_VFP_EXT_V1xD, do_vfp_ctrl_from_reg}, + + /* Memory operations. */ + {"flds", 0xed100a00, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_ldst}, + {"fsts", 0xed000a00, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_ldst}, + {"fldmias", 0xec900a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, + {"fldmfds", 0xec900a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, + {"fldmdbs", 0xed300a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, + {"fldmeas", 0xed300a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, + {"fldmiax", 0xec900b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, + {"fldmfdx", 0xec900b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, + {"fldmdbx", 0xed300b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, + {"fldmeax", 0xed300b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, + {"fstmias", 0xec800a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, + {"fstmeas", 0xec800a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, + {"fstmdbs", 0xed200a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, + {"fstmfds", 0xed200a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, + {"fstmiax", 0xec800b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, + {"fstmeax", 0xec800b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, + {"fstmdbx", 0xed200b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, + {"fstmfdx", 0xed200b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, + + /* Monadic operations. */ + {"fabss", 0xeeb00ac0, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fnegs", 0xeeb10a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fsqrts", 0xeeb10ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + + /* Dyadic operations. */ + {"fadds", 0xee300a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fsubs", 0xee300a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fmuls", 0xee200a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fdivs", 0xee800a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fmacs", 0xee000a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fmscs", 0xee100a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fnmuls", 0xee200a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fnmacs", 0xee000a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + {"fnmscs", 0xee100a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, + + /* Comparisons. */ + {"fcmps", 0xeeb40a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fcmpzs", 0xeeb50a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_compare_z}, + {"fcmpes", 0xeeb40ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, + {"fcmpezs", 0xeeb50ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_compare_z}, + + /* VFP V1 (Double precision). */ + /* Moves and type conversions. */ + {"fcpyd", 0xeeb00b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + {"fcvtds", 0xeeb70ac0, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, + {"fcvtsd", 0xeeb70bc0, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, + {"fmdhr", 0xee200b10, 5, FPU_VFP_EXT_V1, do_vfp_dp_from_reg}, + {"fmdlr", 0xee000b10, 5, FPU_VFP_EXT_V1, do_vfp_dp_from_reg}, + {"fmrdh", 0xee300b10, 5, FPU_VFP_EXT_V1, do_vfp_reg_from_dp}, + {"fmrdl", 0xee100b10, 5, FPU_VFP_EXT_V1, do_vfp_reg_from_dp}, + {"fsitod", 0xeeb80bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, + {"fuitod", 0xeeb80b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, + {"ftosid", 0xeebd0b40, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, + {"ftosizd", 0xeebd0bc0, 7, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, + {"ftouid", 0xeebc0b40, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, + {"ftouizd", 0xeebc0bc0, 7, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, + + /* Memory operations. */ + {"fldd", 0xed100b00, 4, FPU_VFP_EXT_V1, do_vfp_dp_ldst}, + {"fstd", 0xed000b00, 4, FPU_VFP_EXT_V1, do_vfp_dp_ldst}, + {"fldmiad", 0xec900b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, + {"fldmfdd", 0xec900b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, + {"fldmdbd", 0xed300b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, + {"fldmead", 0xed300b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, + {"fstmiad", 0xec800b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, + {"fstmead", 0xec800b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, + {"fstmdbd", 0xed200b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, + {"fstmfdd", 0xed200b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, + + /* Monadic operations. */ + {"fabsd", 0xeeb00bc0, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + {"fnegd", 0xeeb10b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + {"fsqrtd", 0xeeb10bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + + /* Dyadic operations. */ + {"faddd", 0xee300b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fsubd", 0xee300b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fmuld", 0xee200b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fdivd", 0xee800b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fmacd", 0xee000b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fmscd", 0xee100b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fnmuld", 0xee200b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fnmacd", 0xee000b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + {"fnmscd", 0xee100b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, + + /* Comparisons. */ + {"fcmpd", 0xeeb40b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + {"fcmpzd", 0xeeb50b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_compare_z}, + {"fcmped", 0xeeb40bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, + {"fcmpezd", 0xeeb50bc0, 7, FPU_VFP_EXT_V1, do_vfp_dp_compare_z}, + + /* VFP V2. */ + {"fmsrr", 0xec400a10, 5, FPU_VFP_EXT_V2, do_vfp_sp_reg2}, + {"fmrrs", 0xec500a10, 5, FPU_VFP_EXT_V2, do_vfp_sp_reg2}, + {"fmdrr", 0xec400b10, 5, FPU_VFP_EXT_V2, do_vfp_dp_from_reg2}, + {"fmrrd", 0xec500b10, 5, FPU_VFP_EXT_V2, do_vfp_reg2_from_dp}, + + /* Intel XScale extensions to ARM V5 ISA. (All use CP0). */ + {"mia", 0xee200010, 3, ARM_CEXT_XSCALE, do_xsc_mia}, + {"miaph", 0xee280010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, + {"miabb", 0xee2c0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, + {"miabt", 0xee2d0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, + {"miatb", 0xee2e0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, + {"miatt", 0xee2f0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, + {"mar", 0xec400000, 3, ARM_CEXT_XSCALE, do_xsc_mar}, + {"mra", 0xec500000, 3, ARM_CEXT_XSCALE, do_xsc_mra}, + + /* Cirrus Maverick instructions. */ + {"cfldrs", 0xec100400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_1}, + {"cfldrd", 0xec500400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_2}, + {"cfldr32", 0xec100500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_3}, + {"cfldr64", 0xec500500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_4}, + {"cfstrs", 0xec000400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_1}, + {"cfstrd", 0xec400400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_2}, + {"cfstr32", 0xec000500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_3}, + {"cfstr64", 0xec400500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_4}, + {"cfmvsr", 0xee000450, 6, ARM_CEXT_MAVERICK, do_mav_binops_2a}, + {"cfmvrs", 0xee100450, 6, ARM_CEXT_MAVERICK, do_mav_binops_1a}, + {"cfmvdlr", 0xee000410, 7, ARM_CEXT_MAVERICK, do_mav_binops_2b}, + {"cfmvrdl", 0xee100410, 7, ARM_CEXT_MAVERICK, do_mav_binops_1b}, + {"cfmvdhr", 0xee000430, 7, ARM_CEXT_MAVERICK, do_mav_binops_2b}, + {"cfmvrdh", 0xee100430, 7, ARM_CEXT_MAVERICK, do_mav_binops_1b}, + {"cfmv64lr", 0xee000510, 8, ARM_CEXT_MAVERICK, do_mav_binops_2c}, + {"cfmvr64l", 0xee100510, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, + {"cfmv64hr", 0xee000530, 8, ARM_CEXT_MAVERICK, do_mav_binops_2c}, + {"cfmvr64h", 0xee100530, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, + {"cfmval32", 0xee100610, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32al", 0xee000610, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmvam32", 0xee100630, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32am", 0xee000630, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmvah32", 0xee100650, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32ah", 0xee000650, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmva32", 0xee100670, 7, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32a", 0xee000670, 7, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmva64", 0xee100690, 7, ARM_CEXT_MAVERICK, do_mav_binops_3c}, + {"cfmv64a", 0xee000690, 7, ARM_CEXT_MAVERICK, do_mav_binops_3d}, + {"cfmvsc32", 0xee1006b0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_1}, + {"cfmv32sc", 0xee0006b0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_2}, + {"cfcpys", 0xee000400, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, + {"cfcpyd", 0xee000420, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, + {"cfcvtsd", 0xee000460, 7, ARM_CEXT_MAVERICK, do_mav_binops_1f}, + {"cfcvtds", 0xee000440, 7, ARM_CEXT_MAVERICK, do_mav_binops_1g}, + {"cfcvt32s", 0xee000480, 8, ARM_CEXT_MAVERICK, do_mav_binops_1h}, + {"cfcvt32d", 0xee0004a0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1i}, + {"cfcvt64s", 0xee0004c0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1j}, + {"cfcvt64d", 0xee0004e0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1k}, + {"cfcvts32", 0xee100580, 8, ARM_CEXT_MAVERICK, do_mav_binops_1l}, + {"cfcvtd32", 0xee1005a0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1m}, + {"cftruncs32", 0xee1005c0, 10, ARM_CEXT_MAVERICK, do_mav_binops_1l}, + {"cftruncd32", 0xee1005e0, 10, ARM_CEXT_MAVERICK, do_mav_binops_1m}, + {"cfrshl32", 0xee000550, 8, ARM_CEXT_MAVERICK, do_mav_triple_4a}, + {"cfrshl64", 0xee000570, 8, ARM_CEXT_MAVERICK, do_mav_triple_4b}, + {"cfsh32", 0xee000500, 6, ARM_CEXT_MAVERICK, do_mav_shift_1}, + {"cfsh64", 0xee200500, 6, ARM_CEXT_MAVERICK, do_mav_shift_2}, + {"cfcmps", 0xee100490, 6, ARM_CEXT_MAVERICK, do_mav_triple_5a}, + {"cfcmpd", 0xee1004b0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5b}, + {"cfcmp32", 0xee100590, 7, ARM_CEXT_MAVERICK, do_mav_triple_5c}, + {"cfcmp64", 0xee1005b0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5d}, + {"cfabss", 0xee300400, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, + {"cfabsd", 0xee300420, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, + {"cfnegs", 0xee300440, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, + {"cfnegd", 0xee300460, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, + {"cfadds", 0xee300480, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, + {"cfaddd", 0xee3004a0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, + {"cfsubs", 0xee3004c0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, + {"cfsubd", 0xee3004e0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, + {"cfmuls", 0xee100400, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, + {"cfmuld", 0xee100420, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, + {"cfabs32", 0xee300500, 7, ARM_CEXT_MAVERICK, do_mav_binops_1n}, + {"cfabs64", 0xee300520, 7, ARM_CEXT_MAVERICK, do_mav_binops_1o}, + {"cfneg32", 0xee300540, 7, ARM_CEXT_MAVERICK, do_mav_binops_1n}, + {"cfneg64", 0xee300560, 7, ARM_CEXT_MAVERICK, do_mav_binops_1o}, + {"cfadd32", 0xee300580, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, + {"cfadd64", 0xee3005a0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, + {"cfsub32", 0xee3005c0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, + {"cfsub64", 0xee3005e0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, + {"cfmul32", 0xee100500, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, + {"cfmul64", 0xee100520, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, + {"cfmac32", 0xee100540, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, + {"cfmsc32", 0xee100560, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, + {"cfmadd32", 0xee000600, 8, ARM_CEXT_MAVERICK, do_mav_quad_6a}, + {"cfmsub32", 0xee100600, 8, ARM_CEXT_MAVERICK, do_mav_quad_6a}, + {"cfmadda32", 0xee200600, 9, ARM_CEXT_MAVERICK, do_mav_quad_6b}, + {"cfmsuba32", 0xee300600, 9, ARM_CEXT_MAVERICK, do_mav_quad_6b}, }; /* Defines for various bits that we will want to toggle. */ @@ -896,8 +1818,9 @@ static CONST struct asm_opcode insns[] = #define LDM_TYPE_2_OR_3 0x00400000 #define LITERAL_MASK 0xf000f000 -#define COND_MASK 0xf0000000 #define OPCODE_MASK 0xfe1fffff +#define V4_STR_BIT 0x00000020 + #define DATA_OP_SHIFT 21 /* Codes to distinguish the arithmetic instructions. */ @@ -918,6 +1841,7 @@ static CONST struct asm_opcode insns[] = #define OPCODE_BIC 14 #define OPCODE_MVN 15 +/* Thumb v1 (ARMv4T). */ static void do_t_nop PARAMS ((char *)); static void do_t_arit PARAMS ((char *)); static void do_t_add PARAMS ((char *)); @@ -943,6 +1867,10 @@ static void do_t_sub PARAMS ((char *)); static void do_t_swi PARAMS ((char *)); static void do_t_adr PARAMS ((char *)); +/* Thumb v2 (ARMv5T). */ +static void do_t_blx PARAMS ((char *)); +static void do_t_bkpt PARAMS ((char *)); + #define T_OPCODE_MUL 0x4340 #define T_OPCODE_TST 0x4200 #define T_OPCODE_CMN 0x42c0 @@ -1025,7 +1953,7 @@ static int thumb_reg PARAMS ((char ** str, int hi_lo)); struct thumb_opcode { /* Basic string to match. */ - CONST char * template; + const char * template; /* Basic instruction code. */ unsigned long value; @@ -1033,137 +1961,87 @@ struct thumb_opcode int size; /* Which CPU variants this exists for. */ - unsigned long variants; + unsigned long variant; /* Function to call to parse args. */ void (* parms) PARAMS ((char *)); }; -static CONST struct thumb_opcode tinsns[] = -{ - {"adc", 0x4140, 2, ARM_EXT_THUMB, do_t_arit}, - {"add", 0x0000, 2, ARM_EXT_THUMB, do_t_add}, - {"and", 0x4000, 2, ARM_EXT_THUMB, do_t_arit}, - {"asr", 0x0000, 2, ARM_EXT_THUMB, do_t_asr}, - {"b", T_OPCODE_BRANCH, 2, ARM_EXT_THUMB, do_t_branch12}, - {"beq", 0xd0fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bne", 0xd1fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bcs", 0xd2fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bhs", 0xd2fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bcc", 0xd3fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bul", 0xd3fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"blo", 0xd3fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bmi", 0xd4fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bpl", 0xd5fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bvs", 0xd6fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bvc", 0xd7fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bhi", 0xd8fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bls", 0xd9fe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bge", 0xdafe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"blt", 0xdbfe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bgt", 0xdcfe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"ble", 0xddfe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bal", 0xdefe, 2, ARM_EXT_THUMB, do_t_branch9}, - {"bic", 0x4380, 2, ARM_EXT_THUMB, do_t_arit}, - {"bl", 0xf7fffffe, 4, ARM_EXT_THUMB, do_t_branch23}, - {"blx", 0, 0, ARM_EXT_V5, do_t_blx}, - {"bkpt", 0xbe00, 2, ARM_EXT_V5, do_t_bkpt}, - {"bx", 0x4700, 2, ARM_EXT_THUMB, do_t_bx}, - {"cmn", T_OPCODE_CMN, 2, ARM_EXT_THUMB, do_t_arit}, - {"cmp", 0x0000, 2, ARM_EXT_THUMB, do_t_compare}, - {"eor", 0x4040, 2, ARM_EXT_THUMB, do_t_arit}, - {"ldmia", 0xc800, 2, ARM_EXT_THUMB, do_t_ldmstm}, - {"ldr", 0x0000, 2, ARM_EXT_THUMB, do_t_ldr}, - {"ldrb", 0x0000, 2, ARM_EXT_THUMB, do_t_ldrb}, - {"ldrh", 0x0000, 2, ARM_EXT_THUMB, do_t_ldrh}, - {"ldrsb", 0x5600, 2, ARM_EXT_THUMB, do_t_lds}, - {"ldrsh", 0x5e00, 2, ARM_EXT_THUMB, do_t_lds}, - {"ldsb", 0x5600, 2, ARM_EXT_THUMB, do_t_lds}, - {"ldsh", 0x5e00, 2, ARM_EXT_THUMB, do_t_lds}, - {"lsl", 0x0000, 2, ARM_EXT_THUMB, do_t_lsl}, - {"lsr", 0x0000, 2, ARM_EXT_THUMB, do_t_lsr}, - {"mov", 0x0000, 2, ARM_EXT_THUMB, do_t_mov}, - {"mul", T_OPCODE_MUL, 2, ARM_EXT_THUMB, do_t_arit}, - {"mvn", T_OPCODE_MVN, 2, ARM_EXT_THUMB, do_t_arit}, - {"neg", T_OPCODE_NEG, 2, ARM_EXT_THUMB, do_t_arit}, - {"orr", 0x4300, 2, ARM_EXT_THUMB, do_t_arit}, - {"pop", 0xbc00, 2, ARM_EXT_THUMB, do_t_push_pop}, - {"push", 0xb400, 2, ARM_EXT_THUMB, do_t_push_pop}, - {"ror", 0x41c0, 2, ARM_EXT_THUMB, do_t_arit}, - {"sbc", 0x4180, 2, ARM_EXT_THUMB, do_t_arit}, - {"stmia", 0xc000, 2, ARM_EXT_THUMB, do_t_ldmstm}, - {"str", 0x0000, 2, ARM_EXT_THUMB, do_t_str}, - {"strb", 0x0000, 2, ARM_EXT_THUMB, do_t_strb}, - {"strh", 0x0000, 2, ARM_EXT_THUMB, do_t_strh}, - {"swi", 0xdf00, 2, ARM_EXT_THUMB, do_t_swi}, - {"sub", 0x0000, 2, ARM_EXT_THUMB, do_t_sub}, - {"tst", T_OPCODE_TST, 2, ARM_EXT_THUMB, do_t_arit}, +static const struct thumb_opcode tinsns[] = +{ + /* Thumb v1 (ARMv4T). */ + {"adc", 0x4140, 2, ARM_EXT_V4T, do_t_arit}, + {"add", 0x0000, 2, ARM_EXT_V4T, do_t_add}, + {"and", 0x4000, 2, ARM_EXT_V4T, do_t_arit}, + {"asr", 0x0000, 2, ARM_EXT_V4T, do_t_asr}, + {"b", T_OPCODE_BRANCH, 2, ARM_EXT_V4T, do_t_branch12}, + {"beq", 0xd0fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bne", 0xd1fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bcs", 0xd2fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bhs", 0xd2fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bcc", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bul", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"blo", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bmi", 0xd4fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bpl", 0xd5fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bvs", 0xd6fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bvc", 0xd7fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bhi", 0xd8fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bls", 0xd9fe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bge", 0xdafe, 2, ARM_EXT_V4T, do_t_branch9}, + {"blt", 0xdbfe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bgt", 0xdcfe, 2, ARM_EXT_V4T, do_t_branch9}, + {"ble", 0xddfe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bal", 0xdefe, 2, ARM_EXT_V4T, do_t_branch9}, + {"bic", 0x4380, 2, ARM_EXT_V4T, do_t_arit}, + {"bl", 0xf7fffffe, 4, ARM_EXT_V4T, do_t_branch23}, + {"bx", 0x4700, 2, ARM_EXT_V4T, do_t_bx}, + {"cmn", T_OPCODE_CMN, 2, ARM_EXT_V4T, do_t_arit}, + {"cmp", 0x0000, 2, ARM_EXT_V4T, do_t_compare}, + {"eor", 0x4040, 2, ARM_EXT_V4T, do_t_arit}, + {"ldmia", 0xc800, 2, ARM_EXT_V4T, do_t_ldmstm}, + {"ldr", 0x0000, 2, ARM_EXT_V4T, do_t_ldr}, + {"ldrb", 0x0000, 2, ARM_EXT_V4T, do_t_ldrb}, + {"ldrh", 0x0000, 2, ARM_EXT_V4T, do_t_ldrh}, + {"ldrsb", 0x5600, 2, ARM_EXT_V4T, do_t_lds}, + {"ldrsh", 0x5e00, 2, ARM_EXT_V4T, do_t_lds}, + {"ldsb", 0x5600, 2, ARM_EXT_V4T, do_t_lds}, + {"ldsh", 0x5e00, 2, ARM_EXT_V4T, do_t_lds}, + {"lsl", 0x0000, 2, ARM_EXT_V4T, do_t_lsl}, + {"lsr", 0x0000, 2, ARM_EXT_V4T, do_t_lsr}, + {"mov", 0x0000, 2, ARM_EXT_V4T, do_t_mov}, + {"mul", T_OPCODE_MUL, 2, ARM_EXT_V4T, do_t_arit}, + {"mvn", T_OPCODE_MVN, 2, ARM_EXT_V4T, do_t_arit}, + {"neg", T_OPCODE_NEG, 2, ARM_EXT_V4T, do_t_arit}, + {"orr", 0x4300, 2, ARM_EXT_V4T, do_t_arit}, + {"pop", 0xbc00, 2, ARM_EXT_V4T, do_t_push_pop}, + {"push", 0xb400, 2, ARM_EXT_V4T, do_t_push_pop}, + {"ror", 0x41c0, 2, ARM_EXT_V4T, do_t_arit}, + {"sbc", 0x4180, 2, ARM_EXT_V4T, do_t_arit}, + {"stmia", 0xc000, 2, ARM_EXT_V4T, do_t_ldmstm}, + {"str", 0x0000, 2, ARM_EXT_V4T, do_t_str}, + {"strb", 0x0000, 2, ARM_EXT_V4T, do_t_strb}, + {"strh", 0x0000, 2, ARM_EXT_V4T, do_t_strh}, + {"swi", 0xdf00, 2, ARM_EXT_V4T, do_t_swi}, + {"sub", 0x0000, 2, ARM_EXT_V4T, do_t_sub}, + {"tst", T_OPCODE_TST, 2, ARM_EXT_V4T, do_t_arit}, /* Pseudo ops: */ - {"adr", 0x0000, 2, ARM_EXT_THUMB, do_t_adr}, - {"nop", 0x46C0, 2, ARM_EXT_THUMB, do_t_nop}, /* mov r8,r8 */ -}; - -struct reg_entry -{ - CONST char * name; - int number; -}; - -#define int_register(reg) ((reg) >= 0 && (reg) <= 15) -#define cp_register(reg) ((reg) >= 32 && (reg) <= 47) -#define fp_register(reg) ((reg) >= 16 && (reg) <= 23) - -#define REG_PC 15 -#define REG_LR 14 -#define REG_SP 13 - -/* These are the standard names. Users can add aliases with .req. */ -static CONST struct reg_entry reg_table[] = -{ - /* Processor Register Numbers. */ - {"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, - {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, - {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, - {"r12", 12}, {"r13", REG_SP},{"r14", REG_LR},{"r15", REG_PC}, - /* APCS conventions. */ - {"a1", 0}, {"a2", 1}, {"a3", 2}, {"a4", 3}, - {"v1", 4}, {"v2", 5}, {"v3", 6}, {"v4", 7}, {"v5", 8}, - {"v6", 9}, {"sb", 9}, {"v7", 10}, {"sl", 10}, - {"fp", 11}, {"ip", 12}, {"sp", REG_SP},{"lr", REG_LR},{"pc", REG_PC}, - /* ATPCS additions to APCS conventions. */ - {"wr", 7}, {"v8", 11}, - /* FP Registers. */ - {"f0", 16}, {"f1", 17}, {"f2", 18}, {"f3", 19}, - {"f4", 20}, {"f5", 21}, {"f6", 22}, {"f7", 23}, - {"c0", 32}, {"c1", 33}, {"c2", 34}, {"c3", 35}, - {"c4", 36}, {"c5", 37}, {"c6", 38}, {"c7", 39}, - {"c8", 40}, {"c9", 41}, {"c10", 42}, {"c11", 43}, - {"c12", 44}, {"c13", 45}, {"c14", 46}, {"c15", 47}, - {"cr0", 32}, {"cr1", 33}, {"cr2", 34}, {"cr3", 35}, - {"cr4", 36}, {"cr5", 37}, {"cr6", 38}, {"cr7", 39}, - {"cr8", 40}, {"cr9", 41}, {"cr10", 42}, {"cr11", 43}, - {"cr12", 44}, {"cr13", 45}, {"cr14", 46}, {"cr15", 47}, - /* ATPCS additions to float register names. */ - {"s0",16}, {"s1",17}, {"s2",18}, {"s3",19}, - {"s4",20}, {"s5",21}, {"s6",22}, {"s7",23}, - {"d0",16}, {"d1",17}, {"d2",18}, {"d3",19}, - {"d4",20}, {"d5",21}, {"d6",22}, {"d7",23}, - /* FIXME: At some point we need to add VFP register names. */ - /* Array terminator. */ - {NULL, 0} + {"adr", 0x0000, 2, ARM_EXT_V4T, do_t_adr}, + {"nop", 0x46C0, 2, ARM_EXT_V4T, do_t_nop}, /* mov r8,r8 */ + /* Thumb v2 (ARMv5T). */ + {"blx", 0, 0, ARM_EXT_V5T, do_t_blx}, + {"bkpt", 0xbe00, 2, ARM_EXT_V5T, do_t_bkpt}, }; -#define BAD_ARGS _("Bad arguments to instruction") +#define BAD_ARGS _("bad arguments to instruction") #define BAD_PC _("r15 not allowed here") -#define BAD_FLAGS _("Instruction should not have flags") -#define BAD_COND _("Instruction is not conditional") +#define BAD_COND _("instruction is not conditional") #define ERR_NO_ACCUM _("acc0 expected") static struct hash_control * arm_ops_hsh = NULL; static struct hash_control * arm_tops_hsh = NULL; static struct hash_control * arm_cond_hsh = NULL; static struct hash_control * arm_shift_hsh = NULL; -static struct hash_control * arm_reg_hsh = NULL; static struct hash_control * arm_psr_hsh = NULL; /* This table describes all the machine specific pseudo-ops the assembler @@ -1192,7 +2070,7 @@ static void s_arm_elf_cons PARAMS ((int)); static int my_get_expression PARAMS ((expressionS *, char **)); -CONST pseudo_typeS md_pseudo_table[] = +const pseudo_typeS md_pseudo_table[] = { /* Never called becasue '.req' does not start line. */ { "req", s_req, 0 }, @@ -1228,6 +2106,12 @@ CONST pseudo_typeS md_pseudo_table[] = { 0, 0, 0 } }; +/* Other internal functions. */ +static int arm_parse_extension PARAMS ((char *, int *)); +static int arm_parse_cpu PARAMS ((char *)); +static int arm_parse_arch PARAMS ((char *)); +static int arm_parse_fpu PARAMS ((char *)); + /* Stuff needed to resolve the label ambiguity As: ... @@ -1297,7 +2181,7 @@ add_to_lit_pool () { if (next_literal_pool_place >= MAX_LITERAL_POOL_SIZE) { - inst.error = _("Literal Pool Overflow"); + inst.error = _("literal pool overflow"); return FAIL; } @@ -1318,7 +2202,7 @@ add_to_lit_pool () static void symbol_locate (symbolP, name, segment, valu, frag) symbolS * symbolP; - CONST char * name; /* It is copied, the caller can modify. */ + const char * name; /* It is copied, the caller can modify. */ segT segment; /* Segment identifier (SEG_). */ valueT valu; /* Symbol value. */ fragS * frag; /* Associated fragment. */ @@ -1439,7 +2323,7 @@ static void s_req (a) int a ATTRIBUTE_UNUSED; { - as_bad (_("Invalid syntax for .req directive.")); + as_bad (_("invalid syntax for .req directive")); } static void @@ -1514,10 +2398,10 @@ s_align (unused) temp = get_absolute_expression (); if (temp > max_alignment) - as_bad (_("Alignment too large: %d. assumed."), temp = max_alignment); + as_bad (_("alignment too large: %d assumed"), temp = max_alignment); else if (temp < 0) { - as_bad (_("Alignment negative. 0 assumed.")); + as_bad (_("alignment negative. 0 assumed.")); temp = 0; } @@ -1601,7 +2485,7 @@ s_thumb_set (equiv) if (*input_line_pointer != ',') { *end_name = 0; - as_bad (_("Expected comma after name \"%s\""), name); + as_bad (_("expected comma after name \"%s\""), name); *end_name = delim; ignore_rest_of_line (); return; @@ -1721,7 +2605,7 @@ opcode_select (width) case 16: if (! thumb_mode) { - if (! (cpu_variant & ARM_EXT_THUMB)) + if (! (cpu_variant & ARM_EXT_V4T)) as_bad (_("selected processor does not support THUMB opcodes")); thumb_mode = 1; @@ -1734,7 +2618,7 @@ opcode_select (width) case 32: if (thumb_mode) { - if ((cpu_variant & ARM_ANY) == ARM_EXT_THUMB) + if ((cpu_variant & ARM_ALL) == ARM_EXT_V4T) as_bad (_("selected processor does not support ARM opcodes")); thumb_mode = 0; @@ -1788,12 +2672,12 @@ s_code (unused) static void end_of_line (str) - char * str; + char *str; { skip_whitespace (str); - if (* str != '\0') - inst.error = _("Garbage following instruction"); + if (*str != '\0' && !inst.error) + inst.error = _("garbage following instruction"); } static int @@ -1831,7 +2715,7 @@ reg_required_here (str, shift) int reg; char * start = * str; - if ((reg = arm_reg_parse (str)) != FAIL && int_register (reg)) + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_RN].htab)) != FAIL) { if (shift >= 0) inst.instruction |= reg << shift; @@ -1843,20 +2727,20 @@ reg_required_here (str, shift) /* In the few cases where we might be able to accept something else this error can be overridden. */ - sprintf (buff, _("Register expected, not '%.100s'"), start); + sprintf (buff, _("register expected, not '%.100s'"), start); inst.error = buff; return FAIL; } -static CONST struct asm_psr * +static const struct asm_psr * arm_psr_parse (ccp) register char ** ccp; { char * start = * ccp; char c; char * p; - CONST struct asm_psr * psr; + const struct asm_psr * psr; p = start; @@ -1865,7 +2749,7 @@ arm_psr_parse (ccp) { c = *p++; } - while (isalpha (c) || c == '_'); + while (ISALPHA (c) || c == '_'); /* Terminate the word. */ *--p = 0; @@ -1878,7 +2762,7 @@ arm_psr_parse (ccp) strncpy (start, "SPSR", 4); /* Now locate the word in the psr hash table. */ - psr = (CONST struct asm_psr *) hash_find (arm_psr_hsh, start); + psr = (const struct asm_psr *) hash_find (arm_psr_hsh, start); /* Restore the input stream. */ *p = c; @@ -1897,7 +2781,7 @@ psr_required_here (str) char ** str; { char * start = * str; - CONST struct asm_psr * psr; + const struct asm_psr * psr; psr = arm_psr_parse (str); @@ -1924,36 +2808,41 @@ psr_required_here (str) static int co_proc_number (str) - char ** str; + char **str; { int processor, pchar; + char *start; - skip_whitespace (* str); + skip_whitespace (*str); + start = *str; /* The data sheet seems to imply that just a number on its own is valid here, but the RISC iX assembler seems to accept a prefix 'p'. We will accept either. */ - if (**str == 'p' || **str == 'P') - (*str)++; - - pchar = *(*str)++; - if (pchar >= '0' && pchar <= '9') + if ((processor = arm_reg_parse (str, all_reg_maps[REG_TYPE_CP].htab)) + == FAIL) { - processor = pchar - '0'; - if (**str >= '0' && **str <= '9') + *str = start; + + pchar = *(*str)++; + if (pchar >= '0' && pchar <= '9') { - processor = processor * 10 + *(*str)++ - '0'; - if (processor > 15) + processor = pchar - '0'; + if (**str >= '0' && **str <= '9') { - inst.error = _("Illegal co-processor number"); - return FAIL; + processor = processor * 10 + *(*str)++ - '0'; + if (processor > 15) + { + inst.error = _("illegal co-processor number"); + return FAIL; + } } } - } - else - { - inst.error = _("Bad or missing co-processor number"); - return FAIL; + else + { + inst.error = _("bad or missing co-processor number"); + return FAIL; + } } inst.instruction |= processor << 8; @@ -1998,16 +2887,15 @@ cp_reg_required_here (str, where) int reg; char * start = *str; - if ((reg = arm_reg_parse (str)) != FAIL && cp_register (reg)) + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_CN].htab)) != FAIL) { - reg &= 15; inst.instruction |= reg << where; return reg; } /* In the few cases where we might be able to accept something else this error can be overridden. */ - inst.error = _("Co-processor register expected"); + inst.error = _("co-processor register expected"); /* Restore the start point. */ *str = start; @@ -2022,16 +2910,15 @@ fp_reg_required_here (str, where) int reg; char * start = * str; - if ((reg = arm_reg_parse (str)) != FAIL && fp_register (reg)) + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_FN].htab)) != FAIL) { - reg &= 7; inst.instruction |= reg << where; return reg; } /* In the few cases where we might be able to accept something else this error can be overridden. */ - inst.error = _("Floating point register expected"); + inst.error = _("floating point register expected"); /* Restore the start point. */ *str = start; @@ -2087,8 +2974,9 @@ cp_address_offset (str) } static int -cp_address_required_here (str) +cp_address_required_here (str, wb_ok) char ** str; + int wb_ok; { char * p = * str; int pre_inc = 0; @@ -2110,7 +2998,7 @@ cp_address_required_here (str) { p++; - if (skip_past_comma (& p) == SUCCESS) + if (wb_ok && skip_past_comma (& p) == SUCCESS) { /* [Rn], #expr */ write_back = WRITE_BACK; @@ -2152,7 +3040,7 @@ cp_address_required_here (str) skip_whitespace (p); - if (*p == '!') + if (wb_ok && *p == '!') { if (reg == REG_PC) { @@ -2183,20 +3071,17 @@ cp_address_required_here (str) } static void -do_nop (str, flags) +do_empty (str) char * str; - unsigned long flags; { /* Do nothing really. */ - inst.instruction |= flags; /* This is pointless. */ end_of_line (str); return; } static void -do_mrs (str, flags) +do_mrs (str) char *str; - unsigned long flags; { int skip = 0; @@ -2230,7 +3115,7 @@ do_mrs (str, flags) skip = 8; else { - inst.error = _("{C|S}PSR expected"); + inst.error = _("CPSR or SPSR expected"); return; } @@ -2238,7 +3123,6 @@ do_mrs (str, flags) inst.instruction |= SPSR_BIT; str += skip; - inst.instruction |= flags; end_of_line (str); } @@ -2247,9 +3131,8 @@ do_mrs (str, flags) "{C|S}PSR_f, #expression". */ static void -do_msr (str, flags) +do_msr (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -2267,7 +3150,6 @@ do_msr (str, flags) if (reg_required_here (& str, 0) != FAIL) { inst.error = NULL; - inst.instruction |= flags; end_of_line (str); return; } @@ -2301,7 +3183,7 @@ do_msr (str, flags) } #endif - flags |= INST_IMMEDIATE; + inst.instruction |= INST_IMMEDIATE; if (inst.reloc.exp.X_add_symbol) { @@ -2314,7 +3196,7 @@ do_msr (str, flags) if (value == (unsigned) FAIL) { - inst.error = _("Invalid constant"); + inst.error = _("invalid constant"); return; } @@ -2322,7 +3204,6 @@ do_msr (str, flags) } inst.error = NULL; - inst.instruction |= flags; end_of_line (str); } @@ -2333,9 +3214,8 @@ do_msr (str, flags) SMLAL RdLo, RdHi, Rm, Rs. */ static void -do_mull (str, flags) +do_mull (str) char * str; - unsigned long flags; { int rdlo, rdhi, rm, rs; @@ -2379,15 +3259,13 @@ do_mull (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_mul (str, flags) +do_mul (str) char * str; - unsigned long flags; { int rd, rm; @@ -2435,15 +3313,13 @@ do_mul (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_mla (str, flags) +do_mla (str) char * str; - unsigned long flags; { int rd, rm; @@ -2493,7 +3369,6 @@ do_mla (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } @@ -2518,7 +3393,7 @@ accum0_required_here (str) *str = p; /* Advance caller's string pointer too. */ c = *p++; - while (isalnum (c)) + while (ISALNUM (c)) c = *p++; *--p = 0; /* Aap nul into input buffer at non-alnum. */ @@ -2570,7 +3445,7 @@ ld_mode_required_here (string) if (skip_past_comma (& str) == SUCCESS) { /* [Rn],... (post inc) */ - if (ldst_extend (& str, 1) == FAIL) + if (ldst_extend_v4 (&str) == FAIL) return FAIL; } else /* [Rn] */ @@ -2597,7 +3472,7 @@ ld_mode_required_here (string) pre_inc = 1; - if (ldst_extend (& str, 1) == FAIL) + if (ldst_extend_v4 (&str) == FAIL) return FAIL; skip_whitespace (str); @@ -2648,9 +3523,8 @@ ld_mode_required_here (string) Error if any register is R15. */ static void -do_smla (str, flags) +do_smla (str) char * str; - unsigned long flags; { int rd, rm, rs, rn; @@ -2668,9 +3542,6 @@ do_smla (str, flags) else if (rd == REG_PC || rm == REG_PC || rs == REG_PC || rn == REG_PC) inst.error = BAD_PC; - else if (flags) - inst.error = BAD_FLAGS; - else end_of_line (str); } @@ -2681,9 +3552,8 @@ do_smla (str, flags) Warning if Rdlo == Rdhi. */ static void -do_smlal (str, flags) +do_smlal (str) char * str; - unsigned long flags; { int rdlo, rdhi, rm, rs; @@ -2710,10 +3580,7 @@ do_smlal (str, flags) if (rdlo == rdhi) as_tsktsk (_("rdhi and rdlo must be different")); - if (flags) - inst.error = BAD_FLAGS; - else - end_of_line (str); + end_of_line (str); } /* ARM V5E (El Segundo) signed-multiply (argument parse) @@ -2721,9 +3588,8 @@ do_smlal (str, flags) Error if any register is R15. */ static void -do_smul (str, flags) +do_smul (str) char * str; - unsigned long flags; { int rd, rm, rs; @@ -2739,9 +3605,6 @@ do_smul (str, flags) else if (rd == REG_PC || rm == REG_PC || rs == REG_PC) inst.error = BAD_PC; - else if (flags) - inst.error = BAD_FLAGS; - else end_of_line (str); } @@ -2751,9 +3614,8 @@ do_smul (str, flags) Error if any register is R15. */ static void -do_qadd (str, flags) +do_qadd (str) char * str; - unsigned long flags; { int rd, rm, rn; @@ -2769,9 +3631,6 @@ do_qadd (str, flags) else if (rd == REG_PC || rm == REG_PC || rn == REG_PC) inst.error = BAD_PC; - else if (flags) - inst.error = BAD_FLAGS; - else end_of_line (str); } @@ -2786,9 +3645,8 @@ do_qadd (str, flags) Result unpredicatable if Rd or Rn is R15. */ static void -do_co_reg2c (str, flags) +do_co_reg2c (str) char * str; - unsigned long flags; { int rd, rn; @@ -2828,7 +3686,7 @@ do_co_reg2c (str, flags) /* Unpredictable result if rd or rn is R15. */ if (rd == REG_PC || rn == REG_PC) as_tsktsk - (_("Warning: Instruction unpredictable when using r15")); + (_("Warning: instruction unpredictable when using r15")); if (skip_past_comma (& str) == FAIL || cp_reg_required_here (& str, 0) == FAIL) @@ -2838,9 +3696,6 @@ do_co_reg2c (str, flags) return; } - if (flags) - inst.error = BAD_COND; - end_of_line (str); } @@ -2850,18 +3705,11 @@ do_co_reg2c (str, flags) Error if Rd or Rm are R15. */ static void -do_clz (str, flags) +do_clz (str) char * str; - unsigned long flags; { int rd, rm; - if (flags) - { - as_bad (BAD_FLAGS); - return; - } - skip_whitespace (str); if (((rd = reg_required_here (& str, 12)) == FAIL) @@ -2883,13 +3731,9 @@ do_clz (str, flags) Otherwise, it's the same as LDC/STC. */ static void -do_lstc2 (str, flags) +do_lstc2 (str) char * str; - unsigned long flags; { - if (flags) - inst.error = BAD_COND; - skip_whitespace (str); if (co_proc_number (& str) == FAIL) @@ -2904,7 +3748,7 @@ do_lstc2 (str, flags) inst.error = BAD_ARGS; } else if (skip_past_comma (& str) == FAIL - || cp_address_required_here (& str) == FAIL) + || cp_address_required_here (&str, CP_WB_OK) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; @@ -2919,9 +3763,8 @@ do_lstc2 (str, flags) Otherwise, it's the same as CDP. */ static void -do_cdp2 (str, flags) +do_cdp2 (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -2974,9 +3817,6 @@ do_cdp2 (str, flags) } } - if (flags) - inst.error = BAD_FLAGS; - end_of_line (str); } @@ -2987,9 +3827,8 @@ do_cdp2 (str, flags) Otherwise, it's the same as MCR/MRC. */ static void -do_co_reg2 (str, flags) +do_co_reg2 (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -3042,8 +3881,27 @@ do_co_reg2 (str, flags) } } - if (flags) - inst.error = BAD_COND; + end_of_line (str); +} + +/* ARM v5TEJ. Jump to Jazelle code. */ +static void +do_bxj (str) + char * str; +{ + int reg; + + skip_whitespace (str); + + if ((reg = reg_required_here (&str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + /* Note - it is not illegal to do a "bxj pc". Useless, but not illegal. */ + if (reg == REG_PC) + as_tsktsk (_("use of r15 in bxj is not really useful")); end_of_line (str); } @@ -3091,9 +3949,8 @@ do_t_bkpt (str) new one that can cope with setting one extra bit (the H bit). */ static void -do_branch25 (str, flags) +do_branch25 (str) char * str; - unsigned long flags ATTRIBUTE_UNUSED; { if (my_get_expression (& inst.reloc.exp, & str)) return; @@ -3146,19 +4003,12 @@ do_branch25 (str, flags) Also, the can be 25 bits, hence has its own reloc. */ static void -do_blx (str, flags) +do_blx (str) char * str; - unsigned long flags; { char * mystr = str; int rm; - if (flags) - { - as_bad (BAD_FLAGS); - return; - } - skip_whitespace (mystr); rm = reg_required_here (& mystr, 0); @@ -3171,7 +4021,7 @@ do_blx (str, flags) Use the condition code our caller put in inst.instruction. Pass ourselves off as a BX with a funny opcode. */ inst.instruction |= 0x012fff30; - do_bx (str, flags); + do_bx (str); } else { @@ -3186,7 +4036,7 @@ do_blx (str, flags) /* Process like a B/BL, but with a different reloc. Note that B/BL expecte fffffe, not 0, offset in the opcode table. */ - do_branch25 (str, flags); + do_branch25 (str); } } @@ -3238,13 +4088,11 @@ do_t_blx (str) BKPT <16 bit unsigned immediate> Instruction is not conditional. The bit pattern given in insns[] has the COND_ALWAYS condition, - and it is an error if the caller tried to override that. - Note "flags" is nonzero if a flag was supplied (which is an error). */ + and it is an error if the caller tried to override that. */ static void -do_bkpt (str, flags) +do_bkpt (str) char * str; - unsigned long flags; { expressionS expr; unsigned long number; @@ -3279,9 +4127,6 @@ do_bkpt (str, flags) inst.instruction |= number & 0xf; end_of_line (str); - - if (flags) - inst.error = BAD_FLAGS; } /* Xscale multiply-accumulate (argument parse) @@ -3290,17 +4135,13 @@ do_bkpt (str, flags) MIAxycc acc0,Rm,Rs. */ static void -do_mia (str, flags) +do_xsc_mia (str) char * str; - unsigned long flags; { int rs; int rm; - if (flags) - as_bad (BAD_FLAGS); - - else if (accum0_required_here (& str) == FAIL) + if (accum0_required_here (& str) == FAIL) inst.error = ERR_NO_ACCUM; else if (skip_past_comma (& str) == FAIL @@ -3324,16 +4165,12 @@ do_mia (str, flags) MARcc acc0,RdLo,RdHi. */ static void -do_mar (str, flags) +do_xsc_mar (str) char * str; - unsigned long flags; { int rdlo, rdhi; - if (flags) - as_bad (BAD_FLAGS); - - else if (accum0_required_here (& str) == FAIL) + if (accum0_required_here (& str) == FAIL) inst.error = ERR_NO_ACCUM; else if (skip_past_comma (& str) == FAIL @@ -3357,19 +4194,12 @@ do_mar (str, flags) MRAcc RdLo,RdHi,acc0. */ static void -do_mra (str, flags) +do_xsc_mra (str) char * str; - unsigned long flags; { int rdlo; int rdhi; - if (flags) - { - as_bad (BAD_FLAGS); - return; - } - skip_whitespace (str); if ((rdlo = reg_required_here (& str, 12)) == FAIL) @@ -3393,25 +4223,18 @@ do_mra (str, flags) end_of_line (str); } -/* Xscale: Preload-Cache +/* ARMv5TE: Preload-Cache PLD Syntactically, like LDR with B=1, W=0, L=1. */ static void -do_pld (str, flags) +do_pld (str) char * str; - unsigned long flags; { int rd; - if (flags) - { - as_bad (BAD_FLAGS); - return; - } - skip_whitespace (str); if (* str != '[') @@ -3420,7 +4243,7 @@ do_pld (str, flags) return; } - ++ str; + ++str; skip_whitespace (str); if ((rd = reg_required_here (& str, 16)) == FAIL) @@ -3428,21 +4251,23 @@ do_pld (str, flags) skip_whitespace (str); - if (* str == ']') + if (*str == ']') { /* [Rn], ... ? */ - ++ str; + ++str; skip_whitespace (str); - if (skip_past_comma (& str) == SUCCESS) + /* Post-indexed addressing is not allowed with PLD. */ + if (skip_past_comma (&str) == SUCCESS) { - if (ldst_extend (& str, 0) == FAIL) - return; + inst.error + = _("post-indexed expression used in preload instruction"); + return; } - else if (* str == '!') /* [Rn]! */ + else if (*str == '!') /* [Rn]! */ { inst.error = _("writeback used in preload instruction"); - ++ str; + ++str; } else /* [Rn] */ inst.instruction |= INDEX_UP | PRE_INDEX; @@ -3455,7 +4280,7 @@ do_pld (str, flags) return; } - if (ldst_extend (& str, 0) == FAIL) + if (ldst_extend (&str) == FAIL) return; skip_whitespace (str); @@ -3481,59 +4306,29 @@ do_pld (str, flags) end_of_line (str); } -/* Xscale load-consecutive (argument parse) +/* ARMv5TE load-consecutive (argument parse) Mode is like LDRH. LDRccD R, mode STRccD R, mode. */ static void -do_ldrd (str, flags) +do_ldrd (str) char * str; - unsigned long flags; { int rd; int rn; - if (flags != DOUBLE_LOAD_FLAG) - { - /* Change instruction pattern to normal ldr/str. */ - if (inst.instruction & 0x20) - inst.instruction = (inst.instruction & COND_MASK) | 0x04000000; /* str */ - else - inst.instruction = (inst.instruction & COND_MASK) | 0x04100000; /* ldr */ - - /* Perform a normal load/store instruction parse. */ - do_ldst (str, flags); + skip_whitespace (str); + if ((rd = reg_required_here (& str, 12)) == FAIL) + { + inst.error = BAD_ARGS; return; } - if ((cpu_variant & ARM_EXT_XSCALE) != ARM_EXT_XSCALE) - { - static char buff[128]; - - --str; - while (isspace (*str)) - --str; - str -= 4; - - /* Deny all knowledge. */ - sprintf (buff, _("bad instruction '%.100s'"), str); - inst.error = buff; - return; - } - - skip_whitespace (str); - - if ((rd = reg_required_here (& str, 12)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (& str) == FAIL - || (rn = ld_mode_required_here (& str)) == FAIL) + if (skip_past_comma (& str) == FAIL + || (rn = ld_mode_required_here (& str)) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; @@ -3543,22 +4338,32 @@ do_ldrd (str, flags) /* inst.instruction has now been zapped with Rd and the addressing mode. */ if (rd & 1) /* Unpredictable result if Rd is odd. */ { - inst.error = _("Destination register must be even"); + inst.error = _("destination register must be even"); return; } - if (rd == REG_LR || rd == 12) + if (rd == REG_LR) { - inst.error = _("r12 or r14 not allowed here"); + inst.error = _("r14 not allowed here"); return; } if (((rd == rn) || (rd + 1 == rn)) - && - ((inst.instruction & WRITE_BACK) - || (!(inst.instruction & PRE_INDEX)))) + && ((inst.instruction & WRITE_BACK) + || (!(inst.instruction & PRE_INDEX)))) as_warn (_("pre/post-indexing used when modified address register is destination")); + /* For an index-register load, the index register must not overlap the + destination (even if not write-back). */ + if ((inst.instruction & V4_STR_BIT) == 0 + && (inst.instruction & HWOFFSET_IMM) == 0) + { + int rm = inst.instruction & 0x0000000f; + + if (rm == rd || (rm == rd + 1)) + as_warn (_("ldrd destination registers must not overlap index register")); + } + end_of_line (str); } @@ -3651,6 +4456,8 @@ walk_no_bignums (sp) return 0; } +static int in_my_get_expression = 0; + static int my_get_expression (ep, str) expressionS * ep; @@ -3661,7 +4468,17 @@ my_get_expression (ep, str) save_in = input_line_pointer; input_line_pointer = *str; + in_my_get_expression = 1; seg = expression (ep); + in_my_get_expression = 0; + + if (ep->X_op == O_illegal) + { + /* We found a bad expression in md_operand(). */ + *str = input_line_pointer; + input_line_pointer = save_in; + return 1; + } #ifdef OBJ_AOUT if (seg != absolute_section @@ -3686,7 +4503,7 @@ my_get_expression (ep, str) || (ep->X_op_symbol && walk_no_bignums (ep->X_op_symbol))))) { - inst.error = _("Invalid constant"); + inst.error = _("invalid constant"); *str = input_line_pointer; input_line_pointer = save_in; return 1; @@ -3697,6 +4514,20 @@ my_get_expression (ep, str) return 0; } +/* We handle all bad expressions here, so that we can report the faulty + instruction in the error message. */ +void +md_operand (expr) + expressionS *expr; +{ + if (in_my_get_expression) + { + expr->X_op = O_illegal; + if (inst.error == NULL) + inst.error = _("bad expression"); + } +} + /* UNRESTRICT should be one if is permitted for this instruction. */ @@ -3711,12 +4542,12 @@ decode_shift (str, unrestrict) skip_whitespace (* str); - for (p = * str; isalpha (* p); p ++) + for (p = * str; ISALPHA (* p); p ++) ; if (p == * str) { - inst.error = _("Shift expression expected"); + inst.error = _("shift expression expected"); return FAIL; } @@ -3727,7 +4558,7 @@ decode_shift (str, unrestrict) if (shift == NULL) { - inst.error = _("Shift expression expected"); + inst.error = _("shift expression expected"); return FAIL; } @@ -3782,13 +4613,13 @@ decode_shift (str, unrestrict) about this though. */ if (num == 0) { - as_warn (_("Shift of 0 ignored.")); + as_warn (_("shift of 0 ignored.")); shift = & shift_names[0]; assert (shift->properties->index == SHIFT_LSL); } else { - inst.error = _("Invalid immediate shift"); + inst.error = _("invalid immediate shift"); return FAIL; } } @@ -3943,7 +4774,7 @@ data_op2 (str) if (expr.X_op != O_constant) { - inst.error = _("Constant expression expected"); + inst.error = _("constant expression expected"); return FAIL; } @@ -3952,7 +4783,7 @@ data_op2 (str) || (expr.X_add_number & 1) != 0 || ((unsigned) inst.reloc.exp.X_add_number) > 255) { - inst.error = _("Invalid constant"); + inst.error = _("invalid constant"); return FAIL; } inst.instruction |= INST_IMMEDIATE; @@ -3972,7 +4803,7 @@ data_op2 (str) inst.reloc.exp.X_add_number)) == FAIL) { - inst.error = _("Invalid constant"); + inst.error = _("invalid constant"); return FAIL; } } @@ -3985,7 +4816,7 @@ data_op2 (str) } (*str)++; - inst.error = _("Register or shift expression expected"); + inst.error = _("register or shift expression expected"); return FAIL; } } @@ -4038,19 +4869,18 @@ fp_op2 (str) return SUCCESS; } - inst.error = _("Invalid floating point immediate expression"); + inst.error = _("invalid floating point immediate expression"); return FAIL; } inst.error = - _("Floating point register or immediate expression expected"); + _("floating point register or immediate expression expected"); return FAIL; } } static void -do_arit (str, flags) +do_arit (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -4065,15 +4895,13 @@ do_arit (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_adr (str, flags) +do_adr (str) char * str; - unsigned long flags; { /* This is a pseudo-op of the form "adr rd, label" to be converted into a relative address of the form "add rd, pc, #label-.-8". */ @@ -4093,49 +4921,45 @@ do_adr (str, flags) inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ inst.reloc.pc_rel = 1; - inst.instruction |= flags; end_of_line (str); } static void -do_adrl (str, flags) +do_adrl (str) char * str; - unsigned long flags; { /* This is a pseudo-op of the form "adrl rd, label" to be converted into a relative address of the form: - add rd, pc, #low(label-.-8)" - add rd, rd, #high(label-.-8)" */ + add rd, pc, #low(label-.-8)" + add rd, rd, #high(label-.-8)" */ skip_whitespace (str); - if (reg_required_here (& str, 12) == FAIL - || skip_past_comma (& str) == FAIL - || my_get_expression (& inst.reloc.exp, & str)) + if (reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || my_get_expression (&inst.reloc.exp, &str)) { if (!inst.error) inst.error = BAD_ARGS; + return; } end_of_line (str); - /* Frag hacking will turn this into a sub instruction if the offset turns out to be negative. */ inst.reloc.type = BFD_RELOC_ARM_ADRL_IMMEDIATE; inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */ inst.reloc.pc_rel = 1; - inst.instruction |= flags; inst.size = INSN_SIZE * 2; return; } static void -do_cmp (str, flags) +do_cmp (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -4154,18 +4978,13 @@ do_cmp (str, flags) return; } - inst.instruction |= flags; - if ((flags & 0x0000f000) == 0) - inst.instruction |= CONDS_BIT; - end_of_line (str); return; } static void -do_mov (str, flags) +do_mov (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -4184,15 +5003,13 @@ do_mov (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static int -ldst_extend (str, hwse) +ldst_extend (str) char ** str; - int hwse; { int add = INDEX_UP; @@ -4208,8 +5025,7 @@ ldst_extend (str, hwse) { int value = inst.reloc.exp.X_add_number; - if ((hwse && (value < -255 || value > 255)) - || (value < -4095 || value > 4095)) + if (value < -4095 || value > 4095) { inst.error = _("address offset too large"); return FAIL; @@ -4221,23 +5037,11 @@ ldst_extend (str, hwse) add = 0; } - /* Halfword and signextension instructions have the - immediate value split across bits 11..8 and bits 3..0. */ - if (hwse) - inst.instruction |= (add | HWOFFSET_IMM - | ((value >> 4) << 8) | (value & 0xF)); - else - inst.instruction |= add | value; + inst.instruction |= add | value; } else { - if (hwse) - { - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; - } - else - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; inst.reloc.pc_rel = 0; } return SUCCESS; @@ -4254,62 +5058,34 @@ ldst_extend (str, hwse) if (reg_required_here (str, 0) == FAIL) return FAIL; - if (hwse) - inst.instruction |= add; - else - { - inst.instruction |= add | OFFSET_REG; - if (skip_past_comma (str) == SUCCESS) - return decode_shift (str, SHIFT_RESTRICT); - } + inst.instruction |= add | OFFSET_REG; + if (skip_past_comma (str) == SUCCESS) + return decode_shift (str, SHIFT_RESTRICT); return SUCCESS; } } static void -do_ldst (str, flags) +do_ldst (str) char * str; - unsigned long flags; { - int halfword = 0; int pre_inc = 0; int conflict_reg; int value; - /* This is not ideal, but it is the simplest way of dealing with the - ARM7T halfword instructions (since they use a different - encoding, but the same mnemonic): */ - halfword = (flags & 0x80000000) != 0; - if (halfword) - { - /* This is actually a load/store of a halfword, or a - signed-extension load. */ - if ((cpu_variant & ARM_EXT_HALFWORD) == 0) - { - inst.error - = _("Processor does not support halfwords or signed bytes"); - return; - } - - inst.instruction = ((inst.instruction & COND_MASK) - | (flags & ~COND_MASK)); - - flags = 0; - } - skip_whitespace (str); - if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) + if ((conflict_reg = reg_required_here (&str, 12)) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; return; } - if (skip_past_comma (& str) == FAIL) + if (skip_past_comma (&str) == FAIL) { - inst.error = _("Address expected"); + inst.error = _("address expected"); return; } @@ -4336,26 +5112,16 @@ do_ldst (str, flags) if (skip_past_comma (&str) == SUCCESS) { /* [Rn],... (post inc) */ - if (ldst_extend (&str, halfword) == FAIL) + if (ldst_extend (&str) == FAIL) return; if (conflict_reg) - { - if (flags & TRANS_BIT) - as_warn (_("Rn and Rd must be different in %s"), - ((inst.instruction & LOAD_BIT) - ? "LDRT" : "STRT")); - else - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - } + as_warn (_("%s register same as write-back base"), + ((inst.instruction & LOAD_BIT) + ? _("destination") : _("source"))); } else { /* [Rn] */ - if (halfword) - inst.instruction |= HWOFFSET_IMM; - skip_whitespace (str); if (*str == '!') @@ -4368,16 +5134,8 @@ do_ldst (str, flags) inst.instruction |= WRITE_BACK; } - flags |= INDEX_UP; - if (flags & TRANS_BIT) - { - if (conflict_reg) - as_warn (_("Rn and Rd must be different in %s"), - ((inst.instruction & LOAD_BIT) - ? "LDRT" : "STRT")); - } - else - pre_inc = 1; + inst.instruction |= INDEX_UP; + pre_inc = 1; } } else @@ -4390,7 +5148,7 @@ do_ldst (str, flags) } pre_inc = 1; - if (ldst_extend (&str, halfword) == FAIL) + if (ldst_extend (&str) == FAIL) return; skip_whitespace (str); @@ -4416,6 +5174,12 @@ do_ldst (str, flags) } else if (*str == '=') { + if ((inst.instruction & LOAD_BIT) == 0) + { + inst.error = _("invalid pseudo operation"); + return; + } + /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ str++; @@ -4427,7 +5191,7 @@ do_ldst (str, flags) if (inst.reloc.exp.X_op != O_constant && inst.reloc.exp.X_op != O_symbol) { - inst.error = _("Constant expression expected"); + inst.error = _("constant expression expected"); return; } @@ -4439,20 +5203,22 @@ do_ldst (str, flags) { /* This can be done with a mov instruction. */ inst.instruction &= LITERAL_MASK; - inst.instruction |= INST_IMMEDIATE | (OPCODE_MOV << DATA_OP_SHIFT); - inst.instruction |= (flags & COND_MASK) | (value & 0xfff); + inst.instruction |= (INST_IMMEDIATE + | (OPCODE_MOV << DATA_OP_SHIFT)); + inst.instruction |= value & 0xfff; end_of_line (str); return; } - - value = validate_immediate (~ inst.reloc.exp.X_add_number); + + value = validate_immediate (~inst.reloc.exp.X_add_number); if (value != FAIL) { /* This can be done with a mvn instruction. */ inst.instruction &= LITERAL_MASK; - inst.instruction |= INST_IMMEDIATE | (OPCODE_MVN << DATA_OP_SHIFT); - inst.instruction |= (flags & COND_MASK) | (value & 0xfff); + inst.instruction |= (INST_IMMEDIATE + | (OPCODE_MVN << DATA_OP_SHIFT)); + inst.instruction |= value & 0xfff; end_of_line (str); return; } @@ -4467,13 +5233,7 @@ do_ldst (str, flags) } /* Change the instruction exp to point to the pool. */ - if (halfword) - { - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_HWLITERAL; - } - else - inst.reloc.type = BFD_RELOC_ARM_LITERAL; + inst.reloc.type = BFD_RELOC_ARM_LITERAL; inst.reloc.pc_rel = 1; inst.instruction |= (REG_PC << 16); pre_inc = 1; @@ -4483,13 +5243,7 @@ do_ldst (str, flags) if (my_get_expression (&inst.reloc.exp, &str)) return; - if (halfword) - { - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; - } - else - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; #ifndef TE_WINCE /* PC rel adjust. */ inst.reloc.exp.X_add_number -= 8; @@ -4499,468 +5253,690 @@ do_ldst (str, flags) pre_inc = 1; } - if (pre_inc && (flags & TRANS_BIT)) - inst.error = _("Pre-increment instruction with translate"); - - inst.instruction |= flags | (pre_inc ? PRE_INDEX : 0); + inst.instruction |= (pre_inc ? PRE_INDEX : 0); end_of_line (str); return; } -static long -reg_list (strp) - char ** strp; +static void +do_ldstt (str) + char * str; { - char * str = * strp; - long range = 0; - int another_range; - - /* We come back here if we get ranges concatenated by '+' or '|'. */ - do - { - another_range = 0; + int conflict_reg; - if (*str == '{') - { - int in_range = 0; - int cur_reg = -1; + skip_whitespace (str); - str++; - do - { - int reg; + if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } - skip_whitespace (str); + if (skip_past_comma (& str) == FAIL) + { + inst.error = _("address expected"); + return; + } - if ((reg = reg_required_here (& str, -1)) == FAIL) - return FAIL; + if (*str == '[') + { + int reg; - if (in_range) - { - int i; + str++; - if (reg <= cur_reg) - { - inst.error = _("Bad range in register list"); - return FAIL; - } + skip_whitespace (str); - for (i = cur_reg + 1; i < reg; i++) - { - if (range & (1 << i)) - as_tsktsk - (_("Warning: Duplicated register (r%d) in register list"), - i); - else - range |= 1 << i; - } - in_range = 0; - } + if ((reg = reg_required_here (&str, 16)) == FAIL) + return; - if (range & (1 << reg)) - as_tsktsk (_("Warning: Duplicated register (r%d) in register list"), - reg); - else if (reg <= cur_reg) - as_tsktsk (_("Warning: Register range not in ascending order")); + /* ldrt/strt always use post-indexed addressing, so if the base is + the same as Rd, we warn. */ + if (conflict_reg == reg) + as_warn (_("%s register same as write-back base"), + ((inst.instruction & LOAD_BIT) + ? _("destination") : _("source"))); - range |= 1 << reg; - cur_reg = reg; - } - while (skip_past_comma (&str) != FAIL - || (in_range = 1, *str++ == '-')); - str--; - skip_whitespace (str); + skip_whitespace (str); - if (*str++ != '}') - { - inst.error = _("Missing `}'"); - return FAIL; - } - } - else + if (*str == ']') { - expressionS expr; - - if (my_get_expression (&expr, &str)) - return FAIL; + str ++; - if (expr.X_op == O_constant) + if (skip_past_comma (&str) == SUCCESS) { - if (expr.X_add_number - != (expr.X_add_number & 0x0000ffff)) - { - inst.error = _("invalid register mask"); - return FAIL; - } - - if ((range & expr.X_add_number) != 0) - { - int regno = range & expr.X_add_number; - - regno &= -regno; - regno = (1 << regno) - 1; - as_tsktsk - (_("Warning: Duplicated register (r%d) in register list"), - regno); - } - - range |= expr.X_add_number; + /* [Rn],... (post inc) */ + if (ldst_extend (&str) == FAIL) + return; } else { - if (inst.reloc.type != 0) - { - inst.error = _("expression too complex"); - return FAIL; - } + /* [Rn] */ + skip_whitespace (str); - memcpy (&inst.reloc.exp, &expr, sizeof (expressionS)); - inst.reloc.type = BFD_RELOC_ARM_MULTI; - inst.reloc.pc_rel = 0; + /* Skip a write-back '!'. */ + if (*str == '!') + str++; + + inst.instruction |= INDEX_UP; } } - - skip_whitespace (str); - - if (*str == '|' || *str == '+') + else { - str++; - another_range = 1; + inst.error = _("post-indexed expression expected"); + return; } } - while (another_range); + else + { + inst.error = _("post-indexed expression expected"); + return; + } - *strp = str; - return range; + end_of_line (str); + return; } -static void -do_ldmstm (str, flags) - char * str; - unsigned long flags; +static int +ldst_extend_v4 (str) + char ** str; { - int base_reg; - long range; - - skip_whitespace (str); - - if ((base_reg = reg_required_here (&str, 16)) == FAIL) - return; + int add = INDEX_UP; - if (base_reg == REG_PC) + switch (**str) { - inst.error = _("r15 not allowed as base register"); - return; - } - - skip_whitespace (str); + case '#': + case '$': + (*str)++; + if (my_get_expression (& inst.reloc.exp, str)) + return FAIL; - if (*str == '!') - { - flags |= WRITE_BACK; - str++; - } - - if (skip_past_comma (&str) == FAIL - || (range = reg_list (&str)) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - if (*str == '^') - { - str++; - flags |= LDM_TYPE_2_OR_3; - } + if (inst.reloc.exp.X_op == O_constant) + { + int value = inst.reloc.exp.X_add_number; - inst.instruction |= flags | range; - end_of_line (str); - return; -} + if (value < -255 || value > 255) + { + inst.error = _("address offset too large"); + return FAIL; + } -static void -do_swi (str, flags) - char * str; - unsigned long flags; -{ - skip_whitespace (str); + if (value < 0) + { + value = -value; + add = 0; + } - /* Allow optional leading '#'. */ - if (is_immediate_prefix (*str)) - str++; + /* Halfword and signextension instructions have the + immediate value split across bits 11..8 and bits 3..0. */ + inst.instruction |= (add | HWOFFSET_IMM + | ((value >> 4) << 8) | (value & 0xF)); + } + else + { + inst.instruction |= HWOFFSET_IMM; + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; + inst.reloc.pc_rel = 0; + } + return SUCCESS; - if (my_get_expression (& inst.reloc.exp, & str)) - return; + case '-': + add = 0; + /* Fall through. */ - inst.reloc.type = BFD_RELOC_ARM_SWI; - inst.reloc.pc_rel = 0; - inst.instruction |= flags; + case '+': + (*str)++; + /* Fall through. */ - end_of_line (str); + default: + if (reg_required_here (str, 0) == FAIL) + return FAIL; - return; + inst.instruction |= add; + return SUCCESS; + } } +/* Halfword and signed-byte load/store operations. */ static void -do_swap (str, flags) - char * str; - unsigned long flags; +do_ldstv4 (str) + char * str; { - int reg; + int pre_inc = 0; + int conflict_reg; + int value; skip_whitespace (str); - if ((reg = reg_required_here (&str, 12)) == FAIL) - return; - - if (reg == REG_PC) - { - inst.error = _("r15 not allowed in swap"); - return; - } - - if (skip_past_comma (&str) == FAIL - || (reg = reg_required_here (&str, 0)) == FAIL) + if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; return; } - if (reg == REG_PC) + if (skip_past_comma (& str) == FAIL) { - inst.error = _("r15 not allowed in swap"); + inst.error = _("address expected"); return; } - if (skip_past_comma (&str) == FAIL - || *str++ != '[') + if (*str == '[') { - inst.error = BAD_ARGS; - return; - } + int reg; - skip_whitespace (str); + str++; - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; + skip_whitespace (str); - if (reg == REG_PC) - { - inst.error = BAD_PC; - return; - } + if ((reg = reg_required_here (&str, 16)) == FAIL) + return; - skip_whitespace (str); + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); - if (*str++ != ']') - { - inst.error = _("missing ]"); - return; - } + skip_whitespace (str); - inst.instruction |= flags; - end_of_line (str); - return; -} + if (*str == ']') + { + str ++; -static void -do_branch (str, flags) - char * str; - unsigned long flags ATTRIBUTE_UNUSED; -{ - if (my_get_expression (&inst.reloc.exp, &str)) - return; + if (skip_past_comma (&str) == SUCCESS) + { + /* [Rn],... (post inc) */ + if (ldst_extend_v4 (&str) == FAIL) + return; + if (conflict_reg) + as_warn (_("%s register same as write-back base"), + ((inst.instruction & LOAD_BIT) + ? _("destination") : _("source"))); + } + else + { + /* [Rn] */ + inst.instruction |= HWOFFSET_IMM; -#ifdef OBJ_ELF - { - char * save_in; + skip_whitespace (str); - /* ScottB: February 5, 1998 - Check to see of PLT32 reloc - required for the instruction. */ + if (*str == '!') + { + if (conflict_reg) + as_warn (_("%s register same as write-back base"), + ((inst.instruction & LOAD_BIT) + ? _("destination") : _("source"))); + str++; + inst.instruction |= WRITE_BACK; + } - /* arm_parse_reloc () works on input_line_pointer. - We actually want to parse the operands to the branch instruction - passed in 'str'. Save the input pointer and restore it later. */ - save_in = input_line_pointer; - input_line_pointer = str; - if (inst.reloc.exp.X_op == O_symbol - && *str == '(' - && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) - { - inst.reloc.type = BFD_RELOC_ARM_PLT32; - inst.reloc.pc_rel = 0; - /* Modify str to point to after parsed operands, otherwise - end_of_line() will complain about the (PLT) left in str. */ - str = input_line_pointer; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; - inst.reloc.pc_rel = 1; - } - input_line_pointer = save_in; - } -#else - inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; - inst.reloc.pc_rel = 1; -#endif /* OBJ_ELF */ + inst.instruction |= INDEX_UP; + pre_inc = 1; + } + } + else + { + /* [Rn,...] */ + if (skip_past_comma (&str) == FAIL) + { + inst.error = _("pre-indexed expression expected"); + return; + } - end_of_line (str); - return; -} + pre_inc = 1; + if (ldst_extend_v4 (&str) == FAIL) + return; -static void -do_bx (str, flags) - char * str; - unsigned long flags ATTRIBUTE_UNUSED; -{ - int reg; + skip_whitespace (str); - skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } - if ((reg = reg_required_here (&str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; + skip_whitespace (str); + + if (*str == '!') + { + if (conflict_reg) + as_warn (_("%s register same as write-back base"), + ((inst.instruction & LOAD_BIT) + ? _("destination") : _("source"))); + str++; + inst.instruction |= WRITE_BACK; + } + } } + else if (*str == '=') + { + if ((inst.instruction & LOAD_BIT) == 0) + { + inst.error = _("invalid pseudo operation"); + return; + } - /* Note - it is not illegal to do a "bx pc". Useless, but not illegal. */ - if (reg == REG_PC) - as_tsktsk (_("Use of r15 in bx in ARM mode is not really useful")); + /* XXX Does this work correctly for half-word/byte ops? */ + /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ + str++; - end_of_line (str); -} + skip_whitespace (str); -static void -do_cdp (str, flags) - char * str; - unsigned long flags ATTRIBUTE_UNUSED; -{ - /* Co-processor data operation. - Format: CDP{cond} CP#,,CRd,CRn,CRm{,} */ - skip_whitespace (str); + if (my_get_expression (&inst.reloc.exp, &str)) + return; - if (co_proc_number (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + if (inst.reloc.exp.X_op != O_constant + && inst.reloc.exp.X_op != O_symbol) + { + inst.error = _("constant expression expected"); + return; + } - if (skip_past_comma (&str) == FAIL - || cp_opc_expr (&str, 20,4) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + if (inst.reloc.exp.X_op == O_constant) + { + value = validate_immediate (inst.reloc.exp.X_add_number); - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 16) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + if (value != FAIL) + { + /* This can be done with a mov instruction. */ + inst.instruction &= LITERAL_MASK; + inst.instruction |= INST_IMMEDIATE | (OPCODE_MOV << DATA_OP_SHIFT); + inst.instruction |= value & 0xfff; + end_of_line (str); + return; + } + + value = validate_immediate (~ inst.reloc.exp.X_add_number); - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 0) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + if (value != FAIL) + { + /* This can be done with a mvn instruction. */ + inst.instruction &= LITERAL_MASK; + inst.instruction |= INST_IMMEDIATE | (OPCODE_MVN << DATA_OP_SHIFT); + inst.instruction |= value & 0xfff; + end_of_line (str); + return; + } + } - if (skip_past_comma (&str) == SUCCESS) - { - if (cp_opc_expr (&str, 5, 3) == FAIL) + /* Insert into literal pool. */ + if (add_to_lit_pool () == FAIL) { if (!inst.error) - inst.error = BAD_ARGS; + inst.error = _("literal pool insertion failed"); return; } + + /* Change the instruction exp to point to the pool. */ + inst.instruction |= HWOFFSET_IMM; + inst.reloc.type = BFD_RELOC_ARM_HWLITERAL; + inst.reloc.pc_rel = 1; + inst.instruction |= (REG_PC << 16); + pre_inc = 1; + } + else + { + if (my_get_expression (&inst.reloc.exp, &str)) + return; + + inst.instruction |= HWOFFSET_IMM; + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; +#ifndef TE_WINCE + /* PC rel adjust. */ + inst.reloc.exp.X_add_number -= 8; +#endif + inst.reloc.pc_rel = 1; + inst.instruction |= (REG_PC << 16); + pre_inc = 1; } + inst.instruction |= (pre_inc ? PRE_INDEX : 0); end_of_line (str); return; } +static long +reg_list (strp) + char ** strp; +{ + char * str = * strp; + long range = 0; + int another_range; + + /* We come back here if we get ranges concatenated by '+' or '|'. */ + do + { + another_range = 0; + + if (*str == '{') + { + int in_range = 0; + int cur_reg = -1; + + str++; + do + { + int reg; + + skip_whitespace (str); + + if ((reg = reg_required_here (& str, -1)) == FAIL) + return FAIL; + + if (in_range) + { + int i; + + if (reg <= cur_reg) + { + inst.error = _("bad range in register list"); + return FAIL; + } + + for (i = cur_reg + 1; i < reg; i++) + { + if (range & (1 << i)) + as_tsktsk + (_("Warning: duplicated register (r%d) in register list"), + i); + else + range |= 1 << i; + } + in_range = 0; + } + + if (range & (1 << reg)) + as_tsktsk (_("Warning: duplicated register (r%d) in register list"), + reg); + else if (reg <= cur_reg) + as_tsktsk (_("Warning: register range not in ascending order")); + + range |= 1 << reg; + cur_reg = reg; + } + while (skip_past_comma (&str) != FAIL + || (in_range = 1, *str++ == '-')); + str--; + skip_whitespace (str); + + if (*str++ != '}') + { + inst.error = _("missing `}'"); + return FAIL; + } + } + else + { + expressionS expr; + + if (my_get_expression (&expr, &str)) + return FAIL; + + if (expr.X_op == O_constant) + { + if (expr.X_add_number + != (expr.X_add_number & 0x0000ffff)) + { + inst.error = _("invalid register mask"); + return FAIL; + } + + if ((range & expr.X_add_number) != 0) + { + int regno = range & expr.X_add_number; + + regno &= -regno; + regno = (1 << regno) - 1; + as_tsktsk + (_("Warning: duplicated register (r%d) in register list"), + regno); + } + + range |= expr.X_add_number; + } + else + { + if (inst.reloc.type != 0) + { + inst.error = _("expression too complex"); + return FAIL; + } + + memcpy (&inst.reloc.exp, &expr, sizeof (expressionS)); + inst.reloc.type = BFD_RELOC_ARM_MULTI; + inst.reloc.pc_rel = 0; + } + } + + skip_whitespace (str); + + if (*str == '|' || *str == '+') + { + str++; + another_range = 1; + } + } + while (another_range); + + *strp = str; + return range; +} + static void -do_lstc (str, flags) +do_ldmstm (str) char * str; - unsigned long flags; { - /* Co-processor register load/store. - Format: */ + int base_reg; + long range; skip_whitespace (str); - if (co_proc_number (&str) == FAIL) + if ((base_reg = reg_required_here (&str, 16)) == FAIL) + return; + + if (base_reg == REG_PC) { - if (!inst.error) - inst.error = BAD_ARGS; + inst.error = _("r15 not allowed as base register"); return; } - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 12) == FAIL) + skip_whitespace (str); + + if (*str == '!') { - if (!inst.error) - inst.error = BAD_ARGS; - return; + inst.instruction |= WRITE_BACK; + str++; } if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str) == FAIL) + || (range = reg_list (&str)) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; return; } - inst.instruction |= flags; + if (*str == '^') + { + str++; + inst.instruction |= LDM_TYPE_2_OR_3; + } + + inst.instruction |= range; end_of_line (str); return; } static void -do_co_reg (str, flags) +do_swi (str) char * str; - unsigned long flags; { - /* Co-processor register transfer. - Format: {cond} CP#,,Rd,CRn,CRm{,} */ + skip_whitespace (str); + + /* Allow optional leading '#'. */ + if (is_immediate_prefix (*str)) + str++; + + if (my_get_expression (& inst.reloc.exp, & str)) + return; + + inst.reloc.type = BFD_RELOC_ARM_SWI; + inst.reloc.pc_rel = 0; + end_of_line (str); + + return; +} + +static void +do_swap (str) + char * str; +{ + int reg; skip_whitespace (str); - if (co_proc_number (&str) == FAIL) + if ((reg = reg_required_here (&str, 12)) == FAIL) + return; + + if (reg == REG_PC) { - if (!inst.error) - inst.error = BAD_ARGS; + inst.error = _("r15 not allowed in swap"); return; } if (skip_past_comma (&str) == FAIL - || cp_opc_expr (&str, 21, 3) == FAIL) + || (reg = reg_required_here (&str, 0)) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; return; } - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) + if (reg == REG_PC) + { + inst.error = _("r15 not allowed in swap"); + return; + } + + if (skip_past_comma (&str) == FAIL + || *str++ != '[') + { + inst.error = BAD_ARGS; + return; + } + + skip_whitespace (str); + + if ((reg = reg_required_here (&str, 16)) == FAIL) + return; + + if (reg == REG_PC) + { + inst.error = BAD_PC; + return; + } + + skip_whitespace (str); + + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + + end_of_line (str); + return; +} + +static void +do_branch (str) + char * str; +{ + if (my_get_expression (&inst.reloc.exp, &str)) + return; + +#ifdef OBJ_ELF + { + char * save_in; + + /* ScottB: February 5, 1998 - Check to see of PLT32 reloc + required for the instruction. */ + + /* arm_parse_reloc () works on input_line_pointer. + We actually want to parse the operands to the branch instruction + passed in 'str'. Save the input pointer and restore it later. */ + save_in = input_line_pointer; + input_line_pointer = str; + if (inst.reloc.exp.X_op == O_symbol + && *str == '(' + && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) + { + inst.reloc.type = BFD_RELOC_ARM_PLT32; + inst.reloc.pc_rel = 0; + /* Modify str to point to after parsed operands, otherwise + end_of_line() will complain about the (PLT) left in str. */ + str = input_line_pointer; + } + else + { + inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; + inst.reloc.pc_rel = 1; + } + input_line_pointer = save_in; + } +#else + inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; + inst.reloc.pc_rel = 1; +#endif /* OBJ_ELF */ + + end_of_line (str); + return; +} + +static void +do_bx (str) + char * str; +{ + int reg; + + skip_whitespace (str); + + if ((reg = reg_required_here (&str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + /* Note - it is not illegal to do a "bx pc". Useless, but not illegal. */ + if (reg == REG_PC) + as_tsktsk (_("use of r15 in bx in ARM mode is not really useful")); + + end_of_line (str); +} + +static void +do_cdp (str) + char * str; +{ + /* Co-processor data operation. + Format: CDP{cond} CP#,,CRd,CRn,CRm{,} */ + skip_whitespace (str); + + if (co_proc_number (&str) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_opc_expr (&str, 20,4) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_reg_required_here (&str, 12) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; @@ -4992,9 +5968,41 @@ do_co_reg (str, flags) return; } } - if (flags) + + end_of_line (str); + return; +} + +static void +do_lstc (str) + char * str; +{ + /* Co-processor register load/store. + Format: */ + + skip_whitespace (str); + + if (co_proc_number (&str) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_reg_required_here (&str, 12) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_address_required_here (&str, CP_WB_OK) == FAIL) { - inst.error = BAD_COND; + if (! inst.error) + inst.error = BAD_ARGS; + return; } end_of_line (str); @@ -5002,50 +6010,93 @@ do_co_reg (str, flags) } static void -do_fp_ctrl (str, flags) +do_co_reg (str) char * str; - unsigned long flags ATTRIBUTE_UNUSED; { - /* FP control registers. - Format: {cond} Rn */ + /* Co-processor register transfer. + Format: {cond} CP#,,Rd,CRn,CRm{,} */ skip_whitespace (str); - if (reg_required_here (&str, 12) == FAIL) + if (co_proc_number (&str) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_opc_expr (&str, 21, 3) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_reg_required_here (&str, 16) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_reg_required_here (&str, 0) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; return; } + if (skip_past_comma (&str) == SUCCESS) + { + if (cp_opc_expr (&str, 5, 3) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + } + end_of_line (str); return; } static void -do_fp_ldst (str, flags) +do_fpa_ctrl (str) char * str; - unsigned long flags ATTRIBUTE_UNUSED; { + /* FP control registers. + Format: {cond} Rn */ + skip_whitespace (str); - switch (inst.suffix) + if (reg_required_here (&str, 12) == FAIL) { - case SUFF_S: - break; - case SUFF_D: - inst.instruction |= CP_T_X; - break; - case SUFF_E: - inst.instruction |= CP_T_Y; - break; - case SUFF_P: - inst.instruction |= CP_T_X | CP_T_Y; - break; - default: - abort (); + if (!inst.error) + inst.error = BAD_ARGS; + return; } + end_of_line (str); + return; +} + +static void +do_fpa_ldst (str) + char * str; +{ + skip_whitespace (str); + if (fp_reg_required_here (&str, 12) == FAIL) { if (!inst.error) @@ -5054,7 +6105,7 @@ do_fp_ldst (str, flags) } if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str) == FAIL) + || cp_address_required_here (&str, CP_WB_OK) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; @@ -5065,9 +6116,8 @@ do_fp_ldst (str, flags) } static void -do_fp_ldmstm (str, flags) +do_fpa_ldmstm (str) char * str; - unsigned long flags; { int num_regs; @@ -5091,7 +6141,7 @@ do_fp_ldmstm (str, flags) if (inst.reloc.exp.X_op != O_constant) { - inst.error = _("Constant value required for number of registers"); + inst.error = _("constant value required for number of registers"); return; } @@ -5120,7 +6170,7 @@ do_fp_ldmstm (str, flags) abort (); } - if (flags) + if (inst.instruction & (CP_T_Pre | CP_T_UD)) /* ea/fd format. */ { int reg; int write_back; @@ -5160,41 +6210,41 @@ do_fp_ldmstm (str, flags) if (reg == REG_PC) { inst.error = - _("R15 not allowed as base register with write-back"); + _("r15 not allowed as base register with write-back"); return; } } else write_back = 0; - if (flags & CP_T_Pre) + if (inst.instruction & CP_T_Pre) { /* Pre-decrement. */ offset = 3 * num_regs; if (write_back) - flags |= CP_T_WB; + inst.instruction |= CP_T_WB; } else { /* Post-increment. */ if (write_back) { - flags |= CP_T_WB; + inst.instruction |= CP_T_WB; offset = 3 * num_regs; } else { /* No write-back, so convert this into a standard pre-increment instruction -- aesthetically more pleasing. */ - flags = CP_T_Pre | CP_T_UD; + inst.instruction |= CP_T_Pre | CP_T_UD; offset = 0; } } - inst.instruction |= flags | offset; + inst.instruction |= offset; } else if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str) == FAIL) + || cp_address_required_here (&str, CP_WB_OK) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; @@ -5205,26 +6255,11 @@ do_fp_ldmstm (str, flags) } static void -do_fp_dyadic (str, flags) +do_fpa_dyadic (str) char * str; - unsigned long flags; { skip_whitespace (str); - switch (inst.suffix) - { - case SUFF_S: - break; - case SUFF_D: - inst.instruction |= 0x00000080; - break; - case SUFF_E: - inst.instruction |= 0x00080000; - break; - default: - abort (); - } - if (fp_reg_required_here (&str, 12) == FAIL) { if (! inst.error) @@ -5248,32 +6283,16 @@ do_fp_dyadic (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_fp_monadic (str, flags) +do_fpa_monadic (str) char * str; - unsigned long flags; { skip_whitespace (str); - switch (inst.suffix) - { - case SUFF_S: - break; - case SUFF_D: - inst.instruction |= 0x00000080; - break; - case SUFF_E: - inst.instruction |= 0x00080000; - break; - default: - abort (); - } - if (fp_reg_required_here (&str, 12) == FAIL) { if (! inst.error) @@ -5289,15 +6308,13 @@ do_fp_monadic (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_fp_cmp (str, flags) +do_fpa_cmp (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -5316,32 +6333,16 @@ do_fp_cmp (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_fp_from_reg (str, flags) +do_fpa_from_reg (str) char * str; - unsigned long flags; { skip_whitespace (str); - switch (inst.suffix) - { - case SUFF_S: - break; - case SUFF_D: - inst.instruction |= 0x00000080; - break; - case SUFF_E: - inst.instruction |= 0x00080000; - break; - default: - abort (); - } - if (fp_reg_required_here (&str, 16) == FAIL) { if (! inst.error) @@ -5357,15 +6358,13 @@ do_fp_from_reg (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } static void -do_fp_to_reg (str, flags) +do_fpa_to_reg (str) char * str; - unsigned long flags; { skip_whitespace (str); @@ -5380,620 +6379,2166 @@ do_fp_to_reg (str, flags) return; } - inst.instruction |= flags; end_of_line (str); return; } -/* Thumb specific routines. */ +static int +vfp_sp_reg_required_here (str, pos) + char **str; + enum vfp_sp_reg_pos pos; +{ + int reg; + char *start = *str; -/* Parse and validate that a register is of the right form, this saves - repeated checking of this information in many similar cases. - Unlike the 32-bit case we do not insert the register into the opcode - here, since the position is often unknown until the full instruction - has been parsed. */ + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_SN].htab)) != FAIL) + { + switch (pos) + { + case VFP_REG_Sd: + inst.instruction |= ((reg >> 1) << 12) | ((reg & 1) << 22); + break; + + case VFP_REG_Sn: + inst.instruction |= ((reg >> 1) << 16) | ((reg & 1) << 7); + break; + + case VFP_REG_Sm: + inst.instruction |= ((reg >> 1) << 0) | ((reg & 1) << 5); + break; + + default: + abort (); + } + return reg; + } + + /* In the few cases where we might be able to accept something else + this error can be overridden. */ + inst.error = _(all_reg_maps[REG_TYPE_SN].expected); + + /* Restore the start point. */ + *str = start; + return FAIL; +} static int -thumb_reg (strp, hi_lo) - char ** strp; - int hi_lo; +vfp_dp_reg_required_here (str, pos) + char **str; + enum vfp_sp_reg_pos pos; { - int reg; - - if ((reg = reg_required_here (strp, -1)) == FAIL) - return FAIL; + int reg; + char *start = *str; - switch (hi_lo) + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_DN].htab)) != FAIL) { - case THUMB_REG_LO: - if (reg > 7) + switch (pos) { - inst.error = _("lo register required"); - return FAIL; - } - break; + case VFP_REG_Dd: + inst.instruction |= reg << 12; + break; - case THUMB_REG_HI: - if (reg < 8) - { - inst.error = _("hi register required"); - return FAIL; - } - break; + case VFP_REG_Dn: + inst.instruction |= reg << 16; + break; - default: - break; + case VFP_REG_Dm: + inst.instruction |= reg << 0; + break; + + default: + abort (); + } + return reg; } - return reg; -} + /* In the few cases where we might be able to accept something else + this error can be overridden. */ + inst.error = _(all_reg_maps[REG_TYPE_DN].expected); -/* Parse an add or subtract instruction, SUBTRACT is non-zero if the opcode - was SUB. */ + /* Restore the start point. */ + *str = start; + return FAIL; +} static void -thumb_add_sub (str, subtract) - char * str; - int subtract; +do_vfp_sp_monadic (str) + char *str; { - int Rd, Rs, Rn = FAIL; - skip_whitespace (str); - if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL - || skip_past_comma (&str) == FAIL) + if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; return; } - if (is_immediate_prefix (*str)) - { - Rs = Rd; - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else - { - if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL) - { - /* Two operand format, shuffle the registers - and pretend there are 3. */ - Rn = Rs; - Rs = Rd; - } - else if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Rn = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; - } + end_of_line (str); + return; +} - /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; - for the latter case, EXPR contains the immediate that was found. */ - if (Rn != FAIL) - { - /* All register format. */ - if (Rd > 7 || Rs > 7 || Rn > 7) - { - if (Rs != Rd) - { - inst.error = _("dest and source1 must be the same register"); - return; - } +static void +do_vfp_dp_monadic (str) + char *str; +{ + skip_whitespace (str); - /* Can't do this for SUB. */ - if (subtract) - { - inst.error = _("subtract valid only on lo regs"); - return; - } + if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) + return; - inst.instruction = (T_OPCODE_ADD_HI - | (Rd > 7 ? THUMB_H1 : 0) - | (Rn > 7 ? THUMB_H2 : 0)); - inst.instruction |= (Rd & 7) | ((Rn & 7) << 3); - } - else - { - inst.instruction = subtract ? T_OPCODE_SUB_R3 : T_OPCODE_ADD_R3; - inst.instruction |= Rd | (Rs << 3) | (Rn << 6); - } - } - else + if (skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) { - /* Immediate expression, now things start to get nasty. */ - - /* First deal with HI regs, only very restricted cases allowed: - Adjusting SP, and using PC or SP to get an address. */ - if ((Rd > 7 && (Rd != REG_SP || Rs != REG_SP)) - || (Rs > 7 && Rs != REG_SP && Rs != REG_PC)) - { - inst.error = _("invalid Hi register with immediate"); - return; - } - - if (inst.reloc.exp.X_op != O_constant) - { - /* Value isn't known yet, all we can do is store all the fragments - we know about in the instruction and let the reloc hacking - work it all out. */ - inst.instruction = (subtract ? 0x8000 : 0) | (Rd << 4) | Rs; - inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; - } - else - { - int offset = inst.reloc.exp.X_add_number; + if (! inst.error) + inst.error = BAD_ARGS; + return; + } - if (subtract) - offset = -offset; + end_of_line (str); + return; +} - if (offset < 0) - { - offset = -offset; - subtract = 1; +static void +do_vfp_sp_dyadic (str) + char *str; +{ + skip_whitespace (str); - /* Quick check, in case offset is MIN_INT. */ - if (offset < 0) - { - inst.error = _("immediate value out of range"); - return; - } - } - else - subtract = 0; + if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) + return; - if (Rd == REG_SP) - { - if (offset & ~0x1fc) - { - inst.error = _("invalid immediate value for stack adjust"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; - inst.instruction |= offset >> 2; - } - else if (Rs == REG_PC || Rs == REG_SP) - { - if (subtract - || (offset & ~0x3fc)) - { - inst.error = _("invalid immediate for address calculation"); - return; - } - inst.instruction = (Rs == REG_PC ? T_OPCODE_ADD_PC - : T_OPCODE_ADD_SP); - inst.instruction |= (Rd << 8) | (offset >> 2); - } - else if (Rs == Rd) - { - if (offset & ~0xff) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; - inst.instruction |= (Rd << 8) | offset; - } - else - { - if (offset & ~0x7) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; - inst.instruction |= Rd | (Rs << 3) | (offset << 6); - } - } + if (skip_past_comma (&str) == FAIL + || vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL + || skip_past_comma (&str) == FAIL + || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; } end_of_line (str); + return; } static void -thumb_shift (str, shift) - char * str; - int shift; +do_vfp_dp_dyadic (str) + char *str; { - int Rd, Rs, Rn = FAIL; - skip_whitespace (str); - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL) + if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL + || skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; return; } - if (is_immediate_prefix (*str)) + end_of_line (str); + return; +} + +static void +do_vfp_reg_from_sp (str) + char *str; +{ + skip_whitespace (str); + + if (reg_required_here (&str, 12) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL) { - /* Two operand immediate format, set Rs to Rd. */ - Rs = Rd; - str ++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; + if (! inst.error) + inst.error = BAD_ARGS; + return; } - else + + end_of_line (str); + return; +} + +static void +do_vfp_sp_reg2 (str) + char *str; +{ + skip_whitespace (str); + + if (reg_required_here (&str, 12) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16) == FAIL + || skip_past_comma (&str) == FAIL) { - if ((Rs = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + if (! inst.error) + inst.error = BAD_ARGS; + return; + } - if (skip_past_comma (&str) == FAIL) - { - /* Two operand format, shuffle the registers - and pretend there are 3. */ - Rn = Rs; - Rs = Rd; - } - else if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Rn = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + /* We require exactly two consecutive SP registers. */ + if (vfp_sp_reg_list (&str, VFP_REG_Sm) != 2) + { + if (! inst.error) + inst.error = _("only two consecutive VFP SP registers allowed here"); } - /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; - for the latter case, EXPR contains the immediate that was found. */ + end_of_line (str); + return; +} - if (Rn != FAIL) +static void +do_vfp_sp_from_reg (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL) { - if (Rs != Rd) - { - inst.error = _("source1 and dest must be same register"); - return; - } + if (! inst.error) + inst.error = BAD_ARGS; + return; + } - switch (shift) - { - case THUMB_ASR: inst.instruction = T_OPCODE_ASR_R; break; - case THUMB_LSL: inst.instruction = T_OPCODE_LSL_R; break; - case THUMB_LSR: inst.instruction = T_OPCODE_LSR_R; break; - } + end_of_line (str); + return; +} - inst.instruction |= Rd | (Rn << 3); +static void +do_vfp_reg_from_dp (str) + char *str; +{ + skip_whitespace (str); + + if (reg_required_here (&str, 12) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; } - else + + end_of_line (str); + return; +} + +static void +do_vfp_reg2_from_dp (str) + char *str; +{ + skip_whitespace (str); + + if (reg_required_here (&str, 12) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16) == FAIL + || skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) { - switch (shift) - { - case THUMB_ASR: inst.instruction = T_OPCODE_ASR_I; break; - case THUMB_LSL: inst.instruction = T_OPCODE_LSL_I; break; - case THUMB_LSR: inst.instruction = T_OPCODE_LSR_I; break; - } + if (! inst.error) + inst.error = BAD_ARGS; + return; + } - if (inst.reloc.exp.X_op != O_constant) + end_of_line (str); + return; +} + +static void +do_vfp_dp_from_reg (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_dp_from_reg2 (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16)) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static const struct vfp_reg * +vfp_psr_parse (str) + char **str; +{ + char *start = *str; + char c; + char *p; + const struct vfp_reg *vreg; + + p = start; + + /* Find the end of the current token. */ + do + { + c = *p++; + } + while (ISALPHA (c)); + + /* Mark it. */ + *--p = 0; + + for (vreg = vfp_regs + 0; + vreg < vfp_regs + sizeof (vfp_regs) / sizeof (struct vfp_reg); + vreg++) + { + if (strcmp (start, vreg->name) == 0) { - /* Value isn't known yet, create a dummy reloc and let reloc - hacking fix it up. */ - inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + *p = c; + *str = p; + return vreg; } - else - { - unsigned shift_value = inst.reloc.exp.X_add_number; + } - if (shift_value > 32 || (shift_value == 32 && shift == THUMB_LSL)) - { - inst.error = _("Invalid immediate for shift"); - return; - } + *p = c; + return NULL; +} - /* Shifts of zero are handled by converting to LSL. */ - if (shift_value == 0) - inst.instruction = T_OPCODE_LSL_I; +static int +vfp_psr_required_here (str) + char **str; +{ + char *start = *str; + const struct vfp_reg *vreg; - /* Shifts of 32 are encoded as a shift of zero. */ - if (shift_value == 32) - shift_value = 0; + vreg = vfp_psr_parse (str); - inst.instruction |= shift_value << 6; - } + if (vreg) + { + inst.instruction |= vreg->regno; + return SUCCESS; + } - inst.instruction |= Rd | (Rs << 3); + inst.error = _("VFP system register expected"); + + *str = start; + return FAIL; +} + +static void +do_vfp_reg_from_ctrl (str) + char *str; +{ + skip_whitespace (str); + + if (reg_required_here (&str, 12) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_psr_required_here (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_ctrl_from_reg (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_psr_required_here (&str) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; } end_of_line (str); + return; } static void -thumb_mov_compare (str, move) +do_vfp_sp_ldst (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_address_required_here (&str, CP_NO_WB) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_dp_ldst (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&str) == FAIL + || cp_address_required_here (&str, CP_NO_WB) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +/* Parse and encode a VFP SP register list, storing the initial + register in position POS and returning the range as the result. If + the string is invalid return FAIL (an invalid range). */ +static long +vfp_sp_reg_list (str, pos) + char **str; + enum vfp_sp_reg_pos pos; +{ + long range = 0; + int base_reg = 0; + int new_base; + long base_bits = 0; + int count = 0; + long tempinst; + unsigned long mask = 0; + int warned = 0; + + if (**str != '{') + return FAIL; + + (*str)++; + skip_whitespace (*str); + + tempinst = inst.instruction; + + do + { + inst.instruction = 0; + + if ((new_base = vfp_sp_reg_required_here (str, pos)) == FAIL) + return FAIL; + + if (count == 0 || base_reg > new_base) + { + base_reg = new_base; + base_bits = inst.instruction; + } + + if (mask & (1 << new_base)) + { + inst.error = _("invalid register list"); + return FAIL; + } + + if ((mask >> new_base) != 0 && ! warned) + { + as_tsktsk (_("register list not in ascending order")); + warned = 1; + } + + mask |= 1 << new_base; + count++; + + skip_whitespace (*str); + + if (**str == '-') /* We have the start of a range expression */ + { + int high_range; + + (*str)++; + + if ((high_range + = arm_reg_parse (str, all_reg_maps[REG_TYPE_SN].htab)) + == FAIL) + { + inst.error = _(all_reg_maps[REG_TYPE_SN].expected); + return FAIL; + } + + if (high_range <= new_base) + { + inst.error = _("register range not in ascending order"); + return FAIL; + } + + for (new_base++; new_base <= high_range; new_base++) + { + if (mask & (1 << new_base)) + { + inst.error = _("invalid register list"); + return FAIL; + } + + mask |= 1 << new_base; + count++; + } + } + } + while (skip_past_comma (str) != FAIL); + + if (**str != '}') + { + inst.error = _("invalid register list"); + return FAIL; + } + + (*str)++; + + range = count; + + /* Sanity check -- should have raised a parse error above. */ + if (count == 0 || count > 32) + abort(); + + /* Final test -- the registers must be consecutive. */ + while (count--) + { + if ((mask & (1 << base_reg++)) == 0) + { + inst.error = _("non-contiguous register range"); + return FAIL; + } + } + + inst.instruction = tempinst | base_bits; + return range; +} + +static long +vfp_dp_reg_list (str) + char **str; +{ + long range = 0; + int base_reg = 0; + int new_base; + int count = 0; + long tempinst; + unsigned long mask = 0; + int warned = 0; + + if (**str != '{') + return FAIL; + + (*str)++; + skip_whitespace (*str); + + tempinst = inst.instruction; + + do + { + inst.instruction = 0; + + if ((new_base = vfp_dp_reg_required_here (str, VFP_REG_Dd)) == FAIL) + return FAIL; + + if (count == 0 || base_reg > new_base) + { + base_reg = new_base; + range = inst.instruction; + } + + if (mask & (1 << new_base)) + { + inst.error = _("invalid register list"); + return FAIL; + } + + if ((mask >> new_base) != 0 && ! warned) + { + as_tsktsk (_("register list not in ascending order")); + warned = 1; + } + + mask |= 1 << new_base; + count++; + + skip_whitespace (*str); + + if (**str == '-') /* We have the start of a range expression */ + { + int high_range; + + (*str)++; + + if ((high_range + = arm_reg_parse (str, all_reg_maps[REG_TYPE_DN].htab)) + == FAIL) + { + inst.error = _(all_reg_maps[REG_TYPE_DN].expected); + return FAIL; + } + + if (high_range <= new_base) + { + inst.error = _("register range not in ascending order"); + return FAIL; + } + + for (new_base++; new_base <= high_range; new_base++) + { + if (mask & (1 << new_base)) + { + inst.error = _("invalid register list"); + return FAIL; + } + + mask |= 1 << new_base; + count++; + } + } + } + while (skip_past_comma (str) != FAIL); + + if (**str != '}') + { + inst.error = _("invalid register list"); + return FAIL; + } + + (*str)++; + + range |= 2 * count; + + /* Sanity check -- should have raised a parse error above. */ + if (count == 0 || count > 16) + abort(); + + /* Final test -- the registers must be consecutive. */ + while (count--) + { + if ((mask & (1 << base_reg++)) == 0) + { + inst.error = _("non-contiguous register range"); + return FAIL; + } + } + + inst.instruction = tempinst; + return range; +} + +static void +vfp_sp_ldstm(str, ldstm_type) + char *str; + enum vfp_ldstm_type ldstm_type; +{ + long range; + + skip_whitespace (str); + + if (reg_required_here (&str, 16) == FAIL) + return; + + skip_whitespace (str); + + if (*str == '!') + { + inst.instruction |= WRITE_BACK; + str++; + } + else if (ldstm_type != VFP_LDSTMIA) + { + inst.error = _("this addressing mode requires base-register writeback"); + return; + } + + if (skip_past_comma (&str) == FAIL + || (range = vfp_sp_reg_list (&str, VFP_REG_Sd)) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + inst.instruction |= range; + end_of_line (str); +} + +static void +vfp_dp_ldstm(str, ldstm_type) + char *str; + enum vfp_ldstm_type ldstm_type; +{ + long range; + + skip_whitespace (str); + + if (reg_required_here (&str, 16) == FAIL) + return; + + skip_whitespace (str); + + if (*str == '!') + { + inst.instruction |= WRITE_BACK; + str++; + } + else if (ldstm_type != VFP_LDSTMIA && ldstm_type != VFP_LDSTMIAX) + { + inst.error = _("this addressing mode requires base-register writeback"); + return; + } + + if (skip_past_comma (&str) == FAIL + || (range = vfp_dp_reg_list (&str)) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + if (ldstm_type == VFP_LDSTMIAX || ldstm_type == VFP_LDSTMDBX) + range += 1; + + inst.instruction |= range; + end_of_line (str); +} + +static void +do_vfp_sp_ldstmia (str) + char *str; +{ + vfp_sp_ldstm (str, VFP_LDSTMIA); +} + +static void +do_vfp_sp_ldstmdb (str) + char *str; +{ + vfp_sp_ldstm (str, VFP_LDSTMDB); +} + +static void +do_vfp_dp_ldstmia (str) + char *str; +{ + vfp_dp_ldstm (str, VFP_LDSTMIA); +} + +static void +do_vfp_dp_ldstmdb (str) + char *str; +{ + vfp_dp_ldstm (str, VFP_LDSTMDB); +} + +static void +do_vfp_xp_ldstmia (str) + char *str; +{ + vfp_dp_ldstm (str, VFP_LDSTMIAX); +} + +static void +do_vfp_xp_ldstmdb (str) + char *str; +{ + vfp_dp_ldstm (str, VFP_LDSTMDBX); +} + +static void +do_vfp_sp_compare_z (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_dp_compare_z (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_dp_sp_cvt (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +static void +do_vfp_sp_dp_cvt (str) + char *str; +{ + skip_whitespace (str); + + if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL + || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); + return; +} + +/* Thumb specific routines. */ + +/* Parse and validate that a register is of the right form, this saves + repeated checking of this information in many similar cases. + Unlike the 32-bit case we do not insert the register into the opcode + here, since the position is often unknown until the full instruction + has been parsed. */ + +static int +thumb_reg (strp, hi_lo) + char ** strp; + int hi_lo; +{ + int reg; + + if ((reg = reg_required_here (strp, -1)) == FAIL) + return FAIL; + + switch (hi_lo) + { + case THUMB_REG_LO: + if (reg > 7) + { + inst.error = _("lo register required"); + return FAIL; + } + break; + + case THUMB_REG_HI: + if (reg < 8) + { + inst.error = _("hi register required"); + return FAIL; + } + break; + + default: + break; + } + + return reg; +} + +/* Parse an add or subtract instruction, SUBTRACT is non-zero if the opcode + was SUB. */ + +static void +thumb_add_sub (str, subtract) + char * str; + int subtract; +{ + int Rd, Rs, Rn = FAIL; + + skip_whitespace (str); + + if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL + || skip_past_comma (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + if (is_immediate_prefix (*str)) + { + Rs = Rd; + str++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else + { + if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL) + { + /* Two operand format, shuffle the registers + and pretend there are 3. */ + Rn = Rs; + Rs = Rd; + } + else if (is_immediate_prefix (*str)) + { + str++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else if ((Rn = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) + return; + } + + /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; + for the latter case, EXPR contains the immediate that was found. */ + if (Rn != FAIL) + { + /* All register format. */ + if (Rd > 7 || Rs > 7 || Rn > 7) + { + if (Rs != Rd) + { + inst.error = _("dest and source1 must be the same register"); + return; + } + + /* Can't do this for SUB. */ + if (subtract) + { + inst.error = _("subtract valid only on lo regs"); + return; + } + + inst.instruction = (T_OPCODE_ADD_HI + | (Rd > 7 ? THUMB_H1 : 0) + | (Rn > 7 ? THUMB_H2 : 0)); + inst.instruction |= (Rd & 7) | ((Rn & 7) << 3); + } + else + { + inst.instruction = subtract ? T_OPCODE_SUB_R3 : T_OPCODE_ADD_R3; + inst.instruction |= Rd | (Rs << 3) | (Rn << 6); + } + } + else + { + /* Immediate expression, now things start to get nasty. */ + + /* First deal with HI regs, only very restricted cases allowed: + Adjusting SP, and using PC or SP to get an address. */ + if ((Rd > 7 && (Rd != REG_SP || Rs != REG_SP)) + || (Rs > 7 && Rs != REG_SP && Rs != REG_PC)) + { + inst.error = _("invalid Hi register with immediate"); + return; + } + + if (inst.reloc.exp.X_op != O_constant) + { + /* Value isn't known yet, all we can do is store all the fragments + we know about in the instruction and let the reloc hacking + work it all out. */ + inst.instruction = (subtract ? 0x8000 : 0) | (Rd << 4) | Rs; + inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; + } + else + { + int offset = inst.reloc.exp.X_add_number; + + if (subtract) + offset = -offset; + + if (offset < 0) + { + offset = -offset; + subtract = 1; + + /* Quick check, in case offset is MIN_INT. */ + if (offset < 0) + { + inst.error = _("immediate value out of range"); + return; + } + } + else + subtract = 0; + + if (Rd == REG_SP) + { + if (offset & ~0x1fc) + { + inst.error = _("invalid immediate value for stack adjust"); + return; + } + inst.instruction = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; + inst.instruction |= offset >> 2; + } + else if (Rs == REG_PC || Rs == REG_SP) + { + if (subtract + || (offset & ~0x3fc)) + { + inst.error = _("invalid immediate for address calculation"); + return; + } + inst.instruction = (Rs == REG_PC ? T_OPCODE_ADD_PC + : T_OPCODE_ADD_SP); + inst.instruction |= (Rd << 8) | (offset >> 2); + } + else if (Rs == Rd) + { + if (offset & ~0xff) + { + inst.error = _("immediate value out of range"); + return; + } + inst.instruction = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; + inst.instruction |= (Rd << 8) | offset; + } + else + { + if (offset & ~0x7) + { + inst.error = _("immediate value out of range"); + return; + } + inst.instruction = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; + inst.instruction |= Rd | (Rs << 3) | (offset << 6); + } + } + } + + end_of_line (str); +} + +static void +thumb_shift (str, shift) + char * str; + int shift; +{ + int Rd, Rs, Rn = FAIL; + + skip_whitespace (str); + + if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL + || skip_past_comma (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + if (is_immediate_prefix (*str)) + { + /* Two operand immediate format, set Rs to Rd. */ + Rs = Rd; + str ++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else + { + if ((Rs = thumb_reg (&str, THUMB_REG_LO)) == FAIL) + return; + + if (skip_past_comma (&str) == FAIL) + { + /* Two operand format, shuffle the registers + and pretend there are 3. */ + Rn = Rs; + Rs = Rd; + } + else if (is_immediate_prefix (*str)) + { + str++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else if ((Rn = thumb_reg (&str, THUMB_REG_LO)) == FAIL) + return; + } + + /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; + for the latter case, EXPR contains the immediate that was found. */ + + if (Rn != FAIL) + { + if (Rs != Rd) + { + inst.error = _("source1 and dest must be same register"); + return; + } + + switch (shift) + { + case THUMB_ASR: inst.instruction = T_OPCODE_ASR_R; break; + case THUMB_LSL: inst.instruction = T_OPCODE_LSL_R; break; + case THUMB_LSR: inst.instruction = T_OPCODE_LSR_R; break; + } + + inst.instruction |= Rd | (Rn << 3); + } + else + { + switch (shift) + { + case THUMB_ASR: inst.instruction = T_OPCODE_ASR_I; break; + case THUMB_LSL: inst.instruction = T_OPCODE_LSL_I; break; + case THUMB_LSR: inst.instruction = T_OPCODE_LSR_I; break; + } + + if (inst.reloc.exp.X_op != O_constant) + { + /* Value isn't known yet, create a dummy reloc and let reloc + hacking fix it up. */ + inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + } + else + { + unsigned shift_value = inst.reloc.exp.X_add_number; + + if (shift_value > 32 || (shift_value == 32 && shift == THUMB_LSL)) + { + inst.error = _("invalid immediate for shift"); + return; + } + + /* Shifts of zero are handled by converting to LSL. */ + if (shift_value == 0) + inst.instruction = T_OPCODE_LSL_I; + + /* Shifts of 32 are encoded as a shift of zero. */ + if (shift_value == 32) + shift_value = 0; + + inst.instruction |= shift_value << 6; + } + + inst.instruction |= Rd | (Rs << 3); + } + + end_of_line (str); +} + +static void +thumb_mov_compare (str, move) + char * str; + int move; +{ + int Rd, Rs = FAIL; + + skip_whitespace (str); + + if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL + || skip_past_comma (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + if (is_immediate_prefix (*str)) + { + str++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) + return; + + if (Rs != FAIL) + { + if (Rs < 8 && Rd < 8) + { + if (move == THUMB_MOVE) + /* A move of two lowregs is encoded as ADD Rd, Rs, #0 + since a MOV instruction produces unpredictable results. */ + inst.instruction = T_OPCODE_ADD_I3; + else + inst.instruction = T_OPCODE_CMP_LR; + inst.instruction |= Rd | (Rs << 3); + } + else + { + if (move == THUMB_MOVE) + inst.instruction = T_OPCODE_MOV_HR; + else + inst.instruction = T_OPCODE_CMP_HR; + + if (Rd > 7) + inst.instruction |= THUMB_H1; + + if (Rs > 7) + inst.instruction |= THUMB_H2; + + inst.instruction |= (Rd & 7) | ((Rs & 7) << 3); + } + } + else + { + if (Rd > 7) + { + inst.error = _("only lo regs allowed with immediate"); + return; + } + + if (move == THUMB_MOVE) + inst.instruction = T_OPCODE_MOV_I8; + else + inst.instruction = T_OPCODE_CMP_I8; + + inst.instruction |= Rd << 8; + + if (inst.reloc.exp.X_op != O_constant) + inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM; + else + { + unsigned value = inst.reloc.exp.X_add_number; + + if (value > 255) + { + inst.error = _("invalid immediate"); + return; + } + + inst.instruction |= value; + } + } + + end_of_line (str); +} + +static void +thumb_load_store (str, load_store, size) + char * str; + int load_store; + int size; +{ + int Rd, Rb, Ro = FAIL; + + skip_whitespace (str); + + if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL + || skip_past_comma (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + if (*str == '[') + { + str++; + if ((Rb = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) + return; + + if (skip_past_comma (&str) != FAIL) + { + if (is_immediate_prefix (*str)) + { + str++; + if (my_get_expression (&inst.reloc.exp, &str)) + return; + } + else if ((Ro = thumb_reg (&str, THUMB_REG_LO)) == FAIL) + return; + } + else + { + inst.reloc.exp.X_op = O_constant; + inst.reloc.exp.X_add_number = 0; + } + + if (*str != ']') + { + inst.error = _("expected ']'"); + return; + } + str++; + } + else if (*str == '=') + { + if (load_store != THUMB_LOAD) + { + inst.error = _("invalid pseudo operation"); + return; + } + + /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ + str++; + + skip_whitespace (str); + + if (my_get_expression (& inst.reloc.exp, & str)) + return; + + end_of_line (str); + + if ( inst.reloc.exp.X_op != O_constant + && inst.reloc.exp.X_op != O_symbol) + { + inst.error = "Constant expression expected"; + return; + } + + if (inst.reloc.exp.X_op == O_constant + && ((inst.reloc.exp.X_add_number & ~0xFF) == 0)) + { + /* This can be done with a mov instruction. */ + + inst.instruction = T_OPCODE_MOV_I8 | (Rd << 8); + inst.instruction |= inst.reloc.exp.X_add_number; + return; + } + + /* Insert into literal pool. */ + if (add_to_lit_pool () == FAIL) + { + if (!inst.error) + inst.error = "literal pool insertion failed"; + return; + } + + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; + inst.reloc.pc_rel = 1; + inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); + /* Adjust ARM pipeline offset to Thumb. */ + inst.reloc.exp.X_add_number += 4; + + return; + } + else + { + if (my_get_expression (&inst.reloc.exp, &str)) + return; + + inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); + inst.reloc.pc_rel = 1; + inst.reloc.exp.X_add_number -= 4; /* Pipeline offset. */ + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; + end_of_line (str); + return; + } + + if (Rb == REG_PC || Rb == REG_SP) + { + if (size != THUMB_WORD) + { + inst.error = _("byte or halfword not valid for base register"); + return; + } + else if (Rb == REG_PC && load_store != THUMB_LOAD) + { + inst.error = _("r15 based store not allowed"); + return; + } + else if (Ro != FAIL) + { + inst.error = _("invalid base register for register offset"); + return; + } + + if (Rb == REG_PC) + inst.instruction = T_OPCODE_LDR_PC; + else if (load_store == THUMB_LOAD) + inst.instruction = T_OPCODE_LDR_SP; + else + inst.instruction = T_OPCODE_STR_SP; + + inst.instruction |= Rd << 8; + if (inst.reloc.exp.X_op == O_constant) + { + unsigned offset = inst.reloc.exp.X_add_number; + + if (offset & ~0x3fc) + { + inst.error = _("invalid offset"); + return; + } + + inst.instruction |= offset >> 2; + } + else + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; + } + else if (Rb > 7) + { + inst.error = _("invalid base register in load/store"); + return; + } + else if (Ro == FAIL) + { + /* Immediate offset. */ + if (size == THUMB_WORD) + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_IW : T_OPCODE_STR_IW); + else if (size == THUMB_HALFWORD) + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_IH : T_OPCODE_STR_IH); + else + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_IB : T_OPCODE_STR_IB); + + inst.instruction |= Rd | (Rb << 3); + + if (inst.reloc.exp.X_op == O_constant) + { + unsigned offset = inst.reloc.exp.X_add_number; + + if (offset & ~(0x1f << size)) + { + inst.error = _("invalid offset"); + return; + } + inst.instruction |= (offset >> size) << 6; + } + else + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; + } + else + { + /* Register offset. */ + if (size == THUMB_WORD) + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_RW : T_OPCODE_STR_RW); + else if (size == THUMB_HALFWORD) + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_RH : T_OPCODE_STR_RH); + else + inst.instruction = (load_store == THUMB_LOAD + ? T_OPCODE_LDR_RB : T_OPCODE_STR_RB); + + inst.instruction |= Rd | (Rb << 3) | (Ro << 6); + } + + end_of_line (str); +} + +/* A register must be given at this point. + + Shift is the place to put it in inst.instruction. + + Restores input start point on err. + Returns the reg#, or FAIL. */ + +static int +mav_reg_required_here (str, shift, regtype) + char ** str; + int shift; + enum arm_reg_type regtype; +{ + int reg; + char *start = *str; + + if ((reg = arm_reg_parse (str, all_reg_maps[regtype].htab)) != FAIL) + { + if (shift >= 0) + inst.instruction |= reg << shift; + + return reg; + } + + /* Restore the start point. */ + *str = start; + + /* In the few cases where we might be able to accept something else + this error can be overridden. */ + inst.error = _(all_reg_maps[regtype].expected); + + return FAIL; +} + +/* Cirrus Maverick Instructions. */ + +/* Wrapper functions. */ + +static void +do_mav_binops_1a (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVF); +} + +static void +do_mav_binops_1b (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVD); +} + +static void +do_mav_binops_1c (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVDX); +} + +static void +do_mav_binops_1d (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVF); +} + +static void +do_mav_binops_1e (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVD); +} + +static void +do_mav_binops_1f (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVF); +} + +static void +do_mav_binops_1g (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVD); +} + +static void +do_mav_binops_1h (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVFX); +} + +static void +do_mav_binops_1i (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVFX); +} + +static void +do_mav_binops_1j (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVDX); +} + +static void +do_mav_binops_1k (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVDX); +} + +static void +do_mav_binops_1l (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVF); +} + +static void +do_mav_binops_1m (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVD); +} + +static void +do_mav_binops_1n (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVFX); +} + +static void +do_mav_binops_1o (str) + char * str; +{ + do_mav_binops (str, MAV_MODE1, REG_TYPE_MVDX, REG_TYPE_MVDX); +} + +static void +do_mav_binops_2a (str) + char * str; +{ + do_mav_binops (str, MAV_MODE2, REG_TYPE_MVF, REG_TYPE_RN); +} + +static void +do_mav_binops_2b (str) + char * str; +{ + do_mav_binops (str, MAV_MODE2, REG_TYPE_MVD, REG_TYPE_RN); +} + +static void +do_mav_binops_2c (str) + char * str; +{ + do_mav_binops (str, MAV_MODE2, REG_TYPE_MVDX, REG_TYPE_RN); +} + +static void +do_mav_binops_3a (str) + char * str; +{ + do_mav_binops (str, MAV_MODE3, REG_TYPE_MVAX, REG_TYPE_MVFX); +} + +static void +do_mav_binops_3b (str) + char * str; +{ + do_mav_binops (str, MAV_MODE3, REG_TYPE_MVFX, REG_TYPE_MVAX); +} + +static void +do_mav_binops_3c (str) + char * str; +{ + do_mav_binops (str, MAV_MODE3, REG_TYPE_MVAX, REG_TYPE_MVDX); +} + +static void +do_mav_binops_3d (str) + char * str; +{ + do_mav_binops (str, MAV_MODE3, REG_TYPE_MVDX, REG_TYPE_MVAX); +} + +static void +do_mav_triple_4a (str) + char * str; +{ + do_mav_triple (str, MAV_MODE4, REG_TYPE_MVFX, REG_TYPE_MVFX, REG_TYPE_RN); +} + +static void +do_mav_triple_4b (str) + char * str; +{ + do_mav_triple (str, MAV_MODE4, REG_TYPE_MVDX, REG_TYPE_MVDX, REG_TYPE_RN); +} + +static void +do_mav_triple_5a (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVF, REG_TYPE_MVF); +} + +static void +do_mav_triple_5b (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVD, REG_TYPE_MVD); +} + +static void +do_mav_triple_5c (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVFX, REG_TYPE_MVFX); +} + +static void +do_mav_triple_5d (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVDX, REG_TYPE_MVDX); +} + +static void +do_mav_triple_5e (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_MVF, REG_TYPE_MVF, REG_TYPE_MVF); +} + +static void +do_mav_triple_5f (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_MVD, REG_TYPE_MVD, REG_TYPE_MVD); +} + +static void +do_mav_triple_5g (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_MVFX, REG_TYPE_MVFX, REG_TYPE_MVFX); +} + +static void +do_mav_triple_5h (str) + char * str; +{ + do_mav_triple (str, MAV_MODE5, REG_TYPE_MVDX, REG_TYPE_MVDX, REG_TYPE_MVDX); +} + +static void +do_mav_quad_6a (str) + char * str; +{ + do_mav_quad (str, MAV_MODE6, REG_TYPE_MVAX, REG_TYPE_MVFX, REG_TYPE_MVFX, + REG_TYPE_MVFX); +} + +static void +do_mav_quad_6b (str) + char * str; +{ + do_mav_quad (str, MAV_MODE6, REG_TYPE_MVAX, REG_TYPE_MVAX, REG_TYPE_MVFX, + REG_TYPE_MVFX); +} + +/* cfmvsc32 DSPSC,MVFX[15:0]. */ +static void +do_mav_dspsc_1 (str) + char * str; +{ + skip_whitespace (str); + + /* cfmvsc32. */ + if (mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, 16, REG_TYPE_MVFX) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + end_of_line (str); +} + +/* cfmv32sc MVFX[15:0],DSPSC. */ +static void +do_mav_dspsc_2 (str) + char * str; +{ + skip_whitespace (str); + + /* cfmv32sc. */ + if (mav_reg_required_here (&str, 0, REG_TYPE_MVFX) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + end_of_line (str); +} + +static void +do_mav_shift_1 (str) + char * str; +{ + do_mav_shift (str, REG_TYPE_MVFX, REG_TYPE_MVFX); +} + +static void +do_mav_shift_2 (str) + char * str; +{ + do_mav_shift (str, REG_TYPE_MVDX, REG_TYPE_MVDX); +} + +static void +do_mav_ldst_1 (str) + char * str; +{ + do_mav_ldst (str, REG_TYPE_MVF); +} + +static void +do_mav_ldst_2 (str) + char * str; +{ + do_mav_ldst (str, REG_TYPE_MVD); +} + +static void +do_mav_ldst_3 (str) + char * str; +{ + do_mav_ldst (str, REG_TYPE_MVFX); +} + +static void +do_mav_ldst_4 (str) + char * str; +{ + do_mav_ldst (str, REG_TYPE_MVDX); +} + +/* Isnsn like "foo X,Y". */ + +static void +do_mav_binops (str, mode, reg0, reg1) char * str; - int move; + int mode; + enum arm_reg_type reg0; + enum arm_reg_type reg1; { - int Rd, Rs = FAIL; + int shift0, shift1; + + shift0 = mode & 0xff; + shift1 = (mode >> 8) & 0xff; skip_whitespace (str); - if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL - || skip_past_comma (&str) == FAIL) + if (mav_reg_required_here (&str, shift0, reg0) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift1, reg1) == FAIL) { - if (! inst.error) + if (!inst.error) inst.error = BAD_ARGS; - return; } + else + end_of_line (str); +} - if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; +/* Isnsn like "foo X,Y,Z". */ - if (Rs != FAIL) - { - if (Rs < 8 && Rd < 8) - { - if (move == THUMB_MOVE) - /* A move of two lowregs is encoded as ADD Rd, Rs, #0 - since a MOV instruction produces unpredictable results. */ - inst.instruction = T_OPCODE_ADD_I3; - else - inst.instruction = T_OPCODE_CMP_LR; - inst.instruction |= Rd | (Rs << 3); - } - else - { - if (move == THUMB_MOVE) - inst.instruction = T_OPCODE_MOV_HR; - else - inst.instruction = T_OPCODE_CMP_HR; +static void +do_mav_triple (str, mode, reg0, reg1, reg2) + char * str; + int mode; + enum arm_reg_type reg0; + enum arm_reg_type reg1; + enum arm_reg_type reg2; +{ + int shift0, shift1, shift2; - if (Rd > 7) - inst.instruction |= THUMB_H1; + shift0 = mode & 0xff; + shift1 = (mode >> 8) & 0xff; + shift2 = (mode >> 16) & 0xff; - if (Rs > 7) - inst.instruction |= THUMB_H2; + skip_whitespace (str); - inst.instruction |= (Rd & 7) | ((Rs & 7) << 3); - } + if (mav_reg_required_here (&str, shift0, reg0) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift1, reg1) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift2, reg2) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; } else - { - if (Rd > 7) - { - inst.error = _("only lo regs allowed with immediate"); - return; - } + end_of_line (str); +} - if (move == THUMB_MOVE) - inst.instruction = T_OPCODE_MOV_I8; - else - inst.instruction = T_OPCODE_CMP_I8; +/* Isnsn like "foo W,X,Y,Z". + where W=MVAX[0:3] and X,Y,Z=MVFX[0:15]. */ - inst.instruction |= Rd << 8; +static void +do_mav_quad (str, mode, reg0, reg1, reg2, reg3) + char * str; + int mode; + enum arm_reg_type reg0; + enum arm_reg_type reg1; + enum arm_reg_type reg2; + enum arm_reg_type reg3; +{ + int shift0, shift1, shift2, shift3; - if (inst.reloc.exp.X_op != O_constant) - inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM; - else - { - unsigned value = inst.reloc.exp.X_add_number; + shift0= mode & 0xff; + shift1 = (mode >> 8) & 0xff; + shift2 = (mode >> 16) & 0xff; + shift3 = (mode >> 24) & 0xff; - if (value > 255) - { - inst.error = _("invalid immediate"); - return; - } + skip_whitespace (str); - inst.instruction |= value; - } + if (mav_reg_required_here (&str, shift0, reg0) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift1, reg1) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift2, reg2) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, shift3, reg3) == FAIL) + { + if (!inst.error) + inst.error = BAD_ARGS; } - - end_of_line (str); + else + end_of_line (str); } +/* Maverick shift immediate instructions. + cfsh32 MVFX[15:0],MVFX[15:0],Shift[6:0]. + cfsh64 MVDX[15:0],MVDX[15:0],Shift[6:0]. */ + static void -thumb_load_store (str, load_store, size) +do_mav_shift (str, reg0, reg1) char * str; - int load_store; - int size; + enum arm_reg_type reg0; + enum arm_reg_type reg1; { - int Rd, Rb, Ro = FAIL; + int error; + int imm, neg = 0; skip_whitespace (str); - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL) + error = 0; + + if (mav_reg_required_here (&str, 12, reg0) == FAIL + || skip_past_comma (&str) == FAIL + || mav_reg_required_here (&str, 16, reg1) == FAIL + || skip_past_comma (&str) == FAIL) { - if (! inst.error) + if (!inst.error) inst.error = BAD_ARGS; return; } - if (*str == '[') - { - str++; - if ((Rb = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; + /* Calculate the immediate operand. + The operand is a 7bit signed number. */ + skip_whitespace (str); - if (skip_past_comma (&str) != FAIL) - { - if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Ro = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; - } - else - { - inst.reloc.exp.X_op = O_constant; - inst.reloc.exp.X_add_number = 0; - } + if (*str == '#') + ++str; - if (*str != ']') - { - inst.error = _("expected ']'"); - return; - } - str++; + if (!ISDIGIT (*str) && *str != '-') + { + inst.error = _("expecting immediate, 7bit operand"); + return; } - else if (*str == '=') + + if (*str == '-') { - /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ - str++; + neg = 1; + ++str; + } - skip_whitespace (str); + for (imm = 0; *str && ISDIGIT (*str); ++str) + imm = imm * 10 + *str - '0'; - if (my_get_expression (& inst.reloc.exp, & str)) - return; + if (imm > 64) + { + inst.error = _("immediate out of range"); + return; + } - end_of_line (str); + /* Make negative imm's into 7bit signed numbers. */ + if (neg) + { + imm = -imm; + imm &= 0x0000007f; + } - if ( inst.reloc.exp.X_op != O_constant - && inst.reloc.exp.X_op != O_symbol) - { - inst.error = "Constant expression expected"; - return; - } + /* Bits 0-3 of the insn should have bits 0-3 of the immediate. + Bits 5-7 of the insn should have bits 4-6 of the immediate. + Bit 4 should be 0. */ + imm = (imm & 0xf) | ((imm & 0x70) << 1); - if (inst.reloc.exp.X_op == O_constant - && ((inst.reloc.exp.X_add_number & ~0xFF) == 0)) - { - /* This can be done with a mov instruction. */ + inst.instruction |= imm; + end_of_line (str); +} - inst.instruction = T_OPCODE_MOV_I8 | (Rd << 8); - inst.instruction |= inst.reloc.exp.X_add_number; - return; - } +static int +mav_parse_offset (str, negative) + char ** str; + int *negative; +{ + char * p = *str; + int offset; - /* Insert into literal pool. */ - if (add_to_lit_pool () == FAIL) - { - if (!inst.error) - inst.error = "literal pool insertion failed"; - return; - } + *negative = 0; - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - inst.reloc.pc_rel = 1; - inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); - /* Adjust ARM pipeline offset to Thumb. */ - inst.reloc.exp.X_add_number += 4; + skip_whitespace (p); - return; - } - else + if (*p == '#') + ++p; + + if (*p == '-') { - if (my_get_expression (&inst.reloc.exp, &str)) - return; + *negative = 1; + ++p; + } - inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); - inst.reloc.pc_rel = 1; - inst.reloc.exp.X_add_number -= 4; /* Pipeline offset. */ - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - end_of_line (str); - return; + if (!ISDIGIT (*p)) + { + inst.error = _("offset expected"); + return 0; } - if (Rb == REG_PC || Rb == REG_SP) + for (offset = 0; *p && ISDIGIT (*p); ++p) + offset = offset * 10 + *p - '0'; + + if (offset > 0xff) { - if (size != THUMB_WORD) - { - inst.error = _("byte or halfword not valid for base register"); - return; - } - else if (Rb == REG_PC && load_store != THUMB_LOAD) - { - inst.error = _("R15 based store not allowed"); - return; - } - else if (Ro != FAIL) - { - inst.error = _("Invalid base register for register offset"); - return; - } + inst.error = _("offset out of range"); + return 0; + } - if (Rb == REG_PC) - inst.instruction = T_OPCODE_LDR_PC; - else if (load_store == THUMB_LOAD) - inst.instruction = T_OPCODE_LDR_SP; - else - inst.instruction = T_OPCODE_STR_SP; + *str = p; - inst.instruction |= Rd << 8; - if (inst.reloc.exp.X_op == O_constant) - { - unsigned offset = inst.reloc.exp.X_add_number; + return *negative ? -offset : offset; +} - if (offset & ~0x3fc) - { - inst.error = _("invalid offset"); - return; - } +/* Maverick load/store instructions. + CRd,[Rn,]{!}. + CRd,[Rn],. */ - inst.instruction |= offset >> 2; - } - else - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - } - else if (Rb > 7) - { - inst.error = _("invalid base register in load/store"); - return; - } - else if (Ro == FAIL) - { - /* Immediate offset. */ - if (size == THUMB_WORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IW : T_OPCODE_STR_IW); - else if (size == THUMB_HALFWORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IH : T_OPCODE_STR_IH); - else - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IB : T_OPCODE_STR_IB); +static void +do_mav_ldst (str, reg0) + char * str; + enum arm_reg_type reg0; +{ + int offset, negative; + + skip_whitespace (str); - inst.instruction |= Rd | (Rb << 3); + if (mav_reg_required_here (&str, 12, reg0) == FAIL + || skip_past_comma (&str) == FAIL + || *str++ != '[' + || reg_required_here (&str, 16) == FAIL) + goto fail_ldst; - if (inst.reloc.exp.X_op == O_constant) + if (skip_past_comma (&str) == SUCCESS) + { + /* You are here: "]{!}". */ + inst.instruction |= PRE_INDEX; + + offset = mav_parse_offset (&str, &negative); + + if (inst.error) + return; + + if (*str++ != ']') { - unsigned offset = inst.reloc.exp.X_add_number; + inst.error = _("missing ]"); + return; + } - if (offset & ~(0x1f << size)) - { - inst.error = _("Invalid offset"); - return; - } - inst.instruction |= (offset >> size) << 6; + if (*str == '!') + { + inst.instruction |= WRITE_BACK; + ++str; } - else - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; } else { - /* Register offset. */ - if (size == THUMB_WORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RW : T_OPCODE_STR_RW); - else if (size == THUMB_HALFWORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RH : T_OPCODE_STR_RH); - else - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RB : T_OPCODE_STR_RB); + /* You are here: "], ". */ + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } - inst.instruction |= Rd | (Rb << 3) | (Ro << 6); + if (skip_past_comma (&str) == FAIL + || (offset = mav_parse_offset (&str, &negative), inst.error)) + goto fail_ldst; + + inst.instruction |= CP_T_WB; /* Post indexed, set bit W. */ } + if (negative) + offset = -offset; + else + inst.instruction |= CP_T_UD; /* Postive, so set bit U. */ + + inst.instruction |= offset >> 2; end_of_line (str); + return; + +fail_ldst: + if (!inst.error) + inst.error = BAD_ARGS; + return; } static void @@ -6196,7 +8741,7 @@ do_t_ldmstm (str) return; if (*str != '!') - as_warn (_("Inserted missing '!': load/store multiple always writes back base register")); + as_warn (_("inserted missing '!': load/store multiple always writes back base register")); else str++; @@ -6212,7 +8757,7 @@ do_t_ldmstm (str) { /* This really doesn't seem worth it. */ inst.reloc.type = BFD_RELOC_NONE; - inst.error = _("Expression too complex"); + inst.error = _("expression too complex"); return; } @@ -6264,7 +8809,7 @@ do_t_lds (str) || *str++ != ']') { if (! inst.error) - inst.error = _("Syntax: ldrs[b] Rd, [Rb, Ro]"); + inst.error = _("syntax: ldrs[b] Rd, [Rb, Ro]"); return; } @@ -6312,7 +8857,7 @@ do_t_push_pop (str) { /* This really doesn't seem worth it. */ inst.reloc.type = BFD_RELOC_NONE; - inst.error = _("Expression too complex"); + inst.error = _("expression too complex"); return; } @@ -6409,10 +8954,11 @@ do_t_adr (str) } static void -insert_reg (entry) - int entry; +insert_reg (r, htab) + const struct reg_entry *r; + struct hash_control *htab; { - int len = strlen (reg_table[entry].name) + 2; + int len = strlen (r->name) + 2; char * buf = (char *) xmalloc (len); char * buf2 = (char *) xmalloc (len); int i = 0; @@ -6421,21 +8967,35 @@ insert_reg (entry) buf[i++] = REGISTER_PREFIX; #endif - strcpy (buf + i, reg_table[entry].name); + strcpy (buf + i, r->name); for (i = 0; buf[i]; i++) - buf2[i] = islower (buf[i]) ? toupper (buf[i]) : buf[i]; + buf2[i] = TOUPPER (buf[i]); buf2[i] = '\0'; - hash_insert (arm_reg_hsh, buf, (PTR) & reg_table[entry]); - hash_insert (arm_reg_hsh, buf2, (PTR) & reg_table[entry]); + hash_insert (htab, buf, (PTR) r); + hash_insert (htab, buf2, (PTR) r); +} + +static void +build_reg_hsh (map) + struct reg_map *map; +{ + const struct reg_entry *r; + + if ((map->htab = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); + + for (r = map->names; r->name != NULL; r++) + insert_reg (r, map->htab); } static void -insert_reg_alias (str, regnum) +insert_reg_alias (str, regnum, htab) char *str; int regnum; + struct hash_control *htab; { struct reg_entry *new = (struct reg_entry *) xmalloc (sizeof (struct reg_entry)); @@ -6445,9 +9005,95 @@ insert_reg_alias (str, regnum) new->name = name; new->number = regnum; - hash_insert (arm_reg_hsh, name, (PTR) new); + hash_insert (htab, name, (PTR) new); } +/* Look for the .req directive. This is of the form: + + newname .req existing_name + + If we find one, or if it looks sufficiently like one that we want to + handle any error here, return non-zero. Otherwise return zero. */ +static int +create_register_alias (newname, p) + char *newname; + char *p; +{ + char *q; + char c; + + q = p; + skip_whitespace (q); + + c = *p; + *p = '\0'; + + if (*q && !strncmp (q, ".req ", 5)) + { + char *copy_of_str; + char *r; + +#ifdef IGNORE_OPCODE_CASE + newname = original_case_string; +#endif + copy_of_str = newname; + + q += 4; + skip_whitespace (q); + + for (r = q; *r != '\0'; r++) + if (*r == ' ') + break; + + if (r != q) + { + enum arm_reg_type new_type, old_type; + int old_regno; + char d = *r; + + *r = '\0'; + old_type = arm_reg_parse_any (q); + *r = d; + + new_type = arm_reg_parse_any (newname); + + if (new_type == REG_TYPE_MAX) + { + if (old_type != REG_TYPE_MAX) + { + old_regno = arm_reg_parse (&q, all_reg_maps[old_type].htab); + insert_reg_alias (newname, old_regno, + all_reg_maps[old_type].htab); + } + else + as_warn (_("register '%s' does not exist\n"), q); + } + else if (old_type == REG_TYPE_MAX) + { + as_warn (_("ignoring redefinition of register alias '%s' to non-existant register '%s'"), + copy_of_str, q); + } + else + { + /* Do not warn about redefinitions to the same alias. */ + if (new_type != old_type + || (arm_reg_parse (&q, all_reg_maps[old_type].htab) + != arm_reg_parse (&q, all_reg_maps[new_type].htab))) + as_warn (_("ignoring redefinition of register alias '%s'"), + copy_of_str); + + } + } + else + as_warn (_("ignoring incomplete .req pseuso op")); + + *p = c; + return 1; + } + *p = c; + return 0; +} + static void set_constant_flonums () { @@ -6458,6 +9104,54 @@ set_constant_flonums () abort (); } +/* Iterate over the base tables to create the instruction patterns. */ +static void +build_arm_ops_hsh () +{ + unsigned int i; + unsigned int j; + static struct obstack insn_obstack; + + obstack_begin (&insn_obstack, 4000); + + for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) + { + const struct asm_opcode *insn = insns + i; + + if (insn->cond_offset != 0) + { + /* Insn supports conditional execution. Build the varaints + and insert them in the hash table. */ + for (j = 0; j < sizeof (conds) / sizeof (struct asm_cond); j++) + { + unsigned len = strlen (insn->template); + struct asm_opcode *new; + char *template; + + new = obstack_alloc (&insn_obstack, sizeof (struct asm_opcode)); + /* All condition codes are two characters. */ + template = obstack_alloc (&insn_obstack, len + 3); + + strncpy (template, insn->template, insn->cond_offset); + strcpy (template + insn->cond_offset, conds[j].template); + if (len > insn->cond_offset) + strcpy (template + insn->cond_offset + 2, + insn->template + insn->cond_offset); + new->template = template; + new->cond_offset = 0; + new->variant = insn->variant; + new->parms = insn->parms; + new->value = (insn->value & ~COND_MASK) | conds[j].value; + + hash_insert (arm_ops_hsh, new->template, (PTR) new); + } + } + /* Finally, insert the unconditional insn in the table directly; + no need to build a copy. */ + hash_insert (arm_ops_hsh, insn->template, (PTR) insn); + } +} + void md_begin () { @@ -6468,12 +9162,10 @@ md_begin () || (arm_tops_hsh = hash_new ()) == NULL || (arm_cond_hsh = hash_new ()) == NULL || (arm_shift_hsh = hash_new ()) == NULL - || (arm_reg_hsh = hash_new ()) == NULL || (arm_psr_hsh = hash_new ()) == NULL) - as_fatal (_("Virtual memory exhausted")); + as_fatal (_("virtual memory exhausted")); - for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) - hash_insert (arm_ops_hsh, insns[i].template, (PTR) (insns + i)); + build_arm_ops_hsh (); for (i = 0; i < sizeof (tinsns) / sizeof (struct thumb_opcode); i++) hash_insert (arm_tops_hsh, tinsns[i].template, (PTR) (tinsns + i)); for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++) @@ -6483,11 +9175,55 @@ md_begin () for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++) hash_insert (arm_psr_hsh, psrs[i].template, (PTR) (psrs + i)); - for (i = 0; reg_table[i].name; i++) - insert_reg (i); + for (i = (int) REG_TYPE_FIRST; i < (int) REG_TYPE_MAX; i++) + build_reg_hsh (all_reg_maps + i); set_constant_flonums (); + /* Set the cpu variant based on the command-line options. We prefer + -mcpu= over -march= if both are set (as for GCC); and we prefer + -mfpu= over any other way of setting the floating point unit. + Use of legacy options with new options are faulted. */ + if (legacy_cpu != -1) + { + if (mcpu_cpu_opt != -1 || march_cpu_opt != -1) + as_bad (_("use of old and new-style options to set CPU type")); + + mcpu_cpu_opt = legacy_cpu; + } + else if (mcpu_cpu_opt == -1) + mcpu_cpu_opt = march_cpu_opt; + + if (legacy_fpu != -1) + { + if (mfpu_opt != -1) + as_bad (_("use of old and new-style options to set FPU type")); + + mfpu_opt = legacy_fpu; + } + else if (mfpu_opt == -1) + { + if (mcpu_fpu_opt != -1) + mfpu_opt = mcpu_fpu_opt; + else + mfpu_opt = march_fpu_opt; + } + + if (mfpu_opt == -1) + { + if (mcpu_cpu_opt == -1) + mfpu_opt = FPU_DEFAULT; + else if (mcpu_cpu_opt & ARM_EXT_V5) + mfpu_opt = FPU_ARCH_VFP_V2; + else + mfpu_opt = FPU_ARCH_FPA; + } + + if (mcpu_cpu_opt == -1) + mcpu_cpu_opt = CPU_DEFAULT; + + cpu_variant = mcpu_cpu_opt | mfpu_opt; + #if defined OBJ_COFF || defined OBJ_ELF { unsigned int flags = 0; @@ -6497,7 +9233,12 @@ md_begin () if (support_interwork) flags |= F_INTERWORK; if (uses_apcs_float) flags |= F_APCS_FLOAT; if (pic_code) flags |= F_PIC; - if ((cpu_variant & FPU_ALL) == FPU_NONE) flags |= F_SOFT_FLOAT; + if ((cpu_variant & FPU_ANY) == FPU_NONE + || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ + flags |= F_SOFT_FLOAT; + /* Using VFP conventions (even if soft-float). */ + if (cpu_variant & FPU_VFP_EXT_NONE) flags |= F_VFP_FLOAT; + bfd_set_private_flags (stdoutput, flags); @@ -6532,36 +9273,35 @@ md_begin () mach = bfd_mach_arm_2a; break; - default: - case ARM_6 | ARM_3 | ARM_2: /* Actually no CPU type defined. */ - mach = bfd_mach_arm_4; + case ARM_6: /* Also ARM_7. */ + mach = bfd_mach_arm_3; break; - case ARM_7: /* Also ARM_6. */ - mach = bfd_mach_arm_3; + default: + mach = bfd_mach_arm_4; break; } /* Catch special cases. */ - if (cpu_variant & ARM_EXT_XSCALE) + if (cpu_variant & ARM_CEXT_XSCALE) mach = bfd_mach_arm_XScale; else if (cpu_variant & ARM_EXT_V5E) mach = bfd_mach_arm_5TE; else if (cpu_variant & ARM_EXT_V5) { - if (cpu_variant & ARM_EXT_THUMB) + if (cpu_variant & ARM_EXT_V4T) mach = bfd_mach_arm_5T; else mach = bfd_mach_arm_5; } - else if (cpu_variant & ARM_EXT_HALFWORD) + else if (cpu_variant & ARM_EXT_V4) { - if (cpu_variant & ARM_EXT_THUMB) + if (cpu_variant & ARM_EXT_V4T) mach = bfd_mach_arm_4T; else mach = bfd_mach_arm_4; } - else if (cpu_variant & ARM_EXT_LONGMUL) + else if (cpu_variant & ARM_EXT_V3M) mach = bfd_mach_arm_3M; bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); @@ -6667,7 +9407,7 @@ md_atof (type, litP, sizeP) default: *sizeP = 0; - return _("Bad call to MD_ATOF()"); + return _("bad call to MD_ATOF()"); } t = atof_ieee (input_line_pointer, type, words); @@ -6685,14 +9425,21 @@ md_atof (type, litP, sizeP) } else { - /* For a 4 byte float the order of elements in `words' is 1 0. For an - 8 byte float the order is 1 0 3 2. */ - for (i = 0; i < prec; i += 2) - { - md_number_to_chars (litP, (valueT) words[i + 1], 2); - md_number_to_chars (litP + 2, (valueT) words[i], 2); - litP += 4; - } + if (cpu_variant & FPU_ARCH_VFP) + for (i = prec - 1; i >= 0; i--) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + else + /* For a 4 byte float the order of elements in `words' is 1 0. + For an 8 byte float the order is 1 0 3 2. */ + for (i = 0; i < prec; i += 2) + { + md_number_to_chars (litP, (valueT) words[i + 1], 2); + md_number_to_chars (litP + 2, (valueT) words[i], 2); + litP += 4; + } } return 0; @@ -6773,8 +9520,9 @@ md_undefined_symbol (name) advance the pointer. */ static int -arm_reg_parse (ccp) +arm_reg_parse (ccp, htab) register char ** ccp; + struct hash_control *htab; { char * start = * ccp; char c; @@ -6792,15 +9540,15 @@ arm_reg_parse (ccp) p++, start++; #endif #endif - if (!isalpha (*p) || !is_name_beginner (*p)) + if (!ISALPHA (*p) || !is_name_beginner (*p)) return FAIL; c = *p++; - while (isalpha (c) || isdigit (c) || c == '_') + while (ISALPHA (c) || ISDIGIT (c) || c == '_') c = *p++; *--p = 0; - reg = (struct reg_entry *) hash_find (arm_reg_hsh, start); + reg = (struct reg_entry *) hash_find (htab, start); *p = c; if (reg) @@ -6812,13 +9560,29 @@ arm_reg_parse (ccp) return FAIL; } -int -md_apply_fix3 (fixP, val, seg) +/* Search for the following register name in each of the possible reg name + tables. Return the classification if found, or REG_TYPE_MAX if not + present. */ +static enum arm_reg_type +arm_reg_parse_any (cp) + char *cp; +{ + int i; + + for (i = (int) REG_TYPE_FIRST; i < (int) REG_TYPE_MAX; i++) + if (arm_reg_parse (&cp, all_reg_maps[i].htab) != FAIL) + return (enum arm_reg_type) i; + + return REG_TYPE_MAX; +} + +void +md_apply_fix3 (fixP, valP, seg) fixS * fixP; - valueT * val; + valueT * valP; segT seg; { - offsetT value = * val; + offsetT value = * valP; offsetT newval; unsigned int newimm; unsigned long temp; @@ -6909,7 +9673,7 @@ md_apply_fix3 (fixP, val, seg) else { as_bad_where (fixP->fx_file, fixP->fx_line, - _("Unable to compute ADRL instructions for PC offset of 0x%lx"), + _("unable to compute ADRL instructions for PC offset of 0x%lx"), value); break; } @@ -7019,7 +9783,7 @@ md_apply_fix3 (fixP, val, seg) { if (((unsigned long) value) > 0xff) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid swi expression")); + _("invalid swi expression")); newval = md_chars_to_number (buf, THUMB_SIZE) & 0xff00; newval |= value; md_number_to_chars (buf, newval, THUMB_SIZE); @@ -7028,7 +9792,7 @@ md_apply_fix3 (fixP, val, seg) { if (((unsigned long) value) > 0x00ffffff) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid swi expression")); + _("invalid swi expression")); newval = md_chars_to_number (buf, INSN_SIZE) & 0xff000000; newval |= value; md_number_to_chars (buf, newval, INSN_SIZE); @@ -7038,7 +9802,7 @@ md_apply_fix3 (fixP, val, seg) case BFD_RELOC_ARM_MULTI: if (((unsigned long) value) > 0xffff) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid expression in load/store multiple")); + _("invalid expression in load/store multiple")); newval = value | md_chars_to_number (buf, INSN_SIZE); md_number_to_chars (buf, newval, INSN_SIZE); break; @@ -7078,7 +9842,7 @@ md_apply_fix3 (fixP, val, seg) && S_GET_SEGMENT (fixP->fx_addsy) == seg) { /* Get pc relative value to go into the branch. */ - value = * val; + value = * valP; /* Permit a backward branch provided that enough bits are set. Allow a forwards branch, provided that @@ -7091,7 +9855,7 @@ md_apply_fix3 (fixP, val, seg) if (! fixP->fx_done) #endif as_bad_where (fixP->fx_file, fixP->fx_line, - _("gas can't handle same-section branch dest >= 0x04000000")); + _("GAS can't handle same-section branch dest >= 0x04000000")); } value >>= 2; @@ -7133,7 +9897,7 @@ md_apply_fix3 (fixP, val, seg) value += diff; if ((value & ~0xff) && ((value & ~0xff) != ~0xff)) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Branch out of range")); + _("branch out of range")); newval = (newval & 0xff00) | ((value & 0x1ff) >> 1); } md_number_to_chars (buf, newval, THUMB_SIZE); @@ -7149,7 +9913,7 @@ md_apply_fix3 (fixP, val, seg) value += diff; if ((value & ~0x7ff) && ((value & ~0x7ff) != ~0x7ff)) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Branch out of range")); + _("branch out of range")); newval = (newval & 0xf800) | ((value & 0xfff) >> 1); } md_number_to_chars (buf, newval, THUMB_SIZE); @@ -7172,7 +9936,7 @@ md_apply_fix3 (fixP, val, seg) value += diff; if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Branch with link out of range")); + _("branch with link out of range")); newval = (newval & 0xf800) | ((value & 0x7fffff) >> 12); newval2 = (newval2 & 0xf800) | ((value & 0xfff) >> 1); @@ -7248,7 +10012,7 @@ md_apply_fix3 (fixP, val, seg) sign = value >= 0; if (value < -1023 || value > 1023 || (value & 3)) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Illegal value for co-processor offset")); + _("illegal value for co-processor offset")); if (value < 0) value = -value; newval = md_chars_to_number (buf, INSN_SIZE) & 0xff7fff00; @@ -7272,13 +10036,13 @@ md_apply_fix3 (fixP, val, seg) if ((fixP->fx_frag->fr_address + fixP->fx_where + value) & 3) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, target not word aligned (0x%08X)"), + _("invalid offset, target not word aligned (0x%08X)"), (unsigned int) (fixP->fx_frag->fr_address + fixP->fx_where + value)); if ((value + 2) & ~0x3fe) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), value); /* Round up, since pc will be rounded down. */ newval |= (value + 2) >> 2; @@ -7287,28 +10051,28 @@ md_apply_fix3 (fixP, val, seg) case 9: /* SP load/store. */ if (value & ~0x3fc) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), value); newval |= value >> 2; break; case 6: /* Word load/store. */ if (value & ~0x7c) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), value); newval |= value << 4; /* 6 - 2. */ break; case 7: /* Byte load/store. */ if (value & ~0x1f) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), value); newval |= value << 6; break; case 8: /* Halfword load/store. */ if (value & ~0x3e) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), value); newval |= value << 5; /* 6 - 1. */ break; @@ -7347,7 +10111,7 @@ md_apply_fix3 (fixP, val, seg) { if (value & ~0x1fc) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid immediate for stack address calculation")); + _("invalid immediate for stack address calculation")); newval = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; newval |= value >> 2; } @@ -7356,7 +10120,7 @@ md_apply_fix3 (fixP, val, seg) if (subtract || value & ~0x3fc) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid immediate for address calculation (value = 0x%08lX)"), + _("invalid immediate for address calculation (value = 0x%08lX)"), (unsigned long) value); newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP); newval |= rd << 8; @@ -7366,7 +10130,7 @@ md_apply_fix3 (fixP, val, seg) { if (value & ~0xff) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid 8bit immediate")); + _("invalid 8bit immediate")); newval = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; newval |= (rd << 8) | value; } @@ -7374,7 +10138,7 @@ md_apply_fix3 (fixP, val, seg) { if (value & ~0x7) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid 3bit immediate")); + _("invalid 3bit immediate")); newval = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; newval |= rd | (rs << 3) | (value << 6); } @@ -7390,7 +10154,7 @@ md_apply_fix3 (fixP, val, seg) case 0x05: /* 8bit immediate CMP. */ if (value < 0 || value > 255) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Invalid immediate: %ld is too large"), + _("invalid immediate: %ld is too large"), (long) value); newval |= value; break; @@ -7405,7 +10169,7 @@ md_apply_fix3 (fixP, val, seg) /* 5bit shift value (0..31). */ if (value < 0 || value > 31) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Illegal Thumb shift value: %ld"), (long) value); + _("illegal Thumb shift value: %ld"), (long) value); newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf03f; newval |= value << 6; md_number_to_chars (buf, newval, THUMB_SIZE); @@ -7414,15 +10178,13 @@ md_apply_fix3 (fixP, val, seg) case BFD_RELOC_VTABLE_INHERIT: case BFD_RELOC_VTABLE_ENTRY: fixP->fx_done = 0; - return 1; + return; case BFD_RELOC_NONE: default: as_bad_where (fixP->fx_file, fixP->fx_line, - _("Bad relocation fixup type (%d)"), fixP->fx_r_type); + _("bad relocation fixup type (%d)"), fixP->fx_r_type); } - - return 1; } /* Translate internal representation of relocation info to BFD target @@ -7492,7 +10254,7 @@ tc_gen_reloc (section, fixp) /* If this is called then the a literal has been referenced across a section boundary - possibly due to an implicit dump. */ as_bad_where (fixp->fx_file, fixp->fx_line, - _("Literal referenced across section boundary (Implicit dump?)")); + _("literal referenced across section boundary (Implicit dump?)")); return NULL; #ifdef OBJ_ELF @@ -7505,7 +10267,7 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_ARM_IMMEDIATE: as_bad_where (fixp->fx_file, fixp->fx_line, - _("Internal_relocation (type %d) not fixed up (IMMEDIATE)"), + _("internal relocation (type %d) not fixed up (IMMEDIATE)"), fixp->fx_r_type); return NULL; @@ -7516,7 +10278,7 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_ARM_OFFSET_IMM: as_bad_where (fixp->fx_file, fixp->fx_line, - _("Internal_relocation (type %d) not fixed up (OFFSET_IMM)"), + _("internal_relocation (type %d) not fixed up (OFFSET_IMM)"), fixp->fx_r_type); return NULL; @@ -7540,7 +10302,7 @@ tc_gen_reloc (section, fixp) default: type = _(""); break; } as_bad_where (fixp->fx_file, fixp->fx_line, - _("Cannot represent %s relocation in this object file format"), + _("cannot represent %s relocation in this object file format"), type); return NULL; } @@ -7561,7 +10323,7 @@ tc_gen_reloc (section, fixp) if (reloc->howto == NULL) { as_bad_where (fixp->fx_file, fixp->fx_line, - _("Can not represent %s relocation in this object file format"), + _("cannot represent %s relocation in this object file format"), bfd_get_reloc_code_name (code)); return NULL; } @@ -7584,13 +10346,14 @@ md_estimate_size_before_relax (fragP, segtype) } static void -output_inst PARAMS ((void)) +output_inst (str) + const char *str; { char * to = NULL; if (inst.error) { - as_bad (inst.error); + as_bad ("%s -- `%s'", inst.error, str); return; } @@ -7625,10 +10388,9 @@ void md_assemble (str) char * str; { - char c; - char * p; - char * q; - char * start; + char c; + char *p; + char *start; /* Align the instruction. This may not be the right thing to do but ... */ @@ -7658,261 +10420,100 @@ md_assemble (str) if (p == str) { - as_bad (_("No operator -- statement `%s'\n"), str); + as_bad (_("no operator -- statement `%s'\n"), str); return; } if (thumb_mode) { - CONST struct thumb_opcode * opcode; + const struct thumb_opcode * opcode; c = *p; *p = '\0'; - opcode = (CONST struct thumb_opcode *) hash_find (arm_tops_hsh, str); + opcode = (const struct thumb_opcode *) hash_find (arm_tops_hsh, str); *p = c; if (opcode) { /* Check that this instruction is supported for this CPU. */ - if (thumb_mode == 1 && (opcode->variants & cpu_variant) == 0) + if (thumb_mode == 1 && (opcode->variant & cpu_variant) == 0) { - as_bad (_("selected processor does not support this opcode")); + as_bad (_("selected processor does not support `%s'"), str); return; } inst.instruction = opcode->value; inst.size = opcode->size; - (*opcode->parms) (p); - output_inst (); - return; - } - } - else - { - CONST struct asm_opcode * opcode; - unsigned long cond_code; - - inst.size = INSN_SIZE; - /* P now points to the end of the opcode, probably white space, but we - have to break the opcode up in case it contains condionals and flags; - keep trying with progressively smaller basic instructions until one - matches, or we run out of opcode. */ - q = (p - str > LONGEST_INST) ? str + LONGEST_INST : p; - - for (; q != str; q--) - { - c = *q; - *q = '\0'; - - opcode = (CONST struct asm_opcode *) hash_find (arm_ops_hsh, str); - *q = c; - - if (opcode && opcode->template) - { - unsigned long flag_bits = 0; - char * r; - - /* Check that this instruction is supported for this CPU. */ - if ((opcode->variants & cpu_variant) == 0) - goto try_shorter; - - inst.instruction = opcode->value; - if (q == p) /* Just a simple opcode. */ - { - if (opcode->comp_suffix) - { - if (*opcode->comp_suffix != '\0') - as_bad (_("Opcode `%s' must have suffix from list: <%s>"), - str, opcode->comp_suffix); - else - /* Not a conditional instruction. */ - (*opcode->parms) (q, 0); - } - else - { - /* A conditional instruction with default condition. */ - inst.instruction |= COND_ALWAYS; - (*opcode->parms) (q, 0); - } - output_inst (); - return; - } - - /* Not just a simple opcode. Check if extra is a - conditional. */ - r = q; - if (p - r >= 2) - { - CONST struct asm_cond *cond; - char d = *(r + 2); - - *(r + 2) = '\0'; - cond = (CONST struct asm_cond *) hash_find (arm_cond_hsh, r); - *(r + 2) = d; - if (cond) - { - if (cond->value == 0xf0000000) - as_tsktsk ( -_("Warning: Use of the 'nv' conditional is deprecated\n")); - - cond_code = cond->value; - r += 2; - } - else - cond_code = COND_ALWAYS; - } - else - cond_code = COND_ALWAYS; - - /* Apply the conditional, or complain it's not allowed. */ - if (opcode->comp_suffix && *opcode->comp_suffix == '\0') - { - /* Instruction isn't conditional. */ - if (cond_code != COND_ALWAYS) - { - as_bad (_("Opcode `%s' is unconditional\n"), str); - return; - } - } - else - /* Instruction is conditional: set the condition into it. */ - inst.instruction |= cond_code; - - /* If there is a compulsory suffix, it should come here - before any optional flags. */ - if (opcode->comp_suffix && *opcode->comp_suffix != '\0') - { - CONST char *s = opcode->comp_suffix; - - while (*s) - { - inst.suffix++; - if (*r == *s) - break; - s++; - } - - if (*s == '\0') - { - as_bad (_("Opcode `%s' must have suffix from <%s>\n"), - str, opcode->comp_suffix); - return; - } - - r++; - } - - /* The remainder, if any should now be flags for the instruction; - Scan these checking each one found with the opcode. */ - if (r != p) - { - char d; - CONST struct asm_flg *flag = opcode->flags; - - if (flag) - { - int flagno; - - d = *p; - *p = '\0'; - - for (flagno = 0; flag[flagno].template; flagno++) - { - if (streq (r, flag[flagno].template)) - { - flag_bits |= flag[flagno].set_bits; - break; - } - } - - *p = d; - if (! flag[flagno].template) - goto try_shorter; - } - else - goto try_shorter; - } - - (*opcode->parms) (p, flag_bits); - output_inst (); - return; - } - - try_shorter: - ; - } - } - - /* It wasn't an instruction, but it might be a register alias of the form - alias .req reg. */ - q = p; - skip_whitespace (q); - - c = *p; - *p = '\0'; - - if (*q && !strncmp (q, ".req ", 4)) - { - int reg; - char * copy_of_str; - char * r; - -#ifdef IGNORE_OPCODE_CASE - str = original_case_string; -#endif - copy_of_str = str; - - q += 4; - skip_whitespace (q); - - for (r = q; *r != '\0'; r++) - if (*r == ' ') - break; - - if (r != q) - { - int regnum; - char d = *r; - - *r = '\0'; - regnum = arm_reg_parse (& q); - *r = d; + (*opcode->parms) (p); + output_inst (str); + return; + } + } + else + { + const struct asm_opcode * opcode; - reg = arm_reg_parse (& str); + c = *p; + *p = '\0'; + opcode = (const struct asm_opcode *) hash_find (arm_ops_hsh, str); + *p = c; - if (reg == FAIL) + if (opcode) + { + /* Check that this instruction is supported for this CPU. */ + if ((opcode->variant & cpu_variant) == 0) { - if (regnum != FAIL) - insert_reg_alias (str, regnum); - else - as_warn (_("register '%s' does not exist\n"), q); + as_bad (_("selected processor does not support `%s'"), str); + return; } - else if (regnum != FAIL) - { - if (reg != regnum) - as_warn (_("ignoring redefinition of register alias '%s'"), - copy_of_str); - /* Do not warn about redefinitions to the same alias. */ - } - else - as_warn (_("ignoring redefinition of register alias '%s' to non-existant register '%s'"), - copy_of_str, q); + inst.instruction = opcode->value; + inst.size = INSN_SIZE; + (*opcode->parms) (p); + output_inst (str); + return; } - else - as_warn (_("ignoring incomplete .req pseuso op")); - - *p = c; - return; } - *p = c; + /* It wasn't an instruction, but it might be a register alias of the form + alias .req reg. */ + if (create_register_alias (str, p)) + return; + as_bad (_("bad instruction `%s'"), start); } /* md_parse_option Invocation line includes a switch not recognized by the base assembler. - See if it's a processor-specific option. These are: + See if it's a processor-specific option. + + This routine is somewhat complicated by the need for backwards + compatibility (since older releases of gcc can't be changed). + The new options try to make the interface as compatible as + possible with GCC. + + New options (supported) are: + + -mcpu= Assemble for selected processor + -march= Assemble for selected architecture + -mfpu= Assemble for selected FPU. + -EB/-mbig-endian Big-endian + -EL/-mlittle-endian Little-endian + -k Generate PIC code + -mthumb Start in Thumb mode + -mthumb-interwork Code supports ARM/Thumb interworking + + For now we will also provide support for + + -mapcs-32 32-bit Program counter + -mapcs-26 26-bit Program counter + -macps-float Floats passed in FP registers + -mapcs-reentrant Reentrant code + -matpcs + (sometime these will probably be replaced with -mapcs= + and -matpcs=) + + The remaining options are only supported for back-wards compatibility. Cpu variants, the arm part is optional: -m[arm]1 Currently not supported. -m[arm]2, -m[arm]250 Arm 2 and Arm 250 processor @@ -7928,382 +10529,567 @@ _("Warning: Use of the 'nv' conditional is deprecated\n")); FP variants: -mfpa10, -mfpa11 FPA10 and 11 co-processor instructions -mfpe-old (No float load/store multiples) + -mvfpxd VFP Single precision + -mvfp All VFP -mno-fpu Disable all floating point instructions - Run-time endian selection: - -EB big endian cpu - -EL little endian cpu - ARM Procedure Calling Standard: - -mapcs-32 32 bit APCS - -mapcs-26 26 bit APCS - -mapcs-float Pass floats in float regs - -mapcs-reentrant Position independent code - -mthumb-interwork Code supports Arm/Thumb interworking - -matpcs ARM/Thumb Procedure Call Standard - -moabi Old ELF ABI */ + + The following CPU names are recognized: + arm1, arm2, arm250, arm3, arm6, arm600, arm610, arm620, + arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi, arm70, arm700, + arm700i, arm710 arm710t, arm720, arm720t, arm740t, arm710c, + arm7100, arm7500, arm7500fe, arm7tdmi, arm8, arm810, arm9, + arm920, arm920t, arm940t, arm946, arm966, arm9tdmi, arm9e, + arm10t arm10e, arm1020t, arm1020e, arm10200e, + strongarm, strongarm110, strongarm1100, strongarm1110, xscale. + + */ CONST char * md_shortopts = "m:k"; -struct option md_longopts[] = -{ #ifdef ARM_BI_ENDIAN #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}, -#ifdef OBJ_ELF -#define OPTION_OABI (OPTION_MD_BASE +2) - {"oabi", no_argument, NULL, OPTION_OABI}, +#else +#if TARGET_BYTES_BIG_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#else +#define OPTION_EL (OPTION_MD_BASE + 1) +#endif +#endif + +struct option md_longopts[] = +{ +#ifdef OPTION_EB + {"EB", no_argument, NULL, OPTION_EB}, #endif +#ifdef OPTION_EL + {"EL", no_argument, NULL, OPTION_EL}, #endif {NULL, no_argument, NULL, 0} }; size_t md_longopts_size = sizeof (md_longopts); -int -md_parse_option (c, arg) - int c; - char * arg; +struct arm_option_table { - char * str = arg; + char *option; /* Option name to match. */ + char *help; /* Help information. */ + int *var; /* Variable to change. */ + int value; /* What to change it to. */ + char *deprecated; /* If non-null, print this message. */ +}; - switch (c) +struct arm_option_table arm_opts[] = +{ + {"k", N_("generate PIC code"), &pic_code, 1, NULL}, + {"mthumb", N_("assemble Thumb code"), &thumb_mode, 1, NULL}, + {"mthumb-interwork", N_("support ARM/Thumb interworking"), + &support_interwork, 1, NULL}, + {"moabi", N_("use old ABI (ELF only)"), &target_oabi, 1, NULL}, + {"mapcs-32", N_("code uses 32-bit program counter"), &uses_apcs_26, 0, NULL}, + {"mapcs-26", N_("code uses 26-bit program counter"), &uses_apcs_26, 1, NULL}, + {"mapcs-float", N_("floating point args are in fp regs"), &uses_apcs_float, + 1, NULL}, + {"mapcs-reentrant", N_("re-entrant code"), &pic_code, 1, NULL}, + {"matpcs", N_("code is ATPCS conformant"), &atpcs, 1, NULL}, + {"mbig-endian", N_("assemble for big-endian"), &target_big_endian, 1, NULL}, + {"mlittle-endian", N_("assemble for little-endian"), &target_big_endian, 1, + NULL}, + + /* These are recognized by the assembler, but have no affect on code. */ + {"mapcs-frame", N_("use frame pointer"), NULL, 0, NULL}, + {"mapcs-stack-check", N_("use stack size checking"), NULL, 0, NULL}, + + /* DON'T add any new processors to this list -- we want the whole list + to go away... Add them to the processors table instead. */ + {"marm1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, + {"m1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, + {"marm2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, + {"m2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, + {"marm250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, + {"m250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, + {"marm3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, + {"m3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, + {"marm6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, + {"m6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, + {"marm600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, + {"m600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, + {"marm610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, + {"m610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, + {"marm620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, + {"m620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, + {"marm7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, + {"m7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, + {"marm70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, + {"m70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, + {"marm700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, + {"m700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, + {"marm700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, + {"m700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, + {"marm710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, + {"m710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, + {"marm710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, + {"m710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, + {"marm720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, + {"m720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, + {"marm7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, + {"m7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, + {"marm7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, + {"m7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, + {"marm7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, + {"m7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, + {"marm7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, + {"m7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, + {"marm7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, + {"m7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, + {"marm7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, + {"m7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, + {"marm7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, + {"m7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, + {"marm7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, + {"m7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, + {"marm7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"m7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"marm7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"m7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"marm710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, + {"m710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, + {"marm720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, + {"m720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, + {"marm740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, + {"m740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, + {"marm8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, + {"m8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, + {"marm810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, + {"m810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, + {"marm9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, + {"m9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, + {"marm9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, + {"m9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, + {"marm920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, + {"m920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, + {"marm940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, + {"m940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, + {"mstrongarm", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=strongarm")}, + {"mstrongarm110", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm110")}, + {"mstrongarm1100", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm1100")}, + {"mstrongarm1110", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm1110")}, + {"mxscale", NULL, &legacy_cpu, ARM_ARCH_XSCALE, N_("use -mcpu=xscale")}, + {"mall", NULL, &legacy_cpu, ARM_ANY, N_("use -mcpu=all")}, + + /* Architecture variants -- don't add any more to this list either. */ + {"mv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, + {"marmv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, + {"mv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, + {"marmv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, + {"mv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, + {"marmv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, + {"mv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, + {"marmv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, + {"mv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, + {"marmv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, + {"mv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, + {"marmv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, + {"mv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, + {"marmv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, + {"mv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, + {"marmv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, + {"mv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, + {"marmv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, + + /* Floating point variants -- don't add any more to this list either. */ + {"mfpe-old", NULL, &legacy_fpu, FPU_ARCH_FPE, N_("use -mfpu=fpe")}, + {"mfpa10", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa10")}, + {"mfpa11", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa11")}, + {"mno-fpu", NULL, &legacy_fpu, 0, + N_("use either -mfpu=softfpa or -mfpu=softvfp")}, + + {NULL, NULL, NULL, 0, NULL} +}; + +struct arm_cpu_option_table +{ + char *name; + int value; + /* For some CPUs we assume an FPU unless the user explicitly sets + -mfpu=... */ + int default_fpu; +}; + +/* This list should, at a minimum, contain all the cpu names + recognized by GCC. */ +static struct arm_cpu_option_table arm_cpus[] = +{ + {"all", ARM_ANY, FPU_ARCH_FPA}, + {"arm1", ARM_ARCH_V1, FPU_ARCH_FPA}, + {"arm2", ARM_ARCH_V2, FPU_ARCH_FPA}, + {"arm250", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"arm3", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"arm6", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm60", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm600", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm610", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm620", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7m", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm7d", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7dm", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm7di", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7dmi", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm70", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm700", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm700i", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm710", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm710t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm720", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm720t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm740t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm710c", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7100", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7500", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7500fe", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm7tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm8", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"arm810", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm110", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1100", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1110", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"arm9", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm920", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm920t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm922t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm940t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm9tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, + /* For V5 or later processors we default to using VFP; but the user + should really set the FPU type explicitly. */ + {"arm9e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm9e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm926ej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm946e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm946e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm966e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm966e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm10t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, + {"arm10e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1020", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1020t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, + {"arm1020e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + /* ??? XSCALE is really an architecture. */ + {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, + {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, + /* Maverick */ + {"ep9312", ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_NONE}, + {NULL, 0, 0} +}; + +struct arm_arch_option_table +{ + char *name; + int value; + int default_fpu; +}; + +/* This list should, at a minimum, contain all the architecture names + recognized by GCC. */ +static struct arm_arch_option_table arm_archs[] = +{ + {"all", ARM_ANY, FPU_ARCH_FPA}, + {"armv1", ARM_ARCH_V1, FPU_ARCH_FPA}, + {"armv2", ARM_ARCH_V2, FPU_ARCH_FPA}, + {"armv2a", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"armv2s", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"armv3", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"armv3m", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"armv4", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"armv4xm", ARM_ARCH_V4xM, FPU_ARCH_FPA}, + {"armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA}, + {"armv5", ARM_ARCH_V5, FPU_ARCH_VFP}, + {"armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP}, + {"armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP}, + {"armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP}, + {"armv5texp", ARM_ARCH_V5TExP, FPU_ARCH_VFP}, + {"armv5tej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP}, + {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, + {NULL, 0, 0} +}; + +/* ISA extensions in the co-processor space. */ +struct arm_arch_extension_table +{ + char *name; + int value; +}; + +static struct arm_arch_extension_table arm_extensions[] = +{ + {"maverick", ARM_CEXT_MAVERICK}, + {"xscale", ARM_CEXT_XSCALE}, + {NULL, 0} +}; + +struct arm_fpu_option_table +{ + char *name; + int value; +}; + +/* This list should, at a minimum, contain all the fpu names + recognized by GCC. */ +static struct arm_fpu_option_table arm_fpus[] = +{ + {"softfpa", FPU_NONE}, + {"fpe", FPU_ARCH_FPE}, + {"fpe2", FPU_ARCH_FPE}, + {"fpe3", FPU_ARCH_FPA}, /* Third release supports LFM/SFM. */ + {"fpa", FPU_ARCH_FPA}, + {"fpa10", FPU_ARCH_FPA}, + {"fpa11", FPU_ARCH_FPA}, + {"arm7500fe", FPU_ARCH_FPA}, + {"softvfp", FPU_ARCH_VFP}, + {"softvfp+vfp", FPU_ARCH_VFP_V2}, + {"vfp", FPU_ARCH_VFP_V2}, + {"vfp9", FPU_ARCH_VFP_V2}, + {"vfp10", FPU_ARCH_VFP_V2}, + {"vfp10-r0", FPU_ARCH_VFP_V1}, + {"vfpxd", FPU_ARCH_VFP_V1xD}, + {"arm1020t", FPU_ARCH_VFP_V1}, + {"arm1020e", FPU_ARCH_VFP_V2}, + {NULL, 0} +}; + +struct arm_long_option_table +{ + char *option; /* Substring to match. */ + char *help; /* Help information. */ + int (*func) PARAMS ((char *subopt)); /* Function to decode sub-option. */ + char *deprecated; /* If non-null, print this message. */ +}; + +static int +arm_parse_extension (str, opt_p) + char *str; + int *opt_p; +{ + while (str != NULL && *str != 0) { -#ifdef ARM_BI_ENDIAN - case OPTION_EB: - target_big_endian = 1; - break; - case OPTION_EL: - target_big_endian = 0; - break; -#endif + struct arm_arch_extension_table *opt; + char *ext; + int optlen; - case 'm': - switch (*str) + if (*str != '+') { - case 'f': - if (streq (str, "fpa10")) - cpu_variant = (cpu_variant & ~FPU_ALL) | FPU_FPA10; - else if (streq (str, "fpa11")) - cpu_variant = (cpu_variant & ~FPU_ALL) | FPU_FPA11; - else if (streq (str, "fpe-old")) - cpu_variant = (cpu_variant & ~FPU_ALL) | FPU_CORE; - else - goto bad; - break; + as_bad (_("invalid architectural extension")); + return 0; + } - case 'n': - if (streq (str, "no-fpu")) - cpu_variant &= ~FPU_ALL; - break; + str++; + ext = strchr (str, '+'); -#ifdef OBJ_ELF - case 'o': - if (streq (str, "oabi")) - target_oabi = true; - break; -#endif + if (ext != NULL) + optlen = ext - str; + else + optlen = strlen (str); - case 't': - /* Limit assembler to generating only Thumb instructions: */ - if (streq (str, "thumb")) - { - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_EXT_THUMB; - cpu_variant = (cpu_variant & ~FPU_ALL) | FPU_NONE; - thumb_mode = 1; - } - else if (streq (str, "thumb-interwork")) - { - if ((cpu_variant & ARM_EXT_THUMB) == 0) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_ARCH_V4T; -#if defined OBJ_COFF || defined OBJ_ELF - support_interwork = true; -#endif - } - else - goto bad; - break; + if (optlen == 0) + { + as_bad (_("missing architectural extension")); + return 0; + } - default: - if (streq (str, "all")) - { - cpu_variant = ARM_ALL | FPU_ALL; - return 1; - } -#if defined OBJ_COFF || defined OBJ_ELF - if (! strncmp (str, "apcs-", 5)) - { - /* GCC passes on all command line options starting "-mapcs-..." - to us, so we must parse them here. */ + for (opt = arm_extensions; opt->name != NULL; opt++) + if (strncmp (opt->name, str, optlen) == 0) + { + *opt_p |= opt->value; + break; + } - str += 5; + if (opt->name == NULL) + { + as_bad (_("unknown architectural extnsion `%s'"), str); + return 0; + } - if (streq (str, "32")) - { - uses_apcs_26 = false; - return 1; - } - else if (streq (str, "26")) - { - uses_apcs_26 = true; - return 1; - } - else if (streq (str, "frame")) - { - /* Stack frames are being generated - does not affect - linkage of code. */ - return 1; - } - else if (streq (str, "stack-check")) - { - /* Stack checking is being performed - does not affect - linkage, but does require that the functions - __rt_stkovf_split_small and __rt_stkovf_split_big be - present in the final link. */ + str = ext; + }; - return 1; - } - else if (streq (str, "float")) - { - /* Floating point arguments are being passed in the floating - point registers. This does affect linking, since this - version of the APCS is incompatible with the version that - passes floating points in the integer registers. */ + return 1; +} - uses_apcs_float = true; - return 1; - } - else if (streq (str, "reentrant")) - { - /* Reentrant code has been generated. This does affect - linking, since there is no point in linking reentrant/ - position independent code with absolute position code. */ - pic_code = true; - return 1; - } +static int +arm_parse_cpu (str) + char *str; +{ + struct arm_cpu_option_table *opt; + char *ext = strchr (str, '+'); + int optlen; - as_bad (_("Unrecognised APCS switch -m%s"), arg); - return 0; - } + if (ext != NULL) + optlen = ext - str; + else + optlen = strlen (str); - if (! strcmp (str, "atpcs")) - { - atpcs = true; - return 1; - } -#endif - /* Strip off optional "arm". */ - if (! strncmp (str, "arm", 3)) - str += 3; + if (optlen == 0) + { + as_bad (_("missing cpu name `%s'"), str); + return 0; + } - switch (*str) - { - case '1': - if (streq (str, "1")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_1; - else - goto bad; - break; + for (opt = arm_cpus; opt->name != NULL; opt++) + if (strncmp (opt->name, str, optlen) == 0) + { + mcpu_cpu_opt = opt->value; + mcpu_fpu_opt = opt->default_fpu; - case '2': - if (streq (str, "2")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_2; - else if (streq (str, "250")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_250; - else - goto bad; - break; + if (ext != NULL) + return arm_parse_extension (ext, &mcpu_cpu_opt); - case '3': - if (streq (str, "3")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_3; - else - goto bad; - break; + return 1; + } - case '6': - switch (strtol (str, NULL, 10)) - { - case 6: - case 60: - case 600: - case 610: - case 620: - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_6; - break; - default: - goto bad; - } - break; + as_bad (_("unknown cpu `%s'"), str); + return 0; +} - case '7': - /* Eat the processor name. */ - switch (strtol (str, & str, 10)) - { - case 7: - case 70: - case 700: - case 710: - case 720: - case 7100: - case 7500: - break; - default: - goto bad; - } - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_7; - for (; *str; str++) - { - switch (*str) - { - case 't': - cpu_variant |= ARM_ARCH_V4T; - break; +static int +arm_parse_arch (str) + char *str; +{ + struct arm_arch_option_table *opt; + char *ext = strchr (str, '+'); + int optlen; - case 'm': - cpu_variant |= ARM_EXT_LONGMUL; - break; + if (ext != NULL) + optlen = ext - str; + else + optlen = strlen (str); - case 'f': /* fe => fp enabled cpu. */ - if (str[1] == 'e') - ++ str; - else - goto bad; + if (optlen == 0) + { + as_bad (_("missing architecture name `%s'"), str); + return 0; + } - case 'c': /* Left over from 710c processor name. */ - case 'd': /* Debug. */ - case 'i': /* Embedded ICE. */ - /* Included for completeness in ARM processor naming. */ - break; - default: - goto bad; - } - } - break; + for (opt = arm_archs; opt->name != NULL; opt++) + if (strcmp (opt->name, str) == 0) + { + march_cpu_opt = opt->value; + march_fpu_opt = opt->default_fpu; - case '8': - if (streq (str, "8") || streq (str, "810")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_8 | ARM_ARCH_V4; - else - goto bad; - break; + if (ext != NULL) + return arm_parse_extension (ext, &march_cpu_opt); - case '9': - if (streq (str, "9")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_9 | ARM_ARCH_V4T; - else if (streq (str, "920")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_9 | ARM_ARCH_V4; - else if (streq (str, "920t")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_9 | ARM_ARCH_V4T; - else if (streq (str, "9tdmi")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_9 | ARM_ARCH_V4T; - else - goto bad; - break; + return 1; + } - case 's': - if (streq (str, "strongarm") - || streq (str, "strongarm110") - || streq (str, "strongarm1100")) - cpu_variant = (cpu_variant & ~ARM_ANY) - | ARM_8 | ARM_ARCH_V4; - else - goto bad; - break; + as_bad (_("unknown architecture `%s'\n"), str); + return 0; +} - case 'x': - if (streq (str, "xscale")) - cpu_variant = ARM_9 | ARM_ARCH_XSCALE; - else - goto bad; - break; - - case 'v': - /* Select variant based on architecture rather than - processor. */ - switch (*++str) - { - case '2': - switch (*++str) - { - case 'a': - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_3; - break; - case 0: - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_2; - break; - default: - as_bad (_("Invalid architecture variant -m%s"), arg); - break; - } - break; +static int +arm_parse_fpu (str) + char *str; +{ + struct arm_fpu_option_table *opt; - case '3': - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_7; + for (opt = arm_fpus; opt->name != NULL; opt++) + if (strcmp (opt->name, str) == 0) + { + mfpu_opt = opt->value; + return 1; + } - switch (*++str) - { - case 'm': cpu_variant |= ARM_EXT_LONGMUL; break; - case 0: break; - default: - as_bad (_("Invalid architecture variant -m%s"), arg); - break; - } - break; + as_bad (_("unknown floating point format `%s'\n"), str); + return 0; +} - case '4': - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_7 | ARM_ARCH_V4; +struct arm_long_option_table arm_long_opts[] = +{ + {"mcpu=", N_("\t assemble for CPU "), + arm_parse_cpu, NULL}, + {"march=", N_("\t assemble for architecture "), + arm_parse_arch, NULL}, + {"mfpu=", N_("\t assemble for FPU architecture "), + arm_parse_fpu, NULL}, + {NULL, NULL, 0, NULL} +}; - switch (*++str) - { - case 't': cpu_variant |= ARM_EXT_THUMB; break; - case 0: break; - default: - as_bad (_("Invalid architecture variant -m%s"), arg); - break; - } - break; +int +md_parse_option (c, arg) + int c; + char * arg; +{ + struct arm_option_table *opt; + struct arm_long_option_table *lopt; - case '5': - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V5; - switch (*++str) - { - case 't': cpu_variant |= ARM_EXT_THUMB; break; - case 'e': cpu_variant |= ARM_EXT_V5E; break; - case 0: break; - default: - as_bad (_("Invalid architecture variant -m%s"), arg); - break; - } - break; + switch (c) + { +#ifdef OPTION_EB + case OPTION_EB: + target_big_endian = 1; + break; +#endif - default: - as_bad (_("Invalid architecture variant -m%s"), arg); - break; - } - break; +#ifdef OPTION_EL + case OPTION_EL: + target_big_endian = 0; + break; +#endif - default: - bad: - as_bad (_("Invalid processor variant -m%s"), arg); - return 0; + case 'a': + /* Listing option. Just ignore these, we don't support additional + ones. */ + return 0; + + default: + for (opt = arm_opts; opt->option != NULL; opt++) + { + if (c == opt->option[0] + && ((arg == NULL && opt->option[1] == 0) + || strcmp (arg, opt->option + 1) == 0)) + { +#if WARN_DEPRECATED + /* If the option is deprecated, tell the user. */ + if (opt->deprecated != NULL) + as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, + arg ? arg : "", _(opt->deprecated)); +#endif + + if (opt->var != NULL) + *opt->var = opt->value; + + return 1; } } - break; -#if defined OBJ_ELF || defined OBJ_COFF - case 'k': - pic_code = 1; - break; + for (lopt = arm_long_opts; lopt->option != NULL; lopt++) + { + /* These options are expected to have an argument. */ + if (c == lopt->option[0] + && arg != NULL + && strncmp (arg, lopt->option + 1, + strlen (lopt->option + 1)) == 0) + { +#if WARN_DEPRECATED + /* If the option is deprecated, tell the user. */ + if (lopt->deprecated != NULL) + as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, arg, + _(lopt->deprecated)); #endif - default: + /* Call the sup-option parser. */ + return (*lopt->func)(arg + strlen (lopt->option) - 1); + } + } + + as_bad (_("unrecognized option `-%c%s'"), c, arg ? arg : ""); return 0; } @@ -8314,32 +11100,27 @@ void md_show_usage (fp) FILE * fp; { + struct arm_option_table *opt; + struct arm_long_option_table *lopt; + + fprintf (fp, _(" ARM-specific assembler options:\n")); + + for (opt = arm_opts; opt->option != NULL; opt++) + if (opt->help != NULL) + fprintf (fp, " -%-23s%s\n", opt->option, _(opt->help)); + + for (lopt = arm_long_opts; lopt->option != NULL; lopt++) + if (lopt->help != NULL) + fprintf (fp, " -%s%s\n", lopt->option, _(lopt->help)); + +#ifdef OPTION_EB fprintf (fp, _("\ - ARM Specific Assembler Options:\n\ - -m[arm][] select processor variant\n\ - -m[arm]v[2|2a|3|3m|4|4t|5[t][e]] select architecture variant\n\ - -mthumb only allow Thumb instructions\n\ - -mthumb-interwork mark the assembled code as supporting interworking\n\ - -mall allow any instruction\n\ - -mfpa10, -mfpa11 select floating point architecture\n\ - -mfpe-old don't allow floating-point multiple instructions\n\ - -mno-fpu don't allow any floating-point instructions.\n\ - -k generate PIC code.\n")); -#if defined OBJ_COFF || defined OBJ_ELF - fprintf (fp, _("\ - -mapcs-32, -mapcs-26 specify which ARM Procedure Calling Standard to use\n\ - -matpcs use ARM/Thumb Procedure Calling Standard\n\ - -mapcs-float floating point args are passed in FP regs\n\ - -mapcs-reentrant the code is position independent/reentrant\n")); -#endif -#ifdef OBJ_ELF - fprintf (fp, _("\ - -moabi support the old ELF ABI\n")); + -EB assemble code for a big-endian cpu\n")); #endif -#ifdef ARM_BI_ENDIAN + +#ifdef OPTION_EL fprintf (fp, _("\ - -EB assemble code for a big endian cpu\n\ - -EL assemble code for a little endian cpu\n")); + -EL assemble code for a little-endian cpu\n")); #endif } @@ -8741,9 +11522,9 @@ arm_parse_reloc () }; for (i = 0, ip = input_line_pointer; - i < sizeof (id) && (isalnum (*ip) || ispunct (*ip)); + i < sizeof (id) && (ISALNUM (*ip) || ISPUNCT (*ip)); i++, ip++) - id[i] = tolower (*ip); + id[i] = TOLOWER (*ip); for (i = 0; reloc_map[i].str; i++) if (strncmp (id, reloc_map[i].str, reloc_map[i].len) == 0) diff --git a/contrib/binutils/gas/config/tc-arm.h b/contrib/binutils/gas/config/tc-arm.h index 8de5704..2de9674 100644 --- a/contrib/binutils/gas/config/tc-arm.h +++ b/contrib/binutils/gas/config/tc-arm.h @@ -169,12 +169,6 @@ void armelf_frob_symbol PARAMS ((symbolS *, int *)); #define OPTIONAL_REGISTER_PREFIX '%' -#define md_operand(x) - -#define TC_HANDLES_FX_DONE - -#define MD_APPLY_FIX3 - #define LOCAL_LABEL(name) (name[0] == '.' && (name[1] == 'L')) #define LOCAL_LABELS_FB 1 #ifdef OBJ_ELF diff --git a/contrib/binutils/gas/config/tc-i386.c b/contrib/binutils/gas/config/tc-i386.c index bbd4fc4..c81f870 100644 --- a/contrib/binutils/gas/config/tc-i386.c +++ b/contrib/binutils/gas/config/tc-i386.c @@ -26,9 +26,8 @@ Bugs & suggestions are completely welcome. This is free software. Please help us make it better. */ -#include - #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "dwarf2dbg.h" #include "opcode/i386.h" @@ -78,7 +77,7 @@ static bfd_reloc_code_real_type reloc #ifndef DEFAULT_ARCH #define DEFAULT_ARCH "i386" #endif -static char *default_arch = DEFAULT_ARCH; +static const char *default_arch = DEFAULT_ARCH; /* 'md_assemble ()' gathers together information and puts it into a i386_insn. */ @@ -157,7 +156,7 @@ const char extra_symbol_chars[] = "*%-("; /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ -#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD)) +#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD) && !defined(TE_NetBSD)) /* Putting '/' here makes it impossible to use the divide operator. However, we need it for compatibility with SVR4 systems. */ const char comment_chars[] = "#/"; @@ -175,7 +174,7 @@ const char comment_chars[] = "#"; #NO_APP at the beginning of its output. Also note that comments started like this one will always work if '/' isn't otherwise defined. */ -#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD)) +#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD) && !defined(TE_NetBSD)) const char line_comment_chars[] = ""; #else const char line_comment_chars[] = "/"; @@ -540,8 +539,7 @@ static int smallest_imm_type (num) offsetT num; { - if (cpu_arch_flags != (Cpu086 | Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64) - && !(cpu_arch_flags & (CpuUnknown))) + if (cpu_arch_flags != (Cpu086 | Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) { /* This code is disabled on the 486 because all the Imm1 forms in the opcode table are slower on the i486. They're the @@ -891,27 +889,27 @@ md_begin () for (c = 0; c < 256; c++) { - if (isdigit (c)) + if (ISDIGIT (c)) { digit_chars[c] = c; mnemonic_chars[c] = c; register_chars[c] = c; operand_chars[c] = c; } - else if (islower (c)) + else if (ISLOWER (c)) { mnemonic_chars[c] = c; register_chars[c] = c; operand_chars[c] = c; } - else if (isupper (c)) + else if (ISUPPER (c)) { - mnemonic_chars[c] = tolower (c); + mnemonic_chars[c] = TOLOWER (c); register_chars[c] = mnemonic_chars[c]; operand_chars[c] = c; } - if (isalpha (c) || isdigit (c)) + if (ISALPHA (c) || ISDIGIT (c)) identifier_chars[c] = c; else if (c >= 128) { @@ -1269,7 +1267,8 @@ md_assemble (line) } if (!is_space_char (*l) && *l != END_OF_INSN - && *l != PREFIX_SEPARATOR) + && *l != PREFIX_SEPARATOR + && *l != ',') { as_bad (_("invalid character %s in mnemonic"), output_invalid (*l)); @@ -1360,20 +1359,49 @@ md_assemble (line) } } - /* Check if instruction is supported on specified architecture. */ - if (cpu_arch_flags != 0) + if (current_templates->start->opcode_modifier & (Jump | JumpByte)) { - if ((current_templates->start->cpu_flags & ~(Cpu64 | CpuNo64)) - & ~(cpu_arch_flags & ~(Cpu64 | CpuNo64))) - { - as_warn (_("`%s' is not supported on `%s'"), - current_templates->start->name, cpu_arch_name); - } - else if ((Cpu386 & ~cpu_arch_flags) && (flag_code != CODE_16BIT)) + /* Check for a branch hint. We allow ",pt" and ",pn" for + predict taken and predict not taken respectively. + I'm not sure that branch hints actually do anything on loop + and jcxz insns (JumpByte) for current Pentium4 chips. They + may work in the future and it doesn't hurt to accept them + now. */ + if (l[0] == ',' && l[1] == 'p') { - as_warn (_("use .code16 to ensure correct addressing mode")); + if (l[2] == 't') + { + if (! add_prefix (DS_PREFIX_OPCODE)) + return; + l += 3; + } + else if (l[2] == 'n') + { + if (! add_prefix (CS_PREFIX_OPCODE)) + return; + l += 3; + } } } + /* Any other comma loses. */ + if (*l == ',') + { + as_bad (_("invalid character %s in mnemonic"), + output_invalid (*l)); + return; + } + + /* Check if instruction is supported on specified architecture. */ + if ((current_templates->start->cpu_flags & ~(Cpu64 | CpuNo64)) + & ~(cpu_arch_flags & ~(Cpu64 | CpuNo64))) + { + as_warn (_("`%s' is not supported on `%s'"), + current_templates->start->name, cpu_arch_name); + } + else if ((Cpu386 & ~cpu_arch_flags) && (flag_code != CODE_16BIT)) + { + as_warn (_("use .code16 to ensure correct addressing mode")); + } /* Check for rep/repne without a string instruction. */ if (expecting_string_instruction @@ -2695,6 +2723,9 @@ md_assemble (line) { int code16; int prefix; + relax_substateT subtype; + symbolS *sym; + offsetT off; code16 = 0; if (flag_code == CODE_16BIT) @@ -2739,19 +2770,29 @@ md_assemble (line) if (i.prefix[REX_PREFIX]) *p++ = i.prefix[REX_PREFIX]; *p = i.tm.base_opcode; - /* 1 possible extra opcode + displacement go in var part. + + if ((unsigned char) *p == JUMP_PC_RELATIVE) + subtype = ENCODE_RELAX_STATE (UNCOND_JUMP, SMALL); + else if ((cpu_arch_flags & Cpu386) != 0) + subtype = ENCODE_RELAX_STATE (COND_JUMP, SMALL); + else + subtype = ENCODE_RELAX_STATE (COND_JUMP86, SMALL); + subtype |= code16; + + sym = i.op[0].disps->X_add_symbol; + off = i.op[0].disps->X_add_number; + + if (i.op[0].disps->X_op != O_constant + && i.op[0].disps->X_op != O_symbol) + { + /* Handle complex expressions. */ + sym = make_expr_symbol (i.op[0].disps); + off = 0; + } + + /* 1 possible extra opcode + 4 byte displacement go in var part. Pass reloc in fr_var. */ - frag_var (rs_machine_dependent, - 1 + 4, - i.reloc[0], - ((unsigned char) *p == JUMP_PC_RELATIVE - ? ENCODE_RELAX_STATE (UNCOND_JUMP, SMALL) | code16 - : ((cpu_arch_flags & Cpu386) != 0 - ? ENCODE_RELAX_STATE (COND_JUMP, SMALL) | code16 - : ENCODE_RELAX_STATE (COND_JUMP86, SMALL) | code16)), - i.op[0].disps->X_add_symbol, - i.op[0].disps->X_add_number, - p); + frag_var (rs_machine_dependent, 5, i.reloc[0], subtype, sym, off, p); } else if (i.tm.opcode_modifier & (JumpByte | JumpDword)) { @@ -3135,27 +3176,41 @@ lex_got (reloc, adjust) int len; len = strlen (gotrel[j].str); - if (strncmp (cp + 1, gotrel[j].str, len) == 0) + if (strncasecmp (cp + 1, gotrel[j].str, len) == 0) { if (gotrel[j].rel[(unsigned int) flag_code] != 0) { - int first; - char *tmpbuf; + int first, second; + char *tmpbuf, *past_reloc; *reloc = gotrel[j].rel[(unsigned int) flag_code]; + if (adjust) + *adjust = len; if (GOT_symbol == NULL) GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME); /* Replace the relocation token with ' ', so that errors like foo@GOTOFF1 will be detected. */ + + /* The length of the first part of our input line. */ first = cp - input_line_pointer; - tmpbuf = xmalloc (strlen (input_line_pointer)); + + /* The second part goes from after the reloc token until + (and including) an end_of_line char. Don't use strlen + here as the end_of_line char may not be a NUL. */ + past_reloc = cp + 1 + len; + for (cp = past_reloc; !is_end_of_line[(unsigned char) *cp++]; ) + ; + second = cp - past_reloc; + + /* Allocate and copy string. The trailing NUL shouldn't + be necessary, but be safe. */ + tmpbuf = xmalloc (first + second + 2); memcpy (tmpbuf, input_line_pointer, first); tmpbuf[first] = ' '; - strcpy (tmpbuf + first + 1, cp + 1 + len); - if (adjust) - *adjust = len; + memcpy (tmpbuf + first + 1, past_reloc, second); + tmpbuf[first + second + 1] = '\0'; return tmpbuf; } @@ -4042,15 +4097,6 @@ md_convert_frag (abfd, sec, fragP) /* Address we want to reach in file space. */ target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; -#ifdef BFD_ASSEMBLER - /* Not needed otherwise? */ - { - /* Local symbols which have already been resolved have a NULL frag. */ - fragS *sym_frag = symbol_get_frag (fragP->fr_symbol); - if (sym_frag) - target_address += sym_frag->fr_address; - } -#endif /* Address opcode resides at in file space. */ opcode_address = fragP->fr_address + fragP->fr_fix; @@ -4165,19 +4211,17 @@ md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) the same (little-endian) format, so we don't need to care about which we are handling. */ -int -md_apply_fix3 (fixP, valp, seg) +void +md_apply_fix3 (fixP, valP, seg) /* The fix we're to put in. */ fixS *fixP; - /* Pointer to the value of the bits. */ - valueT *valp; - + valueT * valP; /* Segment fix is from. */ segT seg ATTRIBUTE_UNUSED; { - register char *p = fixP->fx_where + fixP->fx_frag->fr_literal; - valueT value = *valp; + char *p = fixP->fx_where + fixP->fx_frag->fr_literal; + valueT value = * valP; #if defined (BFD_ASSEMBLER) && !defined (TE_Mach) if (fixP->fx_pcrel) @@ -4311,30 +4355,26 @@ md_apply_fix3 (fixP, valp, seg) case BFD_RELOC_VTABLE_INHERIT: case BFD_RELOC_VTABLE_ENTRY: fixP->fx_done = 0; - return 1; + return; default: break; } #endif /* defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) */ - *valp = value; + * valP = value; #endif /* defined (BFD_ASSEMBLER) && !defined (TE_Mach) */ -#ifndef BFD_ASSEMBLER - md_number_to_chars (p, value, fixP->fx_size); -#else /* Are we finished with this relocation now? */ - if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0) + if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) fixP->fx_done = 1; +#ifdef BFD_ASSEMBLER else if (use_rela_relocations) { fixP->fx_no_overflow = 1; value = 0; } - md_number_to_chars (p, value, fixP->fx_size); #endif - - return 1; + md_number_to_chars (p, value, fixP->fx_size); } #define MAX_LITTLENUMS 6 @@ -4397,7 +4437,7 @@ static char * output_invalid (c) int c; { - if (isprint (c)) + if (ISPRINT (c)) sprintf (output_invalid_buf, "'%c'", c); else sprintf (output_invalid_buf, "(0x%x)", (unsigned) c); @@ -4611,6 +4651,48 @@ i386_target_format () } #endif /* OBJ_MAYBE_ more than one */ + +#if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) +void i386_elf_emit_arch_note () +{ + if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && cpu_arch_name != NULL) + { + char *p; + asection *seg = now_seg; + subsegT subseg = now_subseg; + Elf_Internal_Note i_note; + Elf_External_Note e_note; + asection *note_secp; + int len; + + /* Create the .note section. */ + note_secp = subseg_new (".note", 0); + bfd_set_section_flags (stdoutput, + note_secp, + SEC_HAS_CONTENTS | SEC_READONLY); + + /* Process the arch string. */ + len = strlen (cpu_arch_name); + + i_note.namesz = len + 1; + i_note.descsz = 0; + i_note.type = NT_ARCH; + p = frag_more (sizeof (e_note.namesz)); + md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz)); + p = frag_more (sizeof (e_note.descsz)); + md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz)); + p = frag_more (sizeof (e_note.type)); + md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type)); + p = frag_more (len + 1); + strcpy (p, cpu_arch_name); + + frag_align (2, 0, 0); + + subseg_set (seg, subseg); + } +} +#endif #endif /* BFD_ASSEMBLER */ symbolS * @@ -4741,8 +4823,9 @@ tc_gen_reloc (section, fixp) switch (fixp->fx_size) { default: - as_bad (_("can not do %d byte pc-relative relocation"), - fixp->fx_size); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("can not do %d byte pc-relative relocation"), + fixp->fx_size); code = BFD_RELOC_32_PCREL; break; case 1: code = BFD_RELOC_8_PCREL; break; @@ -4755,7 +4838,9 @@ tc_gen_reloc (section, fixp) switch (fixp->fx_size) { default: - as_bad (_("can not do %d byte relocation"), fixp->fx_size); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("can not do %d byte relocation"), + fixp->fx_size); code = BFD_RELOC_32; break; case 1: code = BFD_RELOC_8; break; diff --git a/contrib/binutils/gas/config/tc-i386.h b/contrib/binutils/gas/config/tc-i386.h index 71e0c88..d5ba043 100644 --- a/contrib/binutils/gas/config/tc-i386.h +++ b/contrib/binutils/gas/config/tc-i386.h @@ -111,6 +111,11 @@ extern const char *i386_target_format PARAMS ((void)); #endif #endif +#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)) +#define md_end i386_elf_emit_arch_note +extern void i386_elf_emit_arch_note PARAMS ((void)); +#endif + #else /* ! BFD_ASSEMBLER */ /* COFF STUFF */ @@ -121,7 +126,7 @@ extern const char *i386_target_format PARAMS ((void)); #define TC_COUNT_RELOC(x) ((x)->fx_addsy || (x)->fx_r_type==7) #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP) extern short tc_coff_fix2rtype PARAMS ((struct fix *)); -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) +#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) extern int tc_coff_sizemachdep PARAMS ((fragS *frag)); #ifdef TE_GO32 @@ -293,7 +298,6 @@ typedef struct #define CpuSSE 0x1000 /* Streaming SIMD extensions required */ #define CpuSSE2 0x2000 /* Streaming SIMD extensions 2 required */ #define Cpu3dnow 0x4000 /* 3dnow! support required */ -#define CpuUnknown 0x8000 /* The CPU is unknown, be on the safe side. */ /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ @@ -527,9 +531,6 @@ if (fragP->fr_type == rs_align_code) \ - fragP->fr_address \ - fragP->fr_fix)); -/* call md_apply_fix3 with segment instead of md_apply_fix */ -#define MD_APPLY_FIX3 - void i386_print_statistics PARAMS ((FILE *)); #define tc_print_statistics i386_print_statistics diff --git a/contrib/binutils/gas/config/tc-ia64.c b/contrib/binutils/gas/config/tc-ia64.c index 0e1c578..701752f 100644 --- a/contrib/binutils/gas/config/tc-ia64.c +++ b/contrib/binutils/gas/config/tc-ia64.c @@ -1,5 +1,5 @@ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GAS, the GNU Assembler. @@ -43,6 +43,7 @@ */ #include "as.h" +#include "safe-ctype.h" #include "dwarf2dbg.h" #include "subsegs.h" @@ -61,13 +62,17 @@ enum special_section { + /* IA-64 ABI section pseudo-ops. */ SPECIAL_SECTION_BSS = 0, SPECIAL_SECTION_SBSS, SPECIAL_SECTION_SDATA, SPECIAL_SECTION_RODATA, SPECIAL_SECTION_COMMENT, SPECIAL_SECTION_UNWIND, - SPECIAL_SECTION_UNWIND_INFO + SPECIAL_SECTION_UNWIND_INFO, + /* HPUX specific section pseudo-ops. */ + SPECIAL_SECTION_INIT_ARRAY, + SPECIAL_SECTION_FINI_ARRAY, }; enum reloc_func @@ -81,6 +86,7 @@ enum reloc_func FUNC_SEG_RELATIVE, FUNC_LTV_RELATIVE, FUNC_LT_FPTR_RELATIVE, + FUNC_IPLT_RELOC, }; enum reg_symbol @@ -279,6 +285,9 @@ static struct int g_reg_set_conditionally[128]; } last_groups[3]; int group_idx; + + int pointer_size; /* size in bytes of a pointer */ + int pointer_size_shift; /* shift size of a pointer for alignment */ } md; @@ -476,6 +485,7 @@ pseudo_func[] = { "segrel", PSEUDO_FUNC_RELOC, { 0 } }, { "ltv", PSEUDO_FUNC_RELOC, { 0 } }, { "", 0, { 0 } }, /* placeholder for FUNC_LT_FPTR_RELATIVE */ + { "iplt", PSEUDO_FUNC_RELOC, { 0 } }, /* mbtype4 constants: */ { "alt", PSEUDO_FUNC_CONST, { 0xa } }, @@ -523,7 +533,13 @@ static const bfd_vma nop[IA64_NUM_UNITS] = static char special_section_name[][20] = { {".bss"}, {".sbss"}, {".sdata"}, {".rodata"}, {".comment"}, - {".IA_64.unwind"}, {".IA_64.unwind_info"} + {".IA_64.unwind"}, {".IA_64.unwind_info"}, + {".init_array"}, {".fini_array"} + }; + +static char *special_linkonce_name[] = + { + ".gnu.linkonce.ia64unw.", ".gnu.linkonce.ia64unwi." }; /* The best template for a particular sequence of up to three @@ -703,6 +719,7 @@ static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode expressionS *e)); static int parse_operand PARAMS ((expressionS *e)); static struct ia64_opcode * parse_operands PARAMS ((struct ia64_opcode *)); +static int errata_nop_necessary_p PARAMS ((struct slot *, enum ia64_unit)); static void build_insn PARAMS ((struct slot *, bfd_vma *)); static void emit_one_bundle PARAMS ((void)); static void fix_insn PARAMS ((fixS *, const struct ia64_operand *, valueT)); @@ -716,6 +733,7 @@ static void add_qp_imply PARAMS((int p1, int p2)); static void clear_qp_branch_flag PARAMS((valueT mask)); static void clear_qp_mutex PARAMS((valueT mask)); static void clear_qp_implies PARAMS((valueT p1_mask, valueT p2_mask)); +static int has_suffix_p PARAMS((const char *, const char *)); static void clear_register_values PARAMS ((void)); static void print_dependency PARAMS ((const char *action, int depind)); static void instruction_serialization PARAMS ((void)); @@ -851,12 +869,21 @@ static int generate_unwind_image PARAMS ((const char *)); stack, so this must be a macro... */ #define make_unw_section_name(special, text_name, result) \ { \ - char *_prefix = special_section_name[special]; \ - size_t _prefix_len = strlen (_prefix), _text_len = strlen (text_name); \ - char *_result = alloca (_prefix_len + _text_len + 1); \ - memcpy(_result, _prefix, _prefix_len); \ - memcpy(_result + _prefix_len, text_name, _text_len); \ - _result[_prefix_len + _text_len] = '\0'; \ + const char *_prefix = special_section_name[special]; \ + const char *_suffix = text_name; \ + size_t _prefix_len, _suffix_len; \ + char *_result; \ + if (strncmp (text_name, ".gnu.linkonce.t.", \ + sizeof (".gnu.linkonce.t.") - 1) == 0) \ + { \ + _prefix = special_linkonce_name[special - SPECIAL_SECTION_UNWIND]; \ + _suffix += sizeof (".gnu.linkonce.t.") - 1; \ + } \ + _prefix_len = strlen (_prefix), _suffix_len = strlen (_suffix); \ + _result = alloca (_prefix_len + _suffix_len + 1); \ + memcpy (_result, _prefix, _prefix_len); \ + memcpy (_result + _prefix_len, _suffix, _suffix_len); \ + _result[_prefix_len + _suffix_len] = '\0'; \ result = _result; \ } \ while (0) @@ -892,6 +919,20 @@ set_section (name) input_line_pointer = saved_input_line_pointer; } +/* Map 's' to SHF_IA_64_SHORT. */ + +int +ia64_elf_section_letter (letter, ptr_msg) + int letter; + char **ptr_msg; +{ + if (letter == 's') + return SHF_IA_64_SHORT; + + *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S in string"); + return 0; +} + /* Map SHF_IA_64_SHORT to SEC_SMALL_DATA. */ flagword @@ -909,15 +950,28 @@ ia64_elf_section_type (str, len) const char *str; size_t len; { - len = sizeof (ELF_STRING_ia64_unwind_info) - 1; - if (strncmp (str, ELF_STRING_ia64_unwind_info, len) == 0) +#define STREQ(s) ((len == sizeof (s) - 1) && (strncmp (str, s, sizeof (s) - 1) == 0)) + + if (STREQ (ELF_STRING_ia64_unwind_info)) return SHT_PROGBITS; - len = sizeof (ELF_STRING_ia64_unwind) - 1; - if (strncmp (str, ELF_STRING_ia64_unwind, len) == 0) + if (STREQ (ELF_STRING_ia64_unwind_info_once)) + return SHT_PROGBITS; + + if (STREQ (ELF_STRING_ia64_unwind)) + return SHT_IA_64_UNWIND; + + if (STREQ (ELF_STRING_ia64_unwind_once)) return SHT_IA_64_UNWIND; + if (STREQ ("init_array")) + return SHT_INIT_ARRAY; + + if (STREQ ("fini_array")) + return SHT_FINI_ARRAY; + return -1; +#undef STREQ } static unsigned int @@ -2735,6 +2789,47 @@ fixup_unw_records (list) } } +/* Helper routine for output_unw_records. Emits the header for the unwind + info. */ + +static int +setup_unwind_header (int size, unsigned char **mem) +{ + int x, extra = 0; + valueT flag_value; + + /* pad to pointer-size boundry. */ + x = size % md.pointer_size; + if (x != 0) + extra = md.pointer_size - x; + + /* Add 8 for the header + a pointer for the + personality offset. */ + *mem = xmalloc (size + extra + 8 + md.pointer_size); + + /* Clear the padding area and personality. */ + memset (*mem + 8 + size, 0 , extra + md.pointer_size); + + /* Initialize the header area. */ + if (unwind.personality_routine) + { + if (md.flags & EF_IA_64_ABI64) + flag_value = (bfd_vma) 3 << 32; + else + /* 32-bit unwind info block. */ + flag_value = (bfd_vma) 0x1003 << 32; + } + else + flag_value = 0; + + md_number_to_chars (*mem, (((bfd_vma) 1 << 48) /* Version. */ + | flag_value /* U & E handler flags. */ + | ((size + extra) / md.pointer_size)), /* Length. */ + 8); + + return extra; +} + /* Generate an unwind image from a record list. Returns the number of bytes in the resulting image. The memory image itselof is returned in the 'ptr' parameter. */ @@ -2743,7 +2838,7 @@ output_unw_records (list, ptr) unw_rec_list *list; void **ptr; { - int size, x, extra = 0; + int size, extra; unsigned char *mem; *ptr = NULL; @@ -2752,35 +2847,17 @@ output_unw_records (list, ptr) fixup_unw_records (list); size = calc_record_size (list); - /* pad to 8 byte boundry. */ - x = size % 8; - if (x != 0) - extra = 8 - x; - if (size > 0 || unwind.force_unwind_entry) { unwind.force_unwind_entry = 0; - - /* Add 8 for the header + 8 more bytes for the personality offset. */ - mem = xmalloc (size + extra + 16); + extra = setup_unwind_header (size, &mem); vbyte_mem_ptr = mem + 8; - /* Clear the padding area and personality. */ - memset (mem + 8 + size, 0 , extra + 8); - /* Initialize the header area. */ - md_number_to_chars (mem, - (((bfd_vma) 1 << 48) /* version */ - | (unwind.personality_routine - ? ((bfd_vma) 3 << 32) /* U & E handler flags */ - : 0) - | ((size + extra) / 8)), /* length (dwords) */ - 8); - process_unw_records (list, output_vbyte_mem); *ptr = mem; - size += extra + 16; + size += extra + 8 + md.pointer_size; } return size; } @@ -3149,24 +3226,26 @@ generate_unwind_image (text_name) /* Generate the unwind record. */ size = output_unw_records (unwind.list, (void **) &unw_rec); - if (size % 8 != 0) - as_bad ("Unwind record is not a multiple of 8 bytes."); - + if (size % md.pointer_size != 0) + as_bad ("Unwind record is not a multiple of %d bytes.", md.pointer_size); + /* If there are unwind records, switch sections, and output the info. */ if (size != 0) { unsigned char *where; char *sec_name; expressionS exp; + bfd_reloc_code_real_type reloc; make_unw_section_name (SPECIAL_SECTION_UNWIND_INFO, text_name, sec_name); set_section (sec_name); bfd_set_section_flags (stdoutput, now_seg, SEC_LOAD | SEC_ALLOC | SEC_READONLY); - /* Make sure the section has 8 byte alignment. */ - frag_align (3, 0, 0); - record_alignment (now_seg, 3); + /* Make sure the section has 4 byte alignment for ILP32 and + 8 byte alignment for LP64. */ + frag_align (md.pointer_size_shift, 0, 0); + record_alignment (now_seg, md.pointer_size_shift); /* Set expression which points to start of unwind descriptor area. */ unwind.info = expr_build_dot (); @@ -3186,8 +3265,24 @@ generate_unwind_image (text_name) exp.X_op = O_symbol; exp.X_add_symbol = unwind.personality_routine; exp.X_add_number = 0; - fix_new_exp (frag_now, frag_now_fix () - 8, 8, - &exp, 0, BFD_RELOC_IA64_LTOFF_FPTR64LSB); + + if (md.flags & EF_IA_64_BE) + { + if (md.flags & EF_IA_64_ABI64) + reloc = BFD_RELOC_IA64_LTOFF_FPTR64MSB; + else + reloc = BFD_RELOC_IA64_LTOFF_FPTR32MSB; + } + else + { + if (md.flags & EF_IA_64_ABI64) + reloc = BFD_RELOC_IA64_LTOFF_FPTR64LSB; + else + reloc = BFD_RELOC_IA64_LTOFF_FPTR32LSB; + } + + fix_new_exp (frag_now, frag_now_fix () - md.pointer_size, + md.pointer_size, & exp, 0, reloc); unwind.personality_routine = 0; } } @@ -3797,6 +3892,8 @@ dot_endp (dummy) segT saved_seg; subsegT saved_subseg; const char *sec_name, *text_name; + char *name, *p, c; + symbolS *sym; if (unwind.saved_text_seg) { @@ -3820,6 +3917,8 @@ dot_endp (dummy) .text .IA_64.unwind .text.foo .IA_64.unwind.text.foo .foo .IA_64.unwind.foo + .gnu.linkonce.t.foo + .gnu.linkonce.ia64unw.foo _info .IA_64.unwind_info gas issues error message (ditto) _infoFOO .IA_64.unwind_infoFOO gas issues error message (ditto) @@ -3851,9 +3950,6 @@ dot_endp (dummy) if (strcmp (text_name, ".text") == 0) text_name = ""; - expression (&e); - demand_empty_rest_of_line (); - insn_group_break (1, 0, 0); /* If there wasn't a .handlerdata, we haven't generated an image yet. */ @@ -3870,11 +3966,14 @@ dot_endp (dummy) bfd_set_section_flags (stdoutput, now_seg, SEC_LOAD | SEC_ALLOC | SEC_READONLY); - /* Make sure the section has 8 byte alignment. */ - record_alignment (now_seg, 3); + /* Make sure that section has 4 byte alignment for ILP32 and + 8 byte alignment for LP64. */ + record_alignment (now_seg, md.pointer_size_shift); - ptr = frag_more (24); - where = frag_now_fix () - 24; + /* Need space for 3 pointers for procedure start, procedure end, + and unwind info. */ + ptr = frag_more (3 * md.pointer_size); + where = frag_now_fix () - (3 * md.pointer_size); bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8; /* Issue the values of a) Proc Begin, b) Proc End, c) Unwind Record. */ @@ -3906,6 +4005,50 @@ dot_endp (dummy) } subseg_set (saved_seg, saved_subseg); + + /* Parse names of main and alternate entry points and set symbol sizes. */ + while (1) + { + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + sym = symbol_find (name); + if (sym && unwind.proc_start + && (symbol_get_bfdsym (sym)->flags & BSF_FUNCTION) + && S_GET_SIZE (sym) == 0 && symbol_get_obj (sym)->size == NULL) + { + fragS *fr = symbol_get_frag (unwind.proc_start); + fragS *frag = symbol_get_frag (sym); + + /* Check whether the function label is at or beyond last + .proc directive. */ + while (fr && fr != frag) + fr = fr->fr_next; + if (fr) + { + if (frag == frag_now && SEG_NORMAL (now_seg)) + S_SET_SIZE (sym, frag_now_fix () - S_GET_VALUE (sym)); + else + { + symbol_get_obj (sym)->size = + (expressionS *) xmalloc (sizeof (expressionS)); + symbol_get_obj (sym)->size->X_op = O_subtract; + symbol_get_obj (sym)->size->X_add_symbol + = symbol_new (FAKE_LABEL_NAME, now_seg, + frag_now_fix (), frag_now); + symbol_get_obj (sym)->size->X_op_symbol = sym; + symbol_get_obj (sym)->size->X_add_number = 0; + } + } + } + *p = c; + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + } + demand_empty_rest_of_line (); unwind.proc_start = unwind.proc_end = unwind.info = 0; } @@ -4406,7 +4549,7 @@ dot_pred_rel (type) valueT bit = 1; int regno; - if (toupper (*input_line_pointer) != 'P' + if (TOUPPER (*input_line_pointer) != 'P' || (regno = atoi (++input_line_pointer)) < 0 || regno > 63) { @@ -4414,7 +4557,7 @@ dot_pred_rel (type) ignore_rest_of_line (); return; } - while (isdigit (*input_line_pointer)) + while (ISDIGIT (*input_line_pointer)) ++input_line_pointer; if (p1 == -1) p1 = regno; @@ -4431,7 +4574,7 @@ dot_pred_rel (type) valueT stop = 1; ++input_line_pointer; - if (toupper (*input_line_pointer) != 'P' + if (TOUPPER (*input_line_pointer) != 'P' || (regno = atoi (++input_line_pointer)) < 0 || regno > 63) { @@ -4439,7 +4582,7 @@ dot_pred_rel (type) ignore_rest_of_line (); return; } - while (isdigit (*input_line_pointer)) + while (ISDIGIT (*input_line_pointer)) ++input_line_pointer; stop <<= regno; if (bit >= stop) @@ -4582,6 +4725,8 @@ const pseudo_typeS md_pseudo_table[] = { "comment", dot_special_section, SPECIAL_SECTION_COMMENT }, { "ia_64.unwind", dot_special_section, SPECIAL_SECTION_UNWIND }, { "ia_64.unwind_info", dot_special_section, SPECIAL_SECTION_UNWIND_INFO }, + { "init_array", dot_special_section, SPECIAL_SECTION_INIT_ARRAY }, + { "fini_array", dot_special_section, SPECIAL_SECTION_FINI_ARRAY }, { "proc", dot_proc, 0 }, { "body", dot_body, 0 }, { "prologue", dot_prologue, 0 }, @@ -4677,6 +4822,15 @@ const pseudo_typeS md_pseudo_table[] = { "explicit", dot_dv_mode, 'e' }, { "default", dot_dv_mode, 'd' }, + /* ??? These are needed to make gas/testsuite/gas/elf/ehopt.s work. + IA-64 aligns data allocation pseudo-ops by default, so we have to + tell it that these ones are supposed to be unaligned. Long term, + should rewrite so that only IA-64 specific data allocation pseudo-ops + are aligned by default. */ + {"2byte", stmt_cons_ua, 2}, + {"4byte", stmt_cons_ua, 4}, + {"8byte", stmt_cons_ua, 8}, + { NULL, 0, 0 } }; @@ -4693,6 +4847,7 @@ pseudo_opcode[] = { "data2", cons, 2 }, { "data4", cons, 4 }, { "data8", cons, 8 }, + { "data16", cons, 16 }, { "real4", stmt_float_cons, 'f' }, { "real8", stmt_float_cons, 'd' }, { "real10", stmt_float_cons, 'x' }, @@ -4703,6 +4858,7 @@ pseudo_opcode[] = { "data2.ua", stmt_cons_ua, 2 }, { "data4.ua", stmt_cons_ua, 4 }, { "data8.ua", stmt_cons_ua, 8 }, + { "data16.ua", stmt_cons_ua, 16 }, { "real4.ua", float_cons, 'f' }, { "real8.ua", float_cons, 'd' }, { "real10.ua", float_cons, 'x' }, @@ -5256,7 +5412,10 @@ operand_match (idesc, index, e) case O_symbol: fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; - fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, 0); + /* There are no external relocs for TAG13/TAG13b fields, so we + create a dummy reloc. This will not live past md_apply_fix3. */ + fix->code = BFD_RELOC_UNUSED; + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); fix->opnd = idesc->operands[index]; fix->expr = *e; fix->is_pcrel = 1; @@ -6058,6 +6217,7 @@ md_parse_option (c, arg) int c; char *arg; { + switch (c) { /* Switches from the Intel assembler. */ @@ -6184,6 +6344,13 @@ IA-64 options:\n\ stream); } +void +ia64_after_parse_args () +{ + if (debug_type == DEBUG_STABS) + as_fatal (_("--gstabs is not supported for ia64")); +} + /* Return true if TYPE fits in TEMPL at SLOT. */ static int @@ -6274,6 +6441,10 @@ md_begin () symbol_new (".", undefined_section, FUNC_LT_FPTR_RELATIVE, &zero_address_frag); + pseudo_func[FUNC_IPLT_RELOC].u.sym = + symbol_new (".", undefined_section, FUNC_IPLT_RELOC, + &zero_address_frag); + /* Compute the table of best templates. We compute goodness as a base 4 value, in which each match counts for 3, each F counts for 2, each B counts for 1. This should maximize the number of @@ -6446,6 +6617,19 @@ md_begin () if (! ok) as_warn (_("Could not set architecture and machine")); + /* Set the pointer size and pointer shift size depending on md.flags */ + + if (md.flags & EF_IA_64_ABI64) + { + md.pointer_size = 8; /* pointers are 8 bytes */ + md.pointer_size_shift = 3; /* alignment is 8 bytes = 2^2 */ + } + else + { + md.pointer_size = 4; /* pointers are 4 bytes */ + md.pointer_size_shift = 2; /* alignment is 4 bytes = 2^2 */ + } + md.mem_offset.hint = 0; md.path = 0; md.maxpaths = 0; @@ -6462,9 +6646,7 @@ ia64_init (argc, argv) int argc ATTRIBUTE_UNUSED; char **argv ATTRIBUTE_UNUSED; { - md.flags = EF_IA_64_ABI64; - if (TARGET_BYTES_BIG_ENDIAN) - md.flags |= EF_IA_64_BE; + md.flags = MD_FLAGS_DEFAULT; } /* Return a string for the target object file format. */ @@ -6477,16 +6659,36 @@ ia64_target_format () if (md.flags & EF_IA_64_BE) { if (md.flags & EF_IA_64_ABI64) +#if defined(TE_AIX50) + return "elf64-ia64-aix-big"; +#elif defined(TE_HPUX) + return "elf64-ia64-hpux-big"; +#else return "elf64-ia64-big"; +#endif else +#if defined(TE_AIX50) + return "elf32-ia64-aix-big"; +#elif defined(TE_HPUX) + return "elf32-ia64-hpux-big"; +#else return "elf32-ia64-big"; +#endif } else { if (md.flags & EF_IA_64_ABI64) +#ifdef TE_AIX50 + return "elf64-ia64-aix-little"; +#else return "elf64-ia64-little"; +#endif else +#ifdef TE_AIX50 + return "elf32-ia64-aix-little"; +#else return "elf32-ia64-little"; +#endif } } else @@ -6621,10 +6823,10 @@ ia64_unrecognized_line (ch) c = get_symbol_end (); } else if (LOCAL_LABELS_FB - && isdigit ((unsigned char) *input_line_pointer)) + && ISDIGIT (*input_line_pointer)) { temp = 0; - while (isdigit ((unsigned char) *input_line_pointer)) + while (ISDIGIT (*input_line_pointer)) temp = (temp * 10) + *input_line_pointer++ - '0'; fb_label_instance_inc (temp); s = fb_label_name (temp, 0); @@ -6797,7 +6999,7 @@ ia64_parse_name (name, e) switch (name[0]) { case 'i': - if (name[1] == 'n' && isdigit (name[2])) + if (name[1] == 'n' && ISDIGIT (name[2])) { dr = &md.in; name += 2; @@ -6805,7 +7007,7 @@ ia64_parse_name (name, e) break; case 'l': - if (name[1] == 'o' && name[2] == 'c' && isdigit (name[3])) + if (name[1] == 'o' && name[2] == 'c' && ISDIGIT (name[3])) { dr = &md.loc; name += 3; @@ -6813,7 +7015,7 @@ ia64_parse_name (name, e) break; case 'o': - if (name[1] == 'u' && name[2] == 't' && isdigit (name[3])) + if (name[1] == 'u' && name[2] == 't' && ISDIGIT (name[3])) { dr = &md.out; name += 3; @@ -6870,19 +7072,29 @@ ia64_canonicalize_symbol_name (name) return name; } -/* Return true if idesc is a conditional branch instruction. */ +/* Return true if idesc is a conditional branch instruction. This excludes + the modulo scheduled branches, and br.ia. Mod-sched branches are excluded + because they always read/write resources regardless of the value of the + qualifying predicate. br.ia must always use p0, and hence is always + taken. Thus this function returns true for branches which can fall + through, and which use no resources if they do fall through. */ static int is_conditional_branch (idesc) struct ia64_opcode *idesc; { /* br is a conditional branch. Everything that starts with br. except - br.ia is a conditional branch. Everything that starts with brl is a - conditional branch. */ + br.ia, br.c{loop,top,exit}, and br.w{top,exit} is a conditional branch. + Everything that starts with brl is a conditional branch. */ return (idesc->name[0] == 'b' && idesc->name[1] == 'r' && (idesc->name[2] == '\0' - || (idesc->name[2] == '.' && idesc->name[3] != 'i') - || idesc->name[2] == 'l')); + || (idesc->name[2] == '.' && idesc->name[3] != 'i' + && idesc->name[3] != 'c' && idesc->name[3] != 'w') + || idesc->name[2] == 'l' + /* br.cond, br.call, br.clr */ + || (idesc->name[2] == '.' && idesc->name[3] == 'c' + && (idesc->name[4] == 'a' || idesc->name[4] == 'o' + || (idesc->name[4] == 'l' && idesc->name[5] == 'r'))))); } /* Return whether the given opcode is a taken branch. If there's any doubt, @@ -7616,8 +7828,8 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) { int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; - int or_andcm = strstr(idesc->name, "or.andcm") != NULL; - int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + int or_andcm = strstr (idesc->name, "or.andcm") != NULL; + int and_orcm = strstr (idesc->name, "and.orcm") != NULL; if ((idesc->operands[0] == IA64_OPND_P1 || idesc->operands[0] == IA64_OPND_P2) @@ -7738,8 +7950,8 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) { int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; - int or_andcm = strstr(idesc->name, "or.andcm") != NULL; - int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + int or_andcm = strstr (idesc->name, "or.andcm") != NULL; + int and_orcm = strstr (idesc->name, "and.orcm") != NULL; if ((idesc->operands[0] == IA64_OPND_P1 || idesc->operands[0] == IA64_OPND_P2) @@ -8201,8 +8413,8 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) { int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; - int or_andcm = strstr(idesc->name, "or.andcm") != NULL; - int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + int or_andcm = strstr (idesc->name, "or.andcm") != NULL; + int and_orcm = strstr (idesc->name, "and.orcm") != NULL; if (p1 == 63 && (idesc->operands[0] == IA64_OPND_P1 @@ -8453,6 +8665,19 @@ add_qp_mutex (mask) qp_mutexes[qp_mutexeslen++].prmask = mask; } +static int +has_suffix_p (name, suffix) + const char *name; + const char *suffix; +{ + size_t namelen = strlen (name); + size_t sufflen = strlen (suffix); + + if (namelen <= sufflen) + return 0; + return strcmp (name + namelen - sufflen, suffix) == 0; +} + static void clear_register_values () { @@ -8570,21 +8795,19 @@ note_register_values (idesc) } /* In general, clear mutexes and implies which include P1 or P2, with the following exceptions. */ - else if (strstr (idesc->name, ".or.andcm") != NULL) + else if (has_suffix_p (idesc->name, ".or.andcm") + || has_suffix_p (idesc->name, ".and.orcm")) { add_qp_mutex (p1mask | p2mask); clear_qp_implies (p2mask, p1mask); } - else if (strstr (idesc->name, ".and.orcm") != NULL) - { - add_qp_mutex (p1mask | p2mask); - clear_qp_implies (p1mask, p2mask); - } - else if (strstr (idesc->name, ".and") != NULL) + else if (has_suffix_p (idesc->name, ".andcm") + || has_suffix_p (idesc->name, ".and")) { clear_qp_implies (0, p1mask | p2mask); } - else if (strstr (idesc->name, ".or") != NULL) + else if (has_suffix_p (idesc->name, ".orcm") + || has_suffix_p (idesc->name, ".or")) { clear_qp_mutex (p1mask | p2mask); clear_qp_implies (p1mask | p2mask, 0); @@ -8592,7 +8815,7 @@ note_register_values (idesc) else { clear_qp_implies (p1mask | p2mask, p1mask | p2mask); - if (strstr (idesc->name, ".unc") != NULL) + if (has_suffix_p (idesc->name, ".unc")) { add_qp_mutex (p1mask | p2mask); if (CURR_SLOT.qp_regno != 0) @@ -9680,6 +9903,21 @@ ia64_cons_fix_new (f, where, nbytes, exp) code = BFD_RELOC_IA64_DIR64LSB; break; + case 16: + if (exp->X_op == O_pseudo_fixup + && exp->X_op_symbol + && S_GET_VALUE (exp->X_op_symbol) == FUNC_IPLT_RELOC) + { + if (target_big_endian) + code = BFD_RELOC_IA64_IPLTMSB; + else + code = BFD_RELOC_IA64_IPLTLSB; + + exp->X_op = O_symbol; + break; + } + /* FALLTHRU */ + default: as_bad ("Unsupported fixup size %d", nbytes); ignore_rest_of_line (); @@ -9691,10 +9929,11 @@ ia64_cons_fix_new (f, where, nbytes, exp) exp->X_op = O_symbol; code = ia64_gen_real_reloc_type (exp->X_op_symbol, code); } + fix = fix_new_exp (f, where, nbytes, exp, 0, code); /* We need to store the byte order in effect in case we're going to fix an 8 or 16 bit relocation (for which there no real - relocs available). See md_apply_fix(). */ + relocs available). See md_apply_fix3(). */ fix->tc_fix_data.bigendian = target_big_endian; } @@ -9818,6 +10057,10 @@ ia64_gen_real_reloc_type (sym, r_type) break; } break; + + case FUNC_IPLT_RELOC: + break; + default: abort (); } @@ -9916,14 +10159,15 @@ fix_insn (fix, odesc, value) If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry (if possible). */ -int -md_apply_fix3 (fix, valuep, seg) + +void +md_apply_fix3 (fix, valP, seg) fixS *fix; - valueT *valuep; + valueT * valP; segT seg ATTRIBUTE_UNUSED; { char *fixpos; - valueT value = *valuep; + valueT value = * valP; int adjust = 0; fixpos = fix->fx_frag->fr_literal + fix->fx_where; @@ -9958,16 +10202,15 @@ md_apply_fix3 (fix, valuep, seg) } if (fix->fx_addsy) { - switch (fix->fx_r_type) + if (fix->fx_r_type == (int) BFD_RELOC_UNUSED) { - case 0: + /* This must be a TAG13 or TAG13b operand. There are no external + relocs defined for them, so we must give an error. */ as_bad_where (fix->fx_file, fix->fx_line, "%s must have a constant value", elf64_ia64_operands[fix->tc_fix_data.opnd].desc); - break; - - default: - break; + fix->fx_done = 1; + return; } /* ??? This is a hack copied from tc-i386.c to make PCREL relocs @@ -9982,15 +10225,12 @@ md_apply_fix3 (fix, valuep, seg) else number_to_chars_littleendian (fixpos, value, fix->fx_size); fix->fx_done = 1; - return 1; } else { fix_insn (fix, elf64_ia64_operands + fix->tc_fix_data.opnd, value); fix->fx_done = 1; - return 1; } - return 1; } /* Generate the BFD reloc to be stuck in the object file from the diff --git a/contrib/binutils/gas/config/tc-ia64.h b/contrib/binutils/gas/config/tc-ia64.h index 12ae411..53dab86 100644 --- a/contrib/binutils/gas/config/tc-ia64.h +++ b/contrib/binutils/gas/config/tc-ia64.h @@ -1,5 +1,5 @@ /* tc-ia64.h -- Header file for tc-ia64.c. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GAS, the GNU Assembler. @@ -28,9 +28,11 @@ #ifdef TE_HPUX #define md_number_to_chars number_to_chars_bigendian #define TARGET_BYTES_BIG_ENDIAN 1 +#define MD_FLAGS_DEFAULT EF_IA_64_BE #else #define md_number_to_chars number_to_chars_littleendian #define TARGET_BYTES_BIG_ENDIAN 0 +#define MD_FLAGS_DEFAULT EF_IA_64_ABI64 #endif /* TE_HPUX */ /* We need to set the default object file format in ia64_init and not in @@ -46,7 +48,6 @@ extern const char *ia64_target_format PARAMS ((void)); #define TARGET_ARCH bfd_arch_ia64 #define DOUBLESLASH_LINE_COMMENTS /* allow //-style comments */ -#define TC_HANDLES_FX_DONE #define NEED_LITERAL_POOL /* need gp literal pool */ #define RELOC_REQUIRES_SYMBOL @@ -81,29 +82,32 @@ extern void ia64_cons_fix_new PARAMS ((fragS *f, int where, int nbytes, expressionS *exp)); extern void ia64_validate_fix PARAMS ((struct fix *fix)); extern char * ia64_canonicalize_symbol_name PARAMS ((char *)); +extern int ia64_elf_section_letter PARAMS ((int, char **)); extern flagword ia64_elf_section_flags PARAMS ((flagword, int, int)); extern int ia64_elf_section_type PARAMS ((const char *, size_t len)); extern long ia64_pcrel_from_section PARAMS ((struct fix *fix, segT sec)); extern void ia64_md_do_align PARAMS ((int, const char *, int, int)); extern void ia64_handle_align PARAMS ((fragS *f)); +extern void ia64_after_parse_args PARAMS ((void)); #define md_end() ia64_end_of_source () #define md_start_line_hook() ia64_start_line () #define tc_unrecognized_line(ch) ia64_unrecognized_line (ch) #define tc_frob_label(s) ia64_frob_label (s) #define md_flush_pending_output() ia64_flush_pending_output () -#define md_parse_name(s,e) ia64_parse_name (s, e) +#define md_parse_name(s,e,c) ia64_parse_name (s, e) #define tc_canonicalize_symbol_name(s) ia64_canonicalize_symbol_name (s) #define md_optimize_expr(l,o,r) ia64_optimize_expr (l, o, r) #define md_cons_align(n) ia64_cons_align (n) #define TC_FORCE_RELOCATION(f) ia64_force_relocation (f) #define tc_fix_adjustable(f) ia64_fix_adjustable (f) #define md_convert_frag(b,s,f) as_fatal ("ia64_convert_frag") -#define md_create_long_jump(p,f,t,fr,s) as_fatal("ia64_create_long_jump") +#define md_create_long_jump(p,f,t,fr,s) as_fatal ("ia64_create_long_jump") #define md_create_short_jump(p,f,t,fr,s) \ - as_fatal("ia64_create_short_jump") + as_fatal ("ia64_create_short_jump") #define md_estimate_size_before_relax(f,s) \ (as_fatal ("ia64_estimate_size_before_relax"), 1) +#define md_elf_section_letter ia64_elf_section_letter #define md_elf_section_flags ia64_elf_section_flags #define TC_FIX_TYPE struct ia64_fix #define TC_INIT_FIX_DATA(f) { f->tc_fix_data.opnd = 0; } @@ -113,15 +117,15 @@ extern void ia64_handle_align PARAMS ((fragS *f)); #define md_do_align(n,f,l,m,j) ia64_md_do_align (n,f,l,m) #define HANDLE_ALIGN(f) ia64_handle_align (f) #define md_elf_section_type(str,len) ia64_elf_section_type (str, len) +#define md_after_parse_args() ia64_after_parse_args () #define MAX_MEM_FOR_RS_ALIGN_CODE (15 + 16) -/* Call md_apply_fix3 with segment instead of md_apply_fix. */ -#define MD_APPLY_FIX3 - #define WORKING_DOT_WORD /* don't do broken word processing for now */ #define ELF_TC_SPECIAL_SECTIONS \ +{ ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, \ +{ ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, \ { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \ { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, @@ -252,9 +256,12 @@ typedef struct unwind_record True if we are willing to perform this relocation while building the .o file. This is only used for pcrel relocations. */ +/* If the reloc type is BFD_RELOC_UNUSED, then this is for a TAG13/TAG13b field + which has no external reloc, so we must resolve the value now. */ + #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ ((FIX)->fx_addsy == NULL \ - || (FIX)->fx_r_type == 0 \ + || (FIX)->fx_r_type == BFD_RELOC_UNUSED \ || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ && ! S_IS_WEAK ((FIX)->fx_addsy) \ && S_IS_DEFINED ((FIX)->fx_addsy) \ diff --git a/contrib/binutils/gas/config/tc-ppc.c b/contrib/binutils/gas/config/tc-ppc.c index ef70871..8bf09db 100644 --- a/contrib/binutils/gas/config/tc-ppc.c +++ b/contrib/binutils/gas/config/tc-ppc.c @@ -21,8 +21,8 @@ 02111-1307, USA. */ #include -#include #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "opcode/ppc.h" @@ -53,6 +53,36 @@ static int set_target_endian = 0; #endif #endif +/* Macros for calculating LO, HI, HA, HIGHER, HIGHERA, HIGHEST, + HIGHESTA. */ + +/* #lo(value) denotes the least significant 16 bits of the indicated. */ +#define PPC_LO(v) ((v) & 0xffff) + +/* #hi(value) denotes bits 16 through 31 of the indicated value. */ +#define PPC_HI(v) (((v) >> 16) & 0xffff) + +/* #ha(value) denotes the high adjusted value: bits 16 through 31 of + the indicated value, compensating for #lo() being treated as a + signed number. */ +#define PPC_HA(v) PPC_HI ((v) + 0x8000) + +/* #higher(value) denotes bits 32 through 47 of the indicated value. */ +#define PPC_HIGHER(v) (((v) >> 32) & 0xffff) + +/* #highera(value) denotes bits 32 through 47 of the indicated value, + compensating for #lo() being treated as a signed number. */ +#define PPC_HIGHERA(v) PPC_HIGHER ((v) + 0x8000) + +/* #highest(value) denotes bits 48 through 63 of the indicated value. */ +#define PPC_HIGHEST(v) (((v) >> 48) & 0xffff) + +/* #highesta(value) denotes bits 48 through 63 of the indicated value, + compensating for #lo being treated as a signed number. */ +#define PPC_HIGHESTA(v) PPC_HIGHEST ((v) + 0x8000) + +#define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000) + static boolean reg_names_p = TARGET_REG_NAMES_P; static boolean register_name PARAMS ((expressionS *)); @@ -62,8 +92,12 @@ static unsigned long ppc_insert_operand offsetT val, char *file, unsigned int line)); static void ppc_macro PARAMS ((char *str, const struct powerpc_macro *macro)); static void ppc_byte PARAMS ((int)); + +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) static int ppc_is_toc_sym PARAMS ((symbolS *sym)); static void ppc_tc PARAMS ((int)); +static void ppc_machine PARAMS ((int)); +#endif #ifdef OBJ_XCOFF static void ppc_comm PARAMS ((int)); @@ -87,7 +121,6 @@ static void ppc_stabx PARAMS ((int)); static void ppc_rename PARAMS ((int)); static void ppc_toc PARAMS ((int)); static void ppc_xcoff_cons PARAMS ((int)); -static void ppc_machine PARAMS ((int)); static void ppc_vbyte PARAMS ((int)); #endif @@ -188,10 +221,11 @@ const pseudo_typeS md_pseudo_table[] = { "word", ppc_xcoff_cons, 1 }, { "short", ppc_xcoff_cons, 1 }, { "vbyte", ppc_vbyte, 0 }, - { "machine", ppc_machine, 0 }, #endif #ifdef OBJ_ELF + { "llong", ppc_elf_cons, 8 }, + { "quad", ppc_elf_cons, 8 }, { "long", ppc_elf_cons, 4 }, { "word", ppc_elf_cons, 2 }, { "short", ppc_elf_cons, 2 }, @@ -203,7 +237,7 @@ const pseudo_typeS md_pseudo_table[] = #endif #ifdef TE_PE - /* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format */ + /* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format. */ { "previous", ppc_previous, 0 }, { "pdata", ppc_pdata, 0 }, { "ydata", ppc_ydata, 0 }, @@ -218,16 +252,18 @@ const pseudo_typeS md_pseudo_table[] = { "tocd", ppc_pe_tocd, 0 }, #endif - /* This pseudo-op is used even when not generating XCOFF output. */ +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) { "tc", ppc_tc, 0 }, + { "machine", ppc_machine, 0 }, +#endif { NULL, NULL, 0 } }; -/* Predefined register names if -mregnames (or default for Windows NT). */ -/* In general, there are lots of them, in an attempt to be compatible */ -/* with a number of other Windows NT assemblers. */ +/* Predefined register names if -mregnames (or default for Windows NT). + In general, there are lots of them, in an attempt to be compatible + with a number of other Windows NT assemblers. */ /* Structure to hold information about predefined registers. */ struct pd_reg @@ -555,7 +591,7 @@ reg_name_search (regs, regcount, name) } /* - * Summary of register_name(). + * Summary of register_name. * * in: Input_line_pointer points to 1st char of operand. * @@ -575,36 +611,35 @@ register_name (expressionP) char *start; char c; - /* Find the spelling of the operand */ + /* Find the spelling of the operand. */ start = name = input_line_pointer; - if (name[0] == '%' && isalpha (name[1])) + if (name[0] == '%' && ISALPHA (name[1])) name = ++input_line_pointer; - else if (!reg_names_p || !isalpha (name[0])) + else if (!reg_names_p || !ISALPHA (name[0])) return false; c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); - /* look to see if it's in the register table */ + /* Put back the delimiting char. */ + *input_line_pointer = c; + + /* 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 */ + /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - *input_line_pointer = c; /* put back the delimiting char */ return true; } - else - { - /* reset the line as if we had not done anything */ - *input_line_pointer = c; /* put back the delimiting char */ - input_line_pointer = start; /* reset input_line pointer */ - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* This function is called for each symbol seen in an expression. It @@ -664,9 +699,11 @@ static int ppc_cpu = 0; /* The size of the processor we are assembling for. This is either PPC_OPCODE_32 or PPC_OPCODE_64. */ -static unsigned long ppc_size = PPC_OPCODE_32; +static unsigned long ppc_size = (BFD_DEFAULT_TARGET_SIZE == 64 + ? PPC_OPCODE_64 + : PPC_OPCODE_32); -/* Whether to target xcoff64 */ +/* Whether to target xcoff64. */ static int ppc_xcoff64 = 0; /* Opcode hash table. */ @@ -676,10 +713,10 @@ static struct hash_control *ppc_hash; static struct hash_control *ppc_macro_hash; #ifdef OBJ_ELF -/* What type of shared library support to use */ +/* What type of shared library support to use. */ static enum { SHLIB_NONE, SHLIB_PIC, SHLIB_MRELOCATABLE } shlib = SHLIB_NONE; -/* Flags to set in the elf header */ +/* Flags to set in the elf header. */ static flagword ppc_flags = 0; /* Whether this is Solaris or not. */ @@ -759,14 +796,14 @@ symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE" */ #endif /* OBJ_ELF */ #ifdef OBJ_ELF -CONST char *md_shortopts = "b:l:usm:K:VQ:"; +const char *const md_shortopts = "b:l:usm:K:VQ:"; #else -CONST char *md_shortopts = "um:"; +const char *const md_shortopts = "um:"; #endif -struct option md_longopts[] = { +const struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof (md_longopts); +const size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) @@ -783,7 +820,7 @@ md_parse_option (c, arg) #ifdef OBJ_ELF case 'l': /* Solaris as takes -le (presumably for little endian). For completeness - sake, recognize -be also. */ + sake, recognize -be also. */ if (strcmp (arg, "e") == 0) { target_big_endian = 0; @@ -806,7 +843,7 @@ md_parse_option (c, arg) break; case 'K': - /* Recognize -K PIC */ + /* Recognize -K PIC. */ if (strcmp (arg, "PIC") == 0 || strcmp (arg, "pic") == 0) { shlib = SHLIB_PIC; @@ -829,38 +866,63 @@ md_parse_option (c, arg) break; case 'm': + /* Most CPU's are 32 bit. Exceptions are listed below. */ + ppc_size = PPC_OPCODE_32; + /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2 - (RIOS2). */ + (RIOS2). */ if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0) ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_POWER2; /* -mpwr means to assemble for the IBM POWER (RIOS1). */ else if (strcmp (arg, "pwr") == 0) ppc_cpu = PPC_OPCODE_POWER; /* -m601 means to assemble for the Motorola PowerPC 601, which includes - instructions that are holdovers from the Power. */ + instructions that are holdovers from the Power. */ else if (strcmp (arg, "601") == 0) ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_601; /* -mppc, -mppc32, -m603, and -m604 mean to assemble for the - Motorola PowerPC 603/604. */ + Motorola PowerPC 603/604. */ else if (strcmp (arg, "ppc") == 0 || strcmp (arg, "ppc32") == 0 - || strcmp (arg, "403") == 0 - || strcmp (arg, "405") == 0 || strcmp (arg, "603") == 0 || strcmp (arg, "604") == 0) ppc_cpu = PPC_OPCODE_PPC; - else if (strcmp (arg, "7400") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC; + /* -m403 and -m405 mean to assemble for the Motorola PowerPC 403/405. */ + else if (strcmp (arg, "403") == 0 + || strcmp (arg, "405") == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_403; + else if (strcmp (arg, "7400") == 0 + || strcmp (arg, "7410") == 0 + || strcmp (arg, "7450") == 0 + || strcmp (arg, "7455") == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC; + else if (strcmp (arg, "altivec") == 0) + { + if (ppc_cpu == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC; + else + ppc_cpu |= PPC_OPCODE_ALTIVEC; + } /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC - 620. */ + 620. */ else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0) { - ppc_cpu = PPC_OPCODE_PPC; + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64; ppc_size = PPC_OPCODE_64; } else if (strcmp (arg, "ppc64bridge") == 0) { - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE; + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE | PPC_OPCODE_64; + ppc_size = PPC_OPCODE_64; + } + /* -mbooke/-mbooke32 mean enable 32-bit BookE support. */ + else if (strcmp (arg, "booke") == 0 || strcmp (arg, "booke32") == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE; + /* -mbooke64 means enable 64-bit BookE support. */ + else if (strcmp (arg, "booke64") == 0) + { + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | + PPC_OPCODE_BOOKE64 | PPC_OPCODE_64; ppc_size = PPC_OPCODE_64; } /* -mcom means assemble for the common intersection between Power @@ -879,7 +941,8 @@ md_parse_option (c, arg) reg_names_p = false; #ifdef OBJ_ELF - /* -mrelocatable/-mrelocatable-lib -- warn about initializations that require relocation */ + /* -mrelocatable/-mrelocatable-lib -- warn about initializations + that require relocation. */ else if (strcmp (arg, "relocatable") == 0) { shlib = SHLIB_MRELOCATABLE; @@ -892,12 +955,13 @@ md_parse_option (c, arg) ppc_flags |= EF_PPC_RELOCATABLE_LIB; } - /* -memb, set embedded bit */ + /* -memb, set embedded bit. */ else if (strcmp (arg, "emb") == 0) ppc_flags |= EF_PPC_EMB; - /* -mlittle/-mbig set the endianess */ - else if (strcmp (arg, "little") == 0 || strcmp (arg, "little-endian") == 0) + /* -mlittle/-mbig set the endianess. */ + else if (strcmp (arg, "little") == 0 + || strcmp (arg, "little-endian") == 0) { target_big_endian = 0; set_target_endian = 1; @@ -966,10 +1030,16 @@ PowerPC options:\n\ -mpwrx, -mpwr2 generate code for IBM POWER/2 (RIOS2)\n\ -mpwr generate code for IBM POWER (RIOS1)\n\ -m601 generate code for Motorola PowerPC 601\n\ --mppc, -mppc32, -m403, -m405, -m603, -m604\n\ +-mppc, -mppc32, -m603, -m604\n\ generate code for Motorola PowerPC 603/604\n\ +-m403, -m405 generate code for Motorola PowerPC 403/405\n\ +-m7400, -m7410, -m7450, -m7455\n\ + generate code For Motorola PowerPC 7400/7410/7450/7455\n\ -mppc64, -m620 generate code for Motorola PowerPC 620\n\ -mppc64bridge generate code for PowerPC 64, including bridge insns\n\ +-mbooke64 generate code for 64-bit PowerPC BookE\n\ +-mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\ +-maltivec generate code for AltiVec\n\ -mcom generate code Power/PowerPC common instructions\n\ -many generate code for any architecture (PWR/PWRX/PPC)\n\ -mregnames Allow symbolic names for registers\n\ @@ -1006,11 +1076,11 @@ ppc_set_cpu () ppc_cpu = PPC_OPCODE_POWER; else if (strcmp (default_cpu, "rs6000") == 0) ppc_cpu = PPC_OPCODE_POWER; - else if (strcmp (default_cpu, "powerpc") == 0 - || strcmp (default_cpu, "powerpcle") == 0) + else if (strncmp (default_cpu, "powerpc", 7) == 0) ppc_cpu = PPC_OPCODE_PPC; else - as_fatal (_("Unknown default cpu = %s, os = %s"), default_cpu, default_os); + as_fatal (_("Unknown default cpu = %s, os = %s"), + default_cpu, default_os); } } @@ -1030,8 +1100,7 @@ ppc_arch () { if (strcmp (default_cpu, "rs6000") == 0) return bfd_arch_rs6000; - else if (strcmp (default_cpu, "powerpc") == 0 - || strcmp (default_cpu, "powerpcle") == 0) + else if (strncmp (default_cpu, "powerpc", 7) == 0) return bfd_arch_powerpc; } @@ -1042,31 +1111,35 @@ ppc_arch () unsigned long ppc_mach () { - return (ppc_size == PPC_OPCODE_64) ? 620 : 0; + return ppc_size == PPC_OPCODE_64 ? 620 : 0; } +#ifdef OBJ_XCOFF int -ppc_subseg_align() +ppc_subseg_align () { - return (ppc_xcoff64) ? 3 : 2; + return ppc_xcoff64 ? 3 : 2; } +#endif extern char* -ppc_target_format() +ppc_target_format () { #ifdef OBJ_COFF #ifdef TE_PE - return (target_big_endian ? "pe-powerpc" : "pe-powerpcle"); + return target_big_endian ? "pe-powerpc" : "pe-powerpcle"; #elif TE_POWERMAC -#else - return (ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000"); -#endif -#ifdef TE_POWERMAC return "xcoff-powermac"; +#else + return ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000"; #endif #endif #ifdef OBJ_ELF - return (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle"); + boolean is64 = BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64; + + return (target_big_endian + ? (is64 ? "elf64-powerpc" : "elf32-powerpc") + : (is64 ? "elf64-powerpcle" : "elf32-powerpcle")); #endif } @@ -1109,12 +1182,13 @@ md_begin () retval = hash_insert (ppc_hash, op->name, (PTR) op); if (retval != (const char *) NULL) { - /* Ignore Power duplicates for -m601 */ + /* Ignore Power duplicates for -m601. */ if ((ppc_cpu & PPC_OPCODE_601) != 0 && (op->flags & PPC_OPCODE_POWER) != 0) continue; - as_bad (_("Internal assembler error for instruction %s"), op->name); + as_bad (_("Internal assembler error for instruction %s"), + op->name); dup_insn = true; } } @@ -1142,7 +1216,8 @@ md_begin () if (dup_insn) abort (); - /* Tell the main code what the endianness is if it is not overidden by the user. */ + /* Tell the main code what the endianness is if it is not overidden + by the user. */ if (!set_target_endian) { set_target_endian = 1; @@ -1225,10 +1300,7 @@ ppc_insert_operand (insn, operand, val, file, line) char buf[100]; sprint_value (buf, test); - if (file == (char *) NULL) - as_bad (err, buf, min, max); - else - as_bad_where (file, line, err, buf, min, max); + as_bad_where (file, line, err, buf, min, max); } } @@ -1237,9 +1309,9 @@ ppc_insert_operand (insn, operand, val, file, line) const char *errmsg; errmsg = NULL; - insn = (*operand->insert) (insn, (long) val, &errmsg); + insn = (*operand->insert) (insn, (long) val, ppc_cpu | ppc_size, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad_where (file, line, errmsg); } else insn |= (((long) val & ((1 << operand->bits) - 1)) @@ -1259,7 +1331,7 @@ ppc_elf_suffix (str_p, exp_p) struct map_bfd { char *string; int length; - bfd_reloc_code_real_type reloc; + int reloc; }; char ident[20]; @@ -1267,55 +1339,65 @@ ppc_elf_suffix (str_p, exp_p) char *str2; int ch; int len; - struct map_bfd *ptr; + const struct map_bfd *ptr; #define MAP(str,reloc) { str, sizeof (str)-1, reloc } - static struct map_bfd mapping[] = { - MAP ("l", BFD_RELOC_LO16), - MAP ("h", BFD_RELOC_HI16), - MAP ("ha", BFD_RELOC_HI16_S), - MAP ("brtaken", BFD_RELOC_PPC_B16_BRTAKEN), - MAP ("brntaken", BFD_RELOC_PPC_B16_BRNTAKEN), - MAP ("got", BFD_RELOC_16_GOTOFF), - MAP ("got@l", BFD_RELOC_LO16_GOTOFF), - MAP ("got@h", BFD_RELOC_HI16_GOTOFF), - MAP ("got@ha", BFD_RELOC_HI16_S_GOTOFF), - MAP ("fixup", BFD_RELOC_CTOR), /* warnings with -mrelocatable */ - MAP ("plt", BFD_RELOC_24_PLT_PCREL), - MAP ("pltrel24", BFD_RELOC_24_PLT_PCREL), - MAP ("copy", BFD_RELOC_PPC_COPY), - MAP ("globdat", BFD_RELOC_PPC_GLOB_DAT), - MAP ("local24pc", BFD_RELOC_PPC_LOCAL24PC), - MAP ("local", BFD_RELOC_PPC_LOCAL24PC), - MAP ("pltrel", BFD_RELOC_32_PLT_PCREL), - MAP ("plt@l", BFD_RELOC_LO16_PLTOFF), - MAP ("plt@h", BFD_RELOC_HI16_PLTOFF), - MAP ("plt@ha", BFD_RELOC_HI16_S_PLTOFF), - MAP ("sdarel", BFD_RELOC_GPREL16), - MAP ("sectoff", BFD_RELOC_32_BASEREL), - MAP ("sectoff@l", BFD_RELOC_LO16_BASEREL), - MAP ("sectoff@h", BFD_RELOC_HI16_BASEREL), - MAP ("sectoff@ha", BFD_RELOC_HI16_S_BASEREL), - MAP ("naddr", BFD_RELOC_PPC_EMB_NADDR32), - MAP ("naddr16", BFD_RELOC_PPC_EMB_NADDR16), - MAP ("naddr@l", BFD_RELOC_PPC_EMB_NADDR16_LO), - MAP ("naddr@h", BFD_RELOC_PPC_EMB_NADDR16_HI), - MAP ("naddr@ha", BFD_RELOC_PPC_EMB_NADDR16_HA), - MAP ("sdai16", BFD_RELOC_PPC_EMB_SDAI16), - MAP ("sda2rel", BFD_RELOC_PPC_EMB_SDA2REL), - MAP ("sda2i16", BFD_RELOC_PPC_EMB_SDA2I16), - MAP ("sda21", BFD_RELOC_PPC_EMB_SDA21), - MAP ("mrkref", BFD_RELOC_PPC_EMB_MRKREF), - MAP ("relsect", BFD_RELOC_PPC_EMB_RELSEC16), - MAP ("relsect@l", BFD_RELOC_PPC_EMB_RELST_LO), - MAP ("relsect@h", BFD_RELOC_PPC_EMB_RELST_HI), - MAP ("relsect@ha", BFD_RELOC_PPC_EMB_RELST_HA), - MAP ("bitfld", BFD_RELOC_PPC_EMB_BIT_FLD), - MAP ("relsda", BFD_RELOC_PPC_EMB_RELSDA), - MAP ("xgot", BFD_RELOC_PPC_TOC16), - - { (char *)0, 0, BFD_RELOC_UNUSED } + static const struct map_bfd mapping[] = { + MAP ("l", (int) BFD_RELOC_LO16), + MAP ("h", (int) BFD_RELOC_HI16), + MAP ("ha", (int) BFD_RELOC_HI16_S), + MAP ("brtaken", (int) BFD_RELOC_PPC_B16_BRTAKEN), + MAP ("brntaken", (int) BFD_RELOC_PPC_B16_BRNTAKEN), + MAP ("got", (int) BFD_RELOC_16_GOTOFF), + MAP ("got@l", (int) BFD_RELOC_LO16_GOTOFF), + MAP ("got@h", (int) BFD_RELOC_HI16_GOTOFF), + MAP ("got@ha", (int) BFD_RELOC_HI16_S_GOTOFF), + MAP ("fixup", (int) BFD_RELOC_CTOR), /* warning with -mrelocatable */ + MAP ("plt", (int) BFD_RELOC_24_PLT_PCREL), + MAP ("pltrel24", (int) BFD_RELOC_24_PLT_PCREL), + MAP ("copy", (int) BFD_RELOC_PPC_COPY), + MAP ("globdat", (int) BFD_RELOC_PPC_GLOB_DAT), + MAP ("local24pc", (int) BFD_RELOC_PPC_LOCAL24PC), + MAP ("local", (int) BFD_RELOC_PPC_LOCAL24PC), + MAP ("pltrel", (int) BFD_RELOC_32_PLT_PCREL), + MAP ("plt@l", (int) BFD_RELOC_LO16_PLTOFF), + MAP ("plt@h", (int) BFD_RELOC_HI16_PLTOFF), + MAP ("plt@ha", (int) BFD_RELOC_HI16_S_PLTOFF), + MAP ("sdarel", (int) BFD_RELOC_GPREL16), + MAP ("sectoff", (int) BFD_RELOC_32_BASEREL), + MAP ("sectoff@l", (int) BFD_RELOC_LO16_BASEREL), + MAP ("sectoff@h", (int) BFD_RELOC_HI16_BASEREL), + MAP ("sectoff@ha", (int) BFD_RELOC_HI16_S_BASEREL), + MAP ("naddr", (int) BFD_RELOC_PPC_EMB_NADDR32), + MAP ("naddr16", (int) BFD_RELOC_PPC_EMB_NADDR16), + MAP ("naddr@l", (int) BFD_RELOC_PPC_EMB_NADDR16_LO), + MAP ("naddr@h", (int) BFD_RELOC_PPC_EMB_NADDR16_HI), + MAP ("naddr@ha", (int) BFD_RELOC_PPC_EMB_NADDR16_HA), + MAP ("sdai16", (int) BFD_RELOC_PPC_EMB_SDAI16), + MAP ("sda2rel", (int) BFD_RELOC_PPC_EMB_SDA2REL), + MAP ("sda2i16", (int) BFD_RELOC_PPC_EMB_SDA2I16), + MAP ("sda21", (int) BFD_RELOC_PPC_EMB_SDA21), + MAP ("mrkref", (int) BFD_RELOC_PPC_EMB_MRKREF), + MAP ("relsect", (int) BFD_RELOC_PPC_EMB_RELSEC16), + MAP ("relsect@l", (int) BFD_RELOC_PPC_EMB_RELST_LO), + MAP ("relsect@h", (int) BFD_RELOC_PPC_EMB_RELST_HI), + MAP ("relsect@ha", (int) BFD_RELOC_PPC_EMB_RELST_HA), + MAP ("bitfld", (int) BFD_RELOC_PPC_EMB_BIT_FLD), + MAP ("relsda", (int) BFD_RELOC_PPC_EMB_RELSDA), + MAP ("xgot", (int) BFD_RELOC_PPC_TOC16), +#if BFD_DEFAULT_TARGET_SIZE == 64 + MAP ("higher", - (int) BFD_RELOC_PPC64_HIGHER), + MAP ("highera", - (int) BFD_RELOC_PPC64_HIGHER_S), + MAP ("highest", - (int) BFD_RELOC_PPC64_HIGHEST), + MAP ("highesta", - (int) BFD_RELOC_PPC64_HIGHEST_S), + MAP ("tocbase", - (int) BFD_RELOC_PPC64_TOC), + MAP ("toc", - (int) BFD_RELOC_PPC_TOC16), + MAP ("toc@l", - (int) BFD_RELOC_PPC64_TOC16_LO), + MAP ("toc@h", - (int) BFD_RELOC_PPC64_TOC16_HI), + MAP ("toc@ha", - (int) BFD_RELOC_PPC64_TOC16_HA), +#endif + { (char *) 0, 0, (int) BFD_RELOC_UNUSED } }; if (*str++ != '@') @@ -1323,10 +1405,10 @@ ppc_elf_suffix (str_p, exp_p) for (ch = *str, str2 = ident; (str2 < ident + sizeof (ident) - 1 - && (isalnum (ch) || ch == '@')); + && (ISALNUM (ch) || ch == '@')); ch = *++str) { - *str2++ = (islower (ch)) ? ch : tolower (ch); + *str2++ = TOLOWER (ch); } *str2 = '\0'; @@ -1338,14 +1420,23 @@ ppc_elf_suffix (str_p, exp_p) && len == ptr->length && memcmp (ident, ptr->string, ptr->length) == 0) { + int reloc = ptr->reloc; + + if (BFD_DEFAULT_TARGET_SIZE == 64 && reloc < 0) + { + if (ppc_size != PPC_OPCODE_64) + return BFD_RELOC_UNUSED; + reloc = -reloc; + } + if (exp_p->X_add_number != 0 - && (ptr->reloc == BFD_RELOC_16_GOTOFF - || ptr->reloc == BFD_RELOC_LO16_GOTOFF - || ptr->reloc == BFD_RELOC_HI16_GOTOFF - || ptr->reloc == BFD_RELOC_HI16_S_GOTOFF)) + && (reloc == (int) BFD_RELOC_16_GOTOFF + || reloc == (int) BFD_RELOC_LO16_GOTOFF + || reloc == (int) BFD_RELOC_HI16_GOTOFF + || reloc == (int) BFD_RELOC_HI16_S_GOTOFF)) as_warn (_("identifier+constant@got means identifier@got+constant")); - /* Now check for identifier@suffix+constant */ + /* Now check for identifier@suffix+constant. */ if (*str == '-' || *str == '+') { char *orig_line = input_line_pointer; @@ -1362,20 +1453,29 @@ ppc_elf_suffix (str_p, exp_p) if (&input_line_pointer != str_p) input_line_pointer = orig_line; } - *str_p = str; - return ptr->reloc; + + if (BFD_DEFAULT_TARGET_SIZE == 64 + && reloc == (int) BFD_RELOC_PPC64_TOC + && exp_p->X_op == O_symbol) + { + /* This reloc type ignores the symbol. Change the symbol + so that the dummy .TOC. symbol can be omitted from the + object file. */ + exp_p->X_add_symbol = &abs_symbol; + } + + return (bfd_reloc_code_real_type) reloc; } return BFD_RELOC_UNUSED; } -/* Like normal .long/.short/.word, except support @got, etc. */ -/* clobbers input_line_pointer, checks */ -/* end-of-line. */ +/* Like normal .long/.short/.word, except support @got, etc. + Clobbers input_line_pointer, checks end-of-line. */ static void ppc_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long */ + register int nbytes; /* 1=.byte, 2=.word, 4=.long, 8=.llong. */ { expressionS exp; bfd_reloc_code_real_type reloc; @@ -1391,20 +1491,31 @@ ppc_elf_cons (nbytes) expression (&exp); if (exp.X_op == O_symbol && *input_line_pointer == '@' - && (reloc = ppc_elf_suffix (&input_line_pointer, &exp)) != BFD_RELOC_UNUSED) + && (reloc = ppc_elf_suffix (&input_line_pointer, + &exp)) != BFD_RELOC_UNUSED) { - reloc_howto_type *reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc); - int size = bfd_get_reloc_size (reloc_howto); + reloc_howto_type *reloc_howto; + int size; - if (size > nbytes) - as_bad (_("%s relocations do not fit in %d bytes\n"), reloc_howto->name, nbytes); + reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc); + size = bfd_get_reloc_size (reloc_howto); + if (size > nbytes) + { + as_bad (_("%s relocations do not fit in %d bytes\n"), + reloc_howto->name, nbytes); + } else { - register char *p = frag_more ((int) nbytes); - int offset = nbytes - size; - - fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc); + char *p; + int offset; + + p = frag_more (nbytes); + offset = 0; + if (target_big_endian) + offset = nbytes - size; + fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, + &exp, 0, reloc); } } else @@ -1412,7 +1523,8 @@ ppc_elf_cons (nbytes) } while (*input_line_pointer++ == ','); - input_line_pointer--; /* Put terminator back into stream. */ + /* Put terminator back into stream. */ + input_line_pointer--; demand_empty_rest_of_line (); } @@ -1424,16 +1536,16 @@ ppc_elf_rdata (xxx) char *save_line = input_line_pointer; static char section[] = ".rodata\n"; - /* Just pretend this is .section .rodata */ + /* Just pretend this is .section .rodata */ input_line_pointer = section; obj_elf_section (xxx); input_line_pointer = save_line; } -/* Pseudo op to make file scope bss items */ +/* Pseudo op to make file scope bss items. */ static void -ppc_elf_lcomm(xxx) +ppc_elf_lcomm (xxx) int xxx ATTRIBUTE_UNUSED; { register char *name; @@ -1450,7 +1562,7 @@ ppc_elf_lcomm(xxx) name = input_line_pointer; c = get_symbol_end (); - /* just after name is now '\0' */ + /* just after name is now '\0'. */ p = input_line_pointer; *p = c; SKIP_WHITESPACE (); @@ -1506,12 +1618,12 @@ ppc_elf_lcomm(xxx) return; } - /* allocate_bss: */ + /* Allocate_bss. */ old_sec = now_seg; old_subsec = now_subseg; if (align) { - /* convert to a power of 2 alignment */ + /* Convert to a power of 2 alignment. */ for (align2 = 0; (align & 1) == 0; align >>= 1, ++align2); if (align != 1) { @@ -1566,11 +1678,11 @@ ppc_elf_validate_fix (fixp, seg) && fixp->fx_r_type != BFD_RELOC_LO16_BASEREL && fixp->fx_r_type != BFD_RELOC_HI16_BASEREL && fixp->fx_r_type != BFD_RELOC_HI16_S_BASEREL + && (seg->flags & SEC_LOAD) != 0 && strcmp (segment_name (seg), ".got2") != 0 && strcmp (segment_name (seg), ".dtors") != 0 && strcmp (segment_name (seg), ".ctors") != 0 && strcmp (segment_name (seg), ".fixup") != 0 - && strcmp (segment_name (seg), ".stab") != 0 && strcmp (segment_name (seg), ".gcc_except_table") != 0 && strcmp (segment_name (seg), ".eh_frame") != 0 && strcmp (segment_name (seg), ".ex_shared") != 0) @@ -1585,12 +1697,31 @@ ppc_elf_validate_fix (fixp, seg) return; } } + +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Don't emit .TOC. symbol. */ +int +ppc_elf_frob_symbol (sym) + symbolS *sym; +{ + const char *name; + + name = S_GET_NAME (sym); + if (name != NULL && strcmp (name, ".TOC.") == 0) + { + S_CLEAR_EXTERNAL (sym); + return 1; + } + + return 0; +} +#endif #endif /* OBJ_ELF */ #ifdef TE_PE /* - * Summary of parse_toc_entry(). + * Summary of parse_toc_entry. * * in: Input_line_pointer points to the '[' in one of: * @@ -1623,7 +1754,7 @@ enum toc_size_qualifier }; static int -parse_toc_entry(toc_kind) +parse_toc_entry (toc_kind) enum toc_size_qualifier *toc_kind; { char *start; @@ -1631,43 +1762,43 @@ parse_toc_entry(toc_kind) char c; enum toc_size_qualifier t; - /* save the input_line_pointer */ + /* Save the input_line_pointer. */ start = input_line_pointer; - /* skip over the '[' , and whitespace */ + /* Skip over the '[' , and whitespace. */ ++input_line_pointer; SKIP_WHITESPACE (); - /* find the spelling of the operand */ + /* Find the spelling of the operand. */ toc_spec = input_line_pointer; c = get_symbol_end (); - if (strcmp(toc_spec, "toc") == 0) + if (strcmp (toc_spec, "toc") == 0) { t = default_toc; } - else if (strcmp(toc_spec, "tocv") == 0) + else if (strcmp (toc_spec, "tocv") == 0) { t = data_in_toc; } - else if (strcmp(toc_spec, "toc32") == 0) + else if (strcmp (toc_spec, "toc32") == 0) { t = must_be_32; } - else if (strcmp(toc_spec, "toc64") == 0) + else if (strcmp (toc_spec, "toc64") == 0) { t = must_be_64; } else { as_bad (_("syntax error: invalid toc specifier `%s'"), toc_spec); - *input_line_pointer = c; /* put back the delimiting char */ - input_line_pointer = start; /* reset input_line pointer */ + *input_line_pointer = c; + input_line_pointer = start; return 0; } - /* now find the ']' */ - *input_line_pointer = c; /* put back the delimiting char */ + /* Now find the ']'. */ + *input_line_pointer = c; SKIP_WHITESPACE (); /* leading whitespace could be there. */ c = *input_line_pointer++; /* input_line_pointer->past char in c. */ @@ -1675,11 +1806,11 @@ parse_toc_entry(toc_kind) if (c != ']') { as_bad (_("syntax error: expected `]', found `%c'"), c); - input_line_pointer = start; /* reset input_line pointer */ + input_line_pointer = start; return 0; } - *toc_kind = t; /* set return value */ + *toc_kind = t; return 1; } #endif @@ -1720,7 +1851,7 @@ md_assemble (str) #endif /* Get the opcode. */ - for (s = str; *s != '\0' && ! isspace (*s); s++) + for (s = str; *s != '\0' && ! ISSPACE (*s); s++) ; if (*s != '\0') *s++ = '\0'; @@ -1743,7 +1874,7 @@ md_assemble (str) insn = opcode->opcode; str = s; - while (isspace (*str)) + while (ISSPACE (*str)) ++str; /* PowerPC operands are just expressions. The only real issue is @@ -1816,7 +1947,7 @@ md_assemble (str) from the input. */ if ((operand->flags & PPC_OPERAND_FAKE) != 0) { - insn = (*operand->insert) (insn, 0L, &errmsg); + insn = (*operand->insert) (insn, 0L, ppc_cpu | ppc_size, &errmsg); if (errmsg != (const char *) NULL) as_bad (errmsg); continue; @@ -1829,7 +1960,7 @@ md_assemble (str) { if (operand->insert) { - insn = (*operand->insert) (insn, 0L, &errmsg); + insn = (*operand->insert) (insn, 0L, ppc_cpu | ppc_size, &errmsg); if (errmsg != (const char *) NULL) as_bad (errmsg); } @@ -1846,91 +1977,92 @@ md_assemble (str) if (*input_line_pointer == '[') { /* We are expecting something like the second argument here: - - lwz r4,[toc].GS.0.static_int(rtoc) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - The argument following the `]' must be a symbol name, and the - register must be the toc register: 'rtoc' or '2' - - The effect is to 0 as the displacement field - in the instruction, and issue an IMAGE_REL_PPC_TOCREL16 (or - the appropriate variation) reloc against it based on the symbol. - The linker will build the toc, and insert the resolved toc offset. - - Note: - o The size of the toc entry is currently assumed to be - 32 bits. This should not be assumed to be a hard coded - number. - o In an effort to cope with a change from 32 to 64 bits, - there are also toc entries that are specified to be - either 32 or 64 bits: - lwz r4,[toc32].GS.0.static_int(rtoc) - lwz r4,[toc64].GS.0.static_int(rtoc) - These demand toc entries of the specified size, and the - instruction probably requires it. - */ + * + * lwz r4,[toc].GS.0.static_int(rtoc) + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * The argument following the `]' must be a symbol name, and the + * register must be the toc register: 'rtoc' or '2' + * + * The effect is to 0 as the displacement field + * in the instruction, and issue an IMAGE_REL_PPC_TOCREL16 (or + * the appropriate variation) reloc against it based on the symbol. + * The linker will build the toc, and insert the resolved toc offset. + * + * Note: + * o The size of the toc entry is currently assumed to be + * 32 bits. This should not be assumed to be a hard coded + * number. + * o In an effort to cope with a change from 32 to 64 bits, + * there are also toc entries that are specified to be + * either 32 or 64 bits: + * lwz r4,[toc32].GS.0.static_int(rtoc) + * lwz r4,[toc64].GS.0.static_int(rtoc) + * These demand toc entries of the specified size, and the + * instruction probably requires it. + */ int valid_toc; enum toc_size_qualifier toc_kind; bfd_reloc_code_real_type toc_reloc; - /* go parse off the [tocXX] part */ - valid_toc = parse_toc_entry(&toc_kind); + /* Go parse off the [tocXX] part. */ + valid_toc = parse_toc_entry (&toc_kind); if (!valid_toc) { - /* Note: message has already been issued. */ - /* FIXME: what sort of recovery should we do? */ - /* demand_rest_of_line(); return; ? */ + /* Note: message has already been issued. + FIXME: what sort of recovery should we do? + demand_rest_of_line (); return; ? */ } - /* Now get the symbol following the ']' */ - expression(&ex); + /* Now get the symbol following the ']'. */ + expression (&ex); switch (toc_kind) { case default_toc: - /* In this case, we may not have seen the symbol yet, since */ - /* it is allowed to appear on a .extern or .globl or just be */ - /* a label in the .data section. */ + /* In this case, we may not have seen the symbol yet, + since it is allowed to appear on a .extern or .globl + or just be a label in the .data section. */ toc_reloc = BFD_RELOC_PPC_TOC16; break; case data_in_toc: - /* 1. The symbol must be defined and either in the toc */ - /* section, or a global. */ - /* 2. The reloc generated must have the TOCDEFN flag set in */ - /* upper bit mess of the reloc type. */ - /* FIXME: It's a little confusing what the tocv qualifier can */ - /* be used for. At the very least, I've seen three */ - /* uses, only one of which I'm sure I can explain. */ + /* 1. The symbol must be defined and either in the toc + section, or a global. + 2. The reloc generated must have the TOCDEFN flag set + in upper bit mess of the reloc type. + FIXME: It's a little confusing what the tocv + qualifier can be used for. At the very least, I've + seen three uses, only one of which I'm sure I can + explain. */ if (ex.X_op == O_symbol) { assert (ex.X_add_symbol != NULL); if (symbol_get_bfdsym (ex.X_add_symbol)->section != tocdata_section) { - as_bad(_("[tocv] symbol is not a toc symbol")); + as_bad (_("[tocv] symbol is not a toc symbol")); } } toc_reloc = BFD_RELOC_PPC_TOC16; break; case must_be_32: - /* FIXME: these next two specifically specify 32/64 bit toc */ - /* entries. We don't support them today. Is this the */ - /* right way to say that? */ + /* FIXME: these next two specifically specify 32/64 bit + toc entries. We don't support them today. Is this + the right way to say that? */ toc_reloc = BFD_RELOC_UNUSED; as_bad (_("Unimplemented toc32 expression modifier")); break; case must_be_64: - /* FIXME: see above */ + /* FIXME: see above. */ toc_reloc = BFD_RELOC_UNUSED; as_bad (_("Unimplemented toc64 expression modifier")); break; default: fprintf (stderr, - _("Unexpected return value [%d] from parse_toc_entry!\n"), - toc_kind); + _("Unexpected return value [%d] from parse_toc_entry!\n"), + toc_kind); abort (); break; } @@ -1944,8 +2076,8 @@ md_assemble (str) fixups[fc].opindex = *opindex_ptr; ++fc; - /* Ok. We've set up the fixup for the instruction. Now make it - look like the constant 0 was found here */ + /* Ok. We've set up the fixup for the instruction. Now make it + look like the constant 0 was found here. */ ex.X_unsigned = 1; ex.X_op = O_constant; ex.X_add_number = 0; @@ -1992,36 +2124,67 @@ md_assemble (str) case BFD_RELOC_LO16: /* X_unsigned is the default, so if the user has done - something which cleared it, we always produce a - signed value. */ - if (ex.X_unsigned - && (operand->flags & PPC_OPERAND_SIGNED) == 0) + something which cleared it, we always produce a + signed value. */ + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) ex.X_add_number &= 0xffff; else - ex.X_add_number = (((ex.X_add_number & 0xffff) - ^ 0x8000) - - 0x8000); + ex.X_add_number = SEX16 (ex.X_add_number); break; case BFD_RELOC_HI16: - ex.X_add_number = (ex.X_add_number >> 16) & 0xffff; + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HI (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HI (ex.X_add_number)); break; case BFD_RELOC_HI16_S: - ex.X_add_number = ((((ex.X_add_number >> 16) & 0xffff) - + ((ex.X_add_number >> 15) & 1)) - & 0xffff); + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HA (ex.X_add_number)); + break; + +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHER (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHER (ex.X_add_number)); + break; + + case BFD_RELOC_PPC64_HIGHER_S: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHERA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHERA (ex.X_add_number)); break; + + case BFD_RELOC_PPC64_HIGHEST: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHEST (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHEST (ex.X_add_number)); + break; + + case BFD_RELOC_PPC64_HIGHEST_S: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHESTA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHESTA (ex.X_add_number)); + break; +#endif /* BFD_DEFAULT_TARGET_SIZE == 64 */ } -#endif +#endif /* OBJ_ELF */ insn = ppc_insert_operand (insn, operand, ex.X_add_number, (char *) NULL, 0); } #ifdef OBJ_ELF else if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED) { - /* For the absoulte forms of branchs, convert the PC relative form back into - the absolute. */ + /* For the absolute forms of branches, convert the PC + relative form back into the absolute. */ if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) { switch (reloc) @@ -2043,6 +2206,51 @@ md_assemble (str) } } + if (BFD_DEFAULT_TARGET_SIZE == 64 + && ppc_size == PPC_OPCODE_64 + && (operand->flags & PPC_OPERAND_DS) != 0) + { + switch (reloc) + { + case BFD_RELOC_16: + reloc = BFD_RELOC_PPC64_ADDR16_DS; + break; + case BFD_RELOC_LO16: + reloc = BFD_RELOC_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_DS; + break; + case BFD_RELOC_LO16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_LO16_PLTOFF: + reloc = BFD_RELOC_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_32_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_LO16_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC_TOC16: + reloc = BFD_RELOC_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO: + reloc = BFD_RELOC_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16: + reloc = BFD_RELOC_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: + reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS; + break; + default: + as_bad (_("unsupported relocation for DS offset field")); + break; + } + } + /* We need to generate a fixup for this expression. */ if (fc >= MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); @@ -2090,7 +2298,7 @@ md_assemble (str) ++str; } - while (isspace (*str)) + while (ISSPACE (*str)) ++str; if (*str != '\0') @@ -2109,7 +2317,7 @@ md_assemble (str) BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix. */ + md_apply_fix3. */ for (i = 0; i < fc; i++) { const struct powerpc_operand *operand; @@ -2117,11 +2325,12 @@ md_assemble (str) operand = &powerpc_operands[fixups[i].opindex]; if (fixups[i].reloc != BFD_RELOC_UNUSED) { - reloc_howto_type *reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc); + reloc_howto_type *reloc_howto; int size; int offset; fixS *fixP; + reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc); if (!reloc_howto) abort (); @@ -2131,8 +2340,11 @@ md_assemble (str) if (size < 1 || size > 4) abort (); - fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, size, - &fixups[i].exp, reloc_howto->pc_relative, + fixP = fix_new_exp (frag_now, + f - frag_now->fr_literal + offset, + size, + &fixups[i].exp, + reloc_howto->pc_relative, fixups[i].reloc); /* Turn off complaints that the addend is too large for things like @@ -2144,6 +2356,14 @@ md_assemble (str) case BFD_RELOC_LO16: case BFD_RELOC_HI16: case BFD_RELOC_HI16_S: +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + case BFD_RELOC_PPC64_HIGHER_S: + case BFD_RELOC_PPC64_HIGHEST: + case BFD_RELOC_PPC64_HIGHEST_S: +#endif +#endif fixP->fx_no_overflow = 1; break; default: @@ -2151,11 +2371,13 @@ md_assemble (str) } } else - fix_new_exp (frag_now, f - frag_now->fr_literal, 4, + fix_new_exp (frag_now, + f - frag_now->fr_literal, + 4, &fixups[i].exp, (operand->flags & PPC_OPERAND_RELATIVE) != 0, ((bfd_reloc_code_real_type) - (fixups[i].opindex + (int) BFD_RELOC_UNUSED))); + (fixups[i].opindex + (int) BFD_RELOC_UNUSED))); } } @@ -2240,7 +2462,7 @@ ppc_macro (str, macro) } #ifdef OBJ_ELF -/* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED */ +/* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED. */ int ppc_section_letter (letter, ptr_msg) @@ -2250,7 +2472,7 @@ ppc_section_letter (letter, ptr_msg) if (letter == 'e') return SHF_EXCLUDE; - *ptr_msg = _("Bad .section directive: want a,w,x,e in string"); + *ptr_msg = _("Bad .section directive: want a,e,w,x,M,S in string"); return 0; } @@ -2585,8 +2807,8 @@ ppc_change_csect (sym) } /* We set the obstack chunk size to a small value before - changing subsegments, so that we don't use a lot of memory - space for what may be a small section. */ + changing subsegments, so that we don't use a lot of memory + space for what may be a small section. */ hold_chunksize = chunksize; chunksize = 64; @@ -2813,8 +3035,8 @@ ppc_stabx (ignore) default: /* The value is some complex expression. This will probably - fail at some later point, but this is probably the right - thing to do here. */ + fail at some later point, but this is probably the right + thing to do here. */ symbol_set_value_expression (sym, &exp); break; } @@ -2843,23 +3065,23 @@ ppc_stabx (ignore) symbol_get_tc (sym)->output = 1; if (S_GET_STORAGE_CLASS (sym) == C_STSYM) { - + symbol_get_tc (sym)->within = ppc_current_block; /* In this case : - + .bs name .stabx "z",arrays_,133,0 .es - + .comm arrays_,13768,3 - + resolve_symbol_value will copy the exp's "within" into sym's when the offset is 0. Since this seems to be corner case problem, only do the correction for storage class C_STSYM. A better solution - would be to have the tc field updated in ppc_symbol_new_hook. */ - - if (exp.X_op == O_symbol) + would be to have the tc field updated in ppc_symbol_new_hook. */ + + if (exp.X_op == O_symbol) { symbol_get_tc (exp.X_add_symbol)->within = ppc_current_block; } @@ -2977,7 +3199,10 @@ ppc_function (ignore) } /* The .bf pseudo-op. This is just like a COFF C_FCN symbol named - ".bf". */ + ".bf". If the pseudo op .bi was seen before .bf, patch the .bi sym + with the correct line number */ + +static symbolS *saved_bi_sym = 0; static void ppc_bf (ignore) @@ -2996,6 +3221,14 @@ ppc_bf (ignore) S_SET_NUMBER_AUXILIARY (sym, 1); SA_SET_SYM_LNNO (sym, coff_line_base); + /* Line number for bi. */ + if (saved_bi_sym) + { + S_SET_VALUE (saved_bi_sym, coff_n_line_nos); + saved_bi_sym = 0; + } + + symbol_get_tc (sym)->output = 1; ppc_frob_label (sym); @@ -3029,7 +3262,8 @@ ppc_ef (ignore) /* The .bi and .ei pseudo-ops. These take a string argument and generates a C_BINCL or C_EINCL symbol, which goes at the start of - the symbol list. */ + the symbol list. The value of .bi will be know when the next .bf + is encountered. */ static void ppc_biei (ei) @@ -3059,6 +3293,12 @@ ppc_biei (ei) S_SET_STORAGE_CLASS (sym, ei ? C_EINCL : C_BINCL); symbol_get_tc (sym)->output = 1; + /* Save bi. */ + if (ei) + saved_bi_sym = 0; + else + saved_bi_sym = sym; + for (look = last_biei ? last_biei : symbol_rootP; (look != (symbolS *) NULL && (S_GET_STORAGE_CLASS (look) == C_FILE @@ -3293,14 +3533,6 @@ ppc_xcoff_cons (log_size) } static void -ppc_machine(dummy) - int dummy ATTRIBUTE_UNUSED; -{ - discard_rest_of_line(); - /* What does aix use this for? */ -} - -static void ppc_vbyte (dummy) int dummy ATTRIBUTE_UNUSED; { @@ -3328,15 +3560,18 @@ ppc_vbyte (dummy) } #endif /* OBJ_XCOFF */ +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) /* The .tc pseudo-op. This is used when generating either XCOFF or ELF. This takes two or more arguments. When generating XCOFF output, the first argument is the name to give to this location in the toc; this will be a symbol with class - TC. The rest of the arguments are 4 byte values to actually put at + TC. The rest of the arguments are N-byte values to actually put at this location in the TOC; often there is just one more argument, a - relocateable symbol reference. + relocateable symbol reference. The size of the value to store + depends on target word size. A 32-bit target uses 4-byte values, a + 64-bit target uses 8-byte values. When not generating XCOFF output, the arguments are the same, but the first argument is simply ignored. */ @@ -3399,7 +3634,9 @@ ppc_tc (ignore) ppc_frob_label (sym); } -#else /* ! defined (OBJ_XCOFF) */ +#endif /* OBJ_XCOFF */ +#ifdef OBJ_ELF + int align; /* Skip the TOC symbol name. */ while (is_part_of_name (*input_line_pointer) @@ -3409,11 +3646,11 @@ ppc_tc (ignore) || *input_line_pointer == '}') ++input_line_pointer; - /* Align to a four byte boundary. */ - frag_align (2, 0, 0); - record_alignment (now_seg, 2); - -#endif /* ! defined (OBJ_XCOFF) */ + /* Align to a four/eight byte boundary. */ + align = BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64 ? 3 : 2; + frag_align (align, 0, 0); + record_alignment (now_seg, align); +#endif /* OBJ_ELF */ if (*input_line_pointer != ',') demand_empty_rest_of_line (); @@ -3423,10 +3660,44 @@ ppc_tc (ignore) cons ((ppc_size == PPC_OPCODE_64) ? 8 : 4); } } + +/* Pseudo-op .machine. */ +/* FIXME: `.machine' is a nop for the moment. It would be nice to + accept this directive on the first line of input and set ppc_size + and the target format accordingly. Unfortunately, the target + format is selected in output-file.c:output_file_create before we + even get to md_begin, so it's not possible without changing + as.c:main. */ + +static void +ppc_machine (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + discard_rest_of_line (); +} + +/* See whether a symbol is in the TOC section. */ + +static int +ppc_is_toc_sym (sym) + symbolS *sym; +{ +#ifdef OBJ_XCOFF + return symbol_get_tc (sym)->class == XMC_TC; +#endif +#ifdef OBJ_ELF + const char *sname = segment_name (S_GET_SEGMENT (sym)); + if (BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64) + return strcmp (sname, ".toc") == 0; + else + return strcmp (sname, ".got") == 0; +#endif +} +#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */ #ifdef TE_PE -/* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format */ +/* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format. */ /* Set the current section. */ static void @@ -3440,23 +3711,23 @@ ppc_set_current_section (new) /* pseudo-op: .previous behaviour: toggles the current section with the previous section. errors: None - warnings: "No previous section" -*/ + warnings: "No previous section" */ + static void -ppc_previous(ignore) +ppc_previous (ignore) int ignore ATTRIBUTE_UNUSED; { symbolS *tmp; if (ppc_previous_section == NULL) { - as_warn(_("No previous section to return to. Directive ignored.")); + as_warn (_("No previous section to return to. Directive ignored.")); return; } - subseg_set(ppc_previous_section, 0); + subseg_set (ppc_previous_section, 0); - ppc_set_current_section(ppc_previous_section); + ppc_set_current_section (ppc_previous_section); } /* pseudo-op: .pdata @@ -3472,11 +3743,10 @@ ppc_previous(ignore) commentary: Tag index tables (also known as the function table) for exception - handling, debugging, etc. + handling, debugging, etc. */ -*/ static void -ppc_pdata(ignore) +ppc_pdata (ignore) int ignore ATTRIBUTE_UNUSED; { if (pdata_section == 0) @@ -3491,9 +3761,9 @@ ppc_pdata(ignore) } else { - pdata_section = subseg_new(".pdata", 0); + pdata_section = subseg_new (".pdata", 0); } - ppc_set_current_section(pdata_section); + ppc_set_current_section (pdata_section); } /* pseudo-op: .ydata @@ -3508,18 +3778,18 @@ ppc_pdata(ignore) 3 - double word aligned (that would be 4 byte boundary) commentary: Tag tables (also known as the scope table) for exception handling, - debugging, etc. -*/ + debugging, etc. */ + static void -ppc_ydata(ignore) +ppc_ydata (ignore) int ignore ATTRIBUTE_UNUSED; { if (ydata_section == 0) { ydata_section = subseg_new (".ydata", 0); bfd_set_section_flags (stdoutput, ydata_section, - (SEC_ALLOC | SEC_LOAD | SEC_RELOC - | SEC_READONLY | SEC_DATA )); + (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_READONLY | SEC_DATA )); bfd_set_section_alignment (stdoutput, ydata_section, 3); } @@ -3527,7 +3797,7 @@ ppc_ydata(ignore) { ydata_section = subseg_new (".ydata", 0); } - ppc_set_current_section(ydata_section); + ppc_set_current_section (ydata_section); } /* pseudo-op: .reldata @@ -3545,10 +3815,10 @@ ppc_ydata(ignore) commentary: Like .data, but intended to hold data subject to relocation, such as - function descriptors, etc. -*/ + function descriptors, etc. */ + static void -ppc_reldata(ignore) +ppc_reldata (ignore) int ignore ATTRIBUTE_UNUSED; { if (reldata_section == 0) @@ -3556,8 +3826,8 @@ ppc_reldata(ignore) reldata_section = subseg_new (".reldata", 0); bfd_set_section_flags (stdoutput, reldata_section, - ( SEC_ALLOC | SEC_LOAD | SEC_RELOC - | SEC_DATA )); + (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_DATA)); bfd_set_section_alignment (stdoutput, reldata_section, 2); } @@ -3565,7 +3835,7 @@ ppc_reldata(ignore) { reldata_section = subseg_new (".reldata", 0); } - ppc_set_current_section(reldata_section); + ppc_set_current_section (reldata_section); } /* pseudo-op: .rdata @@ -3576,10 +3846,10 @@ ppc_reldata(ignore) initial: .section .rdata "dr3" d - initialized data r - readable - 3 - double word aligned (that would be 4 byte boundary) -*/ + 3 - double word aligned (that would be 4 byte boundary) */ + static void -ppc_rdata(ignore) +ppc_rdata (ignore) int ignore ATTRIBUTE_UNUSED; { if (rdata_section == 0) @@ -3595,7 +3865,7 @@ ppc_rdata(ignore) { rdata_section = subseg_new (".rdata", 0); } - ppc_set_current_section(rdata_section); + ppc_set_current_section (rdata_section); } /* pseudo-op: .ualong @@ -3603,14 +3873,14 @@ ppc_rdata(ignore) performed. FIXME: test the alignment statement errors: None - warnings: None -*/ + warnings: None */ + static void -ppc_ualong(ignore) +ppc_ualong (ignore) int ignore ATTRIBUTE_UNUSED; { - /* try for long */ - cons ( 4 ); + /* Try for long. */ + cons (4); } /* pseudo-op: .znop @@ -3618,20 +3888,17 @@ ppc_ualong(ignore) Issue a IMAGE_REL_PPC_IFGLUE relocation against it, using the supplied symbol name. errors: None - warnings: Missing symbol name -*/ + warnings: Missing symbol name */ + static void -ppc_znop(ignore) +ppc_znop (ignore) int ignore ATTRIBUTE_UNUSED; { unsigned long insn; const struct powerpc_opcode *opcode; expressionS ex; char *f; - symbolS *sym; - - /* Strip out the symbol name */ char *symbol_name; char c; char *name; @@ -3639,6 +3906,7 @@ ppc_znop(ignore) flagword flags; asection *sec; + /* Strip out the symbol name. */ symbol_name = input_line_pointer; c = get_symbol_end (); @@ -3654,7 +3922,7 @@ ppc_znop(ignore) /* Look up the opcode in the hash table. */ opcode = (const struct powerpc_opcode *) hash_find (ppc_hash, "nop"); - /* stick in the nop */ + /* Stick in the nop. */ insn = opcode->opcode; /* Write out the instruction. */ @@ -3673,10 +3941,10 @@ ppc_znop(ignore) /* pseudo-op: behaviour: errors: - warnings: -*/ + warnings: */ + static void -ppc_pe_comm(lcomm) +ppc_pe_comm (lcomm) int lcomm; { register char *name; @@ -3689,7 +3957,7 @@ ppc_pe_comm(lcomm) name = input_line_pointer; c = get_symbol_end (); - /* just after name is now '\0' */ + /* just after name is now '\0'. */ p = input_line_pointer; *p = c; SKIP_WHITESPACE (); @@ -3808,7 +4076,7 @@ void ppc_pe_section (ignore) int ignore ATTRIBUTE_UNUSED; { - /* Strip out the section name */ + /* Strip out the section name. */ char *section_name; char c; char *name; @@ -3851,7 +4119,8 @@ ppc_pe_section (ignore) align = 1; } else - align = 4; /* default alignment to 16 byte boundary */ + /* Default alignment to 16 byte boundary. */ + align = 4; if (*input_line_pointer == ',') { @@ -3939,8 +4208,8 @@ ppc_pe_section (ignore) break; default: - as_bad(_("unknown section attribute '%c'"), - *input_line_pointer); + as_bad (_("unknown section attribute '%c'"), + *input_line_pointer); break; } ++input_line_pointer; @@ -3952,7 +4221,7 @@ ppc_pe_section (ignore) sec = subseg_new (name, (subsegT) exp); - ppc_set_current_section(sec); + ppc_set_current_section (sec); if (flags != SEC_NO_FLAGS) { @@ -3962,7 +4231,7 @@ ppc_pe_section (ignore) bfd_errmsg (bfd_get_error ())); } - bfd_set_section_alignment(stdoutput, sec, align); + bfd_set_section_alignment (stdoutput, sec, align); } @@ -3996,10 +4265,10 @@ ppc_pe_tocd (ignore) if (tocdata_section == 0) { tocdata_section = subseg_new (".tocd", 0); - /* FIXME: section flags won't work */ + /* FIXME: section flags won't work. */ bfd_set_section_flags (stdoutput, tocdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC - | SEC_READONLY | SEC_DATA )); + | SEC_READONLY | SEC_DATA)); bfd_set_section_alignment (stdoutput, tocdata_section, 2); } @@ -4008,7 +4277,7 @@ ppc_pe_tocd (ignore) rdata_section = subseg_new (".tocd", 0); } - ppc_set_current_section(tocdata_section); + ppc_set_current_section (tocdata_section); demand_empty_rest_of_line (); } @@ -4055,8 +4324,7 @@ ppc_canonicalize_symbol_name (name) } for (s++; *s != '\0' && *s != brac; s++) - if (islower (*s)) - *s = toupper (*s); + *s = TOUPPER (*s); if (*s == '\0' || s[1] != '\0') as_bad (_("bad symbol suffix")); @@ -4238,7 +4506,7 @@ ppc_frob_symbol (sym) ppc_last_function = sym; if (symbol_get_tc (sym)->size != (symbolS *) NULL) { - resolve_symbol_value (symbol_get_tc (sym)->size, 1); + resolve_symbol_value (symbol_get_tc (sym)->size); SA_SET_SYM_FSIZE (sym, (long) S_GET_VALUE (symbol_get_tc (sym)->size)); } @@ -4298,7 +4566,7 @@ ppc_frob_symbol (sym) - S_GET_VALUE (sym)); else { - resolve_symbol_value (symbol_get_tc (sym)->next, 1); + resolve_symbol_value (symbol_get_tc (sym)->next); a->x_csect.x_scnlen.l = (S_GET_VALUE (symbol_get_tc (sym)->next) - S_GET_VALUE (sym)); } @@ -4317,7 +4585,7 @@ ppc_frob_symbol (sym) else if (S_GET_SEGMENT (sym) == absolute_section) { /* This is an absolute symbol. The csect will be created by - ppc_adjust_symtab. */ + ppc_adjust_symtab. */ ppc_saw_abs = true; a->x_csect.x_smtyp = XTY_LD; if (symbol_get_tc (sym)->class == -1) @@ -4351,7 +4619,7 @@ ppc_frob_symbol (sym) } else { - resolve_symbol_value (next, 1); + resolve_symbol_value (next); a->x_csect.x_scnlen.l = (S_GET_VALUE (next) - S_GET_VALUE (sym)); } @@ -4382,7 +4650,7 @@ ppc_frob_symbol (sym) { while (symbol_get_tc (csect)->next != (symbolS *) NULL) { - resolve_symbol_value (symbol_get_tc (csect)->next, 1); + resolve_symbol_value (symbol_get_tc (csect)->next); if (S_GET_VALUE (symbol_get_tc (csect)->next) > S_GET_VALUE (sym)) break; @@ -4428,15 +4696,15 @@ ppc_frob_symbol (sym) /* The value is the offset from the enclosing csect. */ block = symbol_get_tc (sym)->within; csect = symbol_get_tc (block)->within; - resolve_symbol_value (csect, 1); + resolve_symbol_value (csect); S_SET_VALUE (sym, S_GET_VALUE (sym) - S_GET_VALUE (csect)); } else if (S_GET_STORAGE_CLASS (sym) == C_BINCL || S_GET_STORAGE_CLASS (sym) == C_EINCL) { /* We want the value to be a file offset into the line numbers. - BFD will do that for us if we set the right flags. We have - already set the value correctly. */ + BFD will do that for us if we set the right flags. We have + already set the value correctly. */ coffsymbol (symbol_get_bfdsym (sym))->native->fix_line = 1; } @@ -4645,7 +4913,7 @@ ppc_fix_adjustable (fix) { valueT val; - resolve_symbol_value (fix->fx_addsy, 1); + resolve_symbol_value (fix->fx_addsy); val = S_GET_VALUE (fix->fx_addsy); if (ppc_toc_csect != (symbolS *) NULL && fix->fx_addsy != (symbolS *) NULL @@ -4665,7 +4933,7 @@ ppc_fix_adjustable (fix) continue; if (symbol_get_tc (sy)->class != XMC_TC) break; - resolve_symbol_value (sy, 1); + resolve_symbol_value (sy); if (val == S_GET_VALUE (sy)) { fix->fx_addsy = sy; @@ -4710,9 +4978,9 @@ ppc_fix_adjustable (fix) <= val)) { /* If the csect address equals the symbol value, then we - have to look through the full symbol table to see - whether this is the csect we want. Note that we will - only get here if the csect has zero length. */ + have to look through the full symbol table to see + whether this is the csect we want. Note that we will + only get here if the csect has zero length. */ if ((symbol_get_frag (csect)->fr_address == val) && S_GET_VALUE (csect) == S_GET_VALUE (fix->fx_addsy)) { @@ -4729,7 +4997,7 @@ ppc_fix_adjustable (fix) } /* If we found the symbol before the next csect - symbol, then this is the csect we want. */ + symbol, then this is the csect we want. */ if (scan == fix->fx_addsy) break; } @@ -4749,7 +5017,7 @@ ppc_fix_adjustable (fix) && S_GET_SEGMENT (fix->fx_addsy) == bss_section && ! S_IS_EXTERNAL (fix->fx_addsy)) { - resolve_symbol_value (symbol_get_frag (fix->fx_addsy)->fr_symbol, 1); + resolve_symbol_value (symbol_get_frag (fix->fx_addsy)->fr_symbol); fix->fx_offset += (S_GET_VALUE (fix->fx_addsy) - S_GET_VALUE (symbol_get_frag (fix->fx_addsy)->fr_symbol)); @@ -4786,18 +5054,27 @@ ppc_force_relocation (fix) #endif /* OBJ_XCOFF */ -/* See whether a symbol is in the TOC section. */ - -static int -ppc_is_toc_sym (sym) - symbolS *sym; +#ifdef OBJ_ELF +int +ppc_fix_adjustable (fix) + fixS *fix; { -#ifdef OBJ_XCOFF - return symbol_get_tc (sym)->class == XMC_TC; -#else - return strcmp (segment_name (S_GET_SEGMENT (sym)), ".got") == 0; -#endif + return (fix->fx_r_type != BFD_RELOC_16_GOTOFF + && fix->fx_r_type != BFD_RELOC_LO16_GOTOFF + && fix->fx_r_type != BFD_RELOC_HI16_GOTOFF + && fix->fx_r_type != BFD_RELOC_HI16_S_GOTOFF + && fix->fx_r_type != BFD_RELOC_GPREL16 + && fix->fx_r_type != BFD_RELOC_VTABLE_INHERIT + && fix->fx_r_type != BFD_RELOC_VTABLE_ENTRY + && ! S_IS_EXTERNAL (fix->fx_addsy) + && ! S_IS_WEAK (fix->fx_addsy) + && (fix->fx_pcrel + || (fix->fx_subsy != NULL + && (S_GET_SEGMENT (fix->fx_subsy) + == S_GET_SEGMENT (fix->fx_addsy))) + || S_IS_LOCAL (fix->fx_addsy))); } +#endif /* 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 @@ -4808,36 +5085,33 @@ ppc_is_toc_sym (sym) 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; +void +md_apply_fix3 (fixP, valP, seg) + fixS *fixP; + valueT * valP; + segT seg ATTRIBUTE_UNUSED; { - valueT value; + valueT value = * valP; #ifdef OBJ_ELF - value = *valuep; - if (fixp->fx_addsy != NULL) + if (fixP->fx_addsy != NULL) { /* `*valuep' may contain the value of the symbol on which the reloc will be based; we have to remove it. */ - if (symbol_used_in_reloc_p (fixp->fx_addsy) - && S_GET_SEGMENT (fixp->fx_addsy) != absolute_section - && S_GET_SEGMENT (fixp->fx_addsy) != undefined_section - && ! bfd_is_com_section (S_GET_SEGMENT (fixp->fx_addsy))) - value -= S_GET_VALUE (fixp->fx_addsy); + if (symbol_used_in_reloc_p (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section + && S_GET_SEGMENT (fixP->fx_addsy) != undefined_section + && ! bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy))) + value -= S_GET_VALUE (fixP->fx_addsy); /* FIXME: Why '+'? Better yet, what exactly is '*valuep' supposed to be? I think this is related to various similar FIXMEs in tc-i386.c and tc-sparc.c. */ - if (fixp->fx_pcrel) - value += fixp->fx_frag->fr_address + fixp->fx_where; + if (fixP->fx_pcrel) + value += fixP->fx_frag->fr_address + fixP->fx_where; } else - { - fixp->fx_done = 1; - } + fixP->fx_done = 1; #else /* FIXME FIXME FIXME: The value we are passed in *valuep includes the symbol values. Since we are using BFD_ASSEMBLER, if we are @@ -4849,163 +5123,171 @@ md_apply_fix3 (fixp, valuep, seg) *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; + if (fixP->fx_addsy == (symbolS *) NULL) + fixP->fx_done = 1; + + else if (fixP->fx_pcrel) + ; + else { - value = fixp->fx_offset; - if (fixp->fx_subsy != (symbolS *) NULL) + 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); + 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, + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); } } } #endif - if ((int) fixp->fx_r_type >= (int) BFD_RELOC_UNUSED) + if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { int opindex; const struct powerpc_operand *operand; char *where; unsigned long insn; - opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED; + opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; operand = &powerpc_operands[opindex]; #ifdef OBJ_XCOFF - /* It appears that an instruction like - l 9,LC..1(30) - when LC..1 is not a TOC symbol does not generate a reloc. It - uses the offset of LC..1 within its csect. However, .long - LC..1 will generate a reloc. I can't find any documentation - on how these cases are to be distinguished, so this is a wild - guess. These cases are generated by gcc -mminimal-toc. */ + /* An instruction like `lwz 9,sym(30)' when `sym' is not a TOC symbol + does not generate a reloc. It uses the offset of `sym' within its + csect. Other usages, such as `.long sym', generate relocs. This + is the documented behaviour of non-TOC symbols. */ if ((operand->flags & PPC_OPERAND_PARENS) != 0 && operand->bits == 16 && operand->shift == 0 && operand->insert == NULL - && fixp->fx_addsy != NULL - && symbol_get_tc (fixp->fx_addsy)->subseg != 0 - && symbol_get_tc (fixp->fx_addsy)->class != XMC_TC - && symbol_get_tc (fixp->fx_addsy)->class != XMC_TC0 - && S_GET_SEGMENT (fixp->fx_addsy) != bss_section) + && fixP->fx_addsy != NULL + && symbol_get_tc (fixP->fx_addsy)->subseg != 0 + && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC + && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC0 + && S_GET_SEGMENT (fixP->fx_addsy) != bss_section) { - value = fixp->fx_offset; - fixp->fx_done = 1; + value = fixP->fx_offset; + fixP->fx_done = 1; } #endif /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. */ - where = fixp->fx_frag->fr_literal + fixp->fx_where; + 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 = ppc_insert_operand (insn, operand, (offsetT) value, - fixp->fx_file, fixp->fx_line); + 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; - } + if (fixP->fx_done) + /* Nothing else to do here. */ + return; + + assert (fixP->fx_addsy != NULL); /* Determine a BFD reloc value based on the operand information. We are only prepared to turn a few of the operands into - relocs. - FIXME: We need to handle the DS field at the very least. - FIXME: Selecting the reloc type is a bit haphazard; perhaps - there should be a new field in the operand table. */ + relocs. */ if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 && operand->bits == 26 && operand->shift == 0) - fixp->fx_r_type = BFD_RELOC_PPC_B26; + fixP->fx_r_type = BFD_RELOC_PPC_B26; else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 && operand->bits == 16 && operand->shift == 0) - fixp->fx_r_type = BFD_RELOC_PPC_B16; + fixP->fx_r_type = BFD_RELOC_PPC_B16; else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 && operand->bits == 26 && operand->shift == 0) - fixp->fx_r_type = BFD_RELOC_PPC_BA26; + fixP->fx_r_type = BFD_RELOC_PPC_BA26; else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 && operand->bits == 16 && operand->shift == 0) - fixp->fx_r_type = BFD_RELOC_PPC_BA16; + fixP->fx_r_type = BFD_RELOC_PPC_BA16; +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) else if ((operand->flags & PPC_OPERAND_PARENS) != 0 && operand->bits == 16 && operand->shift == 0 - && fixp->fx_addsy != NULL - && ppc_is_toc_sym (fixp->fx_addsy)) + && ppc_is_toc_sym (fixP->fx_addsy)) { - fixp->fx_size = 2; + fixP->fx_r_type = BFD_RELOC_PPC_TOC16; +#ifdef OBJ_ELF + if (BFD_DEFAULT_TARGET_SIZE == 64 + && ppc_size == PPC_OPCODE_64 + && (operand->flags & PPC_OPERAND_DS) != 0) + fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS; +#endif + fixP->fx_size = 2; if (target_big_endian) - fixp->fx_where += 2; - fixp->fx_r_type = BFD_RELOC_PPC_TOC16; + fixP->fx_where += 2; } +#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */ else { char *sfile; unsigned int sline; /* Use expr_symbol_where to see if this is an expression - symbol. */ - if (expr_symbol_where (fixp->fx_addsy, &sfile, &sline)) - as_bad_where (fixp->fx_file, fixp->fx_line, + symbol. */ + if (expr_symbol_where (fixP->fx_addsy, &sfile, &sline)) + as_bad_where (fixP->fx_file, fixP->fx_line, _("unresolved expression that must be resolved")); else - as_bad_where (fixp->fx_file, fixp->fx_line, - _("unsupported relocation type")); - fixp->fx_done = 1; - return 1; + as_bad_where (fixP->fx_file, fixP->fx_line, + _("unsupported relocation against %s"), + S_GET_NAME (fixP->fx_addsy)); + fixP->fx_done = 1; + return; } } else { #ifdef OBJ_ELF - ppc_elf_validate_fix (fixp, seg); + ppc_elf_validate_fix (fixP, seg); #endif - switch (fixp->fx_r_type) + switch (fixP->fx_r_type) { - case BFD_RELOC_32: case BFD_RELOC_CTOR: - if (fixp->fx_pcrel) - fixp->fx_r_type = BFD_RELOC_32_PCREL; - /* fall through */ + if (BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64) + goto ctor64; + /* fall through */ + + case BFD_RELOC_32: + if (fixP->fx_pcrel) + fixP->fx_r_type = BFD_RELOC_32_PCREL; + /* fall through */ case BFD_RELOC_RVA: case BFD_RELOC_32_PCREL: case BFD_RELOC_32_BASEREL: case BFD_RELOC_PPC_EMB_NADDR32: - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, value, 4); break; case BFD_RELOC_64: - if (fixp->fx_pcrel) - fixp->fx_r_type = BFD_RELOC_64_PCREL; - /* fall through */ + ctor64: + if (fixP->fx_pcrel) + fixP->fx_r_type = BFD_RELOC_64_PCREL; + /* fall through */ + case BFD_RELOC_64_PCREL: - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, value, 8); break; + case BFD_RELOC_LO16: case BFD_RELOC_16: case BFD_RELOC_GPREL16: @@ -5030,20 +5312,27 @@ md_apply_fix3 (fixp, valuep, seg) case BFD_RELOC_PPC_EMB_RELST_HA: case BFD_RELOC_PPC_EMB_RELSDA: case BFD_RELOC_PPC_TOC16: - if (fixp->fx_pcrel) +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_TOC16_LO: + case BFD_RELOC_PPC64_TOC16_HI: + case BFD_RELOC_PPC64_TOC16_HA: +#endif +#endif + if (fixP->fx_pcrel) { - if (fixp->fx_addsy != NULL) - as_bad_where (fixp->fx_file, fixp->fx_line, + if (fixP->fx_addsy != NULL) + as_bad_where (fixP->fx_file, fixP->fx_line, _("cannot emit PC relative %s relocation against %s"), - bfd_get_reloc_code_name (fixp->fx_r_type), - S_GET_NAME (fixp->fx_addsy)); + bfd_get_reloc_code_name (fixP->fx_r_type), + S_GET_NAME (fixP->fx_addsy)); else - as_bad_where (fixp->fx_file, fixp->fx_line, + as_bad_where (fixP->fx_file, fixP->fx_line, _("cannot emit PC relative %s relocation"), - bfd_get_reloc_code_name (fixp->fx_r_type)); + bfd_get_reloc_code_name (fixP->fx_r_type)); } - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, value, 2); break; @@ -5051,109 +5340,177 @@ md_apply_fix3 (fixp, valuep, seg) lis %r3,(L1-L2)@ha where L1 and L2 are defined later. */ case BFD_RELOC_HI16: - if (fixp->fx_pcrel) + if (fixP->fx_pcrel) abort (); - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, - value >> 16, 2); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HI (value), 2); break; + case BFD_RELOC_HI16_S: - if (fixp->fx_pcrel) + if (fixP->fx_pcrel) + abort (); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HA (value), 2); + break; + +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + if (fixP->fx_pcrel) + abort (); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HIGHER (value), 2); + break; + + case BFD_RELOC_PPC64_HIGHER_S: + if (fixP->fx_pcrel) + abort (); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HIGHERA (value), 2); + break; + + case BFD_RELOC_PPC64_HIGHEST: + if (fixP->fx_pcrel) + abort (); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HIGHEST (value), 2); + break; + + case BFD_RELOC_PPC64_HIGHEST_S: + if (fixP->fx_pcrel) abort (); - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, - (value + 0x8000) >> 16, 2); + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + PPC_HIGHESTA (value), 2); break; + case BFD_RELOC_PPC64_ADDR16_DS: + case BFD_RELOC_PPC64_ADDR16_LO_DS: + case BFD_RELOC_PPC64_GOT16_DS: + case BFD_RELOC_PPC64_GOT16_LO_DS: + case BFD_RELOC_PPC64_PLT16_LO_DS: + case BFD_RELOC_PPC64_SECTOFF_DS: + case BFD_RELOC_PPC64_SECTOFF_LO_DS: + case BFD_RELOC_PPC64_TOC16_DS: + case BFD_RELOC_PPC64_TOC16_LO_DS: + case BFD_RELOC_PPC64_PLTGOT16_DS: + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: + if (fixP->fx_pcrel) + abort (); + { + unsigned char *where = fixP->fx_frag->fr_literal + fixP->fx_where; + unsigned long val; + + if (target_big_endian) + val = bfd_getb16 (where); + else + val = bfd_getl16 (where); + val |= (value & 0xfffc); + if (target_big_endian) + bfd_putb16 ((bfd_vma) val, where); + else + bfd_putl16 ((bfd_vma) val, where); + } + break; +#endif +#endif /* Because SDA21 modifies the register field, the size is set to 4 - bytes, rather than 2, so offset it here appropriately */ + bytes, rather than 2, so offset it here appropriately. */ case BFD_RELOC_PPC_EMB_SDA21: - if (fixp->fx_pcrel) + if (fixP->fx_pcrel) abort (); - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where + ((target_big_endian) ? 2 : 0), value, 2); break; case BFD_RELOC_8: - if (fixp->fx_pcrel) + if (fixP->fx_pcrel) abort (); - md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, value, 1); break; case BFD_RELOC_24_PLT_PCREL: case BFD_RELOC_PPC_LOCAL24PC: - if (!fixp->fx_pcrel && !fixp->fx_done) + if (!fixP->fx_pcrel && !fixP->fx_done) abort (); - if (fixp->fx_done) - { - char *where; - unsigned long insn; - - /* 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); - if ((value & 3) != 0) - as_bad_where (fixp->fx_file, fixp->fx_line, - _("must branch to an address a multiple of 4")); - if ((offsetT) value < -0x40000000 - || (offsetT) value >= 0x40000000) - as_bad_where (fixp->fx_file, fixp->fx_line, - _("@local or @plt branch destination is too far away, %ld bytes"), - value); - insn = insn | (value & 0x03fffffc); - 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) + { + char *where; + unsigned long insn; + + /* 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); + if ((value & 3) != 0) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("must branch to an address a multiple of 4")); + if ((offsetT) value < -0x40000000 + || (offsetT) value >= 0x40000000) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("@local or @plt branch destination is too far away, %ld bytes"), + (long) value); + insn = insn | (value & 0x03fffffc); + if (target_big_endian) + bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); + else + bfd_putl32 ((bfd_vma) insn, (unsigned char *) where); + } break; case BFD_RELOC_VTABLE_INHERIT: - fixp->fx_done = 0; - if (fixp->fx_addsy - && !S_IS_DEFINED (fixp->fx_addsy) - && !S_IS_WEAK (fixp->fx_addsy)) - S_SET_WEAK (fixp->fx_addsy); + fixP->fx_done = 0; + if (fixP->fx_addsy + && !S_IS_DEFINED (fixP->fx_addsy) + && !S_IS_WEAK (fixP->fx_addsy)) + S_SET_WEAK (fixP->fx_addsy); break; case BFD_RELOC_VTABLE_ENTRY: - fixp->fx_done = 0; + fixP->fx_done = 0; break; +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + /* Generated by reference to `sym@tocbase'. The sym is + ignored by the linker. */ + case BFD_RELOC_PPC64_TOC: + fixP->fx_done = 0; + break; +#endif +#endif default: fprintf (stderr, - _("Gas failure, reloc value %d\n"), fixp->fx_r_type); - fflush(stderr); + _("Gas failure, reloc value %d\n"), fixP->fx_r_type); + fflush (stderr); abort (); } } #ifdef OBJ_ELF - fixp->fx_addnumber = value; + fixP->fx_addnumber = value; #else - if (fixp->fx_r_type != BFD_RELOC_PPC_TOC16) - fixp->fx_addnumber = 0; + if (fixP->fx_r_type != BFD_RELOC_PPC_TOC16) + fixP->fx_addnumber = 0; else { #ifdef TE_PE - fixp->fx_addnumber = 0; + fixP->fx_addnumber = 0; #else /* We want to use the offset within the data segment of the symbol, not the actual VMA of the symbol. */ - fixp->fx_addnumber = - - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixp->fx_addsy)); + fixP->fx_addnumber = + - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy)); #endif } #endif - - return 1; } /* Generate a reloc for a fixup. */ @@ -5174,7 +5531,8 @@ tc_gen_reloc (seg, fixp) 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); + _("reloc %d not supported by object file format"), + (int) fixp->fx_r_type); return NULL; } reloc->addend = fixp->fx_addnumber; diff --git a/contrib/binutils/gas/config/tc-ppc.h b/contrib/binutils/gas/config/tc-ppc.h index c2876bf..f4d2f86 100644 --- a/contrib/binutils/gas/config/tc-ppc.h +++ b/contrib/binutils/gas/config/tc-ppc.h @@ -1,5 +1,5 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -56,7 +56,7 @@ extern int target_big_endian; /* The target BFD format. */ #define TARGET_FORMAT (ppc_target_format ()) -extern char* ppc_target_format (); +extern char *ppc_target_format PARAMS ((void)); /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -82,8 +82,34 @@ extern char* ppc_target_format (); /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -/* We set the fx_done field appropriately in md_apply_fix. */ -#define TC_HANDLES_FX_DONE +#define MAX_MEM_FOR_RS_ALIGN_CODE 4 +#define HANDLE_ALIGN(FRAGP) \ + if ((FRAGP)->fr_type == rs_align_code) \ + { \ + valueT count = ((FRAGP)->fr_next->fr_address \ + - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ + if (count != 0 && (count & 3) == 0) \ + { \ + unsigned char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ + \ + (FRAGP)->fr_var = 4; \ + if (target_big_endian) \ + { \ + *dest++ = 0x60; \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0; \ + } \ + else \ + { \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0x60; \ + } \ + } \ + } + #ifdef TE_PE @@ -197,6 +223,8 @@ do { \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_B16_BRNTAKEN \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRTAKEN \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRNTAKEN \ + || (BFD_DEFAULT_TARGET_SIZE == 64 \ + && (FIXP)->fx_r_type == BFD_RELOC_PPC64_TOC) \ || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \ || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY) @@ -216,6 +244,12 @@ extern int ppc_section_flags PARAMS ((int, int, int)); #define md_elf_section_word(STR, LEN) ppc_section_word (STR, LEN) #define md_elf_section_flags(FLAGS, ATTR, TYPE) ppc_section_flags (FLAGS, ATTR, TYPE) +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Extra sections for 64-bit ELF PPC. */ +#define ELF_TC_SPECIAL_SECTIONS \ + { ".toc", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, \ + { ".tocbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE}, +#else /* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a normal section, and not a bss section so that the linker doesn't crater when trying to make more than 2 sections. */ @@ -227,26 +261,14 @@ extern int ppc_section_flags PARAMS ((int, int, int)); { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \ { ".PPC.EMB.sdata0", SHT_PROGBITS, SHF_ALLOC }, \ { ".PPC.EMB.sbss0", SHT_PROGBITS, SHF_ALLOC }, +#endif #define tc_comment_chars ppc_comment_chars extern const char *ppc_comment_chars; /* Keep relocations relative to the GOT, or non-PC relative. */ -#define tc_fix_adjustable(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_LO16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_HI16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_HI16_S_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_GPREL16 \ - && (FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ - && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY \ - && ! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && ((FIX)->fx_pcrel \ - || ((FIX)->fx_subsy != NULL \ - && (S_GET_SEGMENT ((FIX)->fx_subsy) \ - == S_GET_SEGMENT ((FIX)->fx_addsy))) \ - || S_IS_LOCAL ((FIX)->fx_addsy))) +#define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp) +extern int ppc_fix_adjustable PARAMS ((struct fix *)); /* We must never ever try to resolve references to externally visible symbols in the assembler, because the .o file might go into a shared @@ -258,17 +280,20 @@ extern const char *ppc_comment_chars; && S_IS_DEFINED ((FIX)->fx_addsy) \ && ! S_IS_COMMON ((FIX)->fx_addsy))) +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Finish up the symbol. */ +#define tc_frob_symbol(sym, punt) punt = ppc_elf_frob_symbol (sym) +extern int ppc_elf_frob_symbol PARAMS ((symbolS *)); +#endif + #define DWARF2_LINE_MIN_INSN_LENGTH 4 #endif /* OBJ_ELF */ -/* call md_apply_fix3 with segment instead of md_apply_fix */ -#define MD_APPLY_FIX3 - /* call md_pcrel_from_section, not md_pcrel_from */ #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); -#define md_parse_name(name, exp) ppc_parse_name (name, exp) +#define md_parse_name(name, exp, c) ppc_parse_name (name, exp) extern int ppc_parse_name PARAMS ((const char *, struct expressionS *)); #define md_operand(x) diff --git a/contrib/binutils/gas/config/tc-sparc.c b/contrib/binutils/gas/config/tc-sparc.c index 558dc89..fe9f3f7 100644 --- a/contrib/binutils/gas/config/tc-sparc.c +++ b/contrib/binutils/gas/config/tc-sparc.c @@ -20,9 +20,9 @@ Boston, MA 02111-1307, USA. */ #include -#include #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "opcode/sparc.h" @@ -632,12 +632,12 @@ md_show_usage (stream) continue; if (arch != &sparc_arch_table[0]) fprintf (stream, " | "); - if (column + strlen(arch->name) > 70) + if (column + strlen (arch->name) > 70) { column = 0; fputc ('\n', stream); } - column += 5 + 2 + strlen(arch->name); + column += 5 + 2 + strlen (arch->name); fprintf (stream, "-A%s", arch->name); } for (arch = &sparc_arch_table[0]; arch->name; arch++) @@ -645,12 +645,12 @@ md_show_usage (stream) if (!arch->user_option_p) continue; fprintf (stream, " | "); - if (column + strlen(arch->name) > 65) + if (column + strlen (arch->name) > 65) { column = 0; fputc ('\n', stream); } - column += 5 + 7 + strlen(arch->name); + column += 5 + 7 + strlen (arch->name); fprintf (stream, "-xarch=%s", arch->name); } fprintf (stream, _("\n\ @@ -1385,11 +1385,11 @@ sparc_ip (str, pinsn) int special_case = SPECIAL_CASE_NONE; s = str; - if (islower ((unsigned char) *s)) + if (ISLOWER (*s)) { do ++s; - while (islower ((unsigned char) *s) || isdigit ((unsigned char) *s)); + while (ISLOWER (*s) || ISDIGIT (*s)); } switch (*s) @@ -1617,11 +1617,11 @@ sparc_ip (str, pinsn) { s += 4; - if (isdigit ((unsigned char) *s)) + if (ISDIGIT (*s)) { long num = 0; - while (isdigit ((unsigned char) *s)) + while (ISDIGIT (*s)) { num = num * 10 + *s - '0'; ++s; @@ -1825,9 +1825,9 @@ sparc_ip (str, pinsn) break; case '#': /* Must be at least one digit. */ - if (isdigit ((unsigned char) *s++)) + if (ISDIGIT (*s++)) { - while (isdigit ((unsigned char) *s)) + while (ISDIGIT (*s)) { ++s; } @@ -1846,10 +1846,10 @@ sparc_ip (str, pinsn) case 'b': /* Next operand is a coprocessor register. */ case 'c': case 'D': - if (*s++ == '%' && *s++ == 'c' && isdigit ((unsigned char) *s)) + if (*s++ == '%' && *s++ == 'c' && ISDIGIT (*s)) { mask = *s++; - if (isdigit ((unsigned char) *s)) + if (ISDIGIT (*s)) { mask = 10 * (mask - '0') + (*s++ - '0'); if (mask >= 32) @@ -1942,7 +1942,7 @@ sparc_ip (str, pinsn) goto error; case 'r': /* any register */ - if (!isdigit ((unsigned char) (c = *s++))) + if (!ISDIGIT ((c = *s++))) { goto error; } @@ -1957,7 +1957,7 @@ sparc_ip (str, pinsn) case '7': case '8': case '9': - if (isdigit ((unsigned char) *s)) + if (ISDIGIT (*s)) { if ((c = 10 * (c - '0') + (*s++ - '0')) >= 32) { @@ -2022,9 +2022,9 @@ sparc_ip (str, pinsn) if (*s++ == '%' && ((format = *s) == 'f') - && isdigit ((unsigned char) *++s)) + && ISDIGIT (*++s)) { - for (mask = 0; isdigit ((unsigned char) *s); ++s) + for (mask = 0; ISDIGIT (*s); ++s) { mask = 10 * mask + (*s - '0'); } /* read the number */ @@ -2240,7 +2240,7 @@ sparc_ip (str, pinsn) for (s1 = s; *s1 && *s1 != ',' && *s1 != ']'; s1++) ; - if (s1 != s && isdigit ((unsigned char) s1[-1])) + if (s1 != s && ISDIGIT (s1[-1])) { if (s1[-2] == '%' && s1[-3] == '+') s1 -= 3; @@ -2663,7 +2663,7 @@ parse_keyword_arg (lookup_fn, input_pointerP, valueP) p = *input_pointerP; for (q = p + (*p == '#' || *p == '%'); - isalnum ((unsigned char) *q) || *q == '_'; + ISALNUM (*q) || *q == '_'; ++q) continue; c = *q; @@ -2881,18 +2881,16 @@ md_number_to_chars (buf, val, n) /* Apply a fixS to the frags, now that we know the value it ought to hold. */ -int -md_apply_fix3 (fixP, value, segment) +void +md_apply_fix3 (fixP, valP, segment) fixS *fixP; - valueT *value; + valueT *valP; segT segment; { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - offsetT val; + offsetT val = * (offsetT *) valP; long insn; - val = *value; - assert (fixP->fx_r_type < BFD_RELOC_UNUSED); fixP->fx_addnumber = val; /* Remember value for emit_reloc. */ @@ -2905,22 +2903,25 @@ md_apply_fix3 (fixP, value, segment) don't want to include the value of an externally visible symbol. */ if (fixP->fx_addsy != NULL) { - if (symbol_used_in_reloc_p (fixP->fx_addsy) - && (S_IS_EXTERNAL (fixP->fx_addsy) - || S_IS_WEAK (fixP->fx_addsy) + symbolS * sym = fixP->fx_addsy; + segT seg = S_GET_SEGMENT (sym); + + if (symbol_used_in_reloc_p (sym) + && (S_IS_EXTERNAL (sym) + || S_IS_WEAK (sym) + || (seg->flags & SEC_MERGE) || (sparc_pic_code && ! fixP->fx_pcrel) - || (S_GET_SEGMENT (fixP->fx_addsy) != segment - && ((bfd_get_section_flags (stdoutput, - S_GET_SEGMENT (fixP->fx_addsy)) - & SEC_LINK_ONCE) != 0 - || strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), - ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0))) - && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section - && S_GET_SEGMENT (fixP->fx_addsy) != undefined_section - && ! bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy))) - fixP->fx_addnumber -= S_GET_VALUE (fixP->fx_addsy); - return 1; + || (seg != segment + && (((bfd_get_section_flags (stdoutput, seg) & SEC_LINK_ONCE) != 0) + || (strncmp (segment_name (seg), + ".gnu.linkonce", + sizeof ".gnu.linkonce" - 1) == 0)))) + && seg != absolute_section + && seg != undefined_section + && ! bfd_is_com_section (seg)) + fixP->fx_addnumber -= S_GET_VALUE (sym); + + return; } #endif @@ -2991,7 +2992,7 @@ md_apply_fix3 (fixP, value, segment) || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) { fixP->fx_done = 0; - return 1; + return; } else { @@ -3163,14 +3164,10 @@ md_apply_fix3 (fixP, value, segment) case BFD_RELOC_SPARC_LM22: case BFD_RELOC_HI22: if (!fixP->fx_addsy) - { - insn |= (val >> 10) & 0x3fffff; - } + insn |= (val >> 10) & 0x3fffff; else - { - /* FIXME: Need comment explaining why we do this. */ - insn &= ~0xffff; - } + /* FIXME: Need comment explaining why we do this. */ + insn &= ~0xffff; break; case BFD_RELOC_SPARC22: @@ -3186,14 +3183,10 @@ md_apply_fix3 (fixP, value, segment) case BFD_RELOC_LO10: if (!fixP->fx_addsy) - { - insn |= val & 0x3ff; - } + insn |= val & 0x3ff; else - { - /* FIXME: Need comment explaining why we do this. */ - insn &= ~0xff; - } + /* FIXME: Need comment explaining why we do this. */ + insn &= ~0xff; break; case BFD_RELOC_SPARC_OLO10: @@ -3264,8 +3257,6 @@ md_apply_fix3 (fixP, value, segment) /* Are we finished with this relocation now? */ if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) fixP->fx_done = 1; - - return 1; } /* Translate internal representation of relocation info to BFD target @@ -3322,6 +3313,12 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_SPARC_UA16: case BFD_RELOC_SPARC_UA32: case BFD_RELOC_SPARC_UA64: + case BFD_RELOC_8_PCREL: + case BFD_RELOC_16_PCREL: + case BFD_RELOC_32_PCREL: + case BFD_RELOC_64_PCREL: + case BFD_RELOC_SPARC_PLT32: + case BFD_RELOC_SPARC_PLT64: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: code = fixp->fx_r_type; @@ -3411,9 +3408,11 @@ tc_gen_reloc (section, fixp) #else /* elf or coff */ - if (reloc->howto->pc_relative == 0 - || code == BFD_RELOC_SPARC_PC10 - || code == BFD_RELOC_SPARC_PC22) + if (code != BFD_RELOC_32_PCREL_S2 + && code != BFD_RELOC_SPARC_WDISP22 + && code != BFD_RELOC_SPARC_WDISP16 + && code != BFD_RELOC_SPARC_WDISP19 + && code != BFD_RELOC_SPARC_WPLT30) reloc->addend = fixp->fx_addnumber; else if (symbol_section_p (fixp->fx_addsy)) reloc->addend = (section->vma @@ -3909,6 +3908,11 @@ s_proc (ignore) static int sparc_no_align_cons = 0; +/* This static variable is set by sparc_cons to emit requested types + of relocations in cons_fix_new_sparc. */ + +static const char *sparc_cons_special_reloc; + /* 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. */ @@ -3920,6 +3924,7 @@ s_uacons (bytes) /* Tell sparc_cons_align not to align this value. */ sparc_no_align_cons = 1; cons (bytes); + sparc_no_align_cons = 0; } /* This handles the native word allocation pseudo-op .nword. @@ -4180,6 +4185,134 @@ sparc_elf_final_processing () else if (current_architecture == SPARC_OPCODE_ARCH_V9B) elf_elfheader (stdoutput)->e_flags |= EF_SPARC_SUN_US1|EF_SPARC_SUN_US3; } + +void +sparc_cons (exp, size) + expressionS *exp; + int size; +{ + char *save; + + SKIP_WHITESPACE (); + sparc_cons_special_reloc = NULL; + save = input_line_pointer; + if (input_line_pointer[0] == '%' + && input_line_pointer[1] == 'r' + && input_line_pointer[2] == '_') + { + if (strncmp (input_line_pointer + 3, "disp", 4) == 0) + { + input_line_pointer += 7; + sparc_cons_special_reloc = "disp"; + } + else if (strncmp (input_line_pointer + 3, "plt", 3) == 0) + { + if (size != 4 && size != 8) + as_bad (_("Illegal operands: %%r_plt in %d-byte data field"), size); + else + { + input_line_pointer += 6; + sparc_cons_special_reloc = "plt"; + } + } + if (sparc_cons_special_reloc) + { + int bad = 0; + + switch (size) + { + case 1: + if (*input_line_pointer != '8') + bad = 1; + input_line_pointer--; + break; + case 2: + if (input_line_pointer[0] != '1' || input_line_pointer[1] != '6') + bad = 1; + break; + case 4: + if (input_line_pointer[0] != '3' || input_line_pointer[1] != '2') + bad = 1; + break; + case 8: + if (input_line_pointer[0] != '6' || input_line_pointer[1] != '4') + bad = 1; + break; + default: + bad = 1; + break; + } + + if (bad) + { + as_bad (_("Illegal operands: Only %%r_%s%d allowed in %d-byte data fields"), + sparc_cons_special_reloc, size * 8, size); + } + else + { + input_line_pointer += 2; + if (*input_line_pointer != '(') + { + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + sparc_cons_special_reloc, size * 8); + bad = 1; + } + } + + if (bad) + { + input_line_pointer = save; + sparc_cons_special_reloc = NULL; + } + else + { + int c; + char *end = ++input_line_pointer; + int npar = 0; + + while (! is_end_of_line[(c = *end)]) + { + if (c == '(') + npar++; + else if (c == ')') + { + if (!npar) + break; + npar--; + } + end++; + } + + if (c != ')') + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + sparc_cons_special_reloc, size * 8); + else + { + *end = '\0'; + expression (exp); + *end = c; + if (input_line_pointer != end) + { + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + sparc_cons_special_reloc, size * 8); + } + else + { + input_line_pointer++; + SKIP_WHITESPACE (); + c = *input_line_pointer; + if (! is_end_of_line[c] && c != ',') + as_bad (_("Illegal operands: garbage after %%r_%s%d()"), + sparc_cons_special_reloc, size * 8); + } + } + } + } + } + if (sparc_cons_special_reloc == NULL) + expression (exp); +} + #endif /* This is called by emit_expr via TC_CONS_FIX_NEW when creating a @@ -4204,7 +4337,25 @@ cons_fix_new_sparc (frag, where, nbytes, exp) && now_seg->flags & SEC_ALLOC) r = BFD_RELOC_SPARC_REV32; - if (sparc_no_align_cons) + if (sparc_cons_special_reloc) + { + if (*sparc_cons_special_reloc == 'd') + switch (nbytes) + { + case 1: r = BFD_RELOC_8_PCREL; break; + case 2: r = BFD_RELOC_16_PCREL; break; + case 4: r = BFD_RELOC_32_PCREL; break; + case 8: r = BFD_RELOC_64_PCREL; break; + default: abort (); + } + else + switch (nbytes) + { + case 4: r = BFD_RELOC_SPARC_PLT32; break; + case 8: r = BFD_RELOC_SPARC_PLT64; break; + } + } + else if (sparc_no_align_cons) { switch (nbytes) { @@ -4213,8 +4364,7 @@ cons_fix_new_sparc (frag, where, nbytes, exp) case 8: r = BFD_RELOC_SPARC_UA64; break; default: abort (); } - sparc_no_align_cons = 0; - } + } fix_new_exp (frag, where, (int) nbytes, exp, 0, r); } diff --git a/contrib/binutils/gas/config/tc-sparc.h b/contrib/binutils/gas/config/tc-sparc.h index ce19f5d..5d545de 100644 --- a/contrib/binutils/gas/config/tc-sparc.h +++ b/contrib/binutils/gas/config/tc-sparc.h @@ -1,6 +1,6 @@ /* tc-sparc.h - Macros and type defines for the sparc. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000 Free Software Foundation, Inc. + 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -54,7 +54,7 @@ extern const char *sparc_target_format PARAMS ((void)); #define md_convert_frag(b,s,f) \ as_fatal (_("sparc convert_frag\n")) #define md_estimate_size_before_relax(f,s) \ - (as_fatal(_("estimate_size_before_relax called")), 1) + (as_fatal (_("estimate_size_before_relax called")), 1) #define LISTING_HEADER "SPARC GAS " @@ -110,9 +110,6 @@ extern void sparc_handle_align PARAMS ((struct frag *)); extern int elf32_sparc_force_relocation PARAMS ((struct fix *)); #endif -#define MD_APPLY_FIX3 -#define TC_HANDLES_FX_DONE - #ifdef OBJ_ELF /* Keep relocations against global symbols. Don't turn them into relocations against sections. This is required for the dynamic @@ -169,6 +166,11 @@ extern void sparc_md_end PARAMS ((void)); #endif +#ifdef OBJ_ELF +#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) sparc_cons (EXP, NBYTES) +extern void sparc_cons PARAMS ((expressionS *, int)); +#endif + #define TC_CONS_FIX_NEW cons_fix_new_sparc extern void cons_fix_new_sparc PARAMS ((struct frag *, int, unsigned int, struct expressionS *)); diff --git a/contrib/binutils/gas/configure b/contrib/binutils/gas/configure index 5545d4b..c1282ed 100755 --- a/contrib/binutils/gas/configure +++ b/contrib/binutils/gas/configure @@ -55,7 +55,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -170,7 +169,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -341,11 +339,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -511,16 +504,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -559,12 +548,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:563: checking for Cygwin environment" >&5 +echo "configure:552: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -592,19 +581,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:596: checking for mingw32 environment" >&5 +echo "configure:585: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -669,7 +658,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:673: checking host system type" >&5 +echo "configure:662: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -690,7 +679,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:694: checking target system type" >&5 +echo "configure:683: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -708,7 +697,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:712: checking build system type" >&5 +echo "configure:701: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -733,7 +722,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:737: checking for $ac_word" >&5 +echo "configure:726: 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 @@ -763,7 +752,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:767: checking for $ac_word" >&5 +echo "configure:756: 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 +803,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:818: checking for $ac_word" >&5 +echo "configure:807: 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 @@ -846,7 +835,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:839: 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. @@ -857,12 +846,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 861 "configure" +#line 850 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -888,12 +877,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:892: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:881: 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:897: checking whether we are using GNU C" >&5 +echo "configure:886: 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 @@ -902,7 +891,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:906: \"$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:895: \"$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 @@ -921,7 +910,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:925: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:914: 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 @@ -953,7 +942,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:957: checking for POSIXized ISC" >&5 +echo "configure:946: 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 @@ -987,7 +976,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # 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:991: checking for a BSD compatible install" >&5 +echo "configure:980: 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 @@ -1040,7 +1029,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1044: checking whether build environment is sane" >&5 +echo "configure:1033: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1097,7 +1086,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1101: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1090: 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 @@ -1143,7 +1132,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1147: checking for working aclocal" >&5 +echo "configure:1136: 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. @@ -1156,7 +1145,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1160: checking for working autoconf" >&5 +echo "configure:1149: 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. @@ -1169,7 +1158,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1173: checking for working automake" >&5 +echo "configure:1162: 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. @@ -1182,7 +1171,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1186: checking for working autoheader" >&5 +echo "configure:1175: 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. @@ -1195,7 +1184,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1199: checking for working makeinfo" >&5 +echo "configure:1188: 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. @@ -1213,7 +1202,7 @@ fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -1236,7 +1225,7 @@ fi if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -1259,7 +1248,7 @@ fi if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -1287,10 +1276,10 @@ else fi ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1294: checking for ld used by GCC" >&5 +echo "configure:1283: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1298,7 +1287,7 @@ echo "configure:1294: checking for ld used by GCC" >&5 *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' @@ -1320,12 +1309,12 @@ echo "configure:1294: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1324: checking for GNU ld" >&5 +echo "configure:1313: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1327: checking for non-GNU ld" >&5 +echo "configure:1316: checking for non-GNU ld" >&5 fi -if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1333,11 +1322,11 @@ else for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_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 + if "$lt_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 @@ -1346,11 +1335,11 @@ else done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else @@ -1358,24 +1347,24 @@ else 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:1362: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then +echo "configure:1351: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi fi -echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$ac_cv_prog_gnu_ld +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1379: checking for $LD option to reload object files" >&5 +echo "configure:1368: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1387,13 +1376,13 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1391: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then +echo "configure:1380: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -1405,27 +1394,27 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1429: checking whether ln -s works" >&5 +echo "configure:1418: 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 @@ -1446,7 +1435,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1450: checking how to recognise dependant libraries" >&5 +echo "configure:1439: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1464,8 +1453,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -1474,8 +1463,8 @@ beos*) ;; bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -1484,14 +1473,27 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -1504,29 +1506,28 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) - case "$LD" in + case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all @@ -1534,25 +1535,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in - alpha* | i*86 | powerpc* | sparc* | ia64* ) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; +newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' @@ -1569,14 +1575,18 @@ solaris*) lt_cv_file_magic_test_file=/lib/libc.so ;; +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; @@ -1589,13 +1599,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1593: checking for object suffix" >&5 +echo "configure:1603: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1615,7 +1625,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1619: checking for executable suffix" >&5 +echo "configure:1629: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1625,10 +1635,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1654,15 +1664,15 @@ fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # Only perform the check for file, if the check method requires it -case "$deplibs_check_method" in +case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1662: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1672: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1678,7 +1688,7 @@ else if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1720,11 +1730,11 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1724: checking for file" >&5 +echo "configure:1734: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1740,7 +1750,7 @@ else if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1791,7 +1801,7 @@ 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 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1795: checking for $ac_word" >&5 +echo "configure:1805: 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 @@ -1823,7 +1833,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:1827: checking for $ac_word" >&5 +echo "configure:1837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1858,7 +1868,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1862: checking for $ac_word" >&5 +echo "configure:1872: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1890,7 +1900,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1894: checking for $ac_word" >&5 +echo "configure:1904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1928,8 +1938,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$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" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. @@ -1954,12 +1964,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1961 "configure"' > conftest.$ac_ext - if { (eval echo configure:1962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case "`/usr/bin/file conftest.o`" in + echo '#line 1971 "configure"' > conftest.$ac_ext + if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1979,7 +1989,7 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1983: checking whether the C compiler needs -belf" >&5 +echo "configure:1993: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1992,14 +2002,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2109,7 +2119,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - @@ -2148,7 +2157,7 @@ fi using_cgen=no -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2255,9 +2264,13 @@ for this_target in $target $canon_targets ; do mips*) cpu_type=mips endian=big ;; pjl*) cpu_type=pj endian=little ;; pj*) cpu_type=pj endian=big ;; - powerpcle*) cpu_type=ppc endian=little ;; + powerpc*le*) cpu_type=ppc endian=little ;; powerpc*) cpu_type=ppc endian=big ;; rs6000*) cpu_type=ppc ;; + s390x*) cpu_type=s390 arch=s390x ;; + s390*) cpu_type=s390 arch=s390 ;; + sh*le) cpu_type=sh endian=little ;; + sh*) cpu_type=sh endian=big ;; sparclite*) cpu_type=sparc arch=sparclite ;; sparclet*) cpu_type=sparc arch=sparclet ;; sparc64*) cpu_type=sparc arch=v9-64 ;; @@ -2277,6 +2290,7 @@ for this_target in $target $canon_targets ; do dev=no bfd_gas=no em=generic + mips_stabs_elf= # assign object format case ${generic_target} in @@ -2305,7 +2319,8 @@ for this_target in $target $canon_targets ; do arm-*-linux*aout*) fmt=aout em=linux ;; arm*-*-linux-gnu* | arm*-*-uclinux*) fmt=elf em=linux ;; - arm-*-netbsd*) fmt=aout em=nbsd ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-netbsd* | arm-*-openbsd*) fmt=aout em=nbsd ;; arm-*-oabi | thumb-*-oabi) fmt=elf ;; arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; arm-*-wince) fmt=coff em=wince-pe ;; @@ -2346,6 +2361,7 @@ for this_target in $target $canon_targets ; do h8300-*-rtems*) fmt=coff ;; h8300-*-coff) fmt=coff ;; + h8300-*-elf) fmt=elf ;; h8500-*-rtems*) fmt=coff ;; h8500-*-coff) fmt=coff ;; @@ -2356,8 +2372,16 @@ for this_target in $target $canon_targets ; do i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; i386-*-bsd*) fmt=aout em=386bsd ;; i386-*-netbsd0.8) fmt=aout em=386bsd ;; - i386-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes;; - i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;; + i386-*-netbsd*) em=nbsd bfd_gas=yes + case ${cpu} in + x86_64) fmt=elf ;; + *) case ${os} in + *elf*) fmt=elf ;; + *) fmt=aout ;; + esac + ;; + esac + ;; i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;; i386-*-linux*coff*) fmt=coff em=linux ;; @@ -2416,8 +2440,10 @@ EOF i960-*-elf*) fmt=elf ;; ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; ia64-*-linux-gnu*) fmt=elf em=linux ;; ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; m32r-*-*) fmt=elf bfd_gas=yes ;; @@ -2439,7 +2465,9 @@ EOF m68k-*-linux-gnu*) fmt=elf em=linux ;; m68k-*-gnu*) fmt=elf ;; m68k-*-lynxos*) fmt=coff em=lynx ;; - m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; + m68k-*-netbsdaout* | m68k-*-netbsd*) + fmt=aout em=nbsd bfd_gas=yes ;; m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; m68k-apple-aux*) fmt=coff em=aux ;; m68k-*-psos*) fmt=elf em=psos;; @@ -2451,7 +2479,6 @@ EOF mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; # don't change em like *-*-bsd does - mips-dec-netbsd*) fmt=elf endian=little ;; mips-dec-openbsd*) fmt=elf endian=little ;; mips-dec-bsd*) fmt=aout endian=little ;; mips-sony-bsd*) fmt=ecoff ;; @@ -2465,26 +2492,17 @@ EOF mips-*-irix*) fmt=ecoff ;; mips-*-lnews*) fmt=ecoff em=lnews ;; mips-*-riscos*) fmt=ecoff ;; - mips-*-linux-gnu*) - fmt=elf em=tmips - cat >> confdefs.h <<\EOF -#define MIPS_STABS_ELF 1 -EOF - - ;; + mips*-*-linux*) fmt=elf em=tmips mips_stabs_elf=y ;; mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; mips-*-sysv*) fmt=ecoff ;; - mips-*-elf* | mips-*-rtems* | mips-*-openbsd*) + mips-*-elf* | mips-*-rtems* | mips-*-netbsd* | mips-*-openbsd*) fmt=elf ;; - mips-*-vxworks*) fmt=elf - cat >> confdefs.h <<\EOF -#define MIPS_STABS_ELF 1 -EOF - - ;; + mips-*-vxworks*) fmt=elf mips_stabs_elf=y ;; + mmix-*-*) fmt=elf bfd_gas=yes ;; mn10200-*-*) fmt=elf bfd_gas=yes ;; mn10300-*-*) fmt=elf bfd_gas=yes ;; + openrisc-*-*) fmt=elf bfd_gas=yes ;; pj*) fmt=elf ;; ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*) fmt=coff em=pe ;; @@ -2515,10 +2533,20 @@ EOF ppc-*-netware*) fmt=elf em=ppcnw ;; ppc-*-vxworks*) fmt=elf ;; - sh-*-linux*) fmt=elf em=linux ;; + s390x-*-linux-gnu*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in + sh*eb) + endian=big ;; + sh*) + endian=little ;; + esac ;; + sh*-*-netbsdelf*) fmt=elf em=nbsd ;; sh-*-elf*) fmt=elf ;; sh-*-coff*) fmt=coff bfd_gas=yes;; - sh-*-pe*) fmt=coff em=pe bfd_gas=yes;; + sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; sh-*-rtemself*) fmt=elf ;; sh-*-rtems*) fmt=coff bfd_gas=yes;; @@ -2569,12 +2597,13 @@ EOF fmt=aout ;; vax-*-vms) fmt=vms ;; + w65-*-*) fmt=coff ;; + + xstormy16-*-*) fmt=elf bfd_gas=yes ;; z8k-*-coff | z8k-*-sim) fmt=coff ;; - w65-*-*) fmt=coff ;; - *-*-aout | *-*-scout) fmt=aout ;; *-*-freebsd*) fmt=elf em=freebsd bfd_gas=yes ;; @@ -2607,6 +2636,13 @@ EOF fi fi + if test x${mips_stabs_elf} != x; then + cat >> confdefs.h <<\EOF +#define MIPS_STABS_ELF 1 +EOF + + fi + case ${cpu_type}-${fmt} in alpha*-*) bfd_gas=yes ;; arm-*) bfd_gas=yes ;; @@ -2615,6 +2651,7 @@ EOF ia64*-*) bfd_gas=yes ;; mips-*) bfd_gas=yes ;; ns32k-*) bfd_gas=yes ;; + pdp11-*) bfd_gas=yes ;; ppc-*) bfd_gas=yes ;; sparc-*) bfd_gas=yes ;; strongarm-*) bfd_gas=yes ;; @@ -2653,7 +2690,7 @@ EOF # Any other special object files needed ? case ${cpu_type} in - fr30 | m32r) + fr30 | m32r | openrisc) using_cgen=yes ;; @@ -2681,7 +2718,7 @@ EOF fi ;; - i386) + i386 | s390 | sparc) if test $this_target = $target ; then cat >> confdefs.h <> confdefs.h <&6 -echo "configure:3077: checking for $ac_word" >&5 +echo "configure:3112: 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 @@ -3103,7 +3138,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:3107: checking for $ac_word" >&5 +echo "configure:3142: 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 @@ -3154,7 +3189,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3158: checking for $ac_word" >&5 +echo "configure:3193: 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 @@ -3186,7 +3221,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3190: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:3225: 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. @@ -3197,12 +3232,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 3201 "configure" +#line 3236 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -3228,12 +3263,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:3232: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:3267: 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:3237: checking whether we are using GNU C" >&5 +echo "configure:3272: 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 @@ -3242,7 +3277,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3246: \"$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:3281: \"$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 @@ -3261,7 +3296,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:3265: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:3300: 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 @@ -3298,7 +3333,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3302: checking for $ac_word" >&5 +echo "configure:3337: 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 @@ -3329,7 +3364,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3333: checking how to run the C preprocessor" >&5 +echo "configure:3368: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3344,13 +3379,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3361,13 +3396,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3378,13 +3413,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3414,7 +3449,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3418: checking for $ac_word" >&5 +echo "configure:3453: 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 @@ -3447,7 +3482,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3451: checking for $ac_word" >&5 +echo "configure:3486: 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 @@ -3481,7 +3516,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3485: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3520: 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 @@ -3489,7 +3524,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3523,7 +3558,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3527: checking lex output file root" >&5 +echo "configure:3562: 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 @@ -3544,7 +3579,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3548: checking whether yytext is a pointer" >&5 +echo "configure:3583: 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 @@ -3556,14 +3591,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3585,11 +3620,11 @@ EOF fi -ALL_LINGUAS= +ALL_LINGUAS="fr tr" # 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:3593: checking for $ac_word" >&5 +echo "configure:3628: 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 @@ -3617,12 +3652,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3621: checking for ANSI C header files" >&5 +echo "configure:3656: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3630,7 +3665,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3647,7 +3682,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3665,7 +3700,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3686,7 +3721,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3697,7 +3732,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3721,12 +3756,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3725: checking for working const" >&5 +echo "configure:3760: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3796,21 +3831,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3800: checking for inline" >&5 +echo "configure:3835: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3836,12 +3871,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3840: checking for off_t" >&5 +echo "configure:3875: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3869,12 +3904,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3873: checking for size_t" >&5 +echo "configure:3908: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3904,19 +3939,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:3908: checking for working alloca.h" >&5 +echo "configure:3943: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3937,12 +3972,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3941: checking for alloca" >&5 +echo "configure:3976: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4002,12 +4037,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4006: checking whether alloca needs Cray hooks" >&5 +echo "configure:4041: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4036: checking for $ac_func" >&5 +echo "configure:4071: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4087,7 +4122,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4091: checking stack direction for C alloca" >&5 +echo "configure:4126: 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 @@ -4095,7 +4130,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4139,17 +4174,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:4143: checking for $ac_hdr" >&5 +echo "configure:4178: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4178,12 +4213,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4182: checking for $ac_func" >&5 +echo "configure:4217: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4231,7 +4266,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4235: checking for working mmap" >&5 +echo "configure:4270: 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 @@ -4239,7 +4274,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4407,17 +4442,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4411: checking for $ac_hdr" >&5 +echo "configure:4446: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4447,12 +4482,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4451: checking for $ac_func" >&5 +echo "configure:4486: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4504,12 +4539,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4508: checking for $ac_func" >&5 +echo "configure:4543: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4566,19 +4601,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4570: checking for LC_MESSAGES" >&5 +echo "configure:4605: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4599,7 +4634,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4603: checking whether NLS is requested" >&5 +echo "configure:4638: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4619,7 +4654,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4623: checking whether included gettext is requested" >&5 +echo "configure:4658: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4638,17 +4673,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4642: checking for libintl.h" >&5 +echo "configure:4677: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4665,19 +4700,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4669: checking for gettext in libc" >&5 +echo "configure:4704: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4693,7 +4728,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4697: checking for bindtextdomain in -lintl" >&5 +echo "configure:4732: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4701,7 +4736,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4728,19 +4763,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4732: checking for gettext in libintl" >&5 +echo "configure:4767: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4768,7 +4803,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4772: checking for $ac_word" >&5 +echo "configure:4807: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4802,12 +4837,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4806: checking for $ac_func" >&5 +echo "configure:4841: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4857,7 +4892,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4861: checking for $ac_word" >&5 +echo "configure:4896: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4893,7 +4928,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4897: checking for $ac_word" >&5 +echo "configure:4932: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4925,7 +4960,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4965,7 +5000,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4969: checking for $ac_word" >&5 +echo "configure:5004: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4999,7 +5034,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5003: checking for $ac_word" >&5 +echo "configure:5038: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5035,7 +5070,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5039: checking for $ac_word" >&5 +echo "configure:5074: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5125,7 +5160,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5129: checking for catalogs to be installed" >&5 +echo "configure:5164: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5153,17 +5188,17 @@ echo "configure:5129: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5157: checking for linux/version.h" >&5 +echo "configure:5192: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5208,7 +5243,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -5226,7 +5261,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5230: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:5265: 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" @@ -5251,7 +5286,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5255: checking for executable suffix" >&5 +echo "configure:5290: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5261,10 +5296,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:5265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:5300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -5286,17 +5321,17 @@ for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h e do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5290: checking for $ac_hdr" >&5 +echo "configure:5325: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5326,7 +5361,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5330: checking whether compiling a cross-assembler" >&5 +echo "configure:5365: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -5341,19 +5376,19 @@ echo "$ac_t""$cross_gas" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5345: checking for working alloca.h" >&5 +echo "configure:5380: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5374,12 +5409,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5378: checking for alloca" >&5 +echo "configure:5413: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5439,12 +5474,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5443: checking whether alloca needs Cray hooks" >&5 +echo "configure:5478: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5473: checking for $ac_func" >&5 +echo "configure:5508: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5524,7 +5559,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5528: checking stack direction for C alloca" >&5 +echo "configure:5563: 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 @@ -5532,7 +5567,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5573,21 +5608,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5577: checking for inline" >&5 +echo "configure:5612: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5617,12 +5652,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5621: checking for $ac_func" >&5 +echo "configure:5656: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5674,12 +5709,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5678: checking for $ac_func" >&5 +echo "configure:5713: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5731,13 +5766,13 @@ done case "${need_libm}" in yes) LIBM= -case "$host" in +case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; *-ncr-sysv4.3*) echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5741: checking for _mwvalidcheckl in -lmw" >&5 +echo "configure:5776: checking for _mwvalidcheckl in -lmw" >&5 ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5745,7 +5780,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5777,7 +5812,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5781: checking for main in -lm" >&5 +echo "configure:5816: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5785,14 +5820,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5815,7 +5850,7 @@ fi ;; *) echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5819: checking for main in -lm" >&5 +echo "configure:5854: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5823,14 +5858,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5861,12 +5896,12 @@ esac # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5865: checking for working assert macro" >&5 +echo "configure:5900: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5882,7 +5917,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5923,12 +5958,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5927: checking whether declaration is required for strstr" >&5 +echo "configure:5962: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -5960,12 +5995,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5964: checking whether declaration is required for malloc" >&5 +echo "configure:5999: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -5997,12 +6032,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6001: checking whether declaration is required for free" >&5 +echo "configure:6036: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -6034,12 +6069,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6038: checking whether declaration is required for sbrk" >&5 +echo "configure:6073: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -6071,12 +6106,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6075: checking whether declaration is required for environ" >&5 +echo "configure:6110: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -6111,12 +6146,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6115: checking whether declaration is required for errno" >&5 +echo "configure:6150: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff --git a/contrib/binutils/gas/configure.in b/contrib/binutils/gas/configure.in index 4250cf2..0be9d21 100644 --- a/contrib/binutils/gas/configure.in +++ b/contrib/binutils/gas/configure.in @@ -44,7 +44,7 @@ esac])dnl using_cgen=no -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -139,9 +139,13 @@ changequote([,])dnl mips*) cpu_type=mips endian=big ;; pjl*) cpu_type=pj endian=little ;; pj*) cpu_type=pj endian=big ;; - powerpcle*) cpu_type=ppc endian=little ;; + powerpc*le*) cpu_type=ppc endian=little ;; powerpc*) cpu_type=ppc endian=big ;; rs6000*) cpu_type=ppc ;; + s390x*) cpu_type=s390 arch=s390x ;; + s390*) cpu_type=s390 arch=s390 ;; + sh*le) cpu_type=sh endian=little ;; + sh*) cpu_type=sh endian=big ;; sparclite*) cpu_type=sparc arch=sparclite ;; sparclet*) cpu_type=sparc arch=sparclet ;; sparc64*) cpu_type=sparc arch=v9-64 ;; @@ -161,6 +165,7 @@ changequote([,])dnl dev=no bfd_gas=no em=generic + mips_stabs_elf= # assign object format case ${generic_target} in @@ -189,7 +194,8 @@ changequote([,])dnl arm-*-linux*aout*) fmt=aout em=linux ;; arm*-*-linux-gnu* | arm*-*-uclinux*) fmt=elf em=linux ;; - arm-*-netbsd*) fmt=aout em=nbsd ;; + arm-*-netbsdelf*) fmt=elf em=nbsd ;; + arm-*-netbsd* | arm-*-openbsd*) fmt=aout em=nbsd ;; arm-*-oabi | thumb-*-oabi) fmt=elf ;; arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; arm-*-wince) fmt=coff em=wince-pe ;; @@ -230,6 +236,7 @@ changequote([,])dnl h8300-*-rtems*) fmt=coff ;; h8300-*-coff) fmt=coff ;; + h8300-*-elf) fmt=elf ;; h8500-*-rtems*) fmt=coff ;; h8500-*-coff) fmt=coff ;; @@ -240,8 +247,16 @@ changequote([,])dnl i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; i386-*-bsd*) fmt=aout em=386bsd ;; i386-*-netbsd0.8) fmt=aout em=386bsd ;; - i386-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes;; - i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;; + i386-*-netbsd*) em=nbsd bfd_gas=yes + case ${cpu} in + x86_64) fmt=elf ;; + *) case ${os} in + *elf*) fmt=elf ;; + *) fmt=aout ;; + esac + ;; + esac + ;; i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;; i386-*-linux*coff*) fmt=coff em=linux ;; @@ -297,8 +312,10 @@ changequote([,])dnl i960-*-elf*) fmt=elf ;; ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; ia64-*-linux-gnu*) fmt=elf em=linux ;; ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; m32r-*-*) fmt=elf bfd_gas=yes ;; @@ -320,7 +337,9 @@ changequote([,])dnl m68k-*-linux-gnu*) fmt=elf em=linux ;; m68k-*-gnu*) fmt=elf ;; m68k-*-lynxos*) fmt=coff em=lynx ;; - m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; + m68k-*-netbsdaout* | m68k-*-netbsd*) + fmt=aout em=nbsd bfd_gas=yes ;; m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; m68k-apple-aux*) fmt=coff em=aux ;; m68k-*-psos*) fmt=elf em=psos;; @@ -332,7 +351,6 @@ changequote([,])dnl mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; # don't change em like *-*-bsd does - mips-dec-netbsd*) fmt=elf endian=little ;; mips-dec-openbsd*) fmt=elf endian=little ;; mips-dec-bsd*) fmt=aout endian=little ;; mips-sony-bsd*) fmt=ecoff ;; @@ -346,22 +364,17 @@ changequote([,])dnl mips-*-irix*) fmt=ecoff ;; mips-*-lnews*) fmt=ecoff em=lnews ;; mips-*-riscos*) fmt=ecoff ;; - mips-*-linux-gnu*) - fmt=elf em=tmips - AC_DEFINE(MIPS_STABS_ELF, 1, - [Use ELF stabs for MIPS, not ECOFF stabs]) - ;; + mips*-*-linux*) fmt=elf em=tmips mips_stabs_elf=y ;; mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; mips-*-sysv*) fmt=ecoff ;; - mips-*-elf* | mips-*-rtems* | mips-*-openbsd*) + mips-*-elf* | mips-*-rtems* | mips-*-netbsd* | mips-*-openbsd*) fmt=elf ;; - mips-*-vxworks*) fmt=elf - AC_DEFINE(MIPS_STABS_ELF, 1, - [Use ELF stabs for MIPS, not ECOFF stabs]) - ;; + mips-*-vxworks*) fmt=elf mips_stabs_elf=y ;; + mmix-*-*) fmt=elf bfd_gas=yes ;; mn10200-*-*) fmt=elf bfd_gas=yes ;; mn10300-*-*) fmt=elf bfd_gas=yes ;; + openrisc-*-*) fmt=elf bfd_gas=yes ;; pj*) fmt=elf ;; ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*) fmt=coff em=pe ;; @@ -390,10 +403,20 @@ changequote([,])dnl ppc-*-netware*) fmt=elf em=ppcnw ;; ppc-*-vxworks*) fmt=elf ;; - sh-*-linux*) fmt=elf em=linux ;; + s390x-*-linux-gnu*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in + sh*eb) + endian=big ;; + sh*) + endian=little ;; + esac ;; + sh*-*-netbsdelf*) fmt=elf em=nbsd ;; sh-*-elf*) fmt=elf ;; sh-*-coff*) fmt=coff bfd_gas=yes;; - sh-*-pe*) fmt=coff em=pe bfd_gas=yes;; + sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; sh-*-rtemself*) fmt=elf ;; sh-*-rtems*) fmt=coff bfd_gas=yes;; @@ -444,12 +467,13 @@ changequote([,])dnl fmt=aout ;; vax-*-vms) fmt=vms ;; + w65-*-*) fmt=coff ;; + + xstormy16-*-*) fmt=elf bfd_gas=yes ;; z8k-*-coff | z8k-*-sim) fmt=coff ;; - w65-*-*) fmt=coff ;; - *-*-aout | *-*-scout) fmt=aout ;; *-*-freebsd*) fmt=elf em=freebsd bfd_gas=yes ;; @@ -480,6 +504,11 @@ changequote([,])dnl fi fi + if test x${mips_stabs_elf} != x; then + AC_DEFINE(MIPS_STABS_ELF, 1, + [Use ELF stabs for MIPS, not ECOFF stabs]) + fi + case ${cpu_type}-${fmt} in alpha*-*) bfd_gas=yes ;; arm-*) bfd_gas=yes ;; @@ -488,6 +517,7 @@ changequote([,])dnl ia64*-*) bfd_gas=yes ;; mips-*) bfd_gas=yes ;; ns32k-*) bfd_gas=yes ;; + pdp11-*) bfd_gas=yes ;; ppc-*) bfd_gas=yes ;; sparc-*) bfd_gas=yes ;; strongarm-*) bfd_gas=yes ;; @@ -526,7 +556,7 @@ changequote([,])dnl # Any other special object files needed ? case ${cpu_type} in - fr30 | m32r) + fr30 | m32r | openrisc) using_cgen=yes ;; @@ -554,16 +584,16 @@ changequote([,])dnl fi ;; - i386) + i386 | s390 | sparc) if test $this_target = $target ; then AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.]) fi ;; - sparc) - if test $this_target = $target ; then - AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.]) - fi + + xstormy16) + using_cgen=yes ;; + *) ;; esac @@ -595,9 +625,9 @@ changequote([,])dnl case ${generic_target}-${fmt} in mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;; - mips-*-linux-gnu*-*) case "$endian" in - big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;; - *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;; + mips*-*-linux*-*) case "$endian" in + big) emulation="mipsbelf mipslelf mipself" ;; + *) emulation="mipslelf mipsbelf mipself" ;; esac ;; mips-*-lnews*-ecoff) ;; mips-*-*-ecoff) case "$endian" in @@ -652,6 +682,7 @@ fi # is emulated. case ${target_cpu} in vax | tahoe ) atof=${target_cpu} ;; + pdp11) atof=vax ;; *) atof=ieee ;; esac @@ -839,7 +870,7 @@ AC_PROG_CC AC_PROG_YACC AM_PROG_LEX -ALL_LINGUAS= +ALL_LINGUAS="fr tr" CY_GNU_GETTEXT AM_MAINTAINER_MODE diff --git a/contrib/binutils/gas/depend.c b/contrib/binutils/gas/depend.c index c6538dd..3c6049d 100644 --- a/contrib/binutils/gas/depend.c +++ b/contrib/binutils/gas/depend.c @@ -1,5 +1,5 @@ /* depend.c - Handle dependency tracking. - Copyright 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,15 +21,16 @@ #include "as.h" /* The file to write to, or NULL if no dependencies being kept. */ -static char *dep_file = NULL; +static char * dep_file = NULL; -struct dependency { - char *file; - struct dependency *next; -}; +struct dependency + { + char * file; + struct dependency * next; + }; /* All the files we depend on. */ -static struct dependency *dep_chain = NULL; +static struct dependency * dep_chain = NULL; /* Current column in output file. */ static int column = 0; @@ -86,9 +87,11 @@ quote_string_for_make (file, src) { char *p = src; int i = 0; + for (;;) { char c = *p++; + switch (c) { case '\0': @@ -102,6 +105,7 @@ quote_string_for_make (file, src) 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) @@ -190,10 +194,10 @@ print_dependencies () if (dep_file == NULL) return; - f = fopen (dep_file, "w"); + f = fopen (dep_file, FOPEN_WT); if (f == NULL) { - as_warn (_("Can't open `%s' for writing"), dep_file); + as_warn (_("can't open `%s' for writing"), dep_file); return; } @@ -205,5 +209,5 @@ print_dependencies () putc ('\n', f); if (fclose (f)) - as_warn (_("Can't close `%s'"), dep_file); + as_warn (_("can't close `%s'"), dep_file); } diff --git a/contrib/binutils/gas/doc/Makefile.am b/contrib/binutils/gas/doc/Makefile.am index 60761a4..566038c 100644 --- a/contrib/binutils/gas/doc/Makefile.am +++ b/contrib/binutils/gas/doc/Makefile.am @@ -5,6 +5,14 @@ AUTOMAKE_OPTIONS = cygnus # What version of the manual you want; "all" includes everything CONFIG=all +# Options to extract the man page from as.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 + man_MANS = as.1 info_TEXINFOS = as.texinfo gasp.texi @@ -30,9 +38,13 @@ CPU_DOCS = \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ + c-m88k.texi \ c-mips.texi \ + c-mmix.texi \ c-ns32k.texi \ + c-pdp11.texi \ c-pj.texi \ + c-ppc.texi \ c-sh.texi \ c-sparc.texi \ c-tic54x.texi \ @@ -54,3 +66,20 @@ noinst_TEXINFOS = internals.texi DISTCLEANFILES = asconfig.texi MAINTAINERCLEANFILES = gasver.texi + +# Maintenance + +# We need it for the taz target in ../../Makefile.in. +info: $(MANS) + +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +as.1: $(srcdir)/as.texinfo + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod + -($(POD2MAN) as.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f as.pod diff --git a/contrib/binutils/gas/doc/Makefile.in b/contrib/binutils/gas/doc/Makefile.in index 1f48577..147c5e7 100644 --- a/contrib/binutils/gas/doc/Makefile.in +++ b/contrib/binutils/gas/doc/Makefile.in @@ -121,6 +121,15 @@ AUTOMAKE_OPTIONS = cygnus # What version of the manual you want; "all" includes everything CONFIG = all +# Options to extract the man page from as.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 + + man_MANS = as.1 info_TEXINFOS = as.texinfo gasp.texi @@ -140,9 +149,13 @@ CPU_DOCS = \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ + c-m88k.texi \ c-mips.texi \ + c-mmix.texi \ c-ns32k.texi \ + c-pdp11.texi \ c-pj.texi \ + c-ppc.texi \ c-sh.texi \ c-sparc.texi \ c-tic54x.texi \ @@ -447,6 +460,23 @@ gasver.texi: Makefile as.info: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) as.dvi: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) +# Maintenance + +# We need it for the taz target in ../../Makefile.in. +info: $(MANS) + +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +as.1: $(srcdir)/as.texinfo + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod + -($(POD2MAN) as.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f as.pod + # 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 719c80a..9253203 100644 --- a/contrib/binutils/gas/doc/all.texi +++ b/contrib/binutils/gas/doc/all.texi @@ -41,9 +41,13 @@ @set M32R @set M68HC11 @set M680X0 +@set M880X0 @set MCORE @set MIPS +@set MMIX +@set PDP11 @set PJ +@set PPC @set SH @set SPARC @set C54X diff --git a/contrib/binutils/gas/doc/as.texinfo b/contrib/binutils/gas/doc/as.texinfo index 01b3c50..3d7fef5 100644 --- a/contrib/binutils/gas/doc/as.texinfo +++ b/contrib/binutils/gas/doc/as.texinfo @@ -13,12 +13,50 @@ @c %**start of header @setfilename as.info @c ---config--- +@macro gcctabopt{body} +@code{\body\} +@end macro @c defaults, config file may override: @set have-stabs @c --- @include asconfig.texi @include gasver.texi @c --- +@c man begin NAME +@ifset man +@c Configure for the generation of man pages +@set AS as +@set TARGET TARGET +@set GENERIC +@set A29K +@set ARC +@set ARM +@set D10V +@set D30V +@set H8/300 +@set H8/500 +@set HPPA +@set I370 +@set I80386 +@set I860 +@set I960 +@set M32R +@set M68HC11 +@set M680X0 +@set M880X0 +@set MCORE +@set MIPS +@set MMIX +@set PDP11 +@set PJ +@set PPC +@set SH +@set SPARC +@set C54X +@set V850 +@set VAX +@end ifset +@c man end @c common OR combinations of conditions @ifset AOUT @set aout-bout @@ -88,14 +126,17 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the GNU Assembler "@value{AS}". +@c man begin COPYRIGHT Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections, with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + +@c man end @ignore Permission is granted to process this file through Tex and print the @@ -118,7 +159,7 @@ notice identical to this one except for the removal of this paragraph @sp 13 The Free Software Foundation Inc. thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the -first (Vax) version of @code{as} for Project @sc{gnu}. +first (Vax) version of @command{as} for Project @sc{gnu}. The proprietors, management and staff of TNCCA thank FSF for distracting the boss while they got some work done. @@ -154,10 +195,10 @@ Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Sof @node Top @top Using @value{AS} -This file is a user guide to the @sc{gnu} assembler @code{@value{AS}} version +This file is a user guide to the @sc{gnu} assembler @command{@value{AS}} version @value{VERSION}. @ifclear GENERIC -This version of the file describes @code{@value{AS}} configured to generate +This version of the file describes @command{@value{AS}} configured to generate code for @value{TARGET} architectures. @end ifclear @@ -184,9 +225,9 @@ section entitled "GNU Free Documentation License". @node Overview @chapter Overview @iftex -This manual is a user guide to the @sc{gnu} assembler @code{@value{AS}}. +This manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}. @ifclear GENERIC -This version of the manual describes @code{@value{AS}} configured to generate +This version of the manual describes @command{@value{AS}} configured to generate code for @value{TARGET} architectures. @end ifclear @end iftex @@ -194,45 +235,64 @@ code for @value{TARGET} architectures. @cindex invocation summary @cindex option summary @cindex summary of options -Here is a brief summary of how to invoke @code{@value{AS}}. For details, +Here is a brief summary of how to invoke @command{@value{AS}}. For details, @pxref{Invoking,,Comand-Line Options}. +@c man title AS the portable GNU assembler. + +@ignore +@c man begin SEEALSO +gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. +@c man end +@end ignore + @c We don't use deffn and friends for the following because they seem @c to be limited to one line for the header. @smallexample -@value{AS} [ -a[cdhlns][=file] ] [ -D ] [ --defsym @var{sym}=@var{val} ] - [ -f ] [ --gstabs ] [ --gdwarf2 ] [ --help ] [ -I @var{dir} ] [ -J ] [ -K ] [ -L ] - [ --keep-locals ] [ -o @var{objfile} ] [ -R ] [ --statistics ] [ -v ] - [ -version ] [ --version ] [ -W ] [ --warn ] [ --fatal-warnings ] - [ -w ] [ -x ] [ -Z ] [ --target-help ] +@c man begin SYNOPSIS +@value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{-D}] [@b{--defsym} @var{sym}=@var{val}] + [@b{-f}] [@b{--gstabs}] [@b{--gdwarf2}] [@b{--help}] [@b{-I} @var{dir}] + [@b{-J}] [@b{-K}] [@b{-L}] + [@b{--listing-lhs-width}=@var{NUM}] [@b{--listing-lhs-width2}=@var{NUM}] + [@b{--listing-rhs-width}=@var{NUM}] [@b{--listing-cont-lines}=@var{NUM}] + [@b{--keep-locals}] [@b{-o} @var{objfile}] [@b{-R}] [@b{--statistics}] [@b{-v}] + [@b{-version}] [@b{--version}] [@b{-W}] [@b{--warn}] [@b{--fatal-warnings}] + [@b{-w}] [@b{-x}] [@b{-Z}] [@b{--target-help}] [@var{target-options}] + [@b{--}|@var{files} @dots{}] +@c +@c Target dependent options are listed below. Keep the list sorted. +@c Add an empty line for separation. @ifset A29K @c am29k has no machine-dependent assembler options @end ifset @ifset ARC - [ -marc[5|6|7|8] ] - [ -EB | -EL ] + +@emph{Target ARC options:} + [@b{-marc[5|6|7|8]}] + [@b{-EB}|@b{-EL}] @end ifset @ifset ARM - [ -m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]60 | - -m[arm]600 | -m[arm]610 | -m[arm]620 | -m[arm]7[t][[d]m[i]][fe] | -m[arm]70 | - -m[arm]700 | -m[arm]710[c] | -m[arm]7100 | -m[arm]7500 | -m[arm]8 | - -m[arm]810 | -m[arm]9 | -m[arm]920 | -m[arm]920t | -m[arm]9tdmi | - -mstrongarm | -mstrongarm110 | -mstrongarm1100 ] - [ -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t | - -m[arm]v5 | -[arm]v5t | -[arm]v5te ] - [ -mthumb | -mall ] - [ -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu ] - [ -EB | -EL ] - [ -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant ] - [ -mthumb-interwork ] - [ -moabi ] - [ -k ] + +@emph{Target ARM options:} +@c Don't document the deprecated options + [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]] + [@b{-march}=@var{architecture}[+@var{extension}@dots{}]] + [@b{-mfpu}=@var{floating-point-fromat}] + [@b{-mthumb}] + [@b{-EB}|@b{-EL}] + [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}| + @b{-mapcs-reentrant}] + [@b{-mthumb-interwork}] [@b{-moabi}] [@b{-k}] @end ifset @ifset D10V - [ -O ] + +@emph{Target D10V options:} + [@b{-O}] @end ifset @ifset D30V - [ -O | -n | -N ] + +@emph{Target D30V options:} + [@b{-O}|@b{-n}|@b{-N}] @end ifset @ifset H8 @c Hitachi family chips have no machine-dependent assembler options @@ -240,58 +300,113 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details, @ifset HPPA @c HPPA has no machine-dependent assembler options (yet). @end ifset -@ifset PJ - [ -mb | -me ] -@end ifset -@ifset SPARC -@c The order here is important. See c-sparc.texi. - [ -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite - -Av8plus | -Av8plusa | -Av9 | -Av9a ] - [ -xarch=v8plus | -xarch=v8plusa ] [ -bump ] [ -32 | -64 ] -@end ifset -@ifset TIC54X - [ -mcpu=54[123589] | -mcpu=54[56]lp ] [ -mfar-mode | -mf ] - [ -merrors-to-file | -me ] -@end ifset -@ifset Z8000 -@c Z8000 has no machine-dependent assembler options +@ifset I80386 + +@emph{Target i386 options:} + [@b{--32}|@b{--64}] @end ifset @ifset I960 + +@emph{Target i960 options:} @c see md_parse_option in tc-i960.c - [ -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC ] - [ -b ] [ -no-relax ] + [@b{-ACA}|@b{-ACA_A}|@b{-ACB}|@b{-ACC}|@b{-AKA}|@b{-AKB}| + @b{-AKC}|@b{-AMC}] + [@b{-b}] [@b{-no-relax}] @end ifset @ifset M32R - [ --m32rx | --[no-]warn-explicit-parallel-conflicts | --W[n]p ] + +@emph{Target M32R options:} + [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}| + @b{--W[n]p}] @end ifset @ifset M680X0 - [ -l ] [ -m68000 | -m68010 | -m68020 | ... ] -@end ifset -@ifset MCORE - [ -jsri2bsr ] [ -sifilter ] [ -relax ] - [ -mcpu=[210|340] ] + +@emph{Target M680X0 options:} + [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}] @end ifset @ifset M68HC11 - [ -m68hc11 | -m68hc12 ] - [ --force-long-branchs ] [ --short-branchs ] [ --strict-direct-mode ] - [ --print-insn-syntax ] [ --print-opcodes ] [ --generate-example ] + +@emph{Target M68HC11 options:} + [@b{-m68hc11}|@b{-m68hc12}] + [@b{--force-long-branchs}] [@b{--short-branchs}] + [@b{--strict-direct-mode}] [@b{--print-insn-syntax}] + [@b{--print-opcodes}] [@b{--generate-example}] +@end ifset +@ifset MCORE + +@emph{Target MCORE options:} + [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}] + [@b{-mcpu=[210|340]}] @end ifset @ifset MIPS - [ -nocpp ] [ -EL ] [ -EB ] [ -G @var{num} ] [ -mcpu=@var{CPU} ] - [ -mips1 ] [ -mips2 ] [ -mips3 ] [ -mips4 ] [ -mips5 ] - [ -mips32 ] [ -mips64 ] - [ -m4650 ] [ -no-m4650 ] - [ --trap ] [ --break ] - [ --emulation=@var{name} ] -@end ifset - [ -- | @var{files} @dots{} ] + +@emph{Target MIPS options:} + [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-G} @var{num}] [@b{-mcpu}=@var{CPU} ] + [@b{-mips1}] [@b{-mips2}] [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] + [@b{-mips32}] [@b{-mips64}] + [@b{-m4650}] [@b{-no-m4650}] + [@b{--trap}] [@b{--break}] [@b{-n}] + [@b{--emulation}=@var{name} ] +@end ifset +@ifset MMIX + +@emph{Target MMIX options:} + [@b{--fixed-special-register-names}] [@b{--globalize-symbols}] + [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}] + [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}] +@end ifset +@ifset PDP11 + +@emph{Target PDP11 options:} + [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}] + [@b{-m}@var{extension}|@b{-mno-}@var{extension}] + [@b{-m}@var{cpu}] [@b{-m}@var{machine}] +@end ifset +@ifset PJ + +@emph{Target picoJava options:} + [@b{-mb}|@b{-me}] +@end ifset +@ifset PPC + +@emph{Target PowerPC options:} + [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}| + @b{-m403}|@b{-m405}|@b{-mppc64}|@b{-m620}|@b{-mppc64bridge}|@b{-mbooke}| + @b{-mbooke32}|@b{-mbooke64}] + [@b{-mcom}|@b{-many}|@b{-maltivec}] [@b{-memb}] + [@b{-mregnames}|@b{-mno-regnames}] + [@b{-mrelocatable}|@b{-mrelocatable-lib}] + [@b{-mlittle}|@b{-mlittle-endian}|@b{-mbig}|@b{-mbig-endian}] + [@b{-msolaris}|@b{-mno-solaris}] +@end ifset +@ifset SPARC + +@emph{Target SPARC options:} +@c The order here is important. See c-sparc.texi. + [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Asparclet}|@b{-Asparclite} + @b{-Av8plus}|@b{-Av8plusa}|@b{-Av9}|@b{-Av9a}] + [@b{-xarch=v8plus}|@b{-xarch=v8plusa}] [@b{-bump}] + [@b{-32}|@b{-64}] +@end ifset +@ifset TIC54X + +@emph{Target TIC54X options:} + [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}] + [@b{-merrors-to-file} @var{}|@b{-me} @var{}] +@end ifset +@ifset Z8000 +@c Z8000 has no machine-dependent assembler options +@end ifset +@c man end @end smallexample -@table @code +@c man begin OPTIONS + +@table @gcctabopt @item -a[cdhlmns] Turn on listings, in any of a variety of ways: -@table @code +@table @gcctabopt @item -ac omit false conditionals @@ -369,8 +484,24 @@ 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 --listing-lhs-width=@var{number} +Set the maximum width, in words, of the output data column for an assembler +listing to @var{number}. + +@item --listing-lhs-width2=@var{number} +Set the maximum width, in words, of the output data column for continuation +lines in an assembler listing to @var{number}. + +@item --listing-rhs-width=@var{number} +Set the maximum width of an input source line, as displayed in a listing, to +@var{number} bytes. + +@item --listing-cont-lines=@var{number} +Set the maximum number of lines printed in a listing for a single line of input +to @var{number} + 1. + @item -o @var{objfile} -Name the object-file output from @code{@value{AS}} @var{objfile}. +Name the object-file output from @command{@value{AS}} @var{objfile}. @item -R Fold the data section into the text section. @@ -384,10 +515,10 @@ Remove local absolute symbols from the outgoing symbol table. @item -v @itemx -version -Print the @code{as} version. +Print the @command{as} version. @item --version -Print the @code{as} version and exit. +Print the @command{as} version and exit. @item -W @itemx --no-warn @@ -417,7 +548,7 @@ Standard input, or source files to assemble. The following options are available when @value{AS} is configured for an ARC processor. -@table @code +@table @gcctabopt @item -marc[5|6|7|8] This option selects the core processor variant. @item -EB | -EL @@ -429,15 +560,15 @@ Select either big-endian (-EB) or little-endian (-EL) output. The following options are available when @value{AS} is configured for the ARM processor family. -@table @code -@item -m[arm][1|2|3|6|7|8|9][...] +@table @gcctabopt +@item -mcpu=@var{processor}[+@var{extension}@dots{}] Specify which ARM processor variant is the target. -@item -m[arm]v[2|2a|3|3m|4|4t|5|5t] +@item -march=@var{architecture}[+@var{extension}@dots{}] Specify which ARM architecture variant is used by the target. -@item -mthumb | -mall -Enable or disable Thumb only instruction decoding. -@item -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu +@item -mfpu=@var{floating-point-format} Select which Floating Point architecture is the target. +@item -mthumb +Enable Thumb only instruction decoding. @item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant | -moabi Select which procedure calling convention is in use. @item -EB | -EL @@ -453,7 +584,7 @@ Specify that PIC code has been generated. @ifset D10V The following options are available when @value{AS} is configured for a D10V processor. -@table @code +@table @gcctabopt @cindex D10V optimization @cindex optimization, D10V @item -O @@ -464,7 +595,7 @@ Optimize output by parallelizing instructions. @ifset D30V The following options are available when @value{AS} is configured for a D30V processor. -@table @code +@table @gcctabopt @cindex D30V optimization @cindex optimization, D30V @item -O @@ -484,7 +615,7 @@ Warn when a nop after a 32-bit multiply instruction is generated. The following options are available when @value{AS} is configured for the Intel 80960 processor. -@table @code +@table @gcctabopt @item -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC Specify which variant of the 960 architecture is the target. @@ -502,7 +633,7 @@ error if necessary. The following options are available when @value{AS} is configured for the Mitsubishi M32R series. -@table @code +@table @gcctabopt @item --m32rx Specify which processor in the M32R family is the target. The default @@ -523,13 +654,14 @@ encountered. The following options are available when @value{AS} is configured for the Motorola 68000 series. -@table @code +@table @gcctabopt @item -l Shorten references to undefined symbols, to one word instead of two. -@item -m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060 -@itemx | -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -mcpu32 | -m5200 +@item -m68000 | -m68008 | -m68010 | -m68020 | -m68030 +@itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332 +@itemx | -m68333 | -m68340 | -mcpu32 | -m5200 Specify what processor in the 68000 family is the target. The default is normally the 68020, but this can be changed at configuration time. @@ -547,11 +679,42 @@ unit coprocessor. The default is to assume an MMU for 68020 and up. @end table @end ifset +@ifset PDP11 + +For details about the PDP-11 machine dependent features options, +see @ref{PDP-11-Options}. + +@table @gcctabopt +@item -mpic | -mno-pic +Generate position-independent (or position-dependent) code. The +default is @option{-mpic}. + +@item -mall +@itemx -mall-extensions +Enable all instruction set extensions. This is the default. + +@item -mno-extensions +Disable all instruction set extensions. + +@item -m@var{extension} | -mno-@var{extension} +Enable (or disable) a particular instruction set extension. + +@item -m@var{cpu} +Enable the instruction set extensions supported by a particular CPU, and +disable all other extensions. + +@item -m@var{machine} +Enable the instruction set extensions supported by a particular machine +model, and disable all other extensions. +@end table + +@end ifset + @ifset PJ The following options are available when @value{AS} is configured for a picoJava processor. -@table @code +@table @gcctabopt @cindex PJ endianness @cindex endianness, PJ @@ -570,7 +733,7 @@ Generate ``little endian'' format output. The following options are available when @value{AS} is configured for the Motorola 68HC11 or 68HC12 series. -@table @code +@table @gcctabopt @item -m68hc11 | -m68hc12 Specify what processor is the target. The default is @@ -597,16 +760,16 @@ print the list of instructions with syntax and then exit. @item --generate-example print an example of instruction for each possible instruction and then exit. -This option is only useful for testing @code{@value{AS}}. +This option is only useful for testing @command{@value{AS}}. @end table @end ifset @ifset SPARC -The following options are available when @code{@value{AS}} is configured +The following options are available when @command{@value{AS}} is configured for the SPARC architecture: -@table @code +@table @gcctabopt @item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite @itemx -Av8plus | -Av8plusa | -Av9 | -Av9a Explicitly select a variant of the SPARC architecture. @@ -630,7 +793,7 @@ Warn when the assembler switches to another architecture. The following options are available when @value{AS} is configured for the 'c54x architecture. -@table @code +@table @gcctabopt @item -mfar-mode Enable extended addressing mode. All addresses and relocations will assume extended addressing (usually 23 bits). @@ -646,7 +809,7 @@ behaviour in the shell. The following options are available when @value{AS} is configured for a MIPS processor. -@table @code +@table @gcctabopt @item -G @var{num} This option sets the largest size of an object that can be referenced implicitly with the @code{gp} register. It is only accepted for targets that @@ -668,6 +831,7 @@ Generate ``little endian'' format output. @itemx -mips3 @itemx -mips4 @itemx -mips32 +@itemx -mips64 Generate code for a particular MIPS Instruction Set Architecture level. @samp{-mips1} corresponds to the @sc{r2000} and @sc{r3000} processors, @samp{-mips2} to the @sc{r6000} processor, and @samp{-mips3} to the @sc{r4000} @@ -690,7 +854,7 @@ understood. @cindex emulation @item --emulation=@var{name} -This option causes @code{@value{AS}} to emulate @code{@value{AS}} configured +This option causes @command{@value{AS}} to emulate @command{@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 @@ -703,7 +867,7 @@ in the name. Using @samp{-EB} or @samp{-EL} will override the endianness selection in any case. This option is currently supported only when the primary target -@code{@value{AS}} is configured for is a MIPS ELF or ECOFF target. +@command{@value{AS}} is configured for is a MIPS ELF or ECOFF target. Furthermore, the primary target or others specified with @samp{--enable-targets=@dots{}} at configuration time must include support for the other format, if both are to be available. For example, the Irix 5 @@ -714,7 +878,7 @@ fine-grained control over the assembler's behavior, and will be supported for more processors. @item -nocpp -@code{@value{AS}} ignores this option. It is accepted for compatibility with +@command{@value{AS}} ignores this option. It is accepted for compatibility with the native tools. @need 900 @@ -727,6 +891,10 @@ Control how to deal with multiplication overflow and division by zero. (and only work for Instruction Set Architecture level 2 and higher); @samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a break exception. + +@item -n +When this option is used, @command{@value{AS}} will issue a warning every +time it generates a nop instruction from a macro. @end table @end ifset @@ -734,7 +902,7 @@ break exception. The following options are available when @value{AS} is configured for an MCore processor. -@table @code +@table @gcctabopt @item -jsri2bsr @itemx -nojsri2bsr Enable or disable the JSRI to BSR transformation. By default this is enabled. @@ -761,6 +929,12 @@ Assemble for a little endian target. @end table @end ifset +@ifset MMIX +See the info pages for documentation of the MMIX-specific options. +@end ifset + +@c man end + @menu * Manual:: Structure of this Manual * GNU Assembler:: The GNU Assembler @@ -776,13 +950,13 @@ Assemble for a little endian target. @cindex manual, structure and purpose This manual is intended to describe what you need to know to use -@sc{gnu} @code{@value{AS}}. We cover the syntax expected in source files, including +@sc{gnu} @command{@value{AS}}. We cover the syntax expected in source files, including notation for symbols, constants, and expressions; the directives that -@code{@value{AS}} understands; and of course how to invoke @code{@value{AS}}. +@command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}. @ifclear GENERIC We also cover special features in the @value{TARGET} -configuration of @code{@value{AS}}, including assembler directives. +configuration of @command{@value{AS}}, including assembler directives. @end ifclear @ifset GENERIC This manual also describes some of the machine-dependent features of @@ -828,10 +1002,10 @@ computer (in particular, the kinds of computers that @sc{gnu} can run on); once this assumption is granted examples and definitions need less qualification. -@code{@value{AS}} is part of a team of programs that turn a high-level +@command{@value{AS}} is part of a team of programs that turn a high-level human-readable series of instructions into a low-level computer-readable series of instructions. Different versions of -@code{@value{AS}} are used for different kinds of computer. +@command{@value{AS}} are used for different kinds of computer. @end ignore @c There used to be a section "Terminology" here, which defined @@ -846,9 +1020,11 @@ computer-readable series of instructions. Different versions of @node GNU Assembler @section The GNU Assembler -@sc{gnu} @code{as} is really a family of assemblers. +@c man begin DESCRIPTION + +@sc{gnu} @command{as} is really a family of assemblers. @ifclear GENERIC -This manual describes @code{@value{AS}}, a member of that family which is +This manual describes @command{@value{AS}}, a member of that family which is configured for the @value{TARGET} architectures. @end ifclear If you use (or have used) the @sc{gnu} assembler on one architecture, you @@ -858,9 +1034,9 @@ including object file formats, most assembler directives (often called @dfn{pseudo-ops}) and assembler syntax.@refill @cindex purpose of @sc{gnu} assembler -@code{@value{AS}} is primarily intended to assemble the output of the +@command{@value{AS}} is primarily intended to assemble the output of the @sc{gnu} C compiler @code{@value{GCC}} for use by the linker -@code{@value{LD}}. Nevertheless, we've tried to make @code{@value{AS}} +@code{@value{LD}}. Nevertheless, we've tried to make @command{@value{AS}} assemble correctly everything that other assemblers for the same machine would assemble. @ifset VAX @@ -869,12 +1045,14 @@ Any exceptions are documented explicitly (@pxref{Machine Dependencies}). @ifset M680X0 @c This remark should appear in generic version of manual; assumption @c here is that generic version sets M680x0. -This doesn't mean @code{@value{AS}} always uses the same syntax as another +This doesn't mean @command{@value{AS}} always uses the same syntax as another assembler for the same architecture; for example, we know of several incompatible versions of 680x0 assembly language syntax. @end ifset -Unlike older assemblers, @code{@value{AS}} is designed to assemble a source +@c man end + +Unlike older assemblers, @command{@value{AS}} is designed to assemble a source program in one pass of the source file. This has a subtle impact on the @kbd{.org} directive (@pxref{Org,,@code{.org}}). @@ -889,20 +1067,20 @@ are typically different in different file formats. @xref{Symbol Attributes,,Symbol Attributes}. @ifclear GENERIC @ifclear MULTI-OBJ -On the @value{TARGET}, @code{@value{AS}} is configured to produce +On the @value{TARGET}, @command{@value{AS}} is configured to produce @value{OBJ-NAME} format object files. @end ifclear @c The following should exhaust all configs that set MULTI-OBJ, ideally @ifset A29K -On the @value{TARGET}, @code{@value{AS}} can be configured to produce either +On the @value{TARGET}, @command{@value{AS}} can be configured to produce either @code{a.out} or COFF format object files. @end ifset @ifset I960 -On the @value{TARGET}, @code{@value{AS}} can be configured to produce either +On the @value{TARGET}, @command{@value{AS}} can be configured to produce either @code{b.out} or COFF format object files. @end ifset @ifset HPPA -On the @value{TARGET}, @code{@value{AS}} can be configured to produce either +On the @value{TARGET}, @command{@value{AS}} can be configured to produce either SOM or ELF format object files. @end ifset @end ifclear @@ -911,7 +1089,8 @@ SOM or ELF format object files. @section Command Line @cindex command line conventions -After the program name @code{@value{AS}}, the command line may contain + +After the program name @command{@value{AS}}, the command line may contain options and file names. Options may appear in any order, and may be before, after, or between file names. The order of file names is significant. @@ -919,12 +1098,12 @@ significant. @cindex standard input, as input file @kindex -- @file{--} (two hyphens) by itself names the standard input file -explicitly, as one of the files for @code{@value{AS}} to assemble. +explicitly, as one of the files for @command{@value{AS}} to assemble. @cindex options, command line Except for @samp{--} any command line argument that begins with a hyphen (@samp{-}) is an option. Each option changes the behavior of -@code{@value{AS}}. No option changes the way another option works. An +@command{@value{AS}}. No option changes the way another option works. An option is a @samp{-} followed by one or more letters; the case of the letter is important. All options are optional. @@ -945,7 +1124,7 @@ standard). These two command lines are equivalent: @cindex source program @cindex files, input We use the phrase @dfn{source program}, abbreviated @dfn{source}, to -describe the program input to one run of @code{@value{AS}}. The program may +describe the program input to one run of @command{@value{AS}}. The program may be in one or more files; how the source is partitioned into files doesn't change the meaning of the source. @@ -954,26 +1133,29 @@ doesn't change the meaning of the source. The source program is a concatenation of the text in all the files, in the order specified. -Each time you run @code{@value{AS}} it assembles exactly one source +@c man begin DESCRIPTION +Each time you run @command{@value{AS}} it assembles exactly one source program. The source program is made up of one or more files. (The standard input is also a file.) -You give @code{@value{AS}} a command line that has zero or more input file +You give @command{@value{AS}} a command line that has zero or more input file names. The input files are read (from left file name to right). A command line argument (in any position) that has no special meaning is taken to be an input file name. -If you give @code{@value{AS}} no file names it attempts to read one input file -from the @code{@value{AS}} standard input, which is normally your terminal. You -may have to type @key{ctl-D} to tell @code{@value{AS}} there is no more program +If you give @command{@value{AS}} no file names it attempts to read one input file +from the @command{@value{AS}} standard input, which is normally your terminal. You +may have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program to assemble. Use @samp{--} if you need to explicitly name the standard input file in your command line. -If the source is empty, @code{@value{AS}} produces a small, empty object +If the source is empty, @command{@value{AS}} produces a small, empty object file. +@c man end + @subheading Filenames and Line-numbers @cindex input file linenumbers @@ -984,12 +1166,12 @@ number in a physical file; the other refers to a line number in a ``logical'' file. @xref{Errors, ,Error and Warning Messages}. @dfn{Physical files} are those files named in the command line given -to @code{@value{AS}}. +to @command{@value{AS}}. @dfn{Logical files} are simply names declared explicitly by assembler directives; they bear no relation to physical files. Logical file names help -error messages reflect the original source file, when @code{@value{AS}} source -is itself synthesized from other files. @code{@value{AS}} understands the +error messages reflect the original source file, when @command{@value{AS}} source +is itself synthesized from other files. @command{@value{AS}} understands the @samp{#} directives emitted by the @code{@value{GCC}} preprocessor. See also @ref{File,,@code{.file}}. @@ -1000,7 +1182,7 @@ is itself synthesized from other files. @code{@value{AS}} understands the @cindex output file @kindex a.out @kindex .o -Every time you run @code{@value{AS}} it produces an output file, which is +Every time you run @command{@value{AS}} it produces an output file, which is your assembly language program translated into numbers. This file is the object file. Its default name is @ifclear BOUT @@ -1010,9 +1192,9 @@ is the object file. Its default name is @ifset GENERIC @code{a.out}, or @end ifset -@code{b.out} when @code{@value{AS}} is configured for the Intel 80960. +@code{b.out} when @command{@value{AS}} is configured for the Intel 80960. @end ifset -You can give it another name by using the @code{-o} option. Conventionally, +You can give it another name by using the @option{-o} option. Conventionally, object file names end with @file{.o}. The default name is used for historical reasons: older assemblers were capable of assembling self-contained programs directly into a runnable program. (For some formats, this isn't currently @@ -1031,15 +1213,19 @@ information for the debugger. @node Errors @section Error and Warning Messages +@c man begin DESCRIPTION + @cindex error messages @cindex warning messages @cindex messages from assembler -@code{@value{AS}} may write warnings and error messages to the standard error +@command{@value{AS}} may write warnings and error messages to the standard error file (usually your terminal). This should not happen when a compiler -runs @code{@value{AS}} automatically. Warnings report an assumption made so -that @code{@value{AS}} could keep assembling a flawed program; errors report a +runs @command{@value{AS}} automatically. Warnings report an assumption made so +that @command{@value{AS}} could keep assembling a flawed program; errors report a grave problem that stops the assembly. +@c man end + @cindex format of warning messages Warning messages have the format @@ -1090,7 +1276,9 @@ to the @value{TARGET}. to particular machine architectures. @end ifset -If you are invoking @code{@value{AS}} via the @sc{gnu} C compiler (version 2), +@c man begin DESCRIPTION + +If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler (version 2), you can use the @samp{-Wa} option to pass arguments through to the assembler. The assembler arguments must be separated from each other (and the @samp{-Wa}) by commas. For example: @@ -1110,6 +1298,8 @@ command-line options are automatically passed to the assembler by the compiler. precisely what options it passes to each compilation pass, including the assembler.) +@c man end + @menu * a:: -a[cdhlns] enable listings * D:: -D for compatibility @@ -1123,6 +1313,7 @@ assembler.) @end ifset * L:: -L to retain local labels +* listing:: --listing-XXX to configure listing output * M:: -M or --mri to assemble in MRI compatibility mode * MD:: --MD for dependency tracking * o:: -o to name the object file @@ -1135,7 +1326,7 @@ assembler.) @end menu @node a -@section Enable Listings: @code{-a[cdhlns]} +@section Enable Listings: @option{-a[cdhlns]} @kindex -a @kindex -ac @@ -1176,20 +1367,27 @@ listing-control directives have no effect. The letters after @samp{-a} may be combined into one option, @emph{e.g.}, @samp{-aln}. +Note if the assembler source is coming from the standard input (eg because it +is being created by @code{@value{GCC}} and the @samp{-pipe} command line switch +is being used) then the listing will not contain any comments or preprocessor +directives. This is because the listing code buffers input source lines from +stdin only after they have been preprocessed by the assembler. This reduces +memory usage and makes the code more efficient. + @node D -@section @code{-D} +@section @option{-D} @kindex -D This option has no effect whatsoever, but it is accepted to make it more likely that scripts written for other assemblers also work with -@code{@value{AS}}. +@command{@value{AS}}. @node f -@section Work Faster: @code{-f} +@section Work Faster: @option{-f} @kindex -f @cindex trusted compiler -@cindex faster processing (@code{-f}) +@cindex faster processing (@option{-f}) @samp{-f} should only be used when assembling programs written by a (trusted) compiler. @samp{-f} stops the assembler from doing whitespace and comment preprocessing on @@ -1198,27 +1396,27 @@ the input file(s) before assembling them. @xref{Preprocessing, @quotation @emph{Warning:} if you use @samp{-f} when the files actually need to be -preprocessed (if they contain comments, for example), @code{@value{AS}} does +preprocessed (if they contain comments, for example), @command{@value{AS}} does not work correctly. @end quotation @node I -@section @code{.include} search path: @code{-I} @var{path} +@section @code{.include} search path: @option{-I} @var{path} @kindex -I @var{path} @cindex paths for @code{.include} @cindex search path for @code{.include} @cindex @code{include} directive search path Use this option to add a @var{path} to the list of directories -@code{@value{AS}} searches for files specified in @code{.include} -directives (@pxref{Include,,@code{.include}}). You may use @code{-I} as +@command{@value{AS}} searches for files specified in @code{.include} +directives (@pxref{Include,,@code{.include}}). You may use @option{-I} as many times as necessary to include a variety of paths. The current -working directory is always searched first; after that, @code{@value{AS}} +working directory is always searched first; after that, @command{@value{AS}} searches any @samp{-I} directories in the same order as they were specified (left to right) on the command line. @node K -@section Difference Tables: @code{-K} +@section Difference Tables: @option{-K} @kindex -K @ifclear DIFF-TBL-KLUGE @@ -1233,14 +1431,14 @@ alteration on other platforms. @ifset DIFF-TBL-KLUGE @cindex difference tables, warning @cindex warning for altered difference tables -@code{@value{AS}} sometimes alters the code emitted for directives of the form +@command{@value{AS}} sometimes alters the code emitted for directives of the form @samp{.word @var{sym1}-@var{sym2}}; @pxref{Word,,@code{.word}}. You can use the @samp{-K} option if you want a warning issued when this is done. @end ifset @node L -@section Include Local Labels: @code{-L} +@section Include Local Labels: @option{-L} @kindex -L @cindex local labels, retaining in output @@ -1248,10 +1446,10 @@ Labels beginning with @samp{L} (upper case only) are called @dfn{local labels}. @xref{Symbol Names}. Normally you do not see such labels when debugging, because they are intended for the use of programs (like compilers) that compose assembler programs, not for your notice. -Normally both @code{@value{AS}} and @code{@value{LD}} discard such labels, so you do not +Normally both @command{@value{AS}} and @code{@value{LD}} discard such labels, so you do not normally debug with them. -This option tells @code{@value{AS}} to retain those @samp{L@dots{}} symbols +This option tells @command{@value{AS}} to retain those @samp{L@dots{}} symbols in the object file. Usually if you do this you also tell the linker @code{@value{LD}} to preserve symbols whose names begin with @samp{L}. @@ -1261,19 +1459,58 @@ target is allowed to redefine the local label prefix. On the HPPA local labels begin with @samp{L$}. @end ifset +@node listing +@section Configuring listing output: @option{--listing} + +The listing feature of the assembler can be enabled via the command line switch +@samp{-a} (@pxref{a}). This feature combines the input source file(s) with a +hex dump of the corresponding locations in the output object file, and displays +them as a listing file. The format of this listing can be controlled by pseudo +ops inside the assembler source (@pxref{List} @pxref{Title} @pxref{Sbttl} +@pxref{Psize} @pxref{Eject}) and also by the following switches: + +@table @gcctabopt +@item --listing-lhs-width=@samp{number} +@kindex --listing-lhs-width +@cindex Width of first line disassembly output +Sets the maximum width, in words, of the first line of the hex byte dump. This +dump appears on the left hand side of the listing output. + +@item --listing-lhs-width2=@samp{number} +@kindex --listing-lhs-width2 +@cindex Width of continuation lines of disassembly output +Sets the maximum width, in words, of any further lines of the hex byte dump for +a given inut source line. If this value is not specified, it defaults to being +the same as the value specified for @samp{--listing-lhs-width}. If neither +switch is used the default is to one. + +@item --listing-rhs-width=@samp{number} +@kindex --listing-rhs-width +@cindex Width of source line output +Sets the maximum width, in characters, of the source line that is displayed +alongside the hex dump. The default value for this parameter is 100. The +source line is displayed on the right hand side of the listing output. + +@item --listing-cont-lines=@samp{number} +@kindex --listing-cont-lines +@cindex Maximum number of continuation lines +Sets the maximum number of continuation lines of hex dump that will be +displayed for a given single line of source input. The default value is 4. +@end table + @node M -@section Assemble in MRI Compatibility Mode: @code{-M} +@section Assemble in MRI Compatibility Mode: @option{-M} @kindex -M @cindex MRI compatibility mode -The @code{-M} or @code{--mri} option selects MRI compatibility mode. This -changes the syntax and pseudo-op handling of @code{@value{AS}} to make it +The @option{-M} or @option{--mri} option selects MRI compatibility mode. This +changes the syntax and pseudo-op handling of @command{@value{AS}} to make it compatible with the @code{ASM68K} or the @code{ASM960} (depending upon the configured target) assembler from Microtec Research. The exact nature of the MRI syntax will not be documented here; see the MRI manuals for more information. Note in particular that the handling of macros and macro arguments is somewhat different. The purpose of this option is to permit -assembling existing MRI assembler code using @code{@value{AS}}. +assembling existing MRI assembler code using @command{@value{AS}}. The MRI compatibility is not complete. Certain operations of the MRI assembler depend upon its object file format, and can not be supported using other object @@ -1284,7 +1521,7 @@ individually. These are: @item global symbols in common section The m68k MRI assembler supports common sections which are merged by the linker. -Other object file formats do not support this. @code{@value{AS}} handles +Other object file formats do not support this. @command{@value{AS}} handles common sections by treating them as a single common symbol. It permits local symbols to be defined within a common section, but it can not support global symbols, since it has no way to describe them. @@ -1299,7 +1536,7 @@ are not support by other object file formats. The MRI @code{END} pseudo-op permits the specification of a start address. This is not supported by other object file formats. The start address may -instead be specified using the @code{-e} option to the linker, or in a linker +instead be specified using the @option{-e} option to the linker, or in a linker script. @item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops @@ -1310,14 +1547,14 @@ name to the output file. This is not supported by other object file formats. @item @code{ORG} pseudo-op The m68k MRI @code{ORG} pseudo-op begins an absolute section at a given -address. This differs from the usual @code{@value{AS}} @code{.org} pseudo-op, +address. This differs from the usual @command{@value{AS}} @code{.org} pseudo-op, which changes the location within the current section. Absolute sections are not supported by other object file formats. The address of a section may be assigned within a linker script. @end itemize There are some other features of the MRI assembler which are not supported by -@code{@value{AS}}, typically either because they are difficult or because they +@command{@value{AS}}, typically either because they are difficult or because they seem of little consequence. Some of these may be supported in future releases. @itemize @bullet @@ -1342,7 +1579,7 @@ The m68k @code{NOOBJ} pseudo-op is not supported. @item @code{OPT} branch control options The m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB}, -@code{BRL}, and @code{BRW}---are ignored. @code{@value{AS}} automatically +@code{BRL}, and @code{BRW}---are ignored. @command{@value{AS}} automatically relaxes all branches, whether forward or backward, to an appropriate size, so these options serve no purpose. @@ -1393,13 +1630,13 @@ The i960 @code{.setreal} pseudo-op is not supported. @end itemize @node MD -@section Dependency tracking: @code{--MD} +@section Dependency tracking: @option{--MD} @kindex --MD @cindex dependency tracking @cindex make rules -@code{@value{AS}} can generate a dependency file for the file it creates. This +@command{@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. @@ -1408,12 +1645,12 @@ 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} +@section Name the Object File: @option{-o} @kindex -o @cindex naming object file @cindex object file name -There is always one object file output when you run @code{@value{AS}}. By +There is always one object file output when you run @command{@value{AS}}. By default it has the name @ifset GENERIC @ifset I960 @@ -1434,65 +1671,65 @@ default it has the name You use this option (which takes exactly one filename) to give the object file a different name. -Whatever the object file is called, @code{@value{AS}} overwrites any +Whatever the object file is called, @command{@value{AS}} overwrites any existing file of the same name. @node R -@section Join Data and Text Sections: @code{-R} +@section Join Data and Text Sections: @option{-R} @kindex -R @cindex data and text sections, joining @cindex text and data sections, joining @cindex joining text and data sections @cindex merging text and data sections -@code{-R} tells @code{@value{AS}} to write the object file as if all +@option{-R} tells @command{@value{AS}} to write the object file as if all data-section data lives in the text section. This is only done at the very last moment: your binary data are the same, but data section parts are relocated differently. The data section part of your object file is zero bytes long because all its bytes are appended to the text section. (@xref{Sections,,Sections and Relocation}.) -When you specify @code{-R} it would be possible to generate shorter +When you specify @option{-R} it would be possible to generate shorter address displacements (because we do not have to cross between text and data section). We refrain from doing this simply for compatibility with -older versions of @code{@value{AS}}. In future, @code{-R} may work this way. +older versions of @command{@value{AS}}. In future, @option{-R} may work this way. @ifset COFF -When @code{@value{AS}} is configured for COFF output, +When @command{@value{AS}} is configured for COFF output, this option is only useful if you use sections named @samp{.text} and @samp{.data}. @end ifset @ifset HPPA -@code{-R} is not supported for any of the HPPA targets. Using -@code{-R} generates a warning from @code{@value{AS}}. +@option{-R} is not supported for any of the HPPA targets. Using +@option{-R} generates a warning from @command{@value{AS}}. @end ifset @node statistics -@section Display Assembly Statistics: @code{--statistics} +@section Display Assembly Statistics: @option{--statistics} @kindex --statistics @cindex statistics, about assembly @cindex time, total for assembly @cindex space used, maximum for assembly Use @samp{--statistics} to display two statistics about the resources used by -@code{@value{AS}}: the maximum amount of space allocated during the assembly +@command{@value{AS}}: the maximum amount of space allocated during the assembly (in bytes), and the total execution time taken for the assembly (in @sc{cpu} seconds). @node traditional-format -@section Compatible output: @code{--traditional-format} +@section Compatible output: @option{--traditional-format} @kindex --traditional-format -For some targets, the output of @code{@value{AS}} is different in some ways +For some targets, the output of @command{@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. +@command{@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. +@command{@value{AS}} normally does by default on @code{@value{GCC}} output. @node v -@section Announce Version: @code{-v} +@section Announce Version: @option{-v} @kindex -v @kindex -version @@ -1503,41 +1740,41 @@ option @samp{-v} (which you can also spell as @samp{-version}) on the command line. @node W -@section Control Warnings: @code{-W}, @code{--warn}, @code{--no-warn}, @code{--fatal-warnings} +@section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings} -@code{@value{AS}} should never give a warning or error message when +@command{@value{AS}} should never give a warning or error message when assembling compiler output. But programs written by people often -cause @code{@value{AS}} to give a warning that a particular assumption was +cause @command{@value{AS}} to give a warning that a particular assumption was made. All such warnings are directed to the standard error file. @kindex @samp{-W} @kindex @samp{--no-warn} @cindex suppressing warnings @cindex warnings, suppressing -If you use the @code{-W} and @code{--no-warn} options, no warnings are issued. +If you use the @option{-W} and @option{--no-warn} options, no warnings are issued. This only affects the warning messages: it does not change any particular of -how @code{@value{AS}} assembles your file. Errors, which stop the assembly, +how @command{@value{AS}} assembles your file. Errors, which stop the assembly, are still reported. @kindex @samp{--fatal-warnings} @cindex errors, caused by warnings @cindex warnings, causing error -If you use the @code{--fatal-warnings} option, @code{@value{AS}} considers +If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers files that generate warnings to be in error. @kindex @samp{--warn} @cindex warnings, switching on -You can switch these options off again by specifying @code{--warn}, which +You can switch these options off again by specifying @option{--warn}, which causes warnings to be output as usual. @node Z -@section Generate Object File in Spite of Errors: @code{-Z} +@section Generate Object File in Spite of Errors: @option{-Z} @cindex object file, after errors @cindex errors, continuing after -After an error message, @code{@value{AS}} normally produces no output. If for +After an error message, @command{@value{AS}} normally produces no output. If for some reason you are interested in object file output even after -@code{@value{AS}} gives an error message on your program, use the @samp{-Z} -option. If there are any errors, @code{@value{AS}} continues anyways, and +@command{@value{AS}} gives an error message on your program, use the @samp{-Z} +option. If there are any errors, @command{@value{AS}} continues anyways, and writes an object file after a final warning message of the form @samp{@var{n} errors, @var{m} warnings, generating bad object file.} @@ -1547,13 +1784,13 @@ errors, @var{m} warnings, generating bad object file.} @cindex machine-independent syntax @cindex syntax, machine-independent This chapter describes the machine-independent syntax allowed in a -source file. @code{@value{AS}} syntax is similar to what many other +source file. @command{@value{AS}} syntax is similar to what many other assemblers use; it is inspired by the BSD 4.2 @ifclear VAX assembler. @end ifclear @ifset VAX -assembler, except that @code{@value{AS}} does not assemble Vax bit-fields. +assembler, except that @command{@value{AS}} does not assemble Vax bit-fields. @end ifset @menu @@ -1569,7 +1806,7 @@ assembler, except that @code{@value{AS}} does not assemble Vax bit-fields. @section Preprocessing @cindex preprocessing -The @code{@value{AS}} internal preprocessor: +The @command{@value{AS}} internal preprocessor: @itemize @bullet @cindex whitespace, removed by preprocessor @item @@ -1626,7 +1863,7 @@ as exactly one space. @section Comments @cindex comments -There are two ways of rendering comments to @code{@value{AS}}. In both +There are two ways of rendering comments to @command{@value{AS}}. In both cases the comment is equivalent to one space. Anything from @samp{/*} through the next @samp{*/} is a comment. @@ -1668,9 +1905,15 @@ is considered a comment and is ignored. The line comment character is @ifset I960 @samp{#} on the i960; @end ifset +@ifset PDP11 +@samp{;} for the PDP-11; +@end ifset @ifset PJ @samp{;} for picoJava; @end ifset +@ifset PPC +@samp{;} for Motorola PowerPC; +@end ifset @ifset SH @samp{!} for the Hitachi SH; @end ifset @@ -1686,6 +1929,9 @@ is considered a comment and is ignored. The line comment character is @ifset M68HC11 @samp{#} on the 68HC11 and 68HC12; @end ifset +@ifset M880X0 +@samp{;} on the M880x0; +@end ifset @ifset VAX @samp{#} on the Vax; @end ifset @@ -1696,7 +1942,7 @@ is considered a comment and is ignored. The line comment character is @samp{#} on the V850; @end ifset see @ref{Machine Dependencies}. @refill -@c FIXME What about m88k, i860? +@c FIXME What about i860? @ifset GENERIC On some machines there are two different line comment characters. One @@ -1729,7 +1975,7 @@ the line is ignored. (Just like a comment.) # This is logical line # 36. @end smallexample This feature is deprecated, and may disappear from future versions -of @code{@value{AS}}. +of @command{@value{AS}}. @node Symbol Intro @section Symbols @@ -1827,7 +2073,7 @@ directive: typically valid for any computer. If the symbol begins with a letter the statement is an assembly language @dfn{instruction}: it assembles into a machine language instruction. @ifset GENERIC -Different versions of @code{@value{AS}} for different computers +Different versions of @command{@value{AS}} for different computers recognize different instructions. In fact, the same symbol may represent a different instruction in a different computer's assembly language.@refill @@ -1898,8 +2144,8 @@ double-quotes or null characters. The way to get special characters into a string is to @dfn{escape} these characters: precede them with a backslash @samp{\} character. For example @samp{\\} represents one backslash: the first @code{\} is an escape which tells -@code{@value{AS}} to interpret the second character literally as a backslash -(which prevents @code{@value{AS}} from recognizing the second @code{\} as an +@command{@value{AS}} to interpret the second character literally as a backslash +(which prevents @command{@value{AS}} from recognizing the second @code{\} as an escape character). The complete list of escapes follows. @cindex escape codes, character @@ -1982,8 +2228,8 @@ this character, because an unescaped @samp{"} would end the string. Any other character when escaped by @kbd{\} gives a warning, but assembles as if the @samp{\} was not present. The idea is that if you used an escape sequence you clearly didn't want the literal -interpretation of the following character. However @code{@value{AS}} has no -other interpretation, so @code{@value{AS}} knows it is giving you the wrong +interpretation of the following character. However @command{@value{AS}} has no +other interpretation, so @command{@value{AS}} knows it is giving you the wrong code and warns you of the fact. @end table @@ -2023,7 +2269,7 @@ H8/500) immediately following an acute accent is taken as a literal character and does not count as the end of a statement. The value of a character constant in a numeric expression is the machine's byte-wide code for -that character. @code{@value{AS}} assumes your character code is ASCII: +that character. @command{@value{AS}} assumes your character code is ASCII: @kbd{'A} means 65, @kbd{'B} means 66, and so on. @refill @node Numbers @@ -2031,7 +2277,7 @@ that character. @code{@value{AS}} assumes your character code is ASCII: @cindex constants, number @cindex number constants -@code{@value{AS}} distinguishes three kinds of numbers according to how they +@command{@value{AS}} distinguishes three kinds of numbers according to how they are stored in the target machine. @emph{Integers} are numbers that would fit into an @code{int} in the C language. @emph{Bignums} are integers, but they are stored in more than 32 bits. @emph{Flonums} @@ -2096,10 +2342,10 @@ integers are permitted while bignums are not. @cindex precision, floating point A @dfn{flonum} represents a floating point number. The translation is indirect: a decimal floating point number from the text is converted by -@code{@value{AS}} to a generic binary floating point number of more than +@command{@value{AS}} to a generic binary floating point number of more than sufficient precision. This generic floating point number is converted to a particular computer's floating point format (or formats) by a -portion of @code{@value{AS}} specialized to that computer. +portion of @command{@value{AS}} specialized to that computer. A flonum is written by writing (in order) @itemize @bullet @@ -2110,7 +2356,7 @@ The digit @samp{0}. @end ifset @item -A letter, to tell @code{@value{AS}} the rest of the number is a flonum. +A letter, to tell @command{@value{AS}} the rest of the number is a flonum. @ifset GENERIC @kbd{e} is recommended. Case is not important. @ignore @@ -2179,9 +2425,9 @@ One or more decimal digits. At least one of the integer part or the fractional part must be present. The floating point number has the usual base-10 value. -@code{@value{AS}} does all processing using integers. Flonums are computed +@command{@value{AS}} does all processing using integers. Flonums are computed independently of any floating point hardware in the computer running -@code{@value{AS}}. +@command{@value{AS}}. @ifclear GENERIC @ifset I960 @@ -2199,7 +2445,7 @@ specify two numbers separated by a colon--- @var{mask}:@var{value} @end example @noindent -@code{@value{AS}} applies a bitwise @sc{and} between @var{mask} and +@command{@value{AS}} applies a bitwise @sc{and} between @var{mask} and @var{value}. The resulting number is then packed @@ -2241,11 +2487,11 @@ For example there may be a ``read only'' section. @cindex linker, and assembler @cindex assembler, and linker The linker @code{@value{LD}} reads many object files (partial programs) and -combines their contents to form a runnable program. When @code{@value{AS}} +combines their contents to form a runnable program. When @command{@value{AS}} emits an object file, the partial program is assumed to start at address 0. @code{@value{LD}} assigns the final addresses for the partial program, so that different partial programs do not overlap. This is actually an -oversimplification, but it suffices to explain how @code{@value{AS}} uses +oversimplification, but it suffices to explain how @command{@value{AS}} uses sections. @code{@value{LD}} moves blocks of bytes of your program to their run-time @@ -2258,12 +2504,12 @@ the proper run-time addresses. @ifset H8 For the H8/300 and H8/500, and for the Hitachi SH, -@code{@value{AS}} pads sections if needed to +@command{@value{AS}} pads sections if needed to ensure they end on a word (sixteen bit) boundary. @end ifset @cindex standard assembler sections -An object file written by @code{@value{AS}} has at least three sections, any +An object file written by @command{@value{AS}} has at least three sections, any of which may be empty. These are named @dfn{text}, @dfn{data} and @dfn{bss} sections. @@ -2271,7 +2517,7 @@ of which may be empty. These are named @dfn{text}, @dfn{data} and @ifset GENERIC When it generates COFF output, @end ifset -@code{@value{AS}} can also generate whatever other named sections you specify +@command{@value{AS}} can also generate whatever other named sections you specify using the @samp{.section} directive (@pxref{Section,,@code{.section}}). If you do not use any directives that place output in the @samp{.text} or @samp{.data} sections, these sections still exist, but are empty. @@ -2279,16 +2525,16 @@ or @samp{.data} sections, these sections still exist, but are empty. @ifset HPPA @ifset GENERIC -When @code{@value{AS}} generates SOM or ELF output for the HPPA, +When @command{@value{AS}} generates SOM or ELF output for the HPPA, @end ifset -@code{@value{AS}} can also generate whatever other named sections you +@command{@value{AS}} can also generate whatever other named sections you specify using the @samp{.space} and @samp{.subspace} directives. See @cite{HP9000 Series 800 Assembly Language Reference Manual} (HP 92432-90001) for details on the @samp{.space} and @samp{.subspace} assembler directives. @ifset SOM -Additionally, @code{@value{AS}} uses different names for the standard +Additionally, @command{@value{AS}} uses different names for the standard text, data, and bss sections when generating SOM output. Program text is placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and BSS into @samp{$BSS$}. @@ -2305,7 +2551,7 @@ section starts at address @code{0}, the data section at address @end ifset To let @code{@value{LD}} know which data changes when the sections are -relocated, and how to change that data, @code{@value{AS}} also writes to the +relocated, and how to change that data, @command{@value{AS}} also writes to the object file details of the relocation needed. To perform relocation @code{@value{LD}} must know, each time an address in the object file is mentioned: @@ -2326,12 +2572,12 @@ Is the reference to an address ``Program-Counter relative''? @cindex addresses, format of @cindex section-relative addressing -In fact, every address @code{@value{AS}} ever uses is expressed as +In fact, every address @command{@value{AS}} ever uses is expressed as @display (@var{section}) + (@var{offset into section}) @end display @noindent -Further, most expressions @code{@value{AS}} computes have this section-relative +Further, most expressions @command{@value{AS}} computes have this section-relative nature. @ifset SOM (For some object formats, such as SOM for the HPPA, some expressions are @@ -2367,7 +2613,7 @@ the addresses of all partial programs' text sections. Likewise for data and bss sections. Some sections are manipulated by @code{@value{LD}}; others are invented for -use of @code{@value{AS}} and have no meaning except during assembly. +use of @command{@value{AS}} and have no meaning except during assembly. @node Ld Sections @section Linker Sections @@ -2386,7 +2632,7 @@ use of @code{@value{AS}} and have no meaning except during assembly. @itemx text section @itemx data section @end ifset -These sections hold your program. @code{@value{AS}} and @code{@value{LD}} treat them as +These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as separate but equal sections. Anything you can say of one section is true another. @ifset aout-bout @@ -2479,11 +2725,11 @@ DDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil} @cindex internal assembler sections @cindex sections in messages, internal -These sections are meant only for the internal use of @code{@value{AS}}. They +These sections are meant only for the internal use of @command{@value{AS}}. They have no meaning at run-time. You do not really need to know about these -sections for most purposes; but they can be mentioned in @code{@value{AS}} +sections for most purposes; but they can be mentioned in @command{@value{AS}} warning messages, so it might be helpful to have an idea of their -meanings to @code{@value{AS}}. These sections are used to permit the +meanings to @command{@value{AS}}. These sections are used to permit the value of every expression in your assembly language program to be a section-relative address. @@ -2529,7 +2775,7 @@ text or data @end ifset @end ifclear that you want to end up near to each other in the object file, even though they -are not contiguous in the assembler source. @code{@value{AS}} allows you to +are not contiguous in the assembler source. @command{@value{AS}} allows you to use @dfn{subsections} for this purpose. Within each section, there can be numbered subsections with values from 0 to 8192. Objects assembled into the same subsection go into the object file together with other objects in the same @@ -2545,7 +2791,7 @@ goes in subsection number zero. @ifset GENERIC Each subsection is zero-padded up to a multiple of four bytes. (Subsections may be padded a different amount on different flavors -of @code{@value{AS}}.) +of @command{@value{AS}}.) @end ifset @ifclear GENERIC @ifset H8 @@ -2607,7 +2853,7 @@ begins in @code{text 0}. For instance: Each section has a @dfn{location counter} incremented by one for every byte assembled into that section. Because subsections are merely a convenience -restricted to @code{@value{AS}} there is no concept of a subsection location +restricted to @command{@value{AS}} there is no concept of a subsection location counter. There is no way to directly manipulate a location counter---but the @code{.align} directive changes it, and any label definition captures its current value. The location counter of the section where statements are being @@ -2648,7 +2894,7 @@ to debug. @quotation @cindex debuggers, and symbol order -@emph{Warning:} @code{@value{AS}} does not place symbols in the object file in +@emph{Warning:} @command{@value{AS}} does not place symbols in the object file in the same order they were declared. This may break some debuggers. @end quotation @@ -2674,7 +2920,7 @@ definitions. @ifset HPPA On the HPPA, the usual form for a label need not be immediately followed by a colon, but instead must start in column zero. Only one label may be defined on -a single line. To work around this, the HPPA version of @code{@value{AS}} also +a single line. To work around this, the HPPA version of @command{@value{AS}} also provides a special directive @code{.label} for defining labels more flexibly. @end ifset @@ -2729,56 +2975,92 @@ in a program. @cindex temporary symbol names @cindex symbol names, temporary Local symbols help compilers and programmers use names temporarily. -There are ten local symbol names, which are re-used throughout the -program. You may refer to them using the names @samp{0} @samp{1} -@dots{} @samp{9}. To define a local symbol, write a label of the form -@samp{@b{N}:} (where @b{N} represents any digit). To refer to the most -recent previous definition of that symbol write @samp{@b{N}b}, using the -same digit as when you defined the label. To refer to the next -definition of a local label, write @samp{@b{N}f}---where @b{N} gives you -a choice of 10 forward references. The @samp{b} stands for -``backwards'' and the @samp{f} stands for ``forwards''. - -Local symbols are not emitted by the current @sc{gnu} C compiler. - -There is no restriction on how you can use these labels, but -remember that at any point in the assembly you can refer to at most -10 prior local labels and to at most 10 forward local labels. - -Local symbol names are only a notation device. They are immediately -transformed into more conventional symbol names before the assembler -uses them. The symbol names stored in the symbol table, appearing in -error messages and optionally emitted to the object file have these +They create symbols which are guaranteed to be unique over the entire scope of +the input source code and which can be referred to by a simple notation. +To define a local symbol, write a label of the form @samp{@b{N}:} (where @b{N} +represents any positive integer). To refer to the most recent previous +definition of that symbol write @samp{@b{N}b}, using the same number as when +you defined the label. To refer to the next definition of a local label, write +@samp{@b{N}f}--- The @samp{b} stands for``backwards'' and the @samp{f} stands +for ``forwards''. + +There is no restriction on how you can use these labels, and you can reuse them +too. So that it is possible to repeatedly define the same local label (using +the same number @samp{@b{N}}), although you can only refer to the most recently +defined local label of that number (for a backwards reference) or the next +definition of a specific local label for a forward reference. It is also worth +noting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are +implemented in a slightly more efficient manner than the others. + +Here is an example: + +@smallexample +1: branch 1f +2: branch 1b +1: branch 2f +2: branch 1b +@end smallexample + +Which is the equivalent of: + +@smallexample +label_1: branch label_3 +label_2: branch label_1 +label_3: branch label_4 +label_4: branch label_3 +@end smallexample + +Local symbol names are only a notational device. They are immediately +transformed into more conventional symbol names before the assembler uses them. +The symbol names stored in the symbol table, appearing in error messages and +optionally emitted to the object file. The names are constructed using these parts: @table @code @item L -All local labels begin with @samp{L}. Normally both @code{@value{AS}} and +All local labels begin with @samp{L}. Normally both @command{@value{AS}} and @code{@value{LD}} forget symbols that start with @samp{L}. These labels are used for symbols you are never intended to see. If you use the -@samp{-L} option then @code{@value{AS}} retains these symbols in the +@samp{-L} option then @command{@value{AS}} retains these symbols in the object file. If you also instruct @code{@value{LD}} to retain these symbols, you may use them in debugging. -@item @var{digit} -If the label is written @samp{0:} then the digit is @samp{0}. -If the label is written @samp{1:} then the digit is @samp{1}. -And so on up through @samp{9:}. +@item @var{number} +This is the number that was used in the local label definition. So if the +label is written @samp{55:} then the number is @samp{55}. -@item @kbd{C-A} -This unusual character is included so you do not accidentally invent -a symbol of the same name. The character has ASCII value -@samp{\001}. +@item @kbd{C-B} +This unusual character is included so you do not accidentally invent a symbol +of the same name. The character has ASCII value of @samp{\002} (control-B). @item @emph{ordinal number} -This is a serial number to keep the labels distinct. The first -@samp{0:} gets the number @samp{1}; The 15th @samp{0:} gets the -number @samp{15}; @emph{etc.}. Likewise for the other labels @samp{1:} -through @samp{9:}. +This is a serial number to keep the labels distinct. The first definition of +@samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the +number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets +the number @samp{1} and its 15th defintion gets @samp{15} as well. @end table -For instance, the first @code{1:} is named @code{L1@kbd{C-A}1}, the 44th -@code{3:} is named @code{L3@kbd{C-A}44}. +So for example, the first @code{1:} is named @code{L1@kbd{C-B}1}, the 44th +@code{3:} is named @code{L3@kbd{C-B}44}. + +@subheading Dollar Local Labels +@cindex dollar local symbols + +@code{@value{AS}} also supports an even more local form of local labels called +dollar labels. These labels go out of scope (ie they become undefined) as soon +as a non-local label is defined. Thus they remain valid for only a small +region of the input source code. Normal local labels, by contrast, remain in +scope for the entire file, or until they are redefined by another occurrence of +the same local label. + +Dollar labels are defined in exactly the same way as ordinary local labels, +except that instead of being terminated by a colon, they are terminated by a +dollar sign. eg @samp{@b{55$}}. + +They can also be distinguished from ordinary local labels by their transformed +name which uses ASCII character @samp{\001} (control-A) as the magic character +to distinguish them from ordinary labels. Thus the 5th defintion of @samp{6$} +is named @samp{L6@kbd{C-A}5}. @node Dot @section The Special Dot Symbol @@ -2788,7 +3070,7 @@ For instance, the first @code{1:} is named @code{L1@kbd{C-A}1}, the 44th @cindex current address @cindex location counter The special symbol @samp{.} refers to the current address that -@code{@value{AS}} is assembling into. Thus, the expression @samp{melvin: +@command{@value{AS}} is assembling into. Thus, the expression @samp{melvin: .long .} defines @code{melvin} to contain its own address. Assigning a value to @code{.} is treated the same as a @code{.org} directive. Thus, the expression @samp{.=.+4} is the same as saying @@ -2813,7 +3095,7 @@ attributes. The detailed definitions are in @file{a.out.h}. @end ifset -If you use a symbol without defining it, @code{@value{AS}} assumes zero for +If you use a symbol without defining it, @command{@value{AS}} assumes zero for all these attributes, and probably won't warn you. This makes the symbol an externally defined symbol, which is generally what you would want. @@ -2885,7 +3167,7 @@ format depends on the object-code output format in use. @cindex @code{b.out} symbol attributes @cindex symbol attributes, @code{b.out} -These symbol attributes appear only when @code{@value{AS}} is configured for +These symbol attributes appear only when @command{@value{AS}} is configured for one of the Berkeley-descended object output formats---@code{a.out} or @code{b.out}. @@ -2919,13 +3201,13 @@ one of the Berkeley-descended object output formats---@code{a.out} or This is an arbitrary 16-bit value. You may establish a symbol's descriptor value by using a @code{.desc} statement (@pxref{Desc,,@code{.desc}}). A descriptor value means nothing to -@code{@value{AS}}. +@command{@value{AS}}. @node Symbol Other @subsubsection Other @cindex other attribute, of @code{a.out} symbol -This is an arbitrary 8-bit value. It means nothing to @code{@value{AS}}. +This is an arbitrary 8-bit value. It means nothing to @command{@value{AS}}. @end ifset @ifset COFF @@ -2948,7 +3230,7 @@ respectively, with @code{.val} and @code{.type}. @subsubsection Auxiliary Attributes @cindex auxiliary attributes, COFF symbols -The @code{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl}, +The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl}, @code{.size}, and @code{.tag} can generate auxiliary symbol table information for COFF. @end ifset @@ -2979,10 +3261,10 @@ Whitespace may precede and/or follow an expression. The result of an expression must be an absolute number, or else an offset into a particular section. If an expression is not absolute, and there is not -enough information when @code{@value{AS}} sees the expression to know its +enough information when @command{@value{AS}} sees the expression to know its section, a second pass over the source program might be necessary to interpret the expression---but the second pass is currently not implemented. -@code{@value{AS}} aborts with an error message in this situation. +@command{@value{AS}} aborts with an error message in this situation. @menu * Empty Exprs:: Empty Expressions @@ -2996,7 +3278,7 @@ the expression---but the second pass is currently not implemented. @cindex expressions, empty An empty expression has no value: it is just whitespace or null. Wherever an absolute expression is required, you may omit the -expression, and @code{@value{AS}} assumes a value of (absolute) 0. This +expression, and @command{@value{AS}} assumes a value of (absolute) 0. This is compatible with other assemblers. @node Integer Exprs @@ -3036,7 +3318,7 @@ integer. Numbers are usually integers. A number can be a flonum or bignum. In this case, you are warned -that only the low order 32 bits are used, and @code{@value{AS}} pretends +that only the low order 32 bits are used, and @command{@value{AS}} pretends these 32 bits are an integer. You may write integer-manipulating instructions that act on exotic constants, compatible with other assemblers. @@ -3061,7 +3343,7 @@ whitespace. @subsection Prefix Operator @cindex prefix operators -@code{@value{AS}} has the following @dfn{prefix operators}. They each take +@command{@value{AS}} has the following @dfn{prefix operators}. They each take one argument, which must be absolute. @c the tex/end tex stuff surrounding this small table is meant to make @@ -3089,7 +3371,7 @@ one argument, which must be absolute. @cindex operators, permitted arguments @dfn{Infix operators} take two arguments, one on either side. Operators have precedence, but operations with equal precedence are performed left -to right. Apart from @code{+} or @code{-}, both arguments must be +to right. Apart from @code{+} or @option{-}, both arguments must be absolute, and the result is absolute. @enumerate @@ -3274,6 +3556,7 @@ Some machine configurations provide additional directives. * hword:: @code{.hword @var{expressions}} * Ident:: @code{.ident} * If:: @code{.if @var{absolute expression}} +* Incbin:: @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]} * Include:: @code{.include "@var{file}"} * Int:: @code{.int @var{expressions}} @ifset ELF @@ -3375,7 +3658,7 @@ Some machine configurations provide additional directives. This directive stops the assembly immediately. It is for compatibility with other assemblers. The original idea was that the assembly language source would be piped into the assembler. If the sender -of the source quit, it could use this directive tells @code{@value{AS}} to +of the source quit, it could use this directive tells @command{@value{AS}} to quit also. One day @code{.abort} will not be supported. @ifset COFF @@ -3383,11 +3666,11 @@ quit also. One day @code{.abort} will not be supported. @section @code{.ABORT} @cindex @code{ABORT} directive -When producing COFF output, @code{@value{AS}} accepts this directive as a +When producing COFF output, @command{@value{AS}} accepts this directive as a synonym for @samp{.abort}. @ifset BOUT -When producing @code{b.out} output, @code{@value{AS}} accepts this directive, +When producing @code{b.out} output, @command{@value{AS}} accepts this directive, but ignores it. @end ifset @end ifset @@ -3519,7 +3802,7 @@ example, an alignment of 16 means that the least significant 4 bits of the address should be zero). The alignment must be an absolute expression, and it must be a power of two. If @code{@value{LD}} allocates uninitialized memory for the common symbol, it will use the alignment when placing the symbol. If -no alignment is specified, @code{@value{AS}} will set the alignment to the +no alignment is specified, @command{@value{AS}} will set the alignment to the largest power of two less than or equal to the size of the symbol, up to a maximum of 16. @end ifset @@ -3533,7 +3816,7 @@ The syntax for @code{.comm} differs slightly on the HPPA. The syntax is @section @code{.data @var{subsection}} @cindex @code{data} directive -@code{.data} tells @code{@value{AS}} to assemble the following statements onto the +@code{.data} tells @command{@value{AS}} to assemble the following statements onto the end of the data subsection numbered @var{subsection} (which is an absolute expression). If @var{subsection} is omitted, it defaults to zero. @@ -3549,7 +3832,7 @@ Begin defining debugging information for a symbol @var{name}; the definition extends until the @code{.endef} directive is encountered. @ifset BOUT -This directive is only observed when @code{@value{AS}} is configured for COFF +This directive is only observed when @command{@value{AS}} is configured for COFF format output; when producing @code{b.out}, @samp{.def} is recognized, but ignored. @end ifset @@ -3566,9 +3849,9 @@ This directive sets the descriptor of the symbol (@pxref{Symbol Attributes}) to the low 16 bits of an absolute expression. @ifset COFF -The @samp{.desc} directive is not available when @code{@value{AS}} is +The @samp{.desc} directive is not available when @command{@value{AS}} is configured for COFF output; it is only for @code{a.out} or @code{b.out} -object format. For the sake of compatibility, @code{@value{AS}} accepts +object format. For the sake of compatibility, @command{@value{AS}} accepts it, but produces no output, when configured for COFF. @end ifset @end ifset @@ -3586,7 +3869,7 @@ information in the symbol table. It is only permitted inside @ifset BOUT @samp{.dim} is only meaningful when generating COFF format output; when -@code{@value{AS}} is generating @code{b.out}, it accepts this directive but +@command{@value{AS}} is generating @code{b.out}, it accepts this directive but ignores it. @end ifset @end ifset @@ -3600,7 +3883,7 @@ ignores it. assembles floating point numbers. @ifset GENERIC The exact kind of floating point numbers emitted depends on how -@code{@value{AS}} is configured. @xref{Machine Dependencies}. +@command{@value{AS}} is configured. @xref{Machine Dependencies}. @end ifset @ifclear GENERIC @ifset IEEEFLOAT @@ -3622,7 +3905,7 @@ Force a page break at this point, when generating assembly listings. @section @code{.else} @cindex @code{else} directive -@code{.else} is part of the @code{@value{AS}} support for conditional +@code{.else} is part of the @command{@value{AS}} support for conditional assembly; @pxref{If,,@code{.if}}. It marks the beginning of a section of code to be assembled if the condition for the preceding @code{.if} was false. @@ -3631,7 +3914,7 @@ was false. @section @code{.elseif} @cindex @code{elseif} directive -@code{.elseif} is part of the @code{@value{AS}} support for conditional +@code{.elseif} is part of the @command{@value{AS}} support for conditional assembly; @pxref{If,,@code{.if}}. It is shorthand for beginning a new @code{.if} block that would otherwise fill the entire @code{.else} section. @@ -3639,7 +3922,7 @@ assembly; @pxref{If,,@code{.if}}. It is shorthand for beginning a new @section @code{.end} @cindex @code{end} directive -@code{.end} marks the end of the assembly file. @code{@value{AS}} does not +@code{.end} marks the end of the assembly file. @command{@value{AS}} does not process anything in the file past the @code{.end} directive. @ifset COFF @@ -3652,7 +3935,7 @@ This directive flags the end of a symbol definition begun with @ifset BOUT @samp{.endef} is only meaningful when generating COFF format output; if -@code{@value{AS}} is configured to generate @code{b.out}, it accepts this +@command{@value{AS}} is configured to generate @code{b.out}, it accepts this directive but ignores it. @end ifset @end ifset @@ -3666,7 +3949,7 @@ directive but ignores it. @section @code{.endif} @cindex @code{endif} directive -@code{.endif} is part of the @code{@value{AS}} support for conditional assembly; +@code{.endif} is part of the @command{@value{AS}} support for conditional assembly; it marks the end of a block of code that is only assembled conditionally. @xref{If,,@code{.if}}. @@ -3701,8 +3984,8 @@ Except for the contents of the error message, this is roughly equivalent to @node Err @section @code{.err} @cindex @code{err} directive -If @code{@value{AS}} assembles a @code{.err} directive, it will print an error -message and, unless the @code{-Z} option was used, it will not generate an +If @command{@value{AS}} assembles a @code{.err} directive, it will print an error +message and, unless the @option{-Z} option was used, it will not generate an object file. This can be used to signal error an conditionally compiled code. @node Exitm @@ -3714,7 +3997,7 @@ Exit early from the current macro definition. @xref{Macro}. @cindex @code{extern} directive @code{.extern} is accepted in the source program---for compatibility -with other assemblers---but it is ignored. @code{@value{AS}} treats +with other assemblers---but it is ignored. @command{@value{AS}} treats all undefined symbols as external. @node Fail @@ -3722,8 +4005,8 @@ all undefined symbols as external. @cindex @code{fail} directive Generates an error or a warning. If the value of the @var{expression} is 500 -or more, @code{@value{AS}} will print a warning message. If the value is less -than 500, @code{@value{AS}} will print an error message. The message will +or more, @command{@value{AS}} will print a warning message. If the value is less +than 500, @command{@value{AS}} will print an error message. The message will include the value of @var{expression}. This can occasionally be useful inside complex nested macros or conditional assembly. @@ -3734,14 +4017,14 @@ complex nested macros or conditional assembly. @cindex @code{file} directive @cindex logical file name @cindex file name, logical -@code{.file} tells @code{@value{AS}} that we are about to start a new logical +@code{.file} tells @command{@value{AS}} that we are about to start a new logical file. @var{string} is the new file name. In general, the filename is recognized whether or not it is surrounded by quotes @samp{"}; but if you wish to specify an empty file name, you must give the quotes--@code{""}. This statement may go away in future: it is only recognized to be compatible with -old @code{@value{AS}} programs. +old @command{@value{AS}} programs. @ifset A29K -In some configurations of @code{@value{AS}}, @code{.file} has already been +In some configurations of @command{@value{AS}}, @code{.file} has already been removed to avoid conflicts with other assemblers. @xref{Machine Dependencies}. @end ifset @end ifclear @@ -3752,14 +4035,14 @@ removed to avoid conflicts with other assemblers. @xref{Machine Dependencies}. @cindex @code{fill} directive @cindex writing patterns in memory @cindex patterns, writing in memory -@var{result}, @var{size} and @var{value} are absolute expressions. +@var{repeat}, @var{size} and @var{value} are absolute expressions. This emits @var{repeat} copies of @var{size} bytes. @var{Repeat} may be zero or more. @var{Size} may be zero or more, but if it is more than 8, then it is deemed to have the value 8, compatible with other people's assemblers. The contents of each @var{repeat} bytes is taken from an 8-byte number. The highest order 4 bytes are zero. The lowest order 4 bytes are @var{value} rendered in the -byte-order of an integer on the computer @code{@value{AS}} is assembling for. +byte-order of an integer on the computer @command{@value{AS}} is assembling for. Each @var{size} bytes in a repetition is taken from the lowest order @var{size} bytes of this number. Again, this bizarre behavior is compatible with other people's assemblers. @@ -3778,7 +4061,7 @@ This directive assembles zero or more flonums, separated by commas. It has the same effect as @code{.single}. @ifset GENERIC The exact kind of floating point numbers emitted depends on how -@code{@value{AS}} is configured. +@command{@value{AS}} is configured. @xref{Machine Dependencies}. @end ifset @ifclear GENERIC @@ -3864,7 +4147,7 @@ This directive is a synonym for both @samp{.short} and @samp{.word}. @cindex @code{ident} directive This directive is used by some assemblers to place tags in object files. -@code{@value{AS}} simply accepts the directive for source-file +@command{@value{AS}} simply accepts the directive for source-file compatibility with such assemblers, but does not actually emit anything for it. @@ -3946,6 +4229,22 @@ Like @code{.ifeqs}, but the sense of the test is reversed: this assembles the following section of code if the two strings are not the same. @end table +@node Incbin +@section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]} + +@cindex @code{incbin} directive +@cindex binary files, including +The @code{incbin} directive includes @var{file} verbatim at the current +location. You can control the search paths used with the @samp{-I} command-line +option (@pxref{Invoking,,Command-Line Options}). Quotation marks are required +around @var{file}. + +The @var{skip} argument skips a number of bytes from the start of the +@var{file}. The @var{count} argument indicates the maximum number of bytes to +read. Note that the data is not aligned in any way, so it is the user's +responsibility to make sure that proper alignment is provided both before and +after the @code{incbin} directive. + @node Include @section @code{.include "@var{file}"} @@ -4078,7 +4377,7 @@ The syntax for @code{.lcomm} differs slightly on the HPPA. The syntax is @section @code{.lflags} @cindex @code{lflags} directive (ignored) -@code{@value{AS}} accepts this directive, for compatibility with other +@command{@value{AS}} accepts this directive, for compatibility with other assemblers, but ignores it. @ifclear no-line-dir @@ -4099,7 +4398,7 @@ Change the logical line number. @var{line-number} must be an absolute expression. The next line has that logical line number. Therefore any other statements on the current line (after a statement separator character) are reported as on logical line number @var{line-number} @minus{} 1. One day -@code{@value{AS}} will no longer support this directive: it is recognized only +@command{@value{AS}} will no longer support this directive: it is recognized only for compatibility with existing assembler programs. @ifset GENERIC @@ -4112,7 +4411,7 @@ not available; use the synonym @code{.ln} in that context. @ifclear no-line-dir Even though this is a directive associated with the @code{a.out} or -@code{b.out} object-code formats, @code{@value{AS}} still recognizes it +@code{b.out} object-code formats, @command{@value{AS}} still recognizes it when producing COFF output, and treats @samp{.line} as though it were the COFF @samp{.ln} @emph{if} it is found outside a @code{.def}/@code{.endef} pair. @@ -4167,14 +4466,14 @@ Warn if any of the duplicates do not have exactly the same contents. @samp{.ln} is a synonym for @samp{.line}. @end ifclear @ifset no-line-dir -Tell @code{@value{AS}} to change the logical line number. @var{line-number} +Tell @command{@value{AS}} to change the logical line number. @var{line-number} must be an absolute expression. The next line has that logical line number, so any other statements on the current line (after a statement separator character @code{;}) are reported as on logical line number @var{line-number} @minus{} 1. @ifset BOUT -This directive is accepted, but ignored, when @code{@value{AS}} is +This directive is accepted, but ignored, when @command{@value{AS}} is configured for @code{b.out}; its effect is only associated with COFF output format. @end ifset @@ -4185,8 +4484,8 @@ output format. @cindex @code{mri} directive @cindex MRI mode, temporarily -If @var{val} is non-zero, this tells @code{@value{AS}} to enter MRI mode. If -@var{val} is zero, this tells @code{@value{AS}} to exit MRI mode. This change +If @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode. If +@var{val} is zero, this tells @command{@value{AS}} to exit MRI mode. This change affects code assembled until the next @code{.mri} directive, or until the end of the file. @xref{M, MRI mode, MRI mode}. @@ -4307,7 +4606,7 @@ Exit early from the current macro definition. @cindex number of macros executed @cindex macros, count executed @item \@@ -@code{@value{AS}} maintains a counter of how many macros it has +@command{@value{AS}} maintains a counter of how many macros it has executed in this pseudo-variable; you can copy that number to your output with @samp{\@@}, but @emph{only within a macro definition}. @@ -4362,7 +4661,7 @@ expression with the same section as the current subsection. That is, you can't use @code{.org} to cross sections: if @var{new-lc} has the wrong section, the @code{.org} directive is ignored. To be compatible with former assemblers, if the section of @var{new-lc} is absolute, -@code{@value{AS}} issues a warning, then pretends the section of @var{new-lc} +@command{@value{AS}} issues a warning, then pretends the section of @var{new-lc} is the same as the current subsection. @code{.org} may only increase the location counter, or leave it @@ -4372,7 +4671,7 @@ backwards. @c double negative used below "not undefined" because this is a specific @c reference to "undefined" (as SEG_UNKNOWN is called in this manual) @c section. doc@cygnus.com 18feb91 -Because @code{@value{AS}} tries to assemble programs in one pass, @var{new-lc} +Because @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc} may not be undefined. If you really detest this restriction we eagerly await a chance to share your improved assembler. @@ -4462,7 +4761,7 @@ stack. @section @code{.print @var{string}} @cindex @code{print} directive -@code{@value{AS}} will print @var{string} on the standard output during +@command{@value{AS}} will print @var{string} on the standard output during assembly. You must put @var{string} in double quotes. @ifset ELF @@ -4495,7 +4794,7 @@ If you do not use @code{.psize}, listings use a default line-count of 60. You may omit the comma and @var{columns} specification; the default width is 200 columns. -@code{@value{AS}} generates formfeeds whenever the specified number of +@command{@value{AS}} generates formfeeds whenever the specified number of lines is exceeded (or whenever you explicitly request one, using @code{.eject}). @@ -4596,7 +4895,7 @@ symbolic debugging information. @ifset BOUT The @samp{.scl} directive is primarily associated with COFF output; when -configured to generate @code{b.out} output format, @code{@value{AS}} +configured to generate @code{b.out} output format, @command{@value{AS}} accepts this directive but ignores it. @end ifset @end ifset @@ -4642,7 +4941,9 @@ shared section (meaningful for PE targets) If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to be -loaded and writable. +loaded and writable. Note the @code{n} and @code{w} flags remove attributes +from the section, rather than adding them, so if they are used on their own it +will be as if no flags had been specified at all. If the optional argument to the @code{.section} directive is not quoted, it is taken as a subsegment number (@pxref{Sub-Sections}). @@ -4663,7 +4964,7 @@ This is one of the ELF section stack manipulation directives. The others are For ELF targets, the @code{.section} directive is used like this: @smallexample -.section @var{name} [, "@var{flags}"[, @@@var{type}]] +.section @var{name} [, "@var{flags}"[, @@@var{type}[, @@@var{entsize}]]] @end smallexample The optional @var{flags} argument is a quoted string which may contain any @@ -4675,6 +4976,10 @@ section is allocatable section is writable @item x section is executable +@item M +section is mergeable +@item S +section contains zero terminated strings @end table The optional @var{type} argument may contain one of the following constants: @@ -4685,6 +4990,13 @@ section contains data section does not contain data (i.e., section only occupies space) @end table +If @var{flags} contains @code{M} flag, @var{type} argument must be specified +as well as @var{entsize} argument. Sections with @code{M} flag but not +@code{S} flag must contain fixed size constants, each @var{entsize} octets +long. Sections with both @code{M} and @code{S} must contain zero terminated +strings where each character is @var{entsize} bytes long. The linker may remove +duplicates within sections with the same name, same entity size and same flags. + If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to have none of the above flags: it will not be allocated in memory, nor writable, nor @@ -4763,7 +5075,7 @@ This directive assembles zero or more flonums, separated by commas. It has the same effect as @code{.float}. @ifset GENERIC The exact kind of floating point numbers emitted depends on how -@code{@value{AS}} is configured. @xref{Machine Dependencies}. +@command{@value{AS}} is configured. @xref{Machine Dependencies}. @end ifset @ifclear GENERIC @ifset IEEEFLOAT @@ -4782,7 +5094,7 @@ information in the symbol table. It is only permitted inside @ifset BOUT @samp{.size} is only meaningful when generating COFF format output; when -@code{@value{AS}} is generating @code{b.out}, it accepts this directive but +@command{@value{AS}} is generating @code{b.out}, it accepts this directive but ignores it. @end ifset @@ -4857,7 +5169,7 @@ compatibility with other AMD 29K assemblers. @cindex @code{stab@var{x}} directives There are three directives that begin @samp{.stab}. All emit symbols (@pxref{Symbols}), for use by symbolic debuggers. -The symbols are not entered in the @code{@value{AS}} hash table: they +The symbols are not entered in the @command{@value{AS}} hash table: they cannot be referenced elsewhere in the source file. Up to five fields are required: @@ -5032,7 +5344,7 @@ definitions in the symbol table with instances of those structures. @ifset BOUT @samp{.tag} is only used when generating COFF format output; when -@code{@value{AS}} is generating @code{b.out}, it accepts this directive but +@command{@value{AS}} is generating @code{b.out}, it accepts this directive but ignores it. @end ifset @end ifset @@ -5041,7 +5353,7 @@ ignores it. @section @code{.text @var{subsection}} @cindex @code{text} directive -Tells @code{@value{AS}} to assemble the following statements onto the end of +Tells @command{@value{AS}} to assemble the following statements onto the end of the text subsection numbered @var{subsection}, which is an absolute expression. If @var{subsection} is omitted, subsection number zero is used. @@ -5068,7 +5380,7 @@ records the integer @var{int} as the type attribute of a symbol table entry. @ifset BOUT @samp{.type} is associated only with COFF format output; when -@code{@value{AS}} is configured for @code{b.out} output, it accepts this +@command{@value{AS}} is configured for @code{b.out} output, it accepts this directive but ignores it. @end ifset @@ -5119,7 +5431,7 @@ records the address @var{addr} as the value attribute of a symbol table entry. @ifset BOUT -@samp{.val} is used only for COFF output; when @code{@value{AS}} is +@samp{.val} is used only for COFF output; when @command{@value{AS}} is configured for @code{b.out}, it accepts this directive but ignores it. @end ifset @end ifset @@ -5168,10 +5480,10 @@ This directive expects zero or more @var{expressions}, of any section, separated by commas. @ifclear GENERIC @ifset W32 -For each expression, @code{@value{AS}} emits a 32-bit number. +For each expression, @command{@value{AS}} emits a 32-bit number. @end ifset @ifset W16 -For each expression, @code{@value{AS}} emits a 16-bit number. +For each expression, @command{@value{AS}} emits a 16-bit number. @end ifset @end ifclear @ifset GENERIC @@ -5197,11 +5509,11 @@ interest to you does 32-bit addressing (or doesn't require it; @end ifset In order to assemble compiler output into something that works, -@code{@value{AS}} occasionally does strange things to @samp{.word} directives. +@command{@value{AS}} occasionally does strange things to @samp{.word} directives. Directives of the form @samp{.word sym1-sym2} are often emitted by -compilers as part of jump tables. Therefore, when @code{@value{AS}} assembles a +compilers as part of jump tables. Therefore, when @command{@value{AS}} assembles a directive of the form @samp{.word sym1-sym2}, and the difference between -@code{sym1} and @code{sym2} does not fit in 16 bits, @code{@value{AS}} +@code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}} creates a @dfn{secondary jump table}, immediately before the next label. This secondary jump table is preceded by a short-jump to the first byte after the secondary table. This short-jump prevents the flow @@ -5219,7 +5531,7 @@ minus the address of the long-jump to @code{sym4}; and so on, for as many entries in the original jump table as necessary. @ifset INTERNALS -@emph{This feature may be disabled by compiling @code{@value{AS}} with the +@emph{This feature may be disabled by compiling @command{@value{AS}} with the @samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse assembly language programmers. @end ifset @@ -5244,11 +5556,11 @@ They are included for compatibility with older assemblers. @cindex machine dependencies The machine instruction sets are (almost by definition) different on -each machine where @code{@value{AS}} runs. Floating point representations -vary as well, and @code{@value{AS}} often supports a few additional +each machine where @command{@value{AS}} runs. Floating point representations +vary as well, and @command{@value{AS}} often supports a few additional directives or command-line options for compatibility with other assemblers on a particular platform. Finally, some versions of -@code{@value{AS}} support special pseudo-instructions for branch +@command{@value{AS}} support special pseudo-instructions for branch optimization. This chapter discusses most of these differences, though it does not @@ -5301,15 +5613,27 @@ subject, see the hardware manufacturer's manual. @ifset M68HC11 * M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features @end ifset +@ifset M880X0 +* M88K-Dependent:: M880x0 Dependent Features +@end ifset @ifset MIPS * MIPS-Dependent:: MIPS Dependent Features @end ifset +@ifset MMIX +* MMIX-Dependent:: MMIX Dependent Features +@end ifset @ifset SH * SH-Dependent:: Hitachi SH Dependent Features @end ifset +@ifset PDP11 +* PDP-11-Dependent:: PDP-11 Dependent Features +@end ifset @ifset PJ * PJ-Dependent:: picoJava Dependent Features @end ifset +@ifset PPC +* PPC-Dependent:: PowerPC Dependent Features +@end ifset @ifset SPARC * Sparc-Dependent:: SPARC Dependent Features @end ifset @@ -5357,7 +5681,7 @@ subject, see the hardware manufacturer's manual. The machine instruction sets are different on each Hitachi chip family, and there are also some syntax differences among the families. This -chapter describes the specific @code{@value{AS}} features for each +chapter describes the specific @command{@value{AS}} features for each family. @menu @@ -5417,18 +5741,34 @@ family. @include c-m68hc11.texi @end ifset +@ifset M880X0 +@include c-m88k.texi +@end ifset + @ifset MIPS @include c-mips.texi @end ifset +@ifset MMIX +@include c-mmix.texi +@end ifset + @ifset NS32K @include c-ns32k.texi @end ifset +@ifset PDP11 +@include c-pdp11.texi +@end ifset + @ifset PJ @include c-pj.texi @end ifset +@ifset PPC +@include c-ppc.texi +@end ifset + @ifset SH @include c-sh.texi @end ifset @@ -5463,12 +5803,12 @@ family. @cindex bugs in assembler @cindex reporting bugs in assembler -Your bug reports play an essential role in making @code{@value{AS}} reliable. +Your bug reports play an essential role in making @command{@value{AS}} reliable. Reporting a bug may help you by bringing a solution to your problem, or it may not. But in any case the principal function of a bug report is to help the -entire community by making the next version of @code{@value{AS}} work better. -Bug reports are your contribution to the maintenance of @code{@value{AS}}. +entire community by making the next version of @command{@value{AS}} work better. +Bug reports are your contribution to the maintenance of @command{@value{AS}}. In order for a bug report to serve its purpose, you must include the information that enables us to fix the bug. @@ -5490,21 +5830,21 @@ If you are not sure whether you have found a bug, here are some guidelines: @cindex crash of assembler @item If the assembler gets a fatal signal, for any input whatever, that is a -@code{@value{AS}} bug. Reliable assemblers never crash. +@command{@value{AS}} bug. Reliable assemblers never crash. @cindex error on valid input @item -If @code{@value{AS}} produces an error message for valid input, that is a bug. +If @command{@value{AS}} produces an error message for valid input, that is a bug. @cindex invalid input @item -If @code{@value{AS}} does not produce an error message for invalid input, that +If @command{@value{AS}} does not produce an error message for invalid input, that is a bug. However, you should note that your idea of ``invalid input'' might be our idea of ``an extension'' or ``support for traditional practice''. @item If you are an experienced user of assemblers, your suggestions for improvement -of @code{@value{AS}} are welcome in any case. +of @command{@value{AS}} are welcome in any case. @end itemize @node Bug Reporting @@ -5513,14 +5853,14 @@ of @code{@value{AS}} are welcome in any case. @cindex assembler bugs, reporting A number of companies and individuals offer support for @sc{gnu} products. If -you obtained @code{@value{AS}} from a support organization, we recommend you +you obtained @command{@value{AS}} from a support organization, we recommend you contact that organization first. You can find contact information for many support companies and 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}} +In any event, we also recommend that you send bug reports for @command{@value{AS}} to @samp{bug-binutils@@gnu.org}. The fundamental principle of reporting bugs usefully is this: @@ -5550,21 +5890,21 @@ To enable us to fix the bug, you should include all these things: @itemize @bullet @item -The version of @code{@value{AS}}. @code{@value{AS}} announces it if you start +The version of @command{@value{AS}}. @command{@value{AS}} announces it if you start it with the @samp{--version} argument. Without this, we will not know whether there is any point in looking for -the bug in the current version of @code{@value{AS}}. +the bug in the current version of @command{@value{AS}}. @item -Any patches you may have applied to the @code{@value{AS}} source. +Any patches you may have applied to the @command{@value{AS}} source. @item The type of machine you are using, and the operating system name and version number. @item -What compiler (and its version) was used to compile @code{@value{AS}}---e.g. +What compiler (and its version) was used to compile @command{@value{AS}}---e.g. ``@code{gcc-2.7}''. @item @@ -5582,20 +5922,20 @@ high level language source. Most compilers will produce the assembler source when run with the @samp{-S} option. If you are using @code{@value{GCC}}, use the options @samp{-v --save-temps}; this will save the assembler source in a file with an extension of @file{.s}, and also show you exactly how -@code{@value{AS}} is being run. +@command{@value{AS}} is being run. @item A description of what behavior you observe that you believe is incorrect. For example, ``It gets a fatal signal.'' -Of course, if the bug is that @code{@value{AS}} gets a fatal signal, then we +Of course, if the bug is that @command{@value{AS}} gets a fatal signal, then we will certainly notice it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. You might as well not give us a chance to make a mistake. Even if the problem you experience is a fatal signal, you should still say so explicitly. Suppose something strange is going on, such as, your copy of -@code{@value{AS}} is out of synch, or you have encountered a bug in the C +@command{@value{AS}} is out of synch, or you have encountered a bug in the C library on your system. (This has happened!) Your copy might crash and ours would not. If you told us to expect a crash, then when ours fails to crash, we would know that the bug was not happening for us. If you had not told us to @@ -5603,10 +5943,10 @@ expect a crash, then we would not be able to draw any conclusion from our observations. @item -If you wish to suggest changes to the @code{@value{AS}} source, send us context +If you wish to suggest changes to the @command{@value{AS}} source, send us context diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p} option. Always send diffs from the old file to the new file. If you even -discuss something in the @code{@value{AS}} source, refer to it by context, not +discuss something in the @command{@value{AS}} source, refer to it by context, not by line number. The line numbers in our development sources will not match those in your @@ -5644,7 +5984,7 @@ the necessary information, such as the test case, on the assumption that a patch is all we need. We might see problems with your patch and decide to fix the problem another way, or we might not understand it at all. -Sometimes with a program as complicated as @code{@value{AS}} it is very hard to +Sometimes with a program as complicated as @command{@value{AS}} it is very hard to construct an example that will make the program follow a certain path through the code. If you do not send us the example, we will not be able to construct one, so we will not be able to verify that the bug is fixed. @@ -5663,7 +6003,7 @@ things without first using the debugger to find the facts. @node Acknowledgements @chapter Acknowledgements -If you have contributed to @code{@value{AS}} and your name isn't listed here, +If you have contributed to @command{@value{AS}} and your name isn't listed here, it is not meant as a slight. We just don't know about it. Send mail to the maintainer, and we'll correct the situation. Currently @c (January 1994), @@ -5724,7 +6064,7 @@ Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and PowerPC assembler, and made a few other minor patches. -Steve Chamberlain made @code{@value{AS}} able to generate listings. +Steve Chamberlain made @command{@value{AS}} able to generate listings. Hewlett-Packard contributed support for the HP9000/300. diff --git a/contrib/binutils/gas/doc/c-arm.texi b/contrib/binutils/gas/doc/c-arm.texi index 2c67222..022faa0 100644 --- a/contrib/binutils/gas/doc/c-arm.texi +++ b/contrib/binutils/gas/doc/c-arm.texi @@ -31,41 +31,149 @@ @table @code -@cindex @code{-marm} command line option, ARM -@item -marm@code{[2|250|3|6|60|600|610|620|7|7m|7d|7dm|7di|7dmi|70|700|700i|710|710c|7100|7500|7500fe|7tdmi|8|810|9|9tdmi|920|strongarm|strongarm110|strongarm1100]} -@itemx -mxscale +@cindex @code{-mcpu=} command line option, ARM +@item -mcpu=@var{processor}[+@var{extension}@dots{}] This option specifies the target processor. The assembler will issue an error message if an attempt is made to assemble an instruction which -will not execute on the target processor. - -@cindex @code{-marmv} command line option, ARM -@item -marmv@code{[2|2a|3|3m|4|4t|5|5t|5te]} +will not execute on the target processor. The following processor names are +recognized: +@code{arm1}, +@code{arm2}, +@code{arm250}, +@code{arm3}, +@code{arm6}, +@code{arm60}, +@code{arm600}, +@code{arm610}, +@code{arm620}, +@code{arm7}, +@code{arm7m}, +@code{arm7d}, +@code{arm7dm}, +@code{arm7di}, +@code{arm7dmi}, +@code{arm70}, +@code{arm700}, +@code{arm700i}, +@code{arm710}, +@code{arm710t}, +@code{arm720}, +@code{arm720t}, +@code{arm740t}, +@code{arm710c}, +@code{arm7100}, +@code{arm7500}, +@code{arm7500fe}, +@code{arm7t}, +@code{arm7tdmi}, +@code{arm8}, +@code{arm810}, +@code{strongarm}, +@code{strongarm1}, +@code{strongarm110}, +@code{strongarm1100}, +@code{strongarm1110}, +@code{arm9}, +@code{arm920}, +@code{arm920t}, +@code{arm922t}, +@code{arm940t}, +@code{arm9tdmi}, +@code{arm9e}, +@code{arm946e-r0}, +@code{arm946e}, +@code{arm966e-r0}, +@code{arm966e}, +@code{arm10t}, +@code{arm10e}, +@code{arm1020}, +@code{arm1020t}, +@code{arm1020e}, +@code{ep9312} (ARM920 with Cirrus Maverick coprocessor), +@code{i80200} (Intel XScale processor) +and +@code{xscale}. +The special name @code{all} may be used to allow the +assembler to accept instructions valid for any ARM processor. + +In addition to the basic instruction set, the assembler can be told to +accept various extension mnemonics that extend the processor using the +co-processor instruction space. For example, @code{-mcpu=arm920+maverick} +is equivalent to specifying @code{-mcpu=ep9312}. The following extensions +are currently supported: +@code{+maverick} +and +@code{+xscale}. + +@cindex @code{-march=} command line option, ARM +@item -march=@var{architecture}[+@var{extension}@dots{}] This option specifies the target architecture. The assembler will issue an error message if an attempt is made to assemble an instruction which -will not execute on the target architecture. -The option @code{-marmv5te} specifies that v5t architecture should be -used with the El Segundo extensions enabled. +will not execute on the target architecture. The following architecture +names are recognized: +@code{armv1}, +@code{armv2}, +@code{armv2a}, +@code{armv2s}, +@code{armv3}, +@code{armv3m}, +@code{armv4}, +@code{armv4xm}, +@code{armv4t}, +@code{armv4txm}, +@code{armv5}, +@code{armv5t}, +@code{armv5txm}, +@code{armv5te}, +@code{armv5texp} +and +@code{xscale}. +If both @code{-mcpu} and +@code{-march} are specified, the assembler will use +the setting for @code{-mcpu}. + +The architecture option can be extended with the same instruction set +extension options as the @code{-mcpu} option. + +@cindex @code{-mfpu=} command line option, ARM +@item -mfpu=@var{floating-point-format} + +This option specifies the floating point format to assemble for. The +assembler will issue an error message if an attempt is made to assemble +an instruction which will not execute on the target floating point unit. +The following format options are recognized: +@code{softfpa}, +@code{fpe}, +@code{fpe2}, +@code{fpe3}, +@code{fpa}, +@code{fpa10}, +@code{fpa11}, +@code{arm7500fe}, +@code{softvfp}, +@code{softvfp+vfp}, +@code{vfp}, +@code{vfp10}, +@code{vfp10-r0}, +@code{vfp9}, +@code{vfpxd}, +@code{arm1020t} +and +@code{arm1020e}. + +In addition to determining which instructions are assembled, this option +also affects the way in which the @code{.double} assembler directive behaves +when assembling little-endian code. + +The default is dependent on the processor selected. For Architecture 5 or +later, the default is to assembler for VFP instructions; for earlier +architectures the default is to assemble for FPA instructions. @cindex @code{-mthumb} command line option, ARM @item -mthumb -This option specifies that only Thumb instructions should be assembled. - -@cindex @code{-mall} command line option, ARM -@item -mall -This option specifies that any Arm or Thumb instruction should be assembled. - -@cindex @code{-mfpa} command line option, ARM -@item -mfpa @code{[10|11]} -This option specifies the floating point architecture in use on the -target processor. - -@cindex @code{-mfpe-old} command line option, ARM -@item -mfpe-old -Do not allow the assembly of floating point multiple instructions. - -@cindex @code{-mno-fpu} command line option, ARM -@item -mno-fpu -Do not allow the assembly of any floating point instructions. +This option specifies that the assembler should start assembling Thumb +instructions; that is, it should behave as though the file starts with a +@code{.code 16} directive. @cindex @code{-mthumb-interwork} command line option, ARM @item -mthumb-interwork diff --git a/contrib/binutils/gas/doc/c-ppc.texi b/contrib/binutils/gas/doc/c-ppc.texi new file mode 100644 index 0000000..cae9e23 --- /dev/null +++ b/contrib/binutils/gas/doc/c-ppc.texi @@ -0,0 +1,95 @@ +@c Copyright 2001 +@c Free Software Foundation, Inc. +@c This is part of the GAS manual. +@c For copying conditions, see the file as.texinfo. +@ifset GENERIC +@page +@node PPC-Dependent +@chapter PowerPC Dependent Features +@end ifset +@ifclear GENERIC +@node Machine Dependencies +@chapter PowerPC Dependent Features +@end ifclear + +@cindex PowerPC support +@menu +* PowerPC-Opts:: Options +@end menu + +@node PowerPC-Opts +@section Options + +@cindex options for PowerPC +@cindex PowerPC options +@cindex architectures, PowerPC +@cindex PowerPC architectures +The PowerPC chip family includes several successive levels, using the same +core instruction set, but including a few additional instructions at +each level. There are exceptions to this however. For details on what +instructions each variant supports, please see the chip's architecture +reference manual. + +The following table lists all available PowerPC options. + +@table @code +@item -mpwrx | -mpwr2 +Generate code for IBM POWER/2 (RIOS2). + +@item -mpwr +Generate code for IBM POWER (RIOS1) + +@item -m601 +Generate code for Motorola PowerPC 601. + +@item -mppc, -mppc32, -m603, -m604 +Generate code for Motorola PowerPC 603/604. + +@item -m403, -m405 +Generate code for Motorola PowerPC 403/405. + +@item -mppc64, -m620 +Generate code for Motorola PowerPC 620. + +@item -mppc64bridge +Generate code for PowerPC 64, including bridge insns. + +@item -mbooke64 +Generate code for 64-bit Motorola BookE. + +@item -mbooke, mbooke32 +Generate code for 32-bit Motorola BookE. + +@item -mcom +Generate code Power/PowerPC common instructions. + +@item -many +Generate code for any architecture (PWR/PWRX/PPC). + +@item -mregnames +Allow symbolic names for registers. + +@item -mno-regnames +Do not allow symbolic names for registers. + +@item -mrelocatable +Support for GCC's -mrelocatble option. + +@item -mrelocatable-lib +Support for GCC's -mrelocatble-lib option. + +@item -memb +Set PPC_EMB bit in ELF flags. + +@item -mlittle, -mlittle-endian +Generate code for a little endian machine. + +@item -mbig, -mbig-endian +Generate code for a big endian machine. + +@item -msolaris +Generate code for Solaris. + +@item -mno-solaris +Do not generate code for Solaris. +@end table diff --git a/contrib/binutils/gas/doc/internals.texi b/contrib/binutils/gas/doc/internals.texi index eebb9bb..e7d3009 100644 --- a/contrib/binutils/gas/doc/internals.texi +++ b/contrib/binutils/gas/doc/internals.texi @@ -130,11 +130,12 @@ Symbol structures contain the following fields: @item sy_value This is an @code{expressionS} that describes the value of the symbol. It might refer to one or more other symbols; if so, its true value may not be known -until @code{resolve_symbol_value} is called in @code{write_object_file}. +until @code{resolve_symbol_value} is called with @var{finalize_syms} non-zero +in @code{write_object_file}. The expression is often simply a constant. Before @code{resolve_symbol_value} -is called, the value is the offset from the frag (@pxref{Frags}). Afterward, -the frag address has been added in. +is called with @var{finalize_syms} set, the value is the offset from the frag +(@pxref{Frags}). Afterward, the frag address has been added in. @item sy_resolved This field is non-zero if the symbol's value has been completely resolved. It @@ -208,9 +209,7 @@ Set the symbol's value. @item S_GET_VALUE @cindex S_GET_VALUE Get the symbol's value. This will cause @code{resolve_symbol_value} to be -called if necessary, so @code{S_GET_VALUE} should only be called when it is -safe to resolve symbols (i.e., after the entire input file has been read and -all symbols have been defined). +called if necessary. @item S_SET_SEGMENT @cindex S_SET_SEGMENT @@ -513,7 +512,7 @@ A number which is added into the fixup. @item fx_addnumber Some CPU backends use this field to convey information between -@code{md_apply_fix} and @code{tc_gen_reloc}. The machine independent code does +@code{md_apply_fix3} and @code{tc_gen_reloc}. The machine independent code does not use it. @item fx_next @@ -844,11 +843,13 @@ zero if the target is little endian. @itemx md_longopts_size @itemx md_parse_option @itemx md_show_usage +@itemx md_after_parse_args @cindex md_shortopts @cindex md_longopts @cindex md_longopts_size @cindex md_parse_option @cindex md_show_usage +@cindex md_after_parse_args GAS uses these variables and functions during option processing. @code{md_shortopts} is a @code{const char *} which GAS adds to the machine independent string passed to @code{getopt}. @code{md_longopts} is a @@ -860,6 +861,9 @@ GAS will call @code{md_parse_option} whenever @code{getopt} returns an unrecognized code, presumably indicating a special code value which appears in @code{md_longopts}. GAS will call @code{md_show_usage} when a usage message is printed; it should print a description of the machine specific options. +@code{md_after_pase_args}, if defined, is called after all options are +processed, to let the backend override settings done by the generic option +parsing. @item md_begin @cindex md_begin @@ -1131,6 +1135,22 @@ the MIPS which support options to change the endianness, which function to call is a runtime decision. On other targets, @code{md_number_to_chars} can be a simple macro. +@item md_atof (@var{type},@var{litP},@var{sizeP}) +@cindex md_atof +This function is called to convert an ASCII string into a floating point value +in format used by the CPU. It takes three arguments. The first is @var{type} +which is a byte describing the type of floating point number to be created. +Possible values are @var{'f'} or @var{'s'} for single precision, @var{'d'} or +@var{'r'} for double precision and @var{'x'} or @var{'p'} for extended +precision. Either lower or upper case versions of these letters can be used. + +The second parameter is @var{litP} which is a pointer to a byte array where the +converted value should be stored. The third argument is @var{sizeP}, which is +a pointer to a integer that should be filled in with the number of +@var{LITTLENUM}s emitted into the byte array. (@var{LITTLENUM} is defined in +gas/bignum.h). The function should return NULL upon success or an error string +upon failure. + @item md_reloc_size @cindex md_reloc_size This variable is only used in the original version of gas (not @@ -1209,17 +1229,28 @@ The instruction is completed using the data from the relaxation pass. It may also create any necessary relocations. @xref{Relaxation}. -@item md_apply_fix -@cindex md_apply_fix +@item TC_FINALIZE_SYMS_BEFORE_SIZE_SEG +@cindex TC_FINALIZE_SYMS_BEFORE_SIZE_SEG +Specifies the value to be assigned to @code{finalize_syms} before the function +@code{size_segs} is called. Since @code{size_segs} calls @code{cvt_frag_to_fill} +which can call @code{md_convert_frag}, this constant governs whether the symbols +accessed in @code{md_convert_frag} will be fully resolved. In particular it +governs whether local symbols will have been resolved, and had their frag +information removed. Depending upon the processing performed by +@code{md_convert_frag} the frag information may or may not be necessary, as may +the resolved values of the symbols. The default value is 1. + +@item md_apply_fix3 +@cindex md_apply_fix3 GAS will call this for each fixup. It should store the correct value in the object file. @code{fixup_segment} performs a generic overflow check on the -@code{valueT *val} argument after @code{md_apply_fix} returns. If the overflow -check is relevant for the target machine, then @code{md_apply_fix} should +@code{valueT *val} argument after @code{md_apply_fix3} returns. If the overflow +check is relevant for the target machine, then @code{md_apply_fix3} should modify @code{valueT *val}, typically to the value stored in the object file. @item TC_HANDLES_FX_DONE @cindex TC_HANDLES_FX_DONE -If this macro is defined, it means that @code{md_apply_fix} correctly sets the +If this macro is defined, it means that @code{md_apply_fix3} correctly sets the @code{fx_done} field in the fixup. @item tc_gen_reloc @@ -1248,12 +1279,14 @@ You may define this macro to indicate whether a fixup against a locally defined symbol should be adjusted to be against the section symbol. It should return a non-zero value if the adjustment is acceptable. -@item MD_PCREL_FROM_SECTION +@item MD_PCREL_FROM_SECTION (@var{fixp}, @var{section}) @cindex MD_PCREL_FROM_SECTION -If you define this macro, it should return the offset between the address of a -PC relative fixup and the position from which the PC relative adjustment should -be made. On many processors, the base of a PC relative instruction is the next -instruction, so this macro would return the length of an instruction. +If you define this macro, it should return the position from which the PC +relative adjustment for a PC relative fixup should be made. On many +processors, the base of a PC relative instruction is the next instruction, +so this macro would return the length of an instruction, plus the address of +the PC relative fixup. The latter can be calculated as +@var{fixp}->fx_where + @var{fixp}->fx_frag->fr_address . @item md_pcrel_from @cindex md_pcrel_from diff --git a/contrib/binutils/gas/dwarf2dbg.c b/contrib/binutils/gas/dwarf2dbg.c index ea76069..6e62206 100644 --- a/contrib/binutils/gas/dwarf2dbg.c +++ b/contrib/binutils/gas/dwarf2dbg.c @@ -230,11 +230,20 @@ dwarf2_gen_line_info (ofs, loc) { struct line_subseg *ss; struct line_entry *e; + static unsigned int line = -1; + static unsigned int filenum = -1; /* Early out for as-yet incomplete location information. */ if (loc->filenum == 0 || loc->line == 0) return; + /* Don't emit sequences of line symbols for the same line. */ + if (line == loc->line && filenum == loc->filenum) + return; + + line = loc->line; + filenum = loc->filenum; + e = (struct line_entry *) xmalloc (sizeof (*e)); e->next = NULL; e->frag = frag_now; @@ -341,13 +350,13 @@ dwarf2_directive_file (dummy) if (num < 1) { - as_bad (_("File number less than one")); + as_bad (_("file number less than one")); return; } - if (num < files_in_use && files[num].filename != 0) + if (num < (int) files_in_use && files[num].filename != 0) { - as_bad (_("File number %ld already allocated"), (long) num); + as_bad (_("file number %ld already allocated"), (long) num); return; } @@ -383,12 +392,12 @@ dwarf2_directive_loc (dummy) if (filenum < 1) { - as_bad (_("File number less than one")); + as_bad (_("file number less than one")); return; } if (filenum >= (int) files_in_use || files[filenum].filename == 0) { - as_bad (_("Unassigned file number %ld"), (long) filenum); + as_bad (_("unassigned file number %ld"), (long) filenum); return; } @@ -524,8 +533,9 @@ get_frag_fix (frag) for (fr = frchain_root; fr; fr = fr->frch_next) if (fr->frch_last == frag) { - return ((char *) obstack_next_free (&fr->frch_obstack) - - frag->fr_literal); + long align_mask = -1 << get_recorded_alignment (fr->frch_seg); + return (((char *) obstack_next_free (&fr->frch_obstack) + - frag->fr_literal) + ~align_mask) & align_mask; } abort (); @@ -772,7 +782,7 @@ dwarf2dbg_estimate_size_before_relax (frag) offsetT addr_delta; int size; - addr_delta = resolve_symbol_value (frag->fr_symbol, 0); + addr_delta = resolve_symbol_value (frag->fr_symbol); size = size_inc_line_addr (frag->fr_offset, addr_delta); frag->fr_subtype = size; @@ -806,7 +816,7 @@ dwarf2dbg_convert_frag (frag) { offsetT addr_diff; - addr_diff = resolve_symbol_value (frag->fr_symbol, 1); + addr_diff = resolve_symbol_value (frag->fr_symbol); /* fr_var carries the max_chars that we created the fragment with. fr_subtype carries the current expected length. We must, of @@ -933,7 +943,7 @@ out_file_list () { if (files[i].filename == NULL) { - as_bad (_("Unassigned file number %u"), i); + as_bad (_("unassigned file number %ld"), (long) i); continue; } @@ -1212,7 +1222,7 @@ dwarf2_finish () struct line_seg *s; /* If no debug information was recorded, nothing to do. */ - if (all_segs == NULL) + if (all_segs == NULL && files_in_use <= 1) return; /* Calculate the size of an address for the target machine. */ @@ -1239,7 +1249,7 @@ dwarf2_finish () /* If this is assembler generated line info, we need .debug_info and .debug_abbrev sections as well. */ - if (debug_type == DEBUG_DWARF2) + if (all_segs != NULL && debug_type == DEBUG_DWARF2) { segT abbrev_seg; segT info_seg; diff --git a/contrib/binutils/gas/ecoff.c b/contrib/binutils/gas/ecoff.c index cc94bf6..ed11921 100644 --- a/contrib/binutils/gas/ecoff.c +++ b/contrib/binutils/gas/ecoff.c @@ -37,7 +37,7 @@ #include "coff/symconst.h" #include "aout/stab_gnu.h" -#include +#include "safe-ctype.h" /* Why isn't this in coff/sym.h? */ #define ST_RFDESCAPE 0xfff @@ -1553,7 +1553,7 @@ add_string (vp, hash_tbl, str, ret_hash) register shash_t *hash_ptr; if (len >= PAGE_USIZE) - as_fatal (_("String too big (%lu bytes)"), len); + as_fatal (_("string too big (%lu bytes)"), len); hash_ptr = (shash_t *) hash_find (hash_tbl, str); if (hash_ptr == (shash_t *) NULL) @@ -1579,7 +1579,7 @@ add_string (vp, hash_tbl, str, ret_hash) err = hash_insert (hash_tbl, str, (char *) hash_ptr); if (err) - as_fatal (_("Inserting \"%s\" into string hash table: %s"), + as_fatal (_("inserting \"%s\" into string hash table: %s"), str, err); } @@ -2042,7 +2042,7 @@ get_tag (tag, sym, basic_type) hash_ptr = allocate_shash (); err = hash_insert (tag_hash, perm, (char *) hash_ptr); if (err) - as_fatal (_("Inserting \"%s\" into tag hash table: %s"), + as_fatal (_("inserting \"%s\" into tag hash table: %s"), tag, err); hash_ptr->string = perm; } @@ -2298,7 +2298,7 @@ add_file (file_name, indx, fake) (shash_t **)0); if (strlen (file_name) > PAGE_USIZE - 2) - as_fatal (_("Filename goes over one page boundary.")); + as_fatal (_("filename goes over one page boundary")); /* Push the start of the filename. We assume that the filename will be stored at string offset 1. */ @@ -2538,7 +2538,7 @@ ecoff_directive_def (ignore) if (coff_sym_name != (char *) NULL) as_warn (_(".def pseudo-op used inside of .def/.endef; ignored")); else if (*name == '\0') - as_warn (_("Empty symbol name in .def; ignored")); + as_warn (_("empty symbol name in .def; ignored")); else { if (coff_sym_name != (char *) NULL) @@ -2591,7 +2591,7 @@ ecoff_directive_dim (ignore) { if (*input_line_pointer != '\n' && *input_line_pointer != ';') - as_warn (_("Badly formed .dim directive")); + as_warn (_("badly formed .dim directive")); break; } } @@ -2604,7 +2604,7 @@ ecoff_directive_dim (ignore) { if (coff_type.num_dims >= N_TQ) { - as_warn (_("Too many .dim entries")); + as_warn (_("too many .dim entries")); break; } coff_type.dimensions[coff_type.num_dims] = dimens[i]; @@ -2666,7 +2666,7 @@ ecoff_directive_size (ignore) { if (*input_line_pointer != '\n' && *input_line_pointer != ';') - as_warn (_("Badly formed .size directive")); + as_warn (_("badly formed .size directive")); break; } } @@ -2679,7 +2679,7 @@ ecoff_directive_size (ignore) { if (coff_type.num_sizes >= N_TQ) { - as_warn (_("Too many .size entries")); + as_warn (_("too many .size entries")); break; } coff_type.sizes[coff_type.num_sizes] = sizes[i]; @@ -2720,7 +2720,7 @@ ecoff_directive_type (ignore) /* FIXME: We could handle this by setting the continued bit. There would still be a limit: the .type argument can not be infinite. */ - as_warn (_("The type of %s is too complex; it will be simplified"), + as_warn (_("the type of %s is too complex; it will be simplified"), coff_sym_name); break; } @@ -2862,7 +2862,7 @@ ecoff_directive_endef (ignore) if (coff_type.num_sizes != 1 || diff < 0) { - as_warn (_("Bad COFF debugging info")); + as_warn (_("bad COFF debugging information")); return; } @@ -2911,7 +2911,7 @@ ecoff_directive_endef (ignore) { if (coff_tag == (char *) NULL) { - as_warn (_("No tag specified for %s"), name); + as_warn (_("no tag specified for %s"), name); return; } @@ -2943,7 +2943,7 @@ ecoff_directive_endef (ignore) if (coff_type.num_sizes - coff_type.num_dims - coff_type.extra_sizes != 1) { - as_warn (_("Bad COFF debugging information")); + as_warn (_("bad COFF debugging information")); return; } else @@ -3010,7 +3010,6 @@ ecoff_directive_end (ignore) { char *name; char name_end; - register int ch; symbolS *ent; if (cur_file_ptr == (efdr_t *) NULL) @@ -3030,8 +3029,7 @@ ecoff_directive_end (ignore) name = input_line_pointer; name_end = get_symbol_end (); - ch = *name; - if (! is_name_beginner (ch)) + if (name == input_line_pointer) { as_warn (_(".end directive has no name")); *input_line_pointer = name_end; @@ -3067,7 +3065,6 @@ ecoff_directive_ent (ignore) { char *name; char name_end; - register int ch; if (cur_file_ptr == (efdr_t *) NULL) add_file ((const char *) NULL, 0, 1); @@ -3082,8 +3079,7 @@ ecoff_directive_ent (ignore) name = input_line_pointer; name_end = get_symbol_end (); - ch = *name; - if (! is_name_beginner (ch)) + if (name == input_line_pointer) { as_warn (_(".ent directive has no name")); *input_line_pointer = name_end; @@ -3105,7 +3101,7 @@ ecoff_directive_ent (ignore) ++input_line_pointer; SKIP_WHITESPACE (); } - if (isdigit ((unsigned char) *input_line_pointer) + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') (void) get_absolute_expression (); @@ -3149,7 +3145,7 @@ ecoff_directive_file (ignore) if (cur_proc_ptr != (proc_t *) NULL) { - as_warn (_("No way to handle .file within .ent/.end section")); + as_warn (_("no way to handle .file within .ent/.end section")); demand_empty_rest_of_line (); return; } @@ -3181,7 +3177,7 @@ ecoff_directive_fmask (ignore) if (get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .fmask directive")); + as_warn (_("bad .fmask directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3214,7 +3210,7 @@ ecoff_directive_frame (ignore) if (*input_line_pointer++ != ',' || get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .frame directive")); + as_warn (_("bad .frame directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3251,7 +3247,7 @@ ecoff_directive_mask (ignore) if (get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .mask directive")); + as_warn (_("bad .mask directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3400,7 +3396,7 @@ ecoff_directive_weakext (ignore) { if (S_IS_DEFINED (symbolP)) { - as_bad (_("Ignoring attempt to redefine symbol `%s'."), + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); ignore_rest_of_line (); return; @@ -3526,7 +3522,7 @@ ecoff_stab (sec, what, string, type, other, desc) 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)"), + as_warn (_("line number (%d) for .stab%c directive cannot fit in index field (20 bits)"), desc, what); return; } @@ -3550,7 +3546,7 @@ ecoff_stab (sec, what, string, type, other, desc) listing_source_file (string); #endif - if (isdigit ((unsigned char) *input_line_pointer) + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-' || *input_line_pointer == '+') { @@ -3562,7 +3558,7 @@ ecoff_stab (sec, what, string, type, other, desc) } else if (! is_name_beginner ((unsigned char) *input_line_pointer)) { - as_warn (_("Illegal .stab%c directive, bad character"), what); + as_warn (_("illegal .stab%c directive, bad character"), what); return; } else @@ -3620,7 +3616,7 @@ ecoff_frob_symbol (sym) { if (S_IS_COMMON (sym) && S_GET_VALUE (sym) > 0 - && S_GET_VALUE (sym) <= (unsigned) bfd_get_gp_size (stdoutput)) + && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput)) { static asection scom_section; static asymbol scom_symbol; @@ -3645,7 +3641,7 @@ ecoff_frob_symbol (sym) if (S_IS_WEAK (sym)) { if (S_IS_COMMON (sym)) - as_bad (_("Symbol `%s' can not be both weak and common"), + as_bad (_("symbol `%s' can not be both weak and common"), S_GET_NAME (sym)); } } @@ -4085,7 +4081,7 @@ ecoff_build_symbols (backend, buf, bufend, offset) s = symbol_get_obj (as_sym)->ecoff_extern_size; if (s == 0 - || s > (unsigned) bfd_get_gp_size (stdoutput)) + || s > bfd_get_gp_size (stdoutput)) sc = sc_Undefined; else { @@ -4100,7 +4096,7 @@ ecoff_build_symbols (backend, buf, bufend, offset) { if (S_GET_VALUE (as_sym) > 0 && (S_GET_VALUE (as_sym) - <= (unsigned) bfd_get_gp_size (stdoutput))) + <= bfd_get_gp_size (stdoutput))) sc = sc_SCommon; else sc = sc_Common; @@ -4740,7 +4736,7 @@ ecoff_build_debug (hdr, bufp, backend) cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev; if (! end_warning && ! cur_file_ptr->fake) { - as_warn (_("Missing .end or .bend at end of file")); + as_warn (_("missing .end or .bend at end of file")); end_warning = 1; } } diff --git a/contrib/binutils/gas/ehopt.c b/contrib/binutils/gas/ehopt.c index 64ea7e0..ad6e028 100644 --- a/contrib/binutils/gas/ehopt.c +++ b/contrib/binutils/gas/ehopt.c @@ -462,7 +462,7 @@ eh_frame_estimate_size_before_relax (frag) int ca = frag->fr_subtype >> 3; int ret; - diff = resolve_symbol_value (frag->fr_symbol, 0); + diff = resolve_symbol_value (frag->fr_symbol); if (ca > 0 && diff % ca == 0 && diff / ca < 0x40) ret = 0; @@ -508,7 +508,7 @@ eh_frame_convert_frag (frag) loc4_frag = (fragS *) frag->fr_opcode; loc4_fix = (int) frag->fr_offset; - diff = resolve_symbol_value (frag->fr_symbol, 1); + diff = resolve_symbol_value (frag->fr_symbol); switch (frag->fr_subtype & 7) { diff --git a/contrib/binutils/gas/emul-target.h b/contrib/binutils/gas/emul-target.h index 8f18684..4c1a02a 100644 --- a/contrib/binutils/gas/emul-target.h +++ b/contrib/binutils/gas/emul-target.h @@ -50,14 +50,15 @@ #define emul_fake_label_name 0 #endif -struct emulation emul_struct_name = { - 0, - emul_name, - emul_init, - emul_bfd_name, - emul_local_labels_fb, emul_local_labels_dollar, - emul_leading_underscore, emul_strip_underscore, - emul_default_endian, - emul_fake_label_name, - emul_format, -}; +struct emulation emul_struct_name = + { + 0, + emul_name, + emul_init, + emul_bfd_name, + emul_local_labels_fb, emul_local_labels_dollar, + emul_leading_underscore, emul_strip_underscore, + emul_default_endian, + emul_fake_label_name, + emul_format, + }; diff --git a/contrib/binutils/gas/emul.h b/contrib/binutils/gas/emul.h index 465f844..b665260 100644 --- a/contrib/binutils/gas/emul.h +++ b/contrib/binutils/gas/emul.h @@ -21,23 +21,24 @@ #ifndef EMUL_DEFS #define EMUL_DEFS -struct emulation { - void (*match) PARAMS ((const char *)); - const char *name; - void (*init) PARAMS ((void)); - const char *(*bfd_name) PARAMS ((void)); - unsigned local_labels_fb : 1; - unsigned local_labels_dollar : 1; - unsigned leading_underscore : 2; - unsigned strip_underscore : 1; - unsigned default_endian : 2; - const char *fake_label_name; - const struct format_ops *format; -}; - -COMMON struct emulation *this_emulation; - -extern const char *default_emul_bfd_name PARAMS ((void)); +struct emulation + { + void (* match) PARAMS ((const char *)); + const char * name; + void (* init) PARAMS ((void)); + const char *(* bfd_name) PARAMS ((void)); + unsigned local_labels_fb : 1; + unsigned local_labels_dollar : 1; + unsigned leading_underscore : 2; + unsigned strip_underscore : 1; + unsigned default_endian : 2; + const char * fake_label_name; + const struct format_ops * format; + }; + +COMMON struct emulation * this_emulation; + +extern const char * default_emul_bfd_name PARAMS ((void)); extern void common_emul_init PARAMS ((void)); #endif diff --git a/contrib/binutils/gas/expr.c b/contrib/binutils/gas/expr.c index 3b49ac7..74c49d9 100644 --- a/contrib/binutils/gas/expr.c +++ b/contrib/binutils/gas/expr.c @@ -25,11 +25,11 @@ (It also gives smaller files to re-compile.) Here, "operand"s are of expressions, not instructions. */ -#include #include #define min(a, b) ((a) < (b) ? (a) : (b)) #include "as.h" +#include "safe-ctype.h" #include "obstack.h" static void floating_constant PARAMS ((expressionS * expressionP)); @@ -81,9 +81,9 @@ make_expr_symbol (expressionP) generic_floating_point_number or generic_bignum, and we are going to lose it if we haven't already. */ if (expressionP->X_add_number > 0) - as_bad (_("bignum invalid; zero assumed")); + as_bad (_("bignum invalid")); else - as_bad (_("floating point number invalid; zero assumed")); + as_bad (_("floating point number invalid")); zero.X_op = O_constant; zero.X_add_number = 0; zero.X_unsigned = 0; @@ -105,7 +105,7 @@ make_expr_symbol (expressionP) symbol_set_value_expression (symbolP, expressionP); if (expressionP->X_op == O_constant) - resolve_symbol_value (symbolP, 1); + resolve_symbol_value (symbolP); n = (struct expr_symbol_line *) xmalloc (sizeof *n); n->sym = symbolP; @@ -243,11 +243,12 @@ floating_constant (expressionP) { if (error_code == ERROR_EXPONENT_OVERFLOW) { - as_bad (_("bad floating-point constant: exponent overflow, probably assembling junk")); + as_bad (_("bad floating-point constant: exponent overflow")); } else { - as_bad (_("bad floating-point constant: unknown error code=%d."), error_code); + as_bad (_("bad floating-point constant: unknown error code=%d"), + error_code); } } expressionP->X_op = O_big; @@ -330,9 +331,7 @@ 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 ((unsigned char) *suffix); - suffix++) + for (suffix = input_line_pointer; ISALNUM (*suffix); suffix++) { if (*suffix == 'e' || *suffix == 'E') flt = 1; @@ -346,8 +345,7 @@ integer_constant (radix, expressionP) else { c = *--suffix; - if (islower ((unsigned char) c)) - c = toupper (c); + c = TOUPPER (c); if (c == 'B') radix = 2; else if (c == 'D') @@ -427,7 +425,7 @@ integer_constant (radix, expressionP) /* Check for 8 digit per word max. */ if (ndigit > 8) - as_bad (_("A bignum with underscores may not have more than 8 hex digits in any word.")); + as_bad (_("a 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. */ @@ -450,7 +448,7 @@ integer_constant (radix, expressionP) assert (num_little_digits >= 4); if (num_little_digits != 8) - as_bad (_("A bignum with underscores must have exactly 4 words.")); + 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. */ @@ -573,7 +571,7 @@ integer_constant (radix, expressionP) /* Either not seen or not defined. */ /* @@ Should print out the original string instead of the parsed number. */ - as_bad (_("backw. ref to unknown label \"%d:\", 0 assumed."), + as_bad (_("backward ref to unknown label \"%d:\""), (int) number); expressionP->X_op = O_constant; } @@ -696,7 +694,7 @@ mri_char_constant (expressionP) if (i < 0) { - as_bad (_("Character constant too large")); + as_bad (_("character constant too large")); i = 0; } @@ -761,7 +759,7 @@ current_location (expressionp) /* In: Input_line_pointer points to 1st char of operand, which may be a space. - Out: A expressionS. + Out: An expressionS. The operand may have been empty: in this case X_op == O_absent. Input_line_pointer->(next non-blank) char after operand. */ @@ -810,6 +808,9 @@ operand (expressionP) #ifdef LITERAL_PREFIXDOLLAR_HEX case '$': + /* $L is the start of a local label, not a hex constant. */ + if (* input_line_pointer == 'L') + goto isname; integer_constant (16, expressionP); break; #endif @@ -858,8 +859,7 @@ operand (expressionP) { input_line_pointer++; floating_constant (expressionP); - expressionP->X_add_number = - - (isupper ((unsigned char) c) ? tolower (c) : c); + expressionP->X_add_number = - TOLOWER (c); } else { @@ -981,8 +981,7 @@ operand (expressionP) case 'G': input_line_pointer++; floating_constant (expressionP); - expressionP->X_add_number = - - (isupper ((unsigned char) c) ? tolower (c) : c); + expressionP->X_add_number = - TOLOWER (c); break; case '$': @@ -1010,7 +1009,7 @@ operand (expressionP) #ifdef RELAX_PAREN_GROUPING if (c != '(') #endif - as_bad (_("Missing '%c' assumed"), c == '(' ? ')' : ']'); + as_bad (_("missing '%c'"), c == '(' ? ')' : ']'); } else input_line_pointer++; @@ -1231,7 +1230,7 @@ operand (expressionP) specially in certain contexts. If a name always has a specific value, it can often be handled by simply entering it in the symbol table. */ - if (md_parse_name (name, expressionP)) + if (md_parse_name (name, expressionP, &c)) { *input_line_pointer = c; break; @@ -1312,7 +1311,7 @@ operand (expressionP) if (expressionP->X_op == O_absent) { ++input_line_pointer; - as_bad (_("Bad expression")); + as_bad (_("bad expression")); expressionP->X_op = O_constant; expressionP->X_add_number = 0; } @@ -1343,7 +1342,7 @@ operand (expressionP) /* Internal. Simplify a struct expression for use by expr (). */ -/* In: address of a expressionS. +/* In: address of an expressionS. The X_op field of the expressionS may only take certain values. Elsewise we waste time special-case testing. Sigh. Ditto SEG_ABSENT. @@ -1400,7 +1399,7 @@ clean_up_expression (expressionP) Unary operators and parenthetical expressions are treated as operands. As usual, Q==quantity==operand, O==operator, X==expression mnemonics. - We used to do a aho/ullman shift-reduce parser, but the logic got so + We used to do an aho/ullman shift-reduce parser, but the logic got so warped that I flushed it and wrote a recursive-descent parser instead. Now things are stable, would anybody like to write a fast parser? Most expressions are either register (which does not even reach here) @@ -1456,7 +1455,7 @@ static const operatorT op_encoding[256] = { 0 operand, (expression) 1 || 2 && - 3 = <> < <= >= > + 3 == <> < <= >= > 4 + - 5 used for * / % in MRI mode 6 & ^ ! | @@ -1695,21 +1694,6 @@ expr (rankarg, resultP) } } - if (retval == undefined_section) - { - if (SEG_NORMAL (rightseg)) - retval = rightseg; - } - else if (! SEG_NORMAL (retval)) - retval = rightseg; - else if (SEG_NORMAL (rightseg) - && retval != rightseg -#ifdef DIFF_EXPR_OK - && op_left != O_subtract -#endif - ) - as_bad (_("operation combines symbols in different segments")); - op_right = operator (&op_chars); know (op_right == O_illegal @@ -1765,8 +1749,7 @@ expr (rankarg, resultP) && resultP->X_op == O_symbol && (symbol_get_frag (right.X_add_symbol) == symbol_get_frag (resultP->X_add_symbol)) - && SEG_NORMAL (S_GET_SEGMENT (right.X_add_symbol))) - + && SEG_NORMAL (rightseg)) { resultP->X_add_number -= right.X_add_number; resultP->X_add_number += (S_GET_VALUE (resultP->X_add_symbol) @@ -1861,7 +1844,14 @@ expr (rankarg, resultP) if (op_left == O_add) resultP->X_add_number += right.X_add_number; else if (op_left == O_subtract) - resultP->X_add_number -= right.X_add_number; + { + resultP->X_add_number -= right.X_add_number; + if (retval == rightseg && SEG_NORMAL (retval)) + { + retval = absolute_section; + rightseg = absolute_section; + } + } } else { @@ -1873,6 +1863,21 @@ expr (rankarg, resultP) resultP->X_unsigned = 1; } + if (retval != rightseg) + { + if (! SEG_NORMAL (retval)) + { + if (retval != undefined_section || SEG_NORMAL (rightseg)) + retval = rightseg; + } + else if (SEG_NORMAL (rightseg) +#ifdef DIFF_EXPR_OK + && op_left != O_subtract +#endif + ) + as_bad (_("operation combines symbols in different segments")); + } + op_left = op_right; } /* While next operator is >= this rank. */ diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c index 4dc2a7d..8d7ed2f 100644 --- a/contrib/binutils/gas/frags.c +++ b/contrib/binutils/gas/frags.c @@ -84,7 +84,7 @@ frag_grow (nchars) frchain_now->frch_obstack.chunk_size = oldc; } if (obstack_room (&frchain_now->frch_obstack) < nchars) - as_fatal (_("Can't extend frag %d. chars"), nchars); + as_fatal (_("can't extend frag %u chars"), nchars); } /* Call this to close off a completed frag, and start up a new (empty) diff --git a/contrib/binutils/gas/frags.h b/contrib/binutils/gas/frags.h index e4cb050..df259b8 100644 --- a/contrib/binutils/gas/frags.h +++ b/contrib/binutils/gas/frags.h @@ -43,8 +43,9 @@ struct obstack; struct frag { /* Object file address (as an octet offset). */ addressT fr_address; - /* Chain forward; ascending address order. Rooted in frch_root. */ - struct frag *fr_next; + /* When relaxing multiple times, remember the address the frag had + in the last relax pass. */ + addressT last_fr_address; /* (Fixed) number of octets we know we have. May be 0. */ offsetT fr_fix; @@ -52,12 +53,19 @@ struct frag { The generic frag handling code no longer makes any use of fr_var. */ offsetT fr_var; /* For variable-length tail. */ - symbolS *fr_symbol; - /* For variable-length tail. */ offsetT fr_offset; + /* For variable-length tail. */ + symbolS *fr_symbol; /* Points to opcode low addr byte, for relaxation. */ char *fr_opcode; + /* Chain forward; ascending address order. Rooted in frch_root. */ + struct frag *fr_next; + + /* Where the frag was created, or where it became a variant frag. */ + char *fr_file; + unsigned int fr_line; + #ifndef NO_LISTING struct list_info_struct *line; #endif @@ -86,10 +94,6 @@ struct frag { 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]; }; diff --git a/contrib/binutils/gas/gasp.c b/contrib/binutils/gas/gasp.c index ad33a46..73b4d88 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 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, @@ -51,7 +51,6 @@ suitable for gas to consume. #include #include #include -#include #ifdef HAVE_STDLIB_H #include @@ -63,6 +62,7 @@ extern char *malloc (); #include "ansidecl.h" #include "libiberty.h" +#include "safe-ctype.h" #include "sb.h" #include "macro.h" #include "asintl.h" @@ -539,7 +539,7 @@ sb_strtol (idx, string, base, ptr) { int ch = string->ptr[idx]; int dig = 0; - if (isdigit (ch)) + if (ISDIGIT (ch)) dig = ch - '0'; else if (ch >= 'a' && ch <= 'f') dig = ch - 'a' + 10; @@ -574,7 +574,7 @@ level_0 (idx, string, lhs) lhs->value = 0; - if (isdigit ((unsigned char) string->ptr[idx])) + if (ISDIGIT (string->ptr[idx])) { idx = sb_strtol (idx, string, 10, &lhs->value); } @@ -1132,7 +1132,7 @@ change_base (idx, in, out) idx++; } } - else if (isdigit ((unsigned char) in->ptr[idx])) + else if (ISDIGIT (in->ptr[idx])) { int value; /* All numbers must start with a digit, let's chew it and @@ -1549,6 +1549,7 @@ get_any_string (idx, in, out, expand, pretend_quoted) int val; char buf[20]; /* Turns the next expression into a string. */ + /* xgettext: no-c-format */ idx = exp_get_abs (_("% operator needs absolute expression"), idx + 1, in, @@ -1676,7 +1677,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 ((unsigned char) in->ptr[idx])) + if (ISDIGIT (in->ptr[idx])) { idx = exp_get_abs (_(".instr needs absolute expresson.\n"), idx, in, &start); } @@ -1776,26 +1777,26 @@ process_assigns (idx, in, buf) } else if (idx + 3 < in->len && in->ptr[idx] == '.' - && toupper ((unsigned char) in->ptr[idx + 1]) == 'L' - && toupper ((unsigned char) in->ptr[idx + 2]) == 'E' - && toupper ((unsigned char) in->ptr[idx + 3]) == 'N') + && TOUPPER (in->ptr[idx + 1]) == 'L' + && TOUPPER (in->ptr[idx + 2]) == 'E' + && TOUPPER (in->ptr[idx + 3]) == 'N') idx = dolen (idx + 4, in, buf); else if (idx + 6 < in->len && in->ptr[idx] == '.' - && toupper ((unsigned char) in->ptr[idx + 1]) == 'I' - && toupper ((unsigned char) in->ptr[idx + 2]) == 'N' - && toupper ((unsigned char) in->ptr[idx + 3]) == 'S' - && toupper ((unsigned char) in->ptr[idx + 4]) == 'T' - && toupper ((unsigned char) in->ptr[idx + 5]) == 'R') + && TOUPPER (in->ptr[idx + 1]) == 'I' + && TOUPPER (in->ptr[idx + 2]) == 'N' + && TOUPPER (in->ptr[idx + 3]) == 'S' + && TOUPPER (in->ptr[idx + 4]) == 'T' + && TOUPPER (in->ptr[idx + 5]) == 'R') idx = doinstr (idx + 6, in, buf); else if (idx + 7 < in->len && in->ptr[idx] == '.' - && toupper ((unsigned char) in->ptr[idx + 1]) == 'S' - && toupper ((unsigned char) in->ptr[idx + 2]) == 'U' - && toupper ((unsigned char) in->ptr[idx + 3]) == 'B' - && toupper ((unsigned char) in->ptr[idx + 4]) == 'S' - && toupper ((unsigned char) in->ptr[idx + 5]) == 'T' - && toupper ((unsigned char) in->ptr[idx + 6]) == 'R') + && TOUPPER (in->ptr[idx + 1]) == 'S' + && TOUPPER (in->ptr[idx + 2]) == 'U' + && TOUPPER (in->ptr[idx + 3]) == 'B' + && TOUPPER (in->ptr[idx + 4]) == 'S' + && TOUPPER (in->ptr[idx + 5]) == 'T' + && TOUPPER (in->ptr[idx + 6]) == 'R') idx = dosubstr (idx + 7, in, buf); else if (ISFIRSTCHAR (in->ptr[idx])) { @@ -2130,8 +2131,8 @@ whatcond (idx, in, val) char a, b; p = in->ptr + idx; - a = toupper ((unsigned char) p[0]); - b = toupper ((unsigned char) p[1]); + a = TOUPPER (p[0]); + b = TOUPPER (p[1]); if (a == 'E' && b == 'Q') cond = EQ; else if (a == 'N' && b == 'E') @@ -2980,13 +2981,13 @@ chartype_init () int x; for (x = 0; x < 256; x++) { - if (isalpha (x) || x == '_' || x == '$') + if (ISALPHA (x) || x == '_' || x == '$') chartype[x] |= FIRSTBIT; if (mri && x == '.') chartype[x] |= FIRSTBIT; - if (isdigit (x) || isalpha (x) || x == '_' || x == '$') + if (ISDIGIT (x) || ISALPHA (x) || x == '_' || x == '$') chartype[x] |= NEXTBIT; if (x == ' ' || x == '\t' || x == ',' || x == '"' || x == ';' @@ -3537,6 +3538,8 @@ show_help () show_usage (stdout, 0); } +int main PARAMS ((int, char **)); + int main (argc, argv) int argc; @@ -3552,6 +3555,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/contrib/binutils/gas/hash.c b/contrib/binutils/gas/hash.c index ab28396..e993136 100644 --- a/contrib/binutils/gas/hash.c +++ b/contrib/binutils/gas/hash.c @@ -1,6 +1,6 @@ /* hash.c -- gas hash table code Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -30,6 +30,7 @@ structure. */ #include "as.h" +#include "safe-ctype.h" #include "obstack.h" /* The default number of entries to use when creating a hash table. */ @@ -458,8 +459,7 @@ main () printf ("hash_test command: "); gets (answer); command = answer[0]; - if (isupper (command)) - command = tolower (command); /* Ecch! */ + command = TOLOWER (command); /* Ecch! */ switch (command) { case '#': diff --git a/contrib/binutils/gas/input-file.c b/contrib/binutils/gas/input-file.c index f001e52..798f327 100644 --- a/contrib/binutils/gas/input-file.c +++ b/contrib/binutils/gas/input-file.c @@ -1,5 +1,5 @@ /* input_file.c - Deal with Input Files - - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,50 +19,44 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - * Confines all details of reading source bytes to this module. - * All O/S specific crocks should live here. - * What we lose in "efficiency" we gain in modularity. - * Note we don't need to #include the "as.h" file. No common coupling! - */ +/* Confines all details of reading source bytes to this module. + All O/S specific crocks should live here. + What we lose in "efficiency" we gain in modularity. + Note we don't need to #include the "as.h" file. No common coupling! */ #include #include - #include "as.h" #include "input-file.h" +#include "safe-ctype.h" static int input_file_get PARAMS ((char *, int)); /* This variable is non-zero if the file currently being read should be - preprocessed by app. It is zero if the file can be read straight in. - */ + preprocessed by app. It is zero if the file can be read straight in. */ int preprocess = 0; -/* - * This code opens a file, then delivers BUFFER_SIZE character - * chunks of the file on demand. - * BUFFER_SIZE is supposed to be a number chosen for speed. - * The caller only asks once what BUFFER_SIZE is, and asks before - * the nature of the input files (if any) is known. - */ +/* This code opens a file, then delivers BUFFER_SIZE character + chunks of the file on demand. + BUFFER_SIZE is supposed to be a number chosen for speed. + The caller only asks once what BUFFER_SIZE is, and asks before + the nature of the input files (if any) is known. */ #define BUFFER_SIZE (32 * 1024) -/* - * We use static data: the data area is not sharable. - */ +/* We use static data: the data area is not sharable. */ static FILE *f_in; static char *file_name; /* Struct for saving the state of this module for file includes. */ -struct saved_file { - FILE *f_in; - char *file_name; - int preprocess; - char *app_save; -}; +struct saved_file + { + FILE * f_in; + char * file_name; + int preprocess; + char * app_save; + }; /* These hooks accomodate most operating systems. */ @@ -92,6 +86,7 @@ input_file_is_open () /* Push the state of our input, returning a pointer to saved info that can be restored with input_file_pop (). */ + char * input_file_push () { @@ -105,7 +100,8 @@ input_file_push () if (preprocess) saved->app_save = app_push (); - input_file_begin (); /* Initialize for new file */ + /* Initialize for new file. */ + input_file_begin (); return (char *) saved; } @@ -116,7 +112,7 @@ input_file_pop (arg) { register struct saved_file *saved = (struct saved_file *) arg; - input_file_end (); /* Close out old file */ + input_file_end (); /* Close out old file. */ f_in = saved->f_in; file_name = saved->file_name; @@ -140,7 +136,7 @@ input_file_open (filename, pre) assert (filename != 0); /* Filename may not be NULL. */ if (filename[0]) { /* We have a file name. Suck it and see. */ - f_in = fopen (filename, "r"); + f_in = fopen (filename, FOPEN_RT); file_name = filename; } else @@ -150,42 +146,54 @@ input_file_open (filename, pre) } if (f_in == (FILE *) 0) { - as_bad (_("Can't open %s for reading."), file_name); + as_bad (_("can't open %s for reading"), file_name); as_perror ("%s", file_name); return; } c = getc (f_in); if (c == '#') - { /* Begins with comment, may not want to preprocess */ + { + /* Begins with comment, may not want to preprocess. */ c = getc (f_in); if (c == 'N') - { - fgets (buf, 80, f_in); - if (!strcmp (buf, "O_APP\n")) - preprocess = 0; - if (!strchr (buf, '\n')) - ungetc ('#', f_in); /* It was longer */ - else - ungetc ('\n', f_in); - } + { + fgets (buf, 80, f_in); + if (!strncmp (buf, "O_APP", 5) && ISSPACE (buf[5])) + preprocess = 0; + if (!strchr (buf, '\n')) + ungetc ('#', f_in); /* It was longer. */ + else + ungetc ('\n', f_in); + } + else if (c == 'A') + { + fgets (buf, 80, f_in); + if (!strncmp (buf, "PP", 2) && ISSPACE (buf[2])) + preprocess = 1; + if (!strchr (buf, '\n')) + ungetc ('#', f_in); + else + ungetc ('\n', f_in); + } else if (c == '\n') - ungetc ('\n', f_in); + ungetc ('\n', f_in); else - ungetc ('#', f_in); + ungetc ('#', f_in); } else ungetc (c, f_in); } /* Close input file. */ + void input_file_close () { + /* Don't close a null file pointer. */ if (f_in != NULL) - { - fclose (f_in); - } /* don't close a null file pointer */ + fclose (f_in); + f_in = 0; } @@ -218,12 +226,10 @@ input_file_give_next_buffer (where) if (f_in == (FILE *) 0) return 0; - /* - * fflush (stdin); could be done here if you want to synchronise - * stdin and stdout, for the case where our input file is stdin. - * Since the assembler shouldn't do any output to stdout, we - * don't bother to synch output and input. - */ + /* fflush (stdin); could be done here if you want to synchronise + stdin and stdout, for the case where our input file is stdin. + Since the assembler shouldn't do any output to stdout, we + don't bother to synch output and input. */ if (preprocess) size = do_scrub_chars (input_file_get, where, BUFFER_SIZE); else @@ -242,5 +248,6 @@ input_file_give_next_buffer (where) f_in = (FILE *) 0; return_value = 0; } - return (return_value); + + return return_value; } diff --git a/contrib/binutils/gas/input-scrub.c b/contrib/binutils/gas/input-scrub.c index e9c7240..d343711 100644 --- a/contrib/binutils/gas/input-scrub.c +++ b/contrib/binutils/gas/input-scrub.c @@ -394,7 +394,7 @@ input_scrub_next_buffer (bufp) partial_where = 0; if (partial_size > 0) { - as_warn (_("Partial line at end of file ignored")); + as_warn (_("partial line at end of file ignored")); } /* Tell the listing we've finished the file. */ diff --git a/contrib/binutils/gas/itbl-lex.l b/contrib/binutils/gas/itbl-lex.l index 4ac0946..ed0be64 100644 --- a/contrib/binutils/gas/itbl-lex.l +++ b/contrib/binutils/gas/itbl-lex.l @@ -1,5 +1,5 @@ /* itbl-lex.l - Copyright 1997, 1998 Free Software Foundation, Inc. + Copyright 1997, 1998, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,7 +22,6 @@ #include #include #include -#include #include "itbl-parse.h" #ifdef DEBUG diff --git a/contrib/binutils/gas/itbl-ops.c b/contrib/binutils/gas/itbl-ops.c index d3650cd..d67a986 100644 --- a/contrib/binutils/gas/itbl-ops.c +++ b/contrib/binutils/gas/itbl-ops.c @@ -183,17 +183,18 @@ itbl_parse (char *insntbl) { extern FILE *yyin; extern int yyparse (void); - yyin = fopen (insntbl, "r"); + + yyin = fopen (insntbl, FOPEN_RT); if (yyin == 0) { printf ("Can't open processor instruction specification file \"%s\"\n", insntbl); return 1; } - else - { - while (yyparse ()); - } + + while (yyparse ()) + ; + fclose (yyin); itbl_have_entries = 1; return 0; @@ -506,7 +507,7 @@ itbl_assemble (char *name, char *s) int processor; if (!name || !*name) - return 0; /* error! must have a opcode name/expr */ + return 0; /* error! must have an opcode name/expr */ /* find entry in list of instructions for all processors */ for (processor = 0; processor < e_nprocs; processor++) diff --git a/contrib/binutils/gas/listing.c b/contrib/binutils/gas/listing.c index 8168ebe..c92f2db 100644 --- a/contrib/binutils/gas/listing.c +++ b/contrib/binutils/gas/listing.c @@ -91,10 +91,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA on a line */ -#include - #include "as.h" #include +#include "safe-ctype.h" #include "input-file.h" #include "subsegs.h" @@ -370,7 +369,7 @@ listing_newline (ps) unsigned char c = *src++; /* Omit control characters in the listing. */ - if (isascii (c) && ! iscntrl (c)) + if (!ISCNTRL (c)) *dest++ = c; } @@ -485,7 +484,7 @@ buffer_line (file, line, size) } last_open_file_info = file; - last_open_file = fopen (file->filename, "r"); + last_open_file = fopen (file->filename, FOPEN_RT); if (last_open_file == NULL) { file->at_end = 1; @@ -514,9 +513,12 @@ buffer_line (file, line, size) if (c == EOF) { file->at_end = 1; - *p++ = '.'; - *p++ = '.'; - *p++ = '.'; + if (count + 2 < size) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } } file->linenum++; *p++ = 0; @@ -908,7 +910,7 @@ debugging_pseudo (list, line) was_debug = in_debug; in_debug = 0; - while (isspace ((unsigned char) *line)) + while (ISSPACE (*line)) line++; if (*line != '.') @@ -1121,7 +1123,7 @@ listing_print (name) } else { - list_file = fopen (name, "w"); + list_file = fopen (name, FOPEN_WT); if (list_file != NULL) using_stdout = 0; else @@ -1295,7 +1297,7 @@ listing_title (depth) } else if (*input_line_pointer == '\n') { - as_bad (_("New line in title")); + as_bad (_("new line in title")); demand_empty_rest_of_line (); return; } diff --git a/contrib/binutils/gas/macro.c b/contrib/binutils/gas/macro.c index 8512208..11d6511 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 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, @@ -24,20 +24,14 @@ #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 +#ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ @@ -49,7 +43,7 @@ extern void *alloca (); # endif /* alloca */ # endif /* _AIX */ # endif /* HAVE_ALLOCA_H */ -#endif +#endif /* __GNUC__ */ #include #ifdef HAVE_STRING_H @@ -57,11 +51,11 @@ extern void *alloca (); #else #include #endif -#include #ifdef HAVE_STDLIB_H #include #endif #include "libiberty.h" +#include "safe-ctype.h" #include "sb.h" #include "hash.h" #include "macro.h" @@ -189,7 +183,7 @@ buffer_and_nest (from, to, ptr, get_line) /* Skip over a label. */ while (i < ptr->len - && (isalnum ((unsigned char) ptr->ptr[i]) + && (ISALNUM (ptr->ptr[i]) || ptr->ptr[i] == '_' || ptr->ptr[i] == '$')) i++; @@ -212,11 +206,11 @@ buffer_and_nest (from, to, ptr, get_line) i++; if (strncasecmp (ptr->ptr + i, from, from_len) == 0 && (ptr->len == (i + from_len) - || ! isalnum (ptr->ptr[i + from_len]))) + || ! ISALNUM (ptr->ptr[i + from_len]))) depth++; if (strncasecmp (ptr->ptr + i, to, to_len) == 0 && (ptr->len == (i + to_len) - || ! isalnum (ptr->ptr[i + to_len]))) + || ! ISALNUM (ptr->ptr[i + to_len]))) { depth--; if (depth == 0) @@ -247,13 +241,13 @@ get_token (idx, in, name) sb *name; { if (idx < in->len - && (isalpha ((unsigned char) in->ptr[idx]) + && (ISALPHA (in->ptr[idx]) || in->ptr[idx] == '_' || in->ptr[idx] == '$')) { sb_add_char (name, in->ptr[idx++]); while (idx < in->len - && (isalnum ((unsigned char) in->ptr[idx]) + && (ISALNUM (in->ptr[idx]) || in->ptr[idx] == '_' || in->ptr[idx] == '$')) { @@ -384,6 +378,7 @@ get_any_string (idx, in, out, expand, pretend_quoted) int val; char buf[20]; /* Turns the next expression into a string. */ + /* xgettext: no-c-format */ idx = (*macro_expr) (_("% operator needs absolute expression"), idx + 1, in, @@ -573,8 +568,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 ((unsigned char) name.ptr[idx])) - name.ptr[idx] = tolower (name.ptr[idx]); + name.ptr[idx] = TOLOWER (name.ptr[idx]); namestr = sb_terminate (&name); hash_jam (macro_hash, namestr, (PTR) macro); @@ -732,15 +726,14 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) sb_add_char (out, '&'); src++; } - else if (macro_mri - && isalnum ((unsigned char) in->ptr[src])) + else if (macro_mri && ISALNUM (in->ptr[src])) { int ind; formal_entry *f; - if (isdigit ((unsigned char) in->ptr[src])) + if (ISDIGIT (in->ptr[src])) ind = in->ptr[src] - '0'; - else if (isupper ((unsigned char) in->ptr[src])) + else if (ISUPPER (in->ptr[src])) ind = in->ptr[src] - 'A' + 10; else ind = in->ptr[src] - 'a' + 10; @@ -764,7 +757,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) } } else if ((macro_alternate || macro_mri) - && (isalpha ((unsigned char) in->ptr[src]) + && (ISALPHA (in->ptr[src]) || in->ptr[src] == '_' || in->ptr[src] == '$') && (! inquote @@ -935,21 +928,29 @@ macro_expand (idx, in, m, out, comment_char) /* The macro may be called with an optional qualifier, which may be referred to in the macro body as \0. */ if (idx < in->len && in->ptr[idx] == '.') - { - formal_entry *n; - - n = (formal_entry *) xmalloc (sizeof (formal_entry)); - sb_new (&n->name); - sb_new (&n->def); - sb_new (&n->actual); - n->index = QUAL_INDEX; - - n->next = m->formals; - m->formals = n; - - idx = get_any_string (idx + 1, in, &n->actual, 1, 0); - } - } + { + /* The Microtec assembler ignores this if followed by a white space. + (Macro invocation with empty extension) */ + idx++; + if ( idx < in->len + && in->ptr[idx] != ' ' + && in->ptr[idx] != '\t') + { + formal_entry *n; + + n = (formal_entry *) xmalloc (sizeof (formal_entry)); + sb_new (&n->name); + sb_new (&n->def); + sb_new (&n->actual); + n->index = QUAL_INDEX; + + n->next = m->formals; + m->formals = n; + + idx = get_any_string (idx, in, &n->actual, 1, 0); + } + } + } /* Peel off the actuals and store them away in the hash tables' actuals. */ idx = sb_skip_white (idx, in); @@ -1105,14 +1106,14 @@ check_macro (line, expand, comment_char, error, info) macro_entry *macro; sb line_sb; - if (! isalpha ((unsigned char) *line) + if (! ISALPHA (*line) && *line != '_' && *line != '$' && (! macro_mri || *line != '.')) return 0; s = line + 1; - while (isalnum ((unsigned char) *s) + while (ISALNUM (*s) || *s == '_' || *s == '$') ++s; @@ -1121,8 +1122,7 @@ check_macro (line, expand, comment_char, error, info) memcpy (copy, line, s - line); copy[s - line] = '\0'; for (cs = copy; *cs != '\0'; cs++) - if (isupper ((unsigned char) *cs)) - *cs = tolower (*cs); + *cs = TOLOWER (*cs); macro = (macro_entry *) hash_find (macro_hash, copy); diff --git a/contrib/binutils/gas/output-file.c b/contrib/binutils/gas/output-file.c index bcd49b5..531e35f 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 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -16,7 +16,8 @@ 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. */ + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ #include @@ -44,14 +45,14 @@ output_file_create (name) char *name; { if (name[0] == '-' && name[1] == '\0') - { - as_fatal (_("Can't open a bfd on stdout %s "), name); - } + as_fatal (_("can't open a bfd on stdout %s"), name); + else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT))) { - as_perror (_("FATAL: Can't create %s"), name); + as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } + bfd_set_format (stdoutput, bfd_object); #ifdef BFD_ASSEMBLER bfd_set_arch_mach (stdoutput, TARGET_ARCH, TARGET_MACH); @@ -69,18 +70,18 @@ output_file_close (filename) if (bfd_close (stdoutput) == 0) { bfd_perror (filename); - as_perror (_("FATAL: Can't close %s\n"), filename); + as_perror (_("FATAL: can't close %s\n"), filename); exit (EXIT_FAILURE); } #else - /* Close the bfd without getting bfd to write out anything by itself */ + /* Close the bfd without getting bfd to write out anything by itself. */ if (bfd_close_all_done (stdoutput) == 0) { - as_perror (_("FATAL: Can't close %s\n"), filename); + as_perror (_("FATAL: can't close %s\n"), filename); exit (EXIT_FAILURE); } #endif - stdoutput = NULL; /* Trust nobody! */ + stdoutput = NULL; /* Trust nobody! */ } #ifndef BFD_ASSEMBLER @@ -108,15 +109,10 @@ output_file_create (name) return; } - stdoutput = fopen (name, "wb"); - - /* Some systems don't grok "b" in fopen modes. */ - if (stdoutput == NULL) - stdoutput = fopen (name, "w"); - + stdoutput = fopen (name, FOPEN_WB); if (stdoutput == NULL) { - as_perror (_("FATAL: Can't create %s"), name); + as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } } @@ -127,30 +123,32 @@ output_file_close (filename) { if (EOF == fclose (stdoutput)) { - as_perror (_("FATAL: Can't close %s"), filename); + as_perror (_("FATAL: can't close %s"), filename); exit (EXIT_FAILURE); } - stdoutput = NULL; /* Trust nobody! */ + + /* Trust nobody! */ + stdoutput = NULL; } void output_file_append (where, length, filename) - char *where; - long length; - char *filename; + char * where; + long length; + char * filename; { for (; length; length--, where++) { (void) putc (*where, stdoutput); + if (ferror (stdoutput)) /* if ( EOF == (putc( *where, stdoutput )) ) */ { as_perror (_("Failed to emit an object byte"), filename); - as_fatal (_("Can't continue")); + as_fatal (_("can't continue")); } } } #endif -/* end of output-file.c */ diff --git a/contrib/binutils/gas/po/POTFILES.in b/contrib/binutils/gas/po/POTFILES.in index f0a7cd6..d1d5c97 100644 --- a/contrib/binutils/gas/po/POTFILES.in +++ b/contrib/binutils/gas/po/POTFILES.in @@ -86,16 +86,24 @@ config/tc-mcore.c config/tc-mcore.h config/tc-mips.c config/tc-mips.h +config/tc-mmix.c +config/tc-mmix.h config/tc-mn10200.c config/tc-mn10200.h config/tc-mn10300.c config/tc-mn10300.h config/tc-ns32k.c config/tc-ns32k.h +config/tc-openrisc.c +config/tc-openrisc.h +config/tc-pdp11.c +config/tc-pdp11.h config/tc-pj.c config/tc-pj.h config/tc-ppc.c config/tc-ppc.h +config/tc-s390.c +config/tc-s390.h config/tc-sh.c config/tc-sh.h config/tc-sparc.c @@ -114,6 +122,8 @@ config/tc-vax.c config/tc-vax.h config/tc-w65.c config/tc-w65.h +config/tc-xstormy16.c +config/tc-xstormy16.h config/tc-z8k.c config/tc-z8k.h depend.c diff --git a/contrib/binutils/gas/po/gas.pot b/contrib/binutils/gas/po/gas.pot index 4428b64..f477568 100644 --- a/contrib/binutils/gas/po/gas.pot +++ b/contrib/binutils/gas/po/gas.pot @@ -6,84 +6,80 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-01-11 12:04-0800\n" +"POT-Creation-Date: 2002-01-17 12:56+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" -#: app.c:464 app.c:478 +#: app.c:476 app.c:490 msgid "end of file in comment" msgstr "" -#: app.c:557 -msgid "end of file in string: inserted '\"'" +#: app.c:569 +msgid "end of file in string; inserted '\"'" msgstr "" -#: app.c:623 +#: app.c:635 #, c-format -msgid "Unknown escape '\\%c' in string: Ignored" +msgid "unknown escape '\\%c' in string; ignored" msgstr "" -#: app.c:632 -msgid "End of file in string: '\"' inserted" +#: app.c:644 +msgid "end of file in string; '\"' inserted" msgstr "" -#: app.c:752 +#: app.c:764 msgid "end of file not at end of a line; newline inserted" msgstr "" -#: app.c:910 +#: app.c:923 msgid "end of file in multiline comment" msgstr "" -#: app.c:974 +#: app.c:987 msgid "end of file after a one-character quote; \\0 inserted" msgstr "" -#: app.c:982 +#: app.c:995 msgid "end of file in escape character" msgstr "" -#: app.c:994 -msgid "Missing close quote: (assumed)" +#: app.c:1007 +msgid "missing close quote; (assumed)" msgstr "" -#: app.c:1057 app.c:1111 app.c:1186 +#: app.c:1075 app.c:1129 app.c:1139 app.c:1204 msgid "end of file in comment; newline inserted" msgstr "" -#: app.c:1121 -msgid "EOF in Comment: Newline inserted" -msgstr "" - -#: as.c:147 +#: as.c:148 msgid "missing emulation mode name" msgstr "" -#: as.c:162 +#: as.c:163 #, c-format msgid "unrecognized emulation name `%s'" msgstr "" -#: as.c:209 +#: as.c:210 #, c-format msgid "GNU assembler version %s (%s) using BFD version %s" msgstr "" -#: as.c:212 +#: as.c:213 #, c-format msgid "GNU assembler version %s (%s)" msgstr "" -#: as.c:221 +#: as.c:222 #, c-format msgid "Usage: %s [option...] [asmfile...]\n" msgstr "" -#: as.c:223 +#: as.c:224 msgid "" "Options:\n" " -a[sub-option...]\t turn on listings\n" @@ -95,8 +91,6 @@ msgid "" " \t m include macro expansions\n" " \t n omit forms processing\n" " \t s include symbols\n" -" \t L include line debug statistics (if " -"applicable)\n" " \t =FILE list to FILE (must be last sub-option)\n" msgstr "" @@ -168,8 +162,8 @@ msgstr "" #: as.c:283 msgid "" -" -o OBJFILE name the object-file output OBJFILE (default " -"a.out)\n" +" -o OBJFILE name the object-file output OBJFILE (default a." +"out)\n" msgstr "" #: as.c:285 @@ -252,7 +246,7 @@ msgid "" " for the output data column of the listing\n" msgstr "" -#: as.c:327 gasp.c:3527 +#: as.c:327 gasp.c:3528 #, c-format msgid "Report bugs to %s\n" msgstr "" @@ -264,10 +258,10 @@ msgid "GNU assembler %s\n" msgstr "" #: as.c:528 -msgid "Copyright 2000 Free Software Foundation, Inc.\n" +msgid "Copyright 2001 Free Software Foundation, Inc.\n" msgstr "" -#: as.c:529 gasp.c:3621 +#: as.c:529 gasp.c:3627 msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" @@ -316,35 +310,35 @@ msgid "bad defsym; format is --defsym name=value" msgstr "" #: as.c:590 -msgid "No file name following -t option\n" +msgid "no file name following -t option" msgstr "" -#: as.c:606 +#: as.c:605 #, c-format -msgid "Failed to read instruction table %s\n" +msgid "failed to read instruction table %s\n" msgstr "" -#: as.c:723 +#: as.c:720 #, c-format msgid "invalid listing option `%c'" msgstr "" -#: as.c:922 +#: as.c:928 #, c-format msgid "%d warnings, treating warnings as errors" msgstr "" -#: as.c:953 +#: as.c:959 #, c-format msgid "%s: total time in assembly: %ld.%06ld\n" msgstr "" -#: as.c:956 +#: as.c:962 #, c-format msgid "%s: data size %ld\n" msgstr "" -#: as.h:225 +#: as.h:216 #, c-format msgid "Case value %ld unexpected at line %d of file \"%s\"\n" msgstr "" @@ -353,73 +347,71 @@ msgstr "" #. * We have a GROSS internal error. #. * This should never happen. #. -#: atof-generic.c:437 config/tc-a29k.c:544 config/tc-i860.c:340 -#: config/tc-i860.c:832 config/tc-m68k.c:3176 config/tc-m68k.c:3205 -#: config/tc-sparc.c:2543 -msgid "failed sanity check." +#: atof-generic.c:437 config/tc-m68k.c:2879 +msgid "failed sanity check" msgstr "" -#: cond.c:77 +#: cond.c:79 msgid "invalid identifier for \".ifdef\"" msgstr "" -#: cond.c:131 +#: cond.c:133 msgid "non-constant expression in \".if\" statement" msgstr "" -#: cond.c:227 +#: cond.c:229 msgid "bad format for ifc or ifnc" msgstr "" -#: cond.c:261 -msgid "\".elseif\" without matching \".if\" - ignored" +#: cond.c:260 +msgid "\".elseif\" without matching \".if\"" msgstr "" -#: cond.c:266 -msgid "\".elseif\" after \".else\" - ignored" +#: cond.c:264 +msgid "\".elseif\" after \".else\"" msgstr "" -#: cond.c:269 cond.c:378 +#: cond.c:267 cond.c:375 msgid "here is the previous \"else\"" msgstr "" -#: cond.c:272 cond.c:381 +#: cond.c:270 cond.c:378 msgid "here is the previous \"if\"" msgstr "" -#: cond.c:305 +#: cond.c:299 msgid "non-constant expression in \".elseif\" statement" msgstr "" -#: cond.c:340 +#: cond.c:338 msgid "\".endif\" without \".if\"" msgstr "" -#: cond.c:370 -msgid ".else without matching .if - ignored" +#: cond.c:368 +msgid "\".else\" without matching \".if\"" msgstr "" -#: cond.c:375 -msgid "duplicate \"else\" - ignored" +#: cond.c:372 +msgid "duplicate \"else\"" msgstr "" -#: cond.c:426 +#: cond.c:424 msgid ".ifeqs syntax error" msgstr "" -#: cond.c:509 +#: cond.c:507 msgid "end of macro inside conditional" msgstr "" -#: cond.c:511 +#: cond.c:509 msgid "end of file inside conditional" msgstr "" -#: cond.c:514 +#: cond.c:512 msgid "here is the start of the unterminated conditional" msgstr "" -#: cond.c:518 +#: cond.c:516 msgid "here is the \"else\" of the unterminated conditional" msgstr "" @@ -433,17 +425,16 @@ msgstr "" msgid "Attempt to put an undefined symbol into set %s" msgstr "" -#: config/obj-aout.c:197 config/obj-coff.c:1246 config/obj-elf.c:1739 -#: ecoff.c:3647 +#: config/obj-aout.c:197 config/obj-coff.c:1274 #, c-format msgid "Symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-aout.c:255 config/obj-coff.c:1982 +#: config/obj-aout.c:255 config/obj-coff.c:2010 msgid "unresolved relocation" msgstr "" -#: config/obj-aout.c:257 config/obj-coff.c:1984 +#: config/obj-aout.c:257 config/obj-coff.c:2012 #, c-format msgid "bad relocation: symbol `%s' not in symbol table" msgstr "" @@ -453,7 +444,7 @@ msgstr "" msgid "%s: bad type for weak symbol" msgstr "" -#: config/obj-aout.c:458 config/obj-coff.c:2913 write.c:1868 +#: config/obj-aout.c:458 config/obj-coff.c:2940 write.c:1933 #, c-format msgid "%s: global symbols not supported in common sections" msgstr "" @@ -467,181 +458,181 @@ msgstr "" msgid "subsegment index too high" msgstr "" -#: config/obj-bout.c:319 config/obj-vms.c:561 +#: config/obj-bout.c:319 config/obj-vms.c:562 #, c-format msgid "Local symbol %s never defined" msgstr "" -#: config/obj-coff.c:156 +#: config/obj-coff.c:166 #, c-format msgid "Inserting \"%s\" into structure table failed: %s" msgstr "" #. Zero is used as an end marker in the file. -#: config/obj-coff.c:451 +#: config/obj-coff.c:469 msgid "Line numbers must be positive integers\n" msgstr "" -#: config/obj-coff.c:484 config/obj-coff.c:2328 +#: config/obj-coff.c:503 config/obj-coff.c:2355 msgid ".ln pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:527 ecoff.c:3283 +#: config/obj-coff.c:546 ecoff.c:3280 msgid ".loc outside of .text" msgstr "" -#: config/obj-coff.c:534 +#: config/obj-coff.c:553 msgid ".loc pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:622 config/obj-coff.c:2385 +#: config/obj-coff.c:641 config/obj-coff.c:2412 msgid ".def pseudo-op used inside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:668 config/obj-coff.c:2437 +#: config/obj-coff.c:687 config/obj-coff.c:2464 msgid ".endef pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:706 +#: config/obj-coff.c:725 #, c-format msgid "`%s' symbol without preceding function" msgstr "" -#: config/obj-coff.c:793 config/obj-coff.c:2512 +#: config/obj-coff.c:812 config/obj-coff.c:2539 #, c-format msgid "unexpected storage class %d" msgstr "" -#: config/obj-coff.c:906 config/obj-coff.c:2619 +#: config/obj-coff.c:925 config/obj-coff.c:2646 msgid ".dim pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:926 config/obj-coff.c:2639 +#: config/obj-coff.c:945 config/obj-coff.c:2666 msgid "badly formed .dim directive ignored" msgstr "" -#: config/obj-coff.c:977 config/obj-coff.c:2702 +#: config/obj-coff.c:996 config/obj-coff.c:2729 msgid ".size pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:993 config/obj-coff.c:2718 +#: config/obj-coff.c:1012 config/obj-coff.c:2745 msgid ".scl pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1011 config/obj-coff.c:2736 +#: config/obj-coff.c:1030 config/obj-coff.c:2763 msgid ".tag pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1030 config/obj-coff.c:2754 +#: config/obj-coff.c:1049 config/obj-coff.c:2781 #, c-format msgid "tag not found for .tag %s" msgstr "" -#: config/obj-coff.c:1045 config/obj-coff.c:2769 +#: config/obj-coff.c:1064 config/obj-coff.c:2796 msgid ".type pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1067 config/obj-coff.c:2791 +#: config/obj-coff.c:1086 config/obj-coff.c:2818 msgid ".val pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1207 config/obj-coff.c:2986 +#: config/obj-coff.c:1231 config/obj-coff.c:3013 msgid "mismatched .eb" msgstr "" -#: config/obj-coff.c:1225 config/obj-coff.c:3026 +#: config/obj-coff.c:1252 config/obj-coff.c:3053 msgid "C_EFCN symbol out of scope" msgstr "" #. STYP_INFO #. STYP_LIB #. STYP_OVER -#: config/obj-coff.c:1447 +#: config/obj-coff.c:1476 #, c-format msgid "unsupported section attribute '%c'" msgstr "" -#: config/obj-coff.c:1452 config/obj-coff.c:3726 config/tc-ppc.c:3925 +#: config/obj-coff.c:1481 config/obj-coff.c:3758 config/tc-ppc.c:4211 #, c-format msgid "unknown section attribute '%c'" msgstr "" -#: config/obj-coff.c:1482 config/tc-ppc.c:3943 read.c:2512 +#: config/obj-coff.c:1511 config/tc-ppc.c:4229 config/tc-tic54x.c:4130 +#: read.c:2555 #, c-format msgid "error setting flags for \"%s\": %s" msgstr "" -#: config/obj-coff.c:1493 config/obj-elf.c:723 +#: config/obj-coff.c:1522 #, c-format msgid "Ignoring changed section attributes for %s" msgstr "" -#: config/obj-coff.c:1629 +#: config/obj-coff.c:1658 #, c-format msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n" msgstr "" -#: config/obj-coff.c:1809 config/obj-ieee.c:69 +#: config/obj-coff.c:1838 config/obj-ieee.c:69 msgid "Out of step\n" msgstr "" -#: config/obj-coff.c:2244 +#: config/obj-coff.c:2271 msgid "bfd_coff_swap_scnhdr_out failed" msgstr "" -#: config/obj-coff.c:2469 +#: config/obj-coff.c:2496 msgid "`.bf' symbol without preceding function\n" msgstr "" -#: config/obj-coff.c:3422 config/obj-ieee.c:507 output-file.c:52 -#: output-file.c:119 +#: config/obj-coff.c:3450 config/obj-ieee.c:507 #, c-format msgid "FATAL: Can't create %s" msgstr "" -#: config/obj-coff.c:3600 +#: config/obj-coff.c:3632 #, c-format msgid "Can't close %s: %s" msgstr "" -#: config/obj-coff.c:3634 +#: config/obj-coff.c:3666 #, c-format msgid "Too many new sections; can't add \"%s\"" msgstr "" -#: config/obj-coff.c:4041 config/tc-m88k.c:1257 config/tc-sparc.c:3531 +#: config/obj-coff.c:4073 config/tc-sparc.c:3537 msgid "Expected comma after name" msgstr "" -#: config/obj-coff.c:4047 read.c:1956 +#: config/obj-coff.c:4079 msgid "Missing size expression" msgstr "" -#: config/obj-coff.c:4053 +#: config/obj-coff.c:4085 #, c-format msgid "lcomm length (%d.) <0! Ignored." msgstr "" -#: config/obj-coff.c:4081 read.c:2190 +#: config/obj-coff.c:4113 #, c-format msgid "Symbol %s already defined" msgstr "" -#: config/obj-coff.c:4176 config/tc-i960.c:3215 +#: config/obj-coff.c:4208 config/tc-i960.c:3206 #, c-format msgid "No 'bal' entry point for leafproc %s" msgstr "" -#: config/obj-coff.c:4255 write.c:2575 +#: config/obj-coff.c:4287 #, c-format msgid "Negative of non-absolute symbol %s" msgstr "" -#: config/obj-coff.c:4276 write.c:2589 +#: config/obj-coff.c:4308 msgid "callj to difference of 2 symbols" msgstr "" -#: config/obj-coff.c:4322 +#: config/obj-coff.c:4354 #, c-format msgid "Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld." msgstr "" @@ -649,159 +640,196 @@ msgstr "" #. This is a COBR instruction. They have only a 13-bit #. displacement and are only to be used for local branches: #. flag as error, don't generate relocation. -#: config/obj-coff.c:4411 config/tc-i960.c:3235 write.c:2733 +#: config/obj-coff.c:4443 config/tc-i960.c:3226 write.c:2826 msgid "can't use COBR format with external label" msgstr "" -#: config/obj-coff.c:4490 +#: config/obj-coff.c:4518 #, c-format msgid "Value of %ld too large for field of %d bytes at 0x%lx" msgstr "" -#: config/obj-coff.c:4504 write.c:2823 +#: config/obj-coff.c:4532 #, c-format msgid "Signed .word overflow; switch may be too large; %ld at 0x%lx" msgstr "" -#: config/obj-ecoff.c:241 +#: config/obj-ecoff.c:227 msgid "Can't set GP value" msgstr "" -#: config/obj-ecoff.c:248 +#: config/obj-ecoff.c:234 msgid "Can't set register masks" msgstr "" -#: config/obj-elf.c:308 config/tc-sparc.c:3674 config/tc-v850.c:259 -msgid "Expected comma after symbol-name" +#: config/obj-elf.c:308 +msgid "expected comma after symbol-name" msgstr "" -#: config/obj-elf.c:315 config/tc-sparc.c:3684 +#: config/obj-elf.c:315 config/tc-sparc.c:3690 #, c-format msgid ".COMMon length (%d.) <0! Ignored." msgstr "" -#: config/obj-elf.c:325 config/tc-alpha.c:4335 config/tc-sparc.c:3694 -#: config/tc-v850.c:282 -msgid "Ignoring attempt to re-define symbol" +#: config/obj-elf.c:325 ecoff.c:3399 read.c:1403 read.c:1504 read.c:2137 +#: read.c:2226 read.c:2856 read.c:4937 symbols.c:361 symbols.c:460 +#, c-format +msgid "symbol `%s' is already defined" msgstr "" -#: config/obj-elf.c:333 config/tc-sparc.c:3702 config/tc-v850.c:292 +#: config/obj-elf.c:333 #, c-format -msgid "Length of .comm \"%s\" is already %ld. Not changed to %d." +msgid "length of .comm \"%s\" is already %ld; not changed to %d" msgstr "" -#: config/obj-elf.c:356 config/tc-v850.c:319 -msgid "Common alignment negative; 0 assumed" +#: config/obj-elf.c:356 +msgid "common alignment negative; 0 assumed" msgstr "" -#: config/obj-elf.c:375 config/tc-m32r.c:1286 config/tc-ppc.c:1518 -#: config/tc-v850.c:382 -msgid "Common alignment not a power of 2" +#: config/obj-elf.c:375 +msgid "common alignment not a power of 2" msgstr "" -#: config/obj-elf.c:438 config/tc-sparc.c:3826 config/tc-v850.c:564 +#: config/obj-elf.c:438 config/tc-sparc.c:3832 config/tc-v850.c:565 #, c-format msgid "bad .common segment %s" msgstr "" -#: config/obj-elf.c:664 +#: config/obj-elf.c:668 #, c-format -msgid "Setting incorrect section type for %s" +msgid "setting incorrect section type for %s" msgstr "" -#: config/obj-elf.c:668 +#: config/obj-elf.c:672 +#, c-format +msgid "ignoring incorrect section type for %s" +msgstr "" + +#: config/obj-elf.c:685 +#, c-format +msgid "setting incorrect section attributes for %s" +msgstr "" + +#: config/obj-elf.c:732 #, c-format -msgid "Ignoring incorrect section type for %s" +msgid "ignoring changed section attributes for %s" msgstr "" -#: config/obj-elf.c:681 +#: config/obj-elf.c:734 #, c-format -msgid "Setting incorrect section attributes for %s" +msgid "ignoring changed section entity size for %s" +msgstr "" + +#: config/obj-elf.c:737 +#, c-format +msgid "ignoring new section group for %s" +msgstr "" + +#: config/obj-elf.c:788 +msgid "unrecognized .section attribute: want a,w,x,M,S,G" +msgstr "" + +#: config/obj-elf.c:828 +msgid "unrecognized section attribute" +msgstr "" + +#: config/obj-elf.c:850 read.c:2538 +msgid "unrecognized section type" msgstr "" -#: config/obj-elf.c:753 -msgid "Unrecognized .section attribute: want a,w,x" +#: config/obj-elf.c:880 +msgid "missing name" msgstr "" -#: config/obj-elf.c:793 -msgid "Unrecognized section attribute" +#: config/obj-elf.c:987 +msgid "invalid merge entity size" msgstr "" -#: config/obj-elf.c:815 -msgid "Unrecognized section type" +#: config/obj-elf.c:994 +msgid "entity size for SHF_MERGE not specified" msgstr "" -#: config/obj-elf.c:866 -msgid "Missing section name" +#: config/obj-elf.c:1007 +msgid "group name for SHF_GROUP not specified" msgstr "" -#: config/obj-elf.c:932 -msgid "Bad .section directive - character following name is not '#'" +#: config/obj-elf.c:1020 +msgid "character following name is not '#'" msgstr "" -#: config/obj-elf.c:1033 +#: config/obj-elf.c:1121 msgid ".previous without corresponding .section; ignored" msgstr "" -#: config/obj-elf.c:1060 +#: config/obj-elf.c:1148 msgid ".popsection without corresponding .pushsection; ignored" msgstr "" -#: config/obj-elf.c:1113 +#: config/obj-elf.c:1202 msgid "expected comma after name in .symver" msgstr "" -#: config/obj-elf.c:1137 +#: config/obj-elf.c:1225 #, c-format msgid "missing version name in `%s' for symbol `%s'" msgstr "" -#: config/obj-elf.c:1148 +#: config/obj-elf.c:1236 #, c-format msgid "multiple versions [`%s'|`%s'] for symbol `%s'" msgstr "" -#: config/obj-elf.c:1361 config/obj-som.c:155 config/obj-som.c:201 -msgid "Expected quoted string" +#: config/obj-elf.c:1470 +msgid "expected quoted string" msgstr "" -#: config/obj-elf.c:1382 +#: config/obj-elf.c:1491 #, c-format msgid "expected comma after name `%s' in .size directive" msgstr "" -#: config/obj-elf.c:1391 +#: config/obj-elf.c:1500 msgid "missing expression in .size directive" msgstr "" -#: config/obj-elf.c:1467 +#: config/obj-elf.c:1583 #, c-format -msgid "ignoring unrecognized symbol type \"%s\"" +msgid "unrecognized symbol type \"%s\"" msgstr "" -#: config/obj-elf.c:1648 +#: config/obj-elf.c:1764 msgid ".size expression too complicated to fix up" msgstr "" -#: config/obj-elf.c:1680 +#: config/obj-elf.c:1796 #, c-format msgid "" "invalid attempt to declare external version name as default in symbol `%s'" msgstr "" -#: config/obj-elf.c:1862 +#: config/obj-elf.c:1855 ecoff.c:3644 +#, c-format +msgid "symbol `%s' can not be both weak and common" +msgstr "" + +#: config/obj-elf.c:1971 #, c-format -msgid "Failed to set up debugging information: %s" +msgid "can't create group: %s" msgstr "" -#: config/obj-elf.c:1882 +#: config/obj-elf.c:2068 #, c-format -msgid "Can't start writing .mdebug section: %s" +msgid "failed to set up debugging information: %s" msgstr "" -#: config/obj-elf.c:1890 +#: config/obj-elf.c:2088 #, c-format -msgid "Could not write .mdebug section: %s" +msgid "can't start writing .mdebug section: %s" +msgstr "" + +#: config/obj-elf.c:2096 +#, c-format +msgid "could not write .mdebug section: %s" msgstr "" #: config/obj-ieee.c:455 @@ -812,6 +840,10 @@ msgstr "" msgid "Only one .version pseudo-op per file!" msgstr "" +#: config/obj-som.c:155 config/obj-som.c:201 +msgid "Expected quoted string" +msgstr "" + #: config/obj-som.c:164 #, c-format msgid "FATAL: Attaching version header %s" @@ -826,44 +858,45 @@ msgstr "" msgid "FATAL: Attaching copyright header %s" msgstr "" -#: config/obj-vms.c:462 +#: config/obj-vms.c:463 #, c-format msgid "compiler emitted zero-size common symbol `%s' already defined" msgstr "" -#: config/obj-vms.c:472 +#: config/obj-vms.c:473 #, c-format msgid "compiler redefined zero-size common symbol `%s'" msgstr "" -#: config/obj-vms.c:591 +#: config/obj-vms.c:592 #, c-format msgid "Couldn't create VMS object file \"%s\"" msgstr "" -#: config/obj-vms.c:616 +#: config/obj-vms.c:617 msgid "I/O error writing VMS object file (length prefix)" msgstr "" -#: config/obj-vms.c:630 +#: config/obj-vms.c:631 msgid "I/O error writing VMS object file" msgstr "" -#: config/obj-vms.c:1220 +#: config/obj-vms.c:1221 +#, c-format msgid "Couldn't find source file \"%s\", status=%%X%x" msgstr "" -#: config/obj-vms.c:1718 config/obj-vms.c:2894 +#: config/obj-vms.c:1719 config/obj-vms.c:2895 #, c-format msgid "debugger forward reference error, dbx type %d" msgstr "" -#: config/obj-vms.c:1793 +#: config/obj-vms.c:1794 #, c-format msgid "Variable descriptor %d too complicated. Defined as `void *'." msgstr "" -#: config/obj-vms.c:2107 +#: config/obj-vms.c:2108 msgid "" "***Warning - the assembly code generated by the compiler has placed \n" " global constant(s) in the text psect. These will not be available to \n" @@ -874,92 +907,92 @@ msgid "" " I didn't warn you! \n" msgstr "" -#: config/obj-vms.c:2421 +#: config/obj-vms.c:2422 #, c-format msgid "debugginer output: %d is an unknown untyped variable." msgstr "" -#: config/obj-vms.c:2639 +#: config/obj-vms.c:2640 #, c-format msgid "debugger output: structure element `%s' has undefined type" msgstr "" -#: config/obj-vms.c:2750 +#: config/obj-vms.c:2751 #, c-format msgid "debugger output: %d is an unknown type of variable." msgstr "" -#: config/obj-vms.c:2883 +#: config/obj-vms.c:2884 #, c-format msgid "debugger output: Unable to resolve %d circular references." msgstr "" -#: config/obj-vms.c:3085 +#: config/obj-vms.c:3086 #, c-format msgid "Module name truncated: %s\n" msgstr "" -#: config/obj-vms.c:3363 +#: config/obj-vms.c:3364 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" #. impossible -#: config/obj-vms.c:3646 +#: config/obj-vms.c:3647 #, c-format msgid "Unknown VMS psect type (%ld)" msgstr "" -#: config/obj-vms.c:3687 +#: config/obj-vms.c:3688 #, c-format msgid "Globalsymbol attribute for symbol %s was unexpected." msgstr "" -#: config/obj-vms.c:3836 +#: config/obj-vms.c:3837 msgid "Invalid data type for globalvalue" msgstr "" -#: config/obj-vms.c:3848 +#: config/obj-vms.c:3849 #, c-format msgid "Invalid globalvalue of %s" msgstr "" -#: config/obj-vms.c:4198 +#: config/obj-vms.c:4199 msgid "Couldn't find fixup fragment when checking for indirect reference" msgstr "" -#: config/obj-vms.c:4541 config/obj-vms.c:4682 +#: config/obj-vms.c:4542 config/obj-vms.c:4683 msgid "Fixup data addsy and subsy don't have the same type" msgstr "" -#: config/obj-vms.c:4545 config/obj-vms.c:4686 +#: config/obj-vms.c:4546 config/obj-vms.c:4687 msgid "Fixup data addsy and subsy don't have an appropriate type" msgstr "" -#: config/obj-vms.c:4548 config/obj-vms.c:4689 +#: config/obj-vms.c:4549 config/obj-vms.c:4690 msgid "Fixup data is erroneously \"pcrel\"" msgstr "" -#: config/obj-vms.c:4564 config/obj-vms.c:4708 +#: config/obj-vms.c:4565 config/obj-vms.c:4709 msgid "Fixup datum is not a longword" msgstr "" -#: config/obj-vms.c:4568 config/obj-vms.c:4712 +#: config/obj-vms.c:4569 config/obj-vms.c:4713 msgid "Fixup datum is not \"fixP->fx_addsy\"" msgstr "" -#: config/obj-vms.c:4783 +#: config/obj-vms.c:4784 #, c-format msgid "" "g++ wrote an extern reference to `%s' as a routine.\n" "I will fix it, but I hope that it was note really a routine." msgstr "" -#: config/obj-vms.c:4915 +#: config/obj-vms.c:4916 msgid "Can't handle global xtors symbols yet." msgstr "" -#: config/obj-vms.c:4918 +#: config/obj-vms.c:4919 #, c-format msgid "Unknown %s" msgstr "" @@ -967,109 +1000,116 @@ msgstr "" #. #. * Error otherwise. #. -#: config/obj-vms.c:5003 +#: config/obj-vms.c:5004 #, c-format msgid "unhandled stab type %d" msgstr "" -#: config/tc-a29k.c:160 config/tc-sparc.c:3878 +#: config/tc-a29k.c:160 config/tc-sparc.c:3884 msgid "Unknown segment type" msgstr "" #. Probably a memory allocation problem? Give up now. -#: config/tc-a29k.c:330 config/tc-hppa.c:1412 config/tc-mips.c:1030 -#: config/tc-mips.c:1072 config/tc-sparc.c:846 +#: config/tc-a29k.c:330 config/tc-hppa.c:1462 config/tc-mips.c:1251 +#: config/tc-mips.c:1293 config/tc-sparc.c:847 msgid "Broken assembler. No assembly attempted." msgstr "" -#: config/tc-a29k.c:375 config/tc-avr.c:1124 config/tc-d10v.c:532 -#: config/tc-d30v.c:552 config/tc-h8300.c:296 config/tc-h8500.c:294 -#: config/tc-mcore.c:655 config/tc-mn10200.c:954 config/tc-mn10300.c:1335 -#: config/tc-ppc.c:1974 config/tc-sh.c:838 config/tc-tic80.c:282 -#: config/tc-v850.c:2076 config/tc-w65.c:248 config/tc-z8k.c:336 +#: config/tc-a29k.c:375 config/tc-avr.c:1131 config/tc-d10v.c:540 +#: config/tc-d30v.c:552 config/tc-h8300.c:313 config/tc-h8500.c:284 +#: config/tc-mcore.c:655 config/tc-mmix.c:468 config/tc-mn10200.c:940 +#: config/tc-mn10300.c:1311 config/tc-ppc.c:2106 config/tc-s390.c:1054 +#: config/tc-sh.c:869 config/tc-tic80.c:283 config/tc-v850.c:2073 +#: config/tc-w65.c:241 config/tc-z8k.c:343 msgid "missing operand" msgstr "" -#: config/tc-a29k.c:415 config/tc-cris.c:913 config/tc-cris.c:921 -#: config/tc-hppa.c:1545 config/tc-i860.c:431 config/tc-i860.c:448 -#: config/tc-sparc.c:1408 config/tc-sparc.c:1414 +#: config/tc-a29k.c:414 config/tc-cris.c:950 config/tc-cris.c:958 +#: config/tc-hppa.c:1598 config/tc-i860.c:431 config/tc-i860.c:448 +#: config/tc-sparc.c:1409 config/tc-sparc.c:1415 #, c-format msgid "Unknown opcode: `%s'" msgstr "" -#: config/tc-a29k.c:420 +#: config/tc-a29k.c:419 #, c-format msgid "Unknown opcode `%s'." msgstr "" -#: config/tc-a29k.c:452 +#: config/tc-a29k.c:451 #, c-format msgid "Too many operands: %s" msgstr "" -#: config/tc-a29k.c:474 config/tc-a29k.c:505 +#: config/tc-a29k.c:473 config/tc-a29k.c:504 #, c-format msgid "Immediate value of %ld is too large" msgstr "" -#: config/tc-a29k.c:890 +#: config/tc-a29k.c:543 config/tc-i860.c:340 config/tc-i860.c:832 +#: config/tc-m68k.c:3181 config/tc-m68k.c:3210 config/tc-sparc.c:2544 +msgid "failed sanity check." +msgstr "" + +#: config/tc-a29k.c:889 #, c-format msgid "bad relocation type: 0x%02x" msgstr "" -#: config/tc-a29k.c:914 +#: config/tc-a29k.c:916 #, c-format msgid "need %o3\n" msgstr "" -#: config/tc-a29k.c:930 +#: config/tc-a29k.c:932 msgid "a29k_convert_frag\n" msgstr "" -#: config/tc-a29k.c:939 +#: config/tc-a29k.c:941 msgid "a29k_estimate_size_before_relax\n" msgstr "" -#: config/tc-a29k.c:1090 +#: config/tc-a29k.c:1092 #, c-format msgid "label \"$%d\" redefined" msgstr "" -#: config/tc-a29k.c:1163 +#: config/tc-a29k.c:1165 +#, c-format msgid "Invalid expression after %%%%\n" msgstr "" -#: config/tc-a29k.c:1174 +#: config/tc-a29k.c:1176 msgid "Invalid register in & expression" msgstr "" -#: config/tc-alpha.c:837 +#: config/tc-alpha.c:789 #, c-format msgid "internal error: can't hash opcode `%s': %s" msgstr "" -#: config/tc-alpha.c:871 +#: config/tc-alpha.c:824 #, c-format msgid "internal error: can't hash macro `%s': %s" msgstr "" -#: config/tc-alpha.c:954 config/tc-i960.c:2700 +#: config/tc-alpha.c:906 config/tc-i960.c:2701 msgid "syntax error" msgstr "" -#: config/tc-alpha.c:1028 config/tc-arm.c:6629 config/tc-h8300.c:1373 -#: config/tc-h8500.c:1197 config/tc-hppa.c:3939 config/tc-i860.c:931 -#: config/tc-m68hc11.c:478 config/tc-m68k.c:4179 config/tc-m88k.c:1105 -#: config/tc-ns32k.c:1663 config/tc-sparc.c:2830 config/tc-z8k.c:1324 +#: config/tc-alpha.c:980 config/tc-h8300.c:1413 config/tc-h8500.c:1187 +#: config/tc-hppa.c:4017 config/tc-i860.c:931 config/tc-m68hc11.c:500 +#: config/tc-m68k.c:4201 config/tc-m88k.c:1011 config/tc-ns32k.c:1663 +#: config/tc-sparc.c:2831 config/tc-z8k.c:1321 msgid "Bad call to MD_ATOF()" msgstr "" -#: config/tc-alpha.c:1078 +#: config/tc-alpha.c:1030 #, c-format msgid "Unknown CPU identifier `%s'" msgstr "" -#: config/tc-alpha.c:1122 +#: config/tc-alpha.c:1074 msgid "" "Alpha options:\n" "-32addr\t\t\ttreat addresses as 32-bit values\n" @@ -1080,952 +1120,1046 @@ msgid "" "\t\t\tthese variants include PALcode opcodes\n" msgstr "" -#: config/tc-alpha.c:1132 +#: config/tc-alpha.c:1084 msgid "" "VMS options:\n" "-+\t\t\thash encode (don't truncate) names longer than 64 characters\n" "-H\t\t\tshow new symbol after hash truncation\n" msgstr "" -#: config/tc-alpha.c:1305 +#: config/tc-alpha.c:1242 #, c-format msgid "unhandled relocation type %s" msgstr "" -#: config/tc-alpha.c:1318 +#: config/tc-alpha.c:1255 msgid "non-absolute expression in constant field" msgstr "" -#: config/tc-alpha.c:1332 +#: config/tc-alpha.c:1269 #, c-format msgid "type %d reloc done?\n" msgstr "" -#: config/tc-alpha.c:1383 config/tc-alpha.c:1390 config/tc-mips.c:7356 +#: config/tc-alpha.c:1317 config/tc-alpha.c:1324 config/tc-mips.c:7965 msgid "Used $at without \".set noat\"" msgstr "" -#: config/tc-alpha.c:1572 +#: config/tc-alpha.c:1481 #, c-format msgid "cannot represent `%s' relocation in object file" msgstr "" -#: config/tc-alpha.c:1579 +#: config/tc-alpha.c:1488 #, c-format msgid "internal error? cannot generate `%s' relocation" msgstr "" -#: config/tc-alpha.c:1633 +#: config/tc-alpha.c:1543 #, c-format msgid "frame reg expected, using $%d." msgstr "" -#: config/tc-alpha.c:1758 +#: config/tc-alpha.c:1646 +#, c-format +msgid "No !literal!%ld was found" +msgstr "" + +#: config/tc-alpha.c:1654 +#, c-format +msgid "No ldah !gpdisp!%ld was found" +msgstr "" + +#: config/tc-alpha.c:1705 #, c-format -msgid "No !literal!%d was found" +msgid "No lda !gpdisp!%ld was found" msgstr "" #. only support one relocation op per insn -#: config/tc-alpha.c:1946 +#: config/tc-alpha.c:1841 msgid "More than one relocation op per insn" msgstr "" -#: config/tc-alpha.c:1963 +#: config/tc-alpha.c:1857 msgid "No relocation operand" msgstr "" -#: config/tc-alpha.c:1969 +#: config/tc-alpha.c:1867 #, c-format -msgid "No !sequence-number after !%s" +msgid "Unknown relocation operand: !%s" msgstr "" -#: config/tc-alpha.c:1982 +#: config/tc-alpha.c:1877 #, c-format -msgid "Unknown relocation operand: !%s" +msgid "no sequence number after !%s" +msgstr "" + +#: config/tc-alpha.c:1887 +#, c-format +msgid "!%s does not use a sequence number" msgstr "" -#: config/tc-alpha.c:1995 +#: config/tc-alpha.c:1897 #, c-format msgid "Bad sequence number: !%s!%s" msgstr "" -#: config/tc-alpha.c:2346 +#: config/tc-alpha.c:2224 #, c-format msgid "operand out of range (%s not between %d and %d)" msgstr "" -#: config/tc-alpha.c:2445 config/tc-d10v.c:621 config/tc-d30v.c:640 -#: config/tc-mn10200.c:1009 config/tc-mn10300.c:1406 config/tc-ppc.c:1940 -#: config/tc-ppc.c:2048 config/tc-ppc.c:2060 config/tc-v850.c:1856 -#: config/tc-v850.c:1879 config/tc-v850.c:2099 +#: config/tc-alpha.c:2338 config/tc-alpha.c:2362 config/tc-d10v.c:629 +#: config/tc-d30v.c:640 config/tc-mn10200.c:995 config/tc-mn10300.c:1382 +#: config/tc-ppc.c:2072 config/tc-ppc.c:2256 config/tc-ppc.c:2268 +#: config/tc-s390.c:1064 config/tc-s390.c:1121 config/tc-v850.c:1853 +#: config/tc-v850.c:1876 config/tc-v850.c:2096 msgid "too many fixups" msgstr "" -#: config/tc-alpha.c:2660 config/tc-alpha.c:2729 +#: config/tc-alpha.c:2374 +msgid "invalid relocation for instruction" +msgstr "" + +#: config/tc-alpha.c:2385 +msgid "invalid relocation for field" +msgstr "" + +#: config/tc-alpha.c:2484 #, c-format -msgid "inappropriate arguments for opcode `%s'" +msgid "too many ldah insns for !gpdisp!%ld" msgstr "" -#: config/tc-alpha.c:2662 config/tc-alpha.c:2731 +#: config/tc-alpha.c:2486 config/tc-alpha.c:2498 #, c-format -msgid "opcode `%s' not supported for target %s" +msgid "both insns for !gpdisp!%ld must be in the same section" msgstr "" -#: config/tc-alpha.c:2666 config/tc-alpha.c:2734 config/tc-avr.c:1090 +#: config/tc-alpha.c:2496 #, c-format -msgid "unknown opcode `%s'" +msgid "too many lda insns for !gpdisp!%ld" +msgstr "" + +#: config/tc-alpha.c:2577 config/tc-alpha.c:2647 +#, c-format +msgid "inappropriate arguments for opcode `%s'" +msgstr "" + +#: config/tc-alpha.c:2579 config/tc-alpha.c:2649 +#, c-format +msgid "opcode `%s' not supported for target %s" msgstr "" -#: config/tc-alpha.c:2706 config/tc-alpha.c:2773 config/tc-alpha.c:3284 -#: config/tc-alpha.c:3344 config/tc-alpha.c:3396 config/tc-alpha.c:3471 -#: config/tc-alpha.c:3556 config/tc-alpha.c:3682 config/tc-alpha.c:3859 -#: config/tc-alpha.c:3916 config/tc-alpha.c:4026 config/tc-alpha.c:4133 -#: config/tc-alpha.c:4210 +#: config/tc-alpha.c:2583 config/tc-alpha.c:2653 config/tc-avr.c:1097 #, c-format -msgid "Cannot use !%s!%d with %s" +msgid "unknown opcode `%s'" msgstr "" -#: config/tc-alpha.c:2794 +#: config/tc-alpha.c:2701 msgid "can not resolve expression" msgstr "" -#: config/tc-alpha.c:2936 config/tc-alpha.c:3128 +#: config/tc-alpha.c:2845 config/tc-alpha.c:3024 msgid "overflow in literal (.lita) table" msgstr "" -#: config/tc-alpha.c:2943 config/tc-alpha.c:2966 config/tc-alpha.c:3141 -#: config/tc-alpha.c:3485 config/tc-alpha.c:3563 config/tc-alpha.c:3611 -#: config/tc-alpha.c:3711 config/tc-alpha.c:3936 config/tc-alpha.c:4048 +#: config/tc-alpha.c:2852 config/tc-alpha.c:2875 config/tc-alpha.c:3037 +#: config/tc-alpha.c:3252 config/tc-alpha.c:3297 config/tc-alpha.c:3371 +#: config/tc-alpha.c:3463 config/tc-alpha.c:3712 config/tc-alpha.c:3813 msgid "macro requires $at register while noat in effect" msgstr "" -#: config/tc-alpha.c:2945 config/tc-alpha.c:2968 config/tc-alpha.c:3143 +#: config/tc-alpha.c:2854 config/tc-alpha.c:2877 config/tc-alpha.c:3039 msgid "macro requires $at while $at in use" msgstr "" -#: config/tc-alpha.c:3090 expr.c:83 read.c:3164 +#: config/tc-alpha.c:2985 msgid "bignum invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:3092 expr.c:85 read.c:3166 read.c:3499 read.c:4397 +#: config/tc-alpha.c:2987 msgid "floating point number invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:3097 +#: config/tc-alpha.c:2992 msgid "can't handle expression" msgstr "" -#: config/tc-alpha.c:3134 +#: config/tc-alpha.c:3030 msgid "overflow in literal (.lit8) table" msgstr "" -#: config/tc-alpha.c:3306 +#: config/tc-alpha.c:4042 config/tc-ppc.c:1579 config/tc-ppc.c:3974 #, c-format -msgid "bad instruction format for lda !%s!%ld" +msgid ".COMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-alpha.c:4306 config/tc-ppc.c:1467 config/tc-ppc.c:3689 -#: read.c:1369 -#, c-format -msgid ".COMMon length (%ld.) <0! Ignored." +#: config/tc-alpha.c:4071 config/tc-sparc.c:3700 config/tc-v850.c:283 +msgid "Ignoring attempt to re-define symbol" msgstr "" -#: config/tc-alpha.c:4344 config/tc-alpha.c:4353 config/tc-ppc.c:3726 -#: read.c:1393 +#: config/tc-alpha.c:4080 config/tc-alpha.c:4089 config/tc-ppc.c:4011 #, c-format msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-alpha.c:4455 ecoff.c:3087 +#: config/tc-alpha.c:4191 ecoff.c:3084 msgid ".ent directive has no name" msgstr "" -#: config/tc-alpha.c:4463 +#: config/tc-alpha.c:4199 msgid "nested .ent directives" msgstr "" -#: config/tc-alpha.c:4499 ecoff.c:3035 +#: config/tc-alpha.c:4235 ecoff.c:3034 msgid ".end directive has no name" msgstr "" -#: config/tc-alpha.c:4508 +#: config/tc-alpha.c:4244 msgid ".end directive names different symbol than .ent" msgstr "" -#: config/tc-alpha.c:4585 +#: config/tc-alpha.c:4321 #, c-format msgid "Invalid argument %d to .prologue." msgstr "" -#: config/tc-alpha.c:4677 +#: config/tc-alpha.c:4413 msgid "ECOFF debugging is disabled." msgstr "" -#: config/tc-alpha.c:4698 +#: config/tc-alpha.c:4434 msgid "Unknown section directive" msgstr "" -#: config/tc-alpha.c:4734 +#: config/tc-alpha.c:4470 msgid ".ent directive has no symbol" msgstr "" -#: config/tc-alpha.c:4761 +#: config/tc-alpha.c:4497 msgid "Bad .frame directive 1./2. param" msgstr "" -#: config/tc-alpha.c:4773 +#: config/tc-alpha.c:4509 msgid "Bad .frame directive 3./4. param" msgstr "" -#: config/tc-alpha.c:4798 +#: config/tc-alpha.c:4534 msgid ".pdesc directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:4806 +#: config/tc-alpha.c:4542 msgid ".pdesc has no matching .ent" msgstr "" -#: config/tc-alpha.c:4817 +#: config/tc-alpha.c:4553 msgid ".pdesc directive has no entry symbol" msgstr "" -#: config/tc-alpha.c:4830 +#: config/tc-alpha.c:4566 msgid "No comma after .pdesc " msgstr "" -#: config/tc-alpha.c:4853 +#: config/tc-alpha.c:4589 msgid "unknown procedure kind" msgstr "" -#: config/tc-alpha.c:4947 +#: config/tc-alpha.c:4682 msgid ".name directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:4955 +#: config/tc-alpha.c:4690 msgid ".name directive has no symbol" msgstr "" -#: config/tc-alpha.c:4989 +#: config/tc-alpha.c:4724 msgid "No symbol after .linkage" msgstr "" -#: config/tc-alpha.c:5017 +#: config/tc-alpha.c:4752 msgid "No symbol after .code_address" msgstr "" -#: config/tc-alpha.c:5050 ecoff.c:3253 +#: config/tc-alpha.c:4785 msgid "Bad .mask directive" msgstr "" -#: config/tc-alpha.c:5071 ecoff.c:3183 +#: config/tc-alpha.c:4806 msgid "Bad .fmask directive" msgstr "" -#: config/tc-alpha.c:5241 config/tc-arm.c:1593 read.c:2150 read.c:2737 -#: stabs.c:464 +#: config/tc-alpha.c:4976 #, c-format msgid "Expected comma after name \"%s\"" msgstr "" #. *symbol_get_obj (symbolP) = (signed char) temp; -#: config/tc-alpha.c:5252 +#: config/tc-alpha.c:4987 #, c-format msgid "unhandled: .proc %s,%d" msgstr "" -#: config/tc-alpha.c:5287 +#: config/tc-alpha.c:5022 #, c-format msgid "Tried to .set unrecognized mode `%s'" msgstr "" #. not fatal, but it might not work in the end -#: config/tc-alpha.c:5304 +#: config/tc-alpha.c:5039 msgid "File overrides no-base-register option." msgstr "" -#: config/tc-alpha.c:5321 +#: config/tc-alpha.c:5056 #, c-format msgid "Bad base register, using $%d." msgstr "" -#: config/tc-alpha.c:5343 +#: config/tc-alpha.c:5078 #, c-format msgid "Alignment too large: %d. assumed" msgstr "" -#: config/tc-alpha.c:5347 config/tc-d30v.c:2219 +#: config/tc-alpha.c:5082 config/tc-d30v.c:2214 msgid "Alignment negative: 0 assumed" msgstr "" -#: config/tc-alpha.c:5662 +#: config/tc-alpha.c:5394 #, c-format msgid "Chose GP value of %lx\n" msgstr "" -#: config/tc-arc.c:1618 config/tc-arm.c:7532 +#: config/tc-alpha.c:5410 config/tc-ia64.c:932 +msgid "Bad .section directive: want a,s,w,x,M,S in string" +msgstr "" + +#: config/tc-arc.c:1616 config/tc-arm.c:10246 msgid "md_estimate_size_before_relax\n" msgstr "" -#: config/tc-arc.c:1630 +#: config/tc-arc.c:1628 msgid "md_convert_frag\n" msgstr "" -#: config/tc-arm.c:1156 -msgid "Bad arguments to instruction" +#: config/tc-arm.c:664 +msgid "ARM register expected" msgstr "" -#: config/tc-arm.c:1157 -msgid "r15 not allowed here" +#: config/tc-arm.c:665 config/tc-arm.c:2814 +msgid "bad or missing co-processor number" +msgstr "" + +#. In the few cases where we might be able to accept something else +#. this error can be overridden. +#: config/tc-arm.c:666 config/tc-arm.c:2869 +msgid "co-processor register expected" +msgstr "" + +#: config/tc-arm.c:667 +msgid "FPA register expected" +msgstr "" + +#: config/tc-arm.c:668 +msgid "VFP single precision register expected" +msgstr "" + +#: config/tc-arm.c:669 +msgid "VFP double precision register expected" +msgstr "" + +#: config/tc-arm.c:670 +msgid "Maverick MVF register expected" +msgstr "" + +#: config/tc-arm.c:671 +msgid "Maverick MVD register expected" +msgstr "" + +#: config/tc-arm.c:672 config/tc-arm.c:673 +msgid "Maverick MVFX register expected" +msgstr "" + +#: config/tc-arm.c:674 +msgid "Maverick MVAX register expected" +msgstr "" + +#: config/tc-arm.c:675 +msgid "Maverick DSPSC register expected" +msgstr "" + +#: config/tc-arm.c:2013 +msgid "bad arguments to instruction" msgstr "" -#: config/tc-arm.c:1158 -msgid "Instruction should not have flags" +#: config/tc-arm.c:2014 +msgid "r15 not allowed here" msgstr "" -#: config/tc-arm.c:1159 -msgid "Instruction is not conditional" +#: config/tc-arm.c:2015 +msgid "instruction is not conditional" msgstr "" -#: config/tc-arm.c:1160 +#: config/tc-arm.c:2016 msgid "acc0 expected" msgstr "" -#: config/tc-arm.c:1289 -msgid "Literal Pool Overflow" +#: config/tc-arm.c:2155 +msgid "literal pool overflow" msgstr "" -#: config/tc-arm.c:1431 -msgid "Invalid syntax for .req directive." +#: config/tc-arm.c:2297 +msgid "invalid syntax for .req directive" msgstr "" -#: config/tc-arm.c:1506 config/tc-mips.c:9916 read.c:2035 +#: config/tc-arm.c:2372 #, c-format -msgid "Alignment too large: %d. assumed." +msgid "alignment too large: %d assumed" +msgstr "" + +#: config/tc-arm.c:2375 +msgid "alignment negative. 0 assumed." msgstr "" -#: config/tc-arm.c:1509 read.c:2040 -msgid "Alignment negative. 0 assumed." +#: config/tc-arm.c:2459 +#, c-format +msgid "expected comma after name \"%s\"" msgstr "" -#: config/tc-arm.c:1643 config/tc-m32r.c:417 read.c:2795 read.c:4857 +#: config/tc-arm.c:2509 config/tc-m32r.c:418 #, c-format msgid "symbol `%s' already defined" msgstr "" -#: config/tc-arm.c:1714 +#: config/tc-arm.c:2580 msgid "selected processor does not support THUMB opcodes" msgstr "" -#: config/tc-arm.c:1727 +#: config/tc-arm.c:2593 msgid "selected processor does not support ARM opcodes" msgstr "" -#: config/tc-arm.c:1739 +#: config/tc-arm.c:2605 #, c-format msgid "invalid instruction size selected (%d)" msgstr "" -#: config/tc-arm.c:1774 +#: config/tc-arm.c:2640 #, c-format msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" msgstr "" -#: config/tc-arm.c:1785 -msgid "Garbage following instruction" +#: config/tc-arm.c:2651 +msgid "garbage following instruction" msgstr "" #. In the few cases where we might be able to accept something else #. this error can be overridden. -#: config/tc-arm.c:1835 +#: config/tc-arm.c:2701 #, c-format -msgid "Register expected, not '%.100s'" +msgid "register expected, not '%.100s'" msgstr "" #. In the few cases where we might be able to accept #. something else this error can be overridden. -#: config/tc-arm.c:1907 +#: config/tc-arm.c:2773 msgid "flag for {c}psr instruction expected" msgstr "" -#: config/tc-arm.c:1937 -msgid "Illegal co-processor number" -msgstr "" - -#: config/tc-arm.c:1944 -msgid "Bad or missing co-processor number" +#: config/tc-arm.c:2807 +msgid "illegal co-processor number" msgstr "" -#: config/tc-arm.c:1968 config/tc-arm.c:3054 config/tc-arm.c:3246 +#: config/tc-arm.c:2839 config/tc-arm.c:3877 config/tc-arm.c:4059 msgid "bad or missing expression" msgstr "" -#: config/tc-arm.c:1974 +#: config/tc-arm.c:2845 msgid "immediate co-processor expression too large" msgstr "" #. In the few cases where we might be able to accept something else #. this error can be overridden. -#: config/tc-arm.c:1999 -msgid "Co-processor register expected" +#: config/tc-arm.c:2892 +msgid "floating point register expected" msgstr "" -#. In the few cases where we might be able to accept something else -#. this error can be overridden. -#: config/tc-arm.c:2023 -msgid "Floating point register expected" -msgstr "" - -#: config/tc-arm.c:2040 +#: config/tc-arm.c:2909 msgid "immediate expression expected" msgstr "" -#: config/tc-arm.c:2055 +#: config/tc-arm.c:2924 msgid "co-processor address must be word aligned" msgstr "" -#: config/tc-arm.c:2061 +#: config/tc-arm.c:2930 msgid "offset too large" msgstr "" -#: config/tc-arm.c:2109 +#: config/tc-arm.c:2979 msgid "pc may not be used in post-increment" msgstr "" -#: config/tc-arm.c:2125 config/tc-arm.c:2578 config/tc-arm.c:3438 -#: config/tc-arm.c:4358 +#: config/tc-arm.c:2995 config/tc-arm.c:3440 config/tc-arm.c:4228 +#: config/tc-arm.c:5095 config/tc-arm.c:5429 msgid "pre-indexed expression expected" msgstr "" -#: config/tc-arm.c:2138 config/tc-arm.c:2591 config/tc-arm.c:3449 -#: config/tc-arm.c:4370 config/tc-arm.c:4716 +#: config/tc-arm.c:3008 config/tc-arm.c:3453 config/tc-arm.c:4239 +#: config/tc-arm.c:5107 config/tc-arm.c:5441 config/tc-arm.c:5790 +#: config/tc-arm.c:8452 config/tc-arm.c:8467 msgid "missing ]" msgstr "" -#: config/tc-arm.c:2148 +#: config/tc-arm.c:3018 msgid "pc may not be used with write-back" msgstr "" -#: config/tc-arm.c:2203 +#: config/tc-arm.c:3070 msgid "comma expected after register name" msgstr "" -#: config/tc-arm.c:2222 -msgid "{C|S}PSR expected" +#: config/tc-arm.c:3089 +msgid "CPSR or SPSR expected" msgstr "" -#: config/tc-arm.c:2250 +#: config/tc-arm.c:3115 msgid "comma missing after psr flags" msgstr "" -#: config/tc-arm.c:2267 config/tc-arm.c:2277 +#: config/tc-arm.c:3131 config/tc-arm.c:3141 msgid "only a register or immediate value can follow a psr flag" msgstr "" -#: config/tc-arm.c:2284 +#: config/tc-arm.c:3152 msgid "immediate value cannot be used to set this field" msgstr "" -#: config/tc-arm.c:2301 config/tc-arm.c:3673 config/tc-arm.c:3939 -#: config/tc-arm.c:3959 -msgid "Invalid constant" +#: config/tc-arm.c:3170 config/tc-arm.c:4455 config/tc-arm.c:4735 +#: config/tc-arm.c:4755 config/tc-i960.c:1924 +msgid "invalid constant" msgstr "" -#: config/tc-arm.c:2351 +#: config/tc-arm.c:3218 msgid "rdhi, rdlo and rm must all be different" msgstr "" -#: config/tc-arm.c:2407 +#: config/tc-arm.c:3272 msgid "rd and rm should be different in mul" msgstr "" -#: config/tc-arm.c:2463 +#: config/tc-arm.c:3326 msgid "rd and rm should be different in mla" msgstr "" -#: config/tc-arm.c:2512 +#: config/tc-arm.c:3374 #, c-format msgid "acc0 expected, not '%.100s'" msgstr "" -#: config/tc-arm.c:2695 +#: config/tc-arm.c:3552 msgid "rdhi and rdlo must be different" msgstr "" -#: config/tc-arm.c:2815 -msgid "Warning: Instruction unpredictable when using r15" +#: config/tc-arm.c:3660 +msgid "Warning: instruction unpredictable when using r15" msgstr "" -#: config/tc-arm.c:3063 config/tc-arm.c:3255 config/tc-arm.c:5503 -#: config/tc-arm.c:5536 config/tc-arm.c:5546 +#: config/tc-arm.c:3886 config/tc-arm.c:4068 config/tc-arm.c:7395 +#: config/tc-arm.c:7428 config/tc-arm.c:7438 msgid "immediate value out of range" msgstr "" -#: config/tc-arm.c:3403 +#: config/tc-arm.c:4191 msgid "'[' expected after PLD mnemonic" msgstr "" -#: config/tc-arm.c:3428 config/tc-arm.c:3458 -msgid "writeback used in preload instruction" +#: config/tc-arm.c:4213 +msgid "post-indexed expression used in preload instruction" msgstr "" -#. Deny all knowledge. -#: config/tc-arm.c:3506 -#, c-format -msgid "bad instruction '%.100s'" +#: config/tc-arm.c:4218 config/tc-arm.c:4248 +msgid "writeback used in preload instruction" msgstr "" -#: config/tc-arm.c:3530 -msgid "Destination register must be even" +#: config/tc-arm.c:4290 +msgid "destination register must be even" msgstr "" -#: config/tc-arm.c:3536 -msgid "r12 or r14 not allowed here" +#: config/tc-arm.c:4296 +msgid "r14 not allowed here" msgstr "" -#: config/tc-arm.c:3544 +#: config/tc-arm.c:4303 msgid "pre/post-indexing used when modified address register is destination" msgstr "" -#: config/tc-arm.c:3657 +#: config/tc-arm.c:4313 +msgid "ldrd destination registers must not overlap index register" +msgstr "" + +#: config/tc-arm.c:4439 msgid "bad_segment" msgstr "" -#: config/tc-arm.c:3703 config/tc-arm.c:3714 -msgid "Shift expression expected" +#: config/tc-arm.c:4476 expr.c:1314 read.c:2198 +msgid "bad expression" +msgstr "" + +#: config/tc-arm.c:4499 config/tc-arm.c:4510 +msgid "shift expression expected" msgstr "" -#: config/tc-arm.c:3738 +#: config/tc-arm.c:4534 msgid "shift requires register or #expression" msgstr "" -#: config/tc-arm.c:3739 +#: config/tc-arm.c:4535 msgid "shift requires #expression" msgstr "" -#: config/tc-arm.c:3769 -msgid "Shift of 0 ignored." +#: config/tc-arm.c:4565 +msgid "shift of 0 ignored." msgstr "" -#: config/tc-arm.c:3775 -msgid "Invalid immediate shift" +#: config/tc-arm.c:4571 +msgid "invalid immediate shift" msgstr "" -#: config/tc-arm.c:3930 config/tc-arm.c:4400 -msgid "Constant expression expected" +#: config/tc-arm.c:4726 config/tc-arm.c:5143 config/tc-arm.c:5478 +#: config/tc-arm.c:6087 config/tc-v850.c:1956 config/tc-v850.c:1977 +msgid "constant expression expected" msgstr "" -#: config/tc-arm.c:3972 -msgid "Register or shift expression expected" +#: config/tc-arm.c:4768 +msgid "register or shift expression expected" msgstr "" -#: config/tc-arm.c:4025 -msgid "Invalid floating point immediate expression" +#: config/tc-arm.c:4821 +msgid "invalid floating point immediate expression" msgstr "" -#: config/tc-arm.c:4029 -msgid "Floating point register or immediate expression expected" +#: config/tc-arm.c:4825 +msgid "floating point register or immediate expression expected" msgstr "" -#: config/tc-arm.c:4198 +#: config/tc-arm.c:4979 config/tc-arm.c:5309 msgid "address offset too large" msgstr "" -#: config/tc-arm.c:4275 -msgid "Processor does not support halfwords or signed bytes" -msgstr "" - -#: config/tc-arm.c:4296 -msgid "Address expected" +#: config/tc-arm.c:5037 config/tc-arm.c:5227 config/tc-arm.c:5369 +msgid "address expected" msgstr "" -#: config/tc-arm.c:4326 config/tc-arm.c:4341 config/tc-arm.c:4379 +#: config/tc-arm.c:5067 config/tc-arm.c:5079 config/tc-arm.c:5116 +#: config/tc-arm.c:5245 config/tc-arm.c:5399 config/tc-arm.c:5413 +#: config/tc-arm.c:5450 #, c-format msgid "%s register same as write-back base" msgstr "" -#: config/tc-arm.c:4328 config/tc-arm.c:4343 config/tc-arm.c:4381 +#: config/tc-arm.c:5069 config/tc-arm.c:5081 config/tc-arm.c:5118 +#: config/tc-arm.c:5247 config/tc-arm.c:5401 config/tc-arm.c:5415 +#: config/tc-arm.c:5452 msgid "destination" msgstr "" -#: config/tc-arm.c:4328 config/tc-arm.c:4343 config/tc-arm.c:4381 +#: config/tc-arm.c:5069 config/tc-arm.c:5081 config/tc-arm.c:5118 +#: config/tc-arm.c:5247 config/tc-arm.c:5401 config/tc-arm.c:5415 +#: config/tc-arm.c:5452 msgid "source" msgstr "" -#: config/tc-arm.c:4420 +#: config/tc-arm.c:5128 config/tc-arm.c:5462 config/tc-arm.c:7699 +msgid "invalid pseudo operation" +msgstr "" + +#: config/tc-arm.c:5180 config/tc-arm.c:5513 msgid "literal pool insertion failed" msgstr "" -#: config/tc-arm.c:4459 -msgid "Pre-increment instruction with translate" +#: config/tc-arm.c:5275 config/tc-arm.c:5281 +msgid "post-indexed expression expected" msgstr "" -#: config/tc-arm.c:4500 -msgid "Bad range in register list" +#: config/tc-arm.c:5579 +msgid "bad range in register list" msgstr "" -#: config/tc-arm.c:4508 config/tc-arm.c:4517 config/tc-arm.c:4559 +#: config/tc-arm.c:5587 config/tc-arm.c:5596 config/tc-arm.c:5638 #, c-format -msgid "Warning: Duplicated register (r%d) in register list" +msgid "Warning: duplicated register (r%d) in register list" msgstr "" -#: config/tc-arm.c:4520 -msgid "Warning: Register range not in ascending order" +#: config/tc-arm.c:5599 +msgid "Warning: register range not in ascending order" msgstr "" -#: config/tc-arm.c:4532 -msgid "Missing `}'" +#: config/tc-arm.c:5611 +msgid "missing `}'" msgstr "" -#: config/tc-arm.c:4548 +#: config/tc-arm.c:5627 msgid "invalid register mask" msgstr "" -#: config/tc-arm.c:4569 config/tc-avr.c:852 config/tc-cris.c:2733 -#: config/tc-d10v.c:1560 config/tc-d30v.c:1865 config/tc-mips.c:3230 -#: config/tc-mips.c:4162 config/tc-mips.c:4947 config/tc-mips.c:5493 -#: config/tc-ppc.c:4854 config/tc-v850.c:2385 +#: config/tc-arm.c:5648 config/tc-arm.c:8709 config/tc-arm.c:8809 +#: config/tc-avr.c:860 config/tc-cris.c:3006 config/tc-d10v.c:1563 +#: config/tc-d30v.c:1863 config/tc-mips.c:3641 config/tc-mips.c:4630 +#: config/tc-mips.c:5486 config/tc-mips.c:6091 config/tc-ppc.c:5143 +#: config/tc-v850.c:2376 msgid "expression too complex" msgstr "" -#: config/tc-arm.c:4608 +#: config/tc-arm.c:5686 msgid "r15 not allowed as base register" msgstr "" -#: config/tc-arm.c:4676 config/tc-arm.c:4690 +#: config/tc-arm.c:5750 config/tc-arm.c:5764 msgid "r15 not allowed in swap" msgstr "" -#: config/tc-arm.c:4788 -msgid "Use of r15 in bx in ARM mode is not really useful" +#: config/tc-arm.c:5859 +msgid "use of r15 in bx in ARM mode is not really useful" msgstr "" -#: config/tc-arm.c:5044 config/tc-v850.c:1959 config/tc-v850.c:1980 -msgid "constant expression expected" +#: config/tc-arm.c:6093 +msgid "constant value required for number of registers" +msgstr "" + +#: config/tc-arm.c:6101 +msgid "number of registers must be in the range [1:4]" msgstr "" -#: config/tc-arm.c:5050 -msgid "Constant value required for number of registers" +#: config/tc-arm.c:6162 +msgid "r15 not allowed as base register with write-back" msgstr "" -#: config/tc-arm.c:5058 -msgid "number of registers must be in the range [1:4]" +#: config/tc-arm.c:6544 +msgid "only two consecutive VFP SP registers allowed here" +msgstr "" + +#: config/tc-arm.c:6712 +msgid "VFP system register expected" +msgstr "" + +#: config/tc-arm.c:6850 config/tc-arm.c:6889 config/tc-arm.c:6902 +#: config/tc-arm.c:6963 config/tc-arm.c:7002 config/tc-arm.c:7015 +#: config/tc-mips.c:9060 config/tc-mips.c:9090 +msgid "invalid register list" msgstr "" -#: config/tc-arm.c:5119 -msgid "R15 not allowed as base register with write-back" +#: config/tc-arm.c:6856 config/tc-arm.c:6969 +msgid "register list not in ascending order" msgstr "" -#: config/tc-arm.c:5367 +#: config/tc-arm.c:6881 config/tc-arm.c:6994 +msgid "register range not in ascending order" +msgstr "" + +#: config/tc-arm.c:6919 config/tc-arm.c:7032 +msgid "non-contiguous register range" +msgstr "" + +#: config/tc-arm.c:7062 config/tc-arm.c:7099 +msgid "this addressing mode requires base-register writeback" +msgstr "" + +#: config/tc-arm.c:7259 msgid "lo register required" msgstr "" -#: config/tc-arm.c:5375 +#: config/tc-arm.c:7267 msgid "hi register required" msgstr "" -#: config/tc-arm.c:5445 +#: config/tc-arm.c:7337 config/tc-arm.c:8541 msgid "dest and source1 must be the same register" msgstr "" -#: config/tc-arm.c:5452 +#: config/tc-arm.c:7344 msgid "subtract valid only on lo regs" msgstr "" -#: config/tc-arm.c:5476 +#: config/tc-arm.c:7368 msgid "invalid Hi register with immediate" msgstr "" -#: config/tc-arm.c:5514 +#: config/tc-arm.c:7406 msgid "invalid immediate value for stack adjust" msgstr "" -#: config/tc-arm.c:5525 +#: config/tc-arm.c:7417 msgid "invalid immediate for address calculation" msgstr "" -#: config/tc-arm.c:5612 +#: config/tc-arm.c:7504 msgid "source1 and dest must be same register" msgstr "" -#: config/tc-arm.c:5646 -msgid "Invalid immediate for shift" +#: config/tc-arm.c:7538 +msgid "invalid immediate for shift" msgstr "" -#: config/tc-arm.c:5725 +#: config/tc-arm.c:7617 msgid "only lo regs allowed with immediate" msgstr "" -#: config/tc-arm.c:5744 +#: config/tc-arm.c:7636 msgid "invalid immediate" msgstr "" -#: config/tc-arm.c:5798 +#: config/tc-arm.c:7690 msgid "expected ']'" msgstr "" -#: config/tc-arm.c:5865 +#: config/tc-arm.c:7763 msgid "byte or halfword not valid for base register" msgstr "" -#: config/tc-arm.c:5870 -msgid "R15 based store not allowed" +#: config/tc-arm.c:7768 +msgid "r15 based store not allowed" msgstr "" -#: config/tc-arm.c:5875 -msgid "Invalid base register for register offset" +#: config/tc-arm.c:7773 +msgid "invalid base register for register offset" msgstr "" -#: config/tc-arm.c:5893 +#: config/tc-arm.c:7791 config/tc-arm.c:7826 msgid "invalid offset" msgstr "" -#: config/tc-arm.c:5904 +#: config/tc-arm.c:7802 msgid "invalid base register in load/store" msgstr "" -#: config/tc-arm.c:5928 -msgid "Invalid offset" +#: config/tc-arm.c:8345 +msgid "expecting immediate, 7bit operand" msgstr "" -#: config/tc-arm.c:6003 -msgid "dest and source1 one must be the same register" +#: config/tc-arm.c:8360 +msgid "immediate out of range" msgstr "" -#: config/tc-arm.c:6011 -msgid "Rs and Rd must be different in MUL" +#: config/tc-arm.c:8403 +msgid "offset expected" msgstr "" -#: config/tc-arm.c:6155 -msgid "" -"Inserted missing '!': load/store multiple always writes back base register" +#: config/tc-arm.c:8412 config/tc-pj.c:528 config/tc-sh.c:3030 +msgid "offset out of range" msgstr "" -#: config/tc-arm.c:6171 config/tc-arm.c:6271 -msgid "Expression too complex" +#: config/tc-arm.c:8549 +msgid "Rs and Rd must be different in MUL" msgstr "" -#: config/tc-arm.c:6177 -msgid "only lo-regs valid in load/store multiple" +#: config/tc-arm.c:8693 +msgid "" +"inserted missing '!': load/store multiple always writes back base register" msgstr "" -#: config/tc-arm.c:6223 -msgid "Syntax: ldrs[b] Rd, [Rb, Ro]" +#: config/tc-arm.c:8715 +msgid "only lo-regs valid in load/store multiple" msgstr "" -#: config/tc-arm.c:6287 -msgid "invalid register list to push/pop instruction" +#: config/tc-arm.c:8761 +msgid "syntax: ldrs[b] Rd, [Rb, Ro]" msgstr "" -#: config/tc-arm.c:6429 config/tc-cris.c:664 -msgid "Virtual memory exhausted" +#: config/tc-arm.c:8825 +msgid "invalid register list to push/pop instruction" msgstr "" -#: config/tc-arm.c:6835 -#, c-format -msgid "invalid constant (%lx) after fixup" +#: config/tc-arm.c:8937 config/tc-arm.c:9115 +msgid "virtual memory exhausted" msgstr "" -#: config/tc-arm.c:6871 +#: config/tc-arm.c:9018 #, c-format -msgid "Unable to compute ADRL instructions for PC offset of 0x%lx" +msgid "register '%s' does not exist\n" msgstr "" -#: config/tc-arm.c:6901 +#: config/tc-arm.c:9022 #, c-format -msgid "bad immediate value for offset (%ld)" -msgstr "" - -#: config/tc-arm.c:6923 config/tc-arm.c:6945 -msgid "invalid literal constant: pool needs to be closer" +msgid "" +"ignoring redefinition of register alias '%s' to non-existant register '%s'" msgstr "" -#: config/tc-arm.c:6925 +#: config/tc-arm.c:9031 #, c-format -msgid "bad immediate value for half-word offset (%ld)" +msgid "ignoring redefinition of register alias '%s'" msgstr "" -#: config/tc-arm.c:6962 -msgid "shift expression is too large" +#: config/tc-arm.c:9037 +msgid "ignoring incomplete .req pseuso op" msgstr "" -#: config/tc-arm.c:6981 config/tc-arm.c:6990 -msgid "Invalid swi expression" +#: config/tc-arm.c:9312 +msgid "bad call to MD_ATOF()" msgstr "" -#: config/tc-arm.c:7000 -msgid "Invalid expression in load/store multiple" +#: config/tc-arm.c:9542 +#, c-format +msgid "invalid constant (%lx) after fixup" msgstr "" -#: config/tc-arm.c:7053 -msgid "gas can't handle same-section branch dest >= 0x04000000" +#: config/tc-arm.c:9578 +#, c-format +msgid "unable to compute ADRL instructions for PC offset of 0x%lx" msgstr "" -#: config/tc-arm.c:7062 -msgid "out of range branch" +#: config/tc-arm.c:9608 +#, c-format +msgid "bad immediate value for offset (%ld)" msgstr "" -#: config/tc-arm.c:7095 config/tc-arm.c:7111 config/tc-mips.c:9743 -msgid "Branch out of range" +#: config/tc-arm.c:9630 config/tc-arm.c:9652 +msgid "invalid literal constant: pool needs to be closer" msgstr "" -#: config/tc-arm.c:7134 -msgid "Branch with link out of range" +#: config/tc-arm.c:9632 +#, c-format +msgid "bad immediate value for half-word offset (%ld)" msgstr "" -#: config/tc-arm.c:7201 -msgid "Illegal value for co-processor offset" +#: config/tc-arm.c:9669 +msgid "shift expression is too large" msgstr "" -#: config/tc-arm.c:7225 -#, c-format -msgid "Invalid offset, target not word aligned (0x%08X)" +#: config/tc-arm.c:9688 config/tc-arm.c:9697 +msgid "invalid swi expression" msgstr "" -#: config/tc-arm.c:7231 config/tc-arm.c:7240 config/tc-arm.c:7247 -#: config/tc-arm.c:7254 config/tc-arm.c:7261 -#, c-format -msgid "Invalid offset, value too big (0x%08lX)" +#: config/tc-arm.c:9707 +msgid "invalid expression in load/store multiple" msgstr "" -#: config/tc-arm.c:7300 -msgid "Invalid immediate for stack address calculation" +#: config/tc-arm.c:9760 +msgid "GAS can't handle same-section branch dest >= 0x04000000" msgstr "" -#: config/tc-arm.c:7309 -#, c-format -msgid "Invalid immediate for address calculation (value = 0x%08lX)" +#: config/tc-arm.c:9769 +msgid "out of range branch" msgstr "" -#: config/tc-arm.c:7319 -msgid "Invalid 8bit immediate" +#: config/tc-arm.c:9802 config/tc-arm.c:9818 +msgid "branch out of range" msgstr "" -#: config/tc-arm.c:7327 -msgid "Invalid 3bit immediate" +#: config/tc-arm.c:9841 +msgid "branch with link out of range" msgstr "" -#: config/tc-arm.c:7343 -#, c-format -msgid "Invalid immediate: %ld is too large" +#: config/tc-arm.c:9917 +msgid "illegal value for co-processor offset" msgstr "" -#: config/tc-arm.c:7358 +#: config/tc-arm.c:9941 #, c-format -msgid "Illegal Thumb shift value: %ld" +msgid "invalid offset, target not word aligned (0x%08X)" msgstr "" -#: config/tc-arm.c:7372 config/tc-mn10300.c:1961 +#: config/tc-arm.c:9947 config/tc-arm.c:9956 config/tc-arm.c:9963 +#: config/tc-arm.c:9970 config/tc-arm.c:9977 #, c-format -msgid "Bad relocation fixup type (%d)" +msgid "invalid offset, value too big (0x%08lX)" msgstr "" -#: config/tc-arm.c:7445 -msgid "Literal referenced across section boundary (Implicit dump?)" +#: config/tc-arm.c:10016 +msgid "invalid immediate for stack address calculation" msgstr "" -#: config/tc-arm.c:7458 +#: config/tc-arm.c:10025 #, c-format -msgid "Internal_relocation (type %d) not fixed up (IMMEDIATE)" -msgstr "" - -#: config/tc-arm.c:7464 -msgid "ADRL used for a symbol not defined in the same file" +msgid "invalid immediate for address calculation (value = 0x%08lX)" msgstr "" -#: config/tc-arm.c:7469 -#, c-format -msgid "Internal_relocation (type %d) not fixed up (OFFSET_IMM)" +#: config/tc-arm.c:10035 +msgid "invalid 8bit immediate" msgstr "" -#: config/tc-arm.c:7490 config/tc-cris.c:2672 config/tc-mcore.c:2109 -#: config/tc-ns32k.c:2369 -msgid "" +#: config/tc-arm.c:10043 +msgid "invalid 3bit immediate" msgstr "" -#: config/tc-arm.c:7493 +#: config/tc-arm.c:10059 #, c-format -msgid "Cannot represent %s relocation in this object file format" +msgid "invalid immediate: %ld is too large" msgstr "" -#: config/tc-arm.c:7514 config/tc-mips.c:11261 config/tc-sh.c:3177 +#: config/tc-arm.c:10074 #, c-format -msgid "Can not represent %s relocation in this object file format" +msgid "illegal Thumb shift value: %ld" msgstr "" -#: config/tc-arm.c:7611 +#: config/tc-arm.c:10088 #, c-format -msgid "No operator -- statement `%s'\n" +msgid "bad relocation fixup type (%d)" msgstr "" -#: config/tc-arm.c:7629 -msgid "selected processor does not support this opcode" +#: config/tc-arm.c:10159 +msgid "literal referenced across section boundary (Implicit dump?)" msgstr "" -#: config/tc-arm.c:7675 +#: config/tc-arm.c:10172 #, c-format -msgid "Opcode `%s' must have suffix from list: <%s>" +msgid "internal relocation (type %d) not fixed up (IMMEDIATE)" msgstr "" -#: config/tc-arm.c:7706 -msgid "Warning: Use of the 'nv' conditional is deprecated\n" +#: config/tc-arm.c:10178 +msgid "ADRL used for a symbol not defined in the same file" msgstr "" -#: config/tc-arm.c:7723 +#: config/tc-arm.c:10183 #, c-format -msgid "Opcode `%s' is unconditional\n" +msgid "internal_relocation (type %d) not fixed up (OFFSET_IMM)" msgstr "" -#: config/tc-arm.c:7747 -#, c-format -msgid "Opcode `%s' must have suffix from <%s>\n" +#: config/tc-arm.c:10204 config/tc-cris.c:2940 config/tc-mcore.c:2104 +#: config/tc-mmix.c:2840 config/tc-ns32k.c:2350 +msgid "" msgstr "" -#: config/tc-arm.c:7838 +#: config/tc-arm.c:10207 config/tc-arm.c:10228 #, c-format -msgid "register '%s' does not exist\n" +msgid "cannot represent %s relocation in this object file format" msgstr "" -#: config/tc-arm.c:7843 +#: config/tc-arm.c:10325 #, c-format -msgid "ignoring redefinition of register alias '%s'" +msgid "no operator -- statement `%s'\n" msgstr "" -#: config/tc-arm.c:7849 +#: config/tc-arm.c:10343 config/tc-arm.c:10368 #, c-format -msgid "" -"ignoring redefinition of register alias '%s' to non-existant register '%s'" +msgid "selected processor does not support `%s'" msgstr "" -#: config/tc-arm.c:7853 -msgid "ignoring incomplete .req pseuso op" -msgstr "" - -#: config/tc-arm.c:7860 +#: config/tc-arm.c:10385 #, c-format msgid "bad instruction `%s'" msgstr "" -#: config/tc-arm.c:8035 +#: config/tc-arm.c:10583 #, c-format -msgid "Unrecognised APCS switch -m%s" +msgid "unrecognised APCS switch -m%s" msgstr "" -#: config/tc-arm.c:8192 config/tc-arm.c:8205 config/tc-arm.c:8218 -#: config/tc-arm.c:8231 config/tc-arm.c:8237 +#: config/tc-arm.c:10738 config/tc-arm.c:10751 config/tc-arm.c:10764 +#: config/tc-arm.c:10777 config/tc-arm.c:10783 #, c-format -msgid "Invalid architecture variant -m%s" +msgid "invalid architecture variant -m%s" msgstr "" -#: config/tc-arm.c:8244 +#: config/tc-arm.c:10790 #, c-format -msgid "Invalid processor variant -m%s" +msgid "invalid processor variant -m%s" msgstr "" -#: config/tc-arm.c:8267 +#: config/tc-arm.c:10813 msgid "" " ARM Specific Assembler Options:\n" " -m[arm][] select processor variant\n" " -m[arm]v[2|2a|3|3m|4|4t|5[t][e]] select architecture variant\n" +" -marm9e allow Cirrus/DSP instructions\n" " -mthumb only allow Thumb instructions\n" " -mthumb-interwork mark the assembled code as supporting " "interworking\n" @@ -2033,11 +2167,13 @@ msgid "" " -mfpa10, -mfpa11 select floating point architecture\n" " -mfpe-old don't allow floating-point multiple " "instructions\n" +" -mvfpxd allow vfp single-precision instructions\n" +" -mvfp allow all vfp instructions\n" " -mno-fpu don't allow any floating-point instructions.\n" " -k generate PIC code.\n" msgstr "" -#: config/tc-arm.c:8279 +#: config/tc-arm.c:10828 msgid "" " -mapcs-32, -mapcs-26 specify which ARM Procedure Calling Standard to " "use\n" @@ -2046,30 +2182,34 @@ msgid "" " -mapcs-reentrant the code is position independent/reentrant\n" msgstr "" -#: config/tc-arm.c:8286 +#: config/tc-arm.c:10835 msgid " -moabi support the old ELF ABI\n" msgstr "" -#: config/tc-arm.c:8290 +#: config/tc-arm.c:10839 msgid "" " -EB assemble code for a big endian cpu\n" " -EL assemble code for a little endian cpu\n" msgstr "" -#: config/tc-arm.c:8443 +#: config/tc-arm.c:11023 #, c-format msgid "%s: unexpected function type: %d" msgstr "" +#: config/tc-arm.c:11389 +msgid "alignments greater than 32 bytes not supported in .text sections." +msgstr "" + #: config/tc-arm.h:98 msgid "arm convert_frag\n" msgstr "" -#: config/tc-avr.c:185 +#: config/tc-avr.c:197 msgid "Known MCU names:" msgstr "" -#: config/tc-avr.c:254 +#: config/tc-avr.c:266 msgid "" "AVR options:\n" " -mmcu=[avr-name] select microcontroller variant\n" @@ -2082,7 +2222,7 @@ msgid "" " or immediate microcontroller name.\n" msgstr "" -#: config/tc-avr.c:264 +#: config/tc-avr.c:276 msgid "" " -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" " -mno-skip-bug disable warnings for skipping two-word instructions\n" @@ -2091,320 +2231,359 @@ msgid "" " (default for avr3, avr5)\n" msgstr "" -#: config/tc-avr.c:312 +#: config/tc-avr.c:324 #, c-format msgid "unknown MCU: %s\n" msgstr "" -#: config/tc-avr.c:321 +#: config/tc-avr.c:333 #, c-format msgid "redefinition of mcu type `%s' to `%s'" msgstr "" -#: config/tc-avr.c:372 config/tc-d10v.c:313 config/tc-d30v.c:366 -#: config/tc-mips.c:8789 config/tc-mn10200.c:375 config/tc-pj.c:356 -#: config/tc-ppc.c:4518 config/tc-sh.c:2058 config/tc-v850.c:1291 +#: config/tc-avr.c:384 config/tc-d10v.c:314 config/tc-d30v.c:366 +#: config/tc-mips.c:9586 config/tc-mmix.c:2233 config/tc-mn10200.c:361 +#: config/tc-pj.c:357 config/tc-ppc.c:4803 config/tc-sh.c:2090 +#: config/tc-v850.c:1292 msgid "bad call to md_atof" msgstr "" -#: config/tc-avr.c:435 +#: config/tc-avr.c:447 msgid "constant value required" msgstr "" -#: config/tc-avr.c:438 +#: config/tc-avr.c:450 #, c-format msgid "number must be less than %d" msgstr "" -#: config/tc-avr.c:490 +#: config/tc-avr.c:502 msgid "`,' required" msgstr "" -#: config/tc-avr.c:509 +#: config/tc-avr.c:521 msgid "undefined combination of operands" msgstr "" -#: config/tc-avr.c:518 +#: config/tc-avr.c:530 msgid "skipping two-word instruction" msgstr "" -#: config/tc-avr.c:580 +#: config/tc-avr.c:592 msgid "register r16-r23 required" msgstr "" -#: config/tc-avr.c:586 +#: config/tc-avr.c:598 msgid "register number above 15 required" msgstr "" -#: config/tc-avr.c:592 +#: config/tc-avr.c:604 msgid "even register number required" msgstr "" -#: config/tc-avr.c:598 +#: config/tc-avr.c:610 msgid "register r24, r26, r28 or r30 required" msgstr "" -#: config/tc-avr.c:604 +#: config/tc-avr.c:616 msgid "register name or number from 0 to 31 required" msgstr "" -#: config/tc-avr.c:622 +#: config/tc-avr.c:634 msgid "pointer register (X, Y or Z) required" msgstr "" -#: config/tc-avr.c:629 +#: config/tc-avr.c:641 msgid "cannot both predecrement and postincrement" msgstr "" -#: config/tc-avr.c:637 +#: config/tc-avr.c:649 msgid "addressing mode not supported" msgstr "" -#: config/tc-avr.c:643 +#: config/tc-avr.c:655 msgid "can't predecrement" msgstr "" -#: config/tc-avr.c:646 +#: config/tc-avr.c:658 msgid "pointer register Z required" msgstr "" -#: config/tc-avr.c:664 +#: config/tc-avr.c:676 msgid "pointer register (Y or Z) required" msgstr "" -#: config/tc-avr.c:769 +#: config/tc-avr.c:781 #, c-format msgid "unknown constraint `%c'" msgstr "" -#: config/tc-avr.c:882 config/tc-avr.c:898 config/tc-avr.c:999 +#: config/tc-avr.c:890 config/tc-avr.c:906 config/tc-avr.c:1007 #, c-format msgid "odd address operand: %ld" msgstr "" -#: config/tc-avr.c:890 config/tc-avr.c:909 +#: config/tc-avr.c:898 config/tc-avr.c:917 #, c-format msgid "operand out of range: %ld" msgstr "" -#: config/tc-avr.c:1008 config/tc-d10v.c:1631 config/tc-d30v.c:1990 +#: config/tc-avr.c:1016 config/tc-d10v.c:1634 config/tc-d30v.c:1987 #, c-format msgid "line %d: unknown relocation type: 0x%x" msgstr "" -#: config/tc-avr.c:1022 +#: config/tc-avr.c:1030 msgid "only constant expression allowed" msgstr "" -#: config/tc-avr.c:1060 config/tc-d10v.c:1495 config/tc-d30v.c:1807 -#: config/tc-mn10200.c:1254 config/tc-mn10300.c:1810 config/tc-ppc.c:5161 -#: config/tc-v850.c:2301 +#: config/tc-avr.c:1067 config/tc-d10v.c:1498 config/tc-d30v.c:1807 +#: config/tc-mn10200.c:1240 config/tc-mn10300.c:1774 config/tc-ppc.c:5534 +#: config/tc-v850.c:2296 #, c-format msgid "reloc %d not supported by object file format" msgstr "" -#: config/tc-avr.c:1084 config/tc-d10v.c:1102 config/tc-d10v.c:1116 -#: config/tc-h8300.c:1239 config/tc-h8500.c:1098 config/tc-mcore.c:988 -#: config/tc-pj.c:265 config/tc-sh.c:1640 config/tc-z8k.c:1195 +#: config/tc-avr.c:1091 config/tc-d10v.c:1100 config/tc-d10v.c:1114 +#: config/tc-h8300.c:1275 config/tc-h8500.c:1088 config/tc-mcore.c:988 +#: config/tc-pj.c:266 config/tc-sh.c:1670 config/tc-z8k.c:1192 msgid "can't find opcode " msgstr "" -#: config/tc-avr.c:1101 +#: config/tc-avr.c:1108 #, c-format msgid "illegal opcode %s for mcu %s" msgstr "" -#: config/tc-avr.c:1109 +#: config/tc-avr.c:1116 msgid "garbage at end of line" msgstr "" -#: config/tc-avr.c:1173 +#: config/tc-avr.c:1180 read.c:3219 msgid "illegal expression" msgstr "" -#: config/tc-avr.c:1199 config/tc-avr.c:1265 +#: config/tc-avr.c:1206 config/tc-avr.c:1272 msgid "`)' required" msgstr "" -#: config/tc-avr.c:1219 +#: config/tc-avr.c:1226 #, c-format msgid "constant out of 8-bit range: %d" msgstr "" -#: config/tc-avr.c:1222 +#: config/tc-avr.c:1229 msgid "expression possibly out of 8-bit range" msgstr "" -#: config/tc-avr.c:1293 config/tc-avr.c:1300 +#: config/tc-avr.c:1300 config/tc-avr.c:1307 #, c-format msgid "illegal %srelocation size: %d" msgstr "" -#: config/tc-cris.c:672 +#: config/tc-cris.c:681 +msgid "Virtual memory exhausted" +msgstr "" + +#: config/tc-cris.c:689 #, c-format msgid "Can't hash `%s': %s\n" msgstr "" -#: config/tc-cris.c:673 +#: config/tc-cris.c:690 msgid "(unknown reason)" msgstr "" -#: config/tc-cris.c:677 +#: config/tc-cris.c:694 #, c-format msgid "Buggy opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-cris.c:1002 +#: config/tc-cris.c:1039 #, c-format msgid "Immediate value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1018 +#: config/tc-cris.c:1055 #, c-format msgid "Immediate value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1057 +#: config/tc-cris.c:1094 #, c-format msgid "Immediate value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:1072 +#: config/tc-cris.c:1109 #, c-format msgid "Immediate value not in 6 bit unsigned range: %ld" msgstr "" #. Others have a generic warning. -#: config/tc-cris.c:1159 +#: config/tc-cris.c:1199 #, c-format msgid "Unimplemented register `%s' specified" msgstr "" #. We've come to the end of instructions with this #. opcode, so it must be an error. -#: config/tc-cris.c:1309 +#: config/tc-cris.c:1358 msgid "Illegal operands" msgstr "" -#: config/tc-cris.c:1341 config/tc-cris.c:1372 +#: config/tc-cris.c:1389 config/tc-cris.c:1420 #, c-format msgid "Immediate value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:1351 config/tc-cris.c:1379 +#: config/tc-cris.c:1399 config/tc-cris.c:1427 #, c-format msgid "Immediate value not in 16 bit range: %ld" msgstr "" -#. FIXME: Find out and change to as_warn_where. Add testcase. -#: config/tc-cris.c:2316 +#: config/tc-cris.c:1448 +msgid "PIC relocation size does not match operand size" +msgstr "" + +#: config/tc-cris.c:2447 msgid "32-bit conditional branch generated" msgstr "" +#: config/tc-cris.c:2501 +msgid "Complex expression not supported" +msgstr "" + #. FIXME: Is this function mentioned in the internals.texi manual? If #. not, add it. -#: config/tc-cris.c:2395 +#: config/tc-cris.c:2622 msgid "Bad call to md_atof () - floating point formats are not supported" msgstr "" -#: config/tc-cris.c:2456 +#: config/tc-cris.c:2669 +msgid "PC-relative relocation must be trivially resolved" +msgstr "" + +#: config/tc-cris.c:2712 #, c-format msgid "Value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:2466 +#: config/tc-cris.c:2723 #, c-format msgid "Value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:2473 +#: config/tc-cris.c:2730 #, c-format msgid "Value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2480 +#: config/tc-cris.c:2737 #, c-format msgid "Value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2487 +#: config/tc-cris.c:2744 #, c-format msgid "Value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:2494 +#: config/tc-cris.c:2751 #, c-format msgid "Value not in 6 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2542 +#: config/tc-cris.c:2799 msgid "Please use --help to see usage and options for this assembler.\n" msgstr "" -#: config/tc-cris.c:2554 +#: config/tc-cris.c:2811 msgid "--no-underscore is invalid with a.out format" msgstr "" -#: config/tc-cris.c:2619 +#: config/tc-cris.c:2887 msgid "" "Semantics error. This type of operand can not be relocated, it must be an " "assembly-time constant" msgstr "" -#: config/tc-cris.c:2673 +#: config/tc-cris.c:2941 #, c-format msgid "Cannot generate relocation type for symbol %s, code %s" msgstr "" -#: config/tc-cris.c:2686 +#. The messages are formatted to line up with the generic options. +#: config/tc-cris.c:2955 msgid "CRIS-specific options:\n" msgstr "" -#: config/tc-cris.c:2688 +#: config/tc-cris.c:2957 msgid "" " -h, -H Don't execute, print this help text. Deprecated.\n" msgstr "" -#: config/tc-cris.c:2690 +#: config/tc-cris.c:2959 msgid " -N Warn when branches are expanded to jumps.\n" msgstr "" -#: config/tc-cris.c:2692 +#: config/tc-cris.c:2961 msgid "" " --underscore User symbols are normally prepended with " "underscore.\n" msgstr "" -#: config/tc-cris.c:2694 +#: config/tc-cris.c:2963 msgid " Registers will not need any prefix.\n" msgstr "" -#: config/tc-cris.c:2696 +#: config/tc-cris.c:2965 msgid " --no-underscore User symbols do not have any prefix.\n" msgstr "" -#: config/tc-cris.c:2698 +#: config/tc-cris.c:2967 msgid " Registers will require a `$'-prefix.\n" msgstr "" -#: config/tc-cris.c:2718 +#: config/tc-cris.c:2969 +msgid " --pic\t\t\tEnable generation of position-independent code.\n" +msgstr "" + +#: config/tc-cris.c:2992 msgid "Invalid relocation" msgstr "" -#: config/tc-cris.c:2758 +#: config/tc-cris.c:3033 msgid "Invalid pc-relative relocation" msgstr "" -#: config/tc-cris.c:2796 +#: config/tc-cris.c:3084 #, c-format msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." msgstr "" -#: config/tc-cris.c:2870 +#: config/tc-cris.c:3111 +#, c-format +msgid ".syntax %s requires command-line option `--underscore'" +msgstr "" + +#: config/tc-cris.c:3120 +#, c-format +msgid ".syntax %s requires command-line option `--no-underscore'" +msgstr "" + +#: config/tc-cris.c:3158 msgid "Unknown .syntax operand" msgstr "" -#: config/tc-d10v.c:246 +#: config/tc-cris.c:3169 +msgid "Pseudodirective .file is only valid when generating ELF" +msgstr "" + +#: config/tc-cris.c:3182 +msgid "Pseudodirective .loc is only valid when generating ELF" +msgstr "" + +#: config/tc-d10v.c:247 msgid "" "D10V options:\n" "-O Optimize. Will do some operations in parallel.\n" @@ -2414,26 +2593,26 @@ msgid "" " instructions together.\n" msgstr "" -#: config/tc-d10v.c:530 config/tc-d30v.c:550 config/tc-mn10200.c:951 -#: config/tc-mn10300.c:1332 config/tc-ppc.c:1972 config/tc-tic80.c:278 -#: config/tc-v850.c:2073 +#: config/tc-d10v.c:538 config/tc-d30v.c:550 config/tc-mn10200.c:937 +#: config/tc-mn10300.c:1308 config/tc-ppc.c:2104 config/tc-s390.c:1052 +#: config/tc-tic80.c:279 config/tc-v850.c:2070 msgid "illegal operand" msgstr "" -#: config/tc-d10v.c:573 config/tc-d10v.c:655 config/tc-d30v.c:656 +#: config/tc-d10v.c:581 config/tc-d10v.c:663 config/tc-d30v.c:656 #, c-format msgid "operand out of range: %d" msgstr "" -#: config/tc-d10v.c:716 +#: config/tc-d10v.c:724 msgid "Instruction must be executed in parallel with another instruction." msgstr "" -#: config/tc-d10v.c:772 +#: config/tc-d10v.c:780 msgid "Instruction must be executed in parallel" msgstr "" -#: config/tc-d10v.c:775 +#: config/tc-d10v.c:783 msgid "Long instructions may not be combined." msgstr "" @@ -2445,8 +2624,8 @@ msgstr "" msgid "Two IU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:823 config/tc-d10v.c:831 config/tc-d10v.c:848 -#: config/tc-d10v.c:865 config/tc-d30v.c:878 config/tc-d30v.c:887 +#: config/tc-d10v.c:823 config/tc-d10v.c:831 config/tc-d10v.c:844 +#: config/tc-d10v.c:859 config/tc-d30v.c:878 config/tc-d30v.c:887 msgid "Swapping instruction order" msgstr "" @@ -2454,38 +2633,38 @@ msgstr "" msgid "Two MU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:852 config/tc-d30v.c:904 +#: config/tc-d10v.c:848 config/tc-d30v.c:904 msgid "IU instruction may not be in the left container" msgstr "" -#: config/tc-d10v.c:854 config/tc-d10v.c:871 +#: config/tc-d10v.c:850 config/tc-d10v.c:865 msgid "" "Instruction in R container is squashed by flow control instruction in L " "container." msgstr "" -#: config/tc-d10v.c:869 config/tc-d30v.c:915 +#: config/tc-d10v.c:863 config/tc-d30v.c:915 msgid "MU instruction may not be in the right container" msgstr "" -#: config/tc-d10v.c:877 config/tc-d30v.c:927 +#: config/tc-d10v.c:869 config/tc-d30v.c:927 msgid "unknown execution type passed to write_2_short()" msgstr "" -#: config/tc-d10v.c:1130 config/tc-d10v.c:1151 config/tc-d30v.c:1411 +#: config/tc-d10v.c:1128 config/tc-d10v.c:1149 config/tc-d30v.c:1411 msgid "Unable to mix instructions as specified" msgstr "" -#: config/tc-d10v.c:1198 config/tc-d30v.c:1548 +#: config/tc-d10v.c:1196 config/tc-d30v.c:1548 #, c-format msgid "unknown opcode: %s" msgstr "" -#: config/tc-d10v.c:1280 config/tc-d10v.c:1451 config/tc-tic80.c:535 +#: config/tc-d10v.c:1279 config/tc-d10v.c:1451 config/tc-tic80.c:536 msgid "bad opcode or operands" msgstr "" -#: config/tc-d10v.c:1353 config/tc-m68k.c:4286 +#: config/tc-d10v.c:1352 config/tc-m68k.c:4310 msgid "value out of range" msgstr "" @@ -2493,11 +2672,15 @@ msgstr "" msgid "illegal operand - register name found where none expected" msgstr "" -#: config/tc-d10v.c:1462 config/tc-tic80.c:546 +#: config/tc-d10v.c:1462 config/tc-tic80.c:547 msgid "Register number must be EVEN" msgstr "" -#: config/tc-d10v.c:1611 +#: config/tc-d10v.c:1465 +msgid "Unsupported use of sp" +msgstr "" + +#: config/tc-d10v.c:1614 #, c-format msgid "line %d: rep or repi must include at least 4 instructions" msgstr "" @@ -2609,37 +2792,37 @@ msgstr "" msgid "Odd numbered register used as target of multi-register instruction" msgstr "" -#: config/tc-d30v.c:1879 +#: config/tc-d30v.c:1876 #, c-format msgid "line %d: unable to place address of symbol '%s' into a byte" msgstr "" -#: config/tc-d30v.c:1882 +#: config/tc-d30v.c:1879 #, c-format msgid "line %d: unable to place value %x into a byte" msgstr "" -#: config/tc-d30v.c:1890 +#: config/tc-d30v.c:1887 #, c-format msgid "line %d: unable to place address of symbol '%s' into a short" msgstr "" -#: config/tc-d30v.c:1893 +#: config/tc-d30v.c:1890 #, c-format msgid "line %d: unable to place value %x into a short" msgstr "" -#: config/tc-d30v.c:1901 +#: config/tc-d30v.c:1898 #, c-format msgid "line %d: unable to place address of symbol '%s' into a quad" msgstr "" -#: config/tc-d30v.c:2072 +#: config/tc-d30v.c:2067 #, c-format msgid "value too large to fit in %d bits" msgstr "" -#: config/tc-d30v.c:2215 +#: config/tc-d30v.c:2210 #, c-format msgid "Alignment too large: %d assumed" msgstr "" @@ -2648,933 +2831,956 @@ msgstr "" msgid " FR30 specific command line options:\n" msgstr "" -#: config/tc-fr30.c:143 +#: config/tc-fr30.c:143 config/tc-openrisc.c:150 #, c-format msgid "Instruction %s not allowed in a delay slot." msgstr "" -#: config/tc-fr30.c:380 config/tc-m32r.c:1555 +#: config/tc-fr30.c:383 config/tc-m32r.c:1559 msgid "Addend to unresolved symbol not on word boundary." msgstr "" -#: config/tc-fr30.c:538 config/tc-i960.c:772 config/tc-m32r.c:1864 +#: config/tc-fr30.c:540 config/tc-i960.c:773 config/tc-m32r.c:1867 +#: config/tc-openrisc.c:468 msgid "Bad call to md_atof()" msgstr "" -#: config/tc-h8300.c:245 config/tc-h8300.c:253 +#: config/tc-h8300.c:64 config/tc-h8300.c:75 config/tc-h8300.c:134 +#: config/tc-hppa.c:1422 config/tc-hppa.c:6915 config/tc-hppa.c:6921 +#: config/tc-hppa.c:6927 config/tc-hppa.c:6933 config/tc-mn10300.c:900 +#: config/tc-mn10300.c:2164 +msgid "could not set architecture and machine" +msgstr "" + +#: config/tc-h8300.c:262 config/tc-h8300.c:270 msgid "Reg not valid for H8/300" msgstr "" -#: config/tc-h8300.c:413 config/tc-h8300.c:416 config/tc-h8300.c:419 -#: config/tc-h8300.c:423 +#: config/tc-h8300.c:430 config/tc-h8300.c:433 config/tc-h8300.c:436 +#: config/tc-h8300.c:440 msgid "Invalid register list for ldm/stm\n" msgstr "" -#: config/tc-h8300.c:475 config/tc-h8300.c:537 config/tc-h8300.c:544 +#: config/tc-h8300.c:492 config/tc-h8300.c:554 config/tc-h8300.c:561 msgid "Wrong size pointer register for architecture." msgstr "" -#: config/tc-h8300.c:502 config/tc-h8300.c:511 config/tc-h8300.c:521 +#: config/tc-h8300.c:519 config/tc-h8300.c:528 config/tc-h8300.c:538 msgid "expected @(exp, reg16)" msgstr "" -#: config/tc-h8300.c:600 +#: config/tc-h8300.c:617 msgid "expect :8 or :16 here" msgstr "" -#: config/tc-h8300.c:801 +#: config/tc-h8300.c:818 #, c-format msgid "operand %s0x%lx out of range." msgstr "" -#: config/tc-h8300.c:889 +#: config/tc-h8300.c:906 msgid "Can't work out size of operand.\n" msgstr "" -#: config/tc-h8300.c:937 +#: config/tc-h8300.c:954 #, c-format msgid "Opcode `%s' with these operand types not available in H8/300 mode" msgstr "" -#: config/tc-h8300.c:988 config/tc-h8300.c:1008 +#: config/tc-h8300.c:1005 config/tc-h8300.c:1025 msgid "Need #1 or #2 here" msgstr "" -#: config/tc-h8300.c:1003 +#: config/tc-h8300.c:1020 msgid "#4 not valid on H8/300." msgstr "" -#: config/tc-h8300.c:1089 config/tc-h8300.c:1121 +#: config/tc-h8300.c:1107 config/tc-h8300.c:1157 #, c-format msgid "branch operand has odd offset (%lx)\n" msgstr "" -#: config/tc-h8300.c:1159 +#: config/tc-h8300.c:1195 msgid "destination operand must be 16 bit register" msgstr "" -#: config/tc-h8300.c:1168 +#: config/tc-h8300.c:1204 msgid "source operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1176 +#: config/tc-h8300.c:1212 msgid "destination operand must be 16bit absolute address" msgstr "" -#: config/tc-h8300.c:1183 +#: config/tc-h8300.c:1219 msgid "destination operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1191 +#: config/tc-h8300.c:1227 msgid "source operand must be 16bit absolute address" msgstr "" -#: config/tc-h8300.c:1199 +#. This seems more sane than saying "too many operands". We'll +#. get here only if the trailing trash starts with a comma. +#: config/tc-h8300.c:1235 config/tc-mmix.c:452 config/tc-mmix.c:464 +#: config/tc-mmix.c:2485 config/tc-mmix.c:2509 config/tc-mmix.c:2774 msgid "invalid operands" msgstr "" -#: config/tc-h8300.c:1250 config/tc-h8500.c:1104 config/tc-mips.c:7984 -#: config/tc-sh.c:1877 config/tc-w65.c:740 config/tc-z8k.c:1205 +#: config/tc-h8300.c:1286 config/tc-h8500.c:1094 config/tc-mips.c:8649 +#: config/tc-sh.c:1907 config/tc-w65.c:733 config/tc-z8k.c:1202 msgid "unknown opcode" msgstr "" -#: config/tc-h8300.c:1296 +#: config/tc-h8300.c:1332 msgid "mismatch between opcode size and operand size" msgstr "" -#: config/tc-h8300.c:1307 config/tc-h8500.c:1131 config/tc-sh.c:2013 -#: config/tc-w65.c:770 config/tc-z8k.c:1258 +#: config/tc-h8300.c:1344 config/tc-h8500.c:1121 config/tc-sh.c:2045 +#: config/tc-w65.c:763 config/tc-z8k.c:1255 msgid "call to tc_crawl_symbol_chain \n" msgstr "" -#: config/tc-h8300.c:1321 config/tc-h8500.c:1145 config/tc-sh.c:2020 -#: config/tc-w65.c:784 config/tc-z8k.c:1272 +#: config/tc-h8300.c:1360 config/tc-h8500.c:1135 config/tc-sh.c:2052 +#: config/tc-w65.c:777 config/tc-z8k.c:1269 msgid "call to tc_headers_hook \n" msgstr "" -#: config/tc-h8300.c:1412 config/tc-h8500.c:1235 config/tc-z8k.c:1386 +#: config/tc-h8300.c:1452 config/tc-h8500.c:1225 config/tc-z8k.c:1383 msgid "call to tc_aout_fix_to_chars \n" msgstr "" -#: config/tc-h8300.c:1422 config/tc-z8k.c:1396 +#: config/tc-h8300.c:1466 config/tc-z8k.c:1393 msgid "call to md_convert_frag \n" msgstr "" -#: config/tc-h8300.c:1467 config/tc-z8k.c:1477 +#: config/tc-h8300.c:1528 config/tc-z8k.c:1479 msgid "call tomd_estimate_size_before_relax \n" msgstr "" -#: config/tc-h8500.c:333 +#: config/tc-h8300.c:1649 config/tc-mcore.c:2413 config/tc-pj.c:572 +#: config/tc-sh.c:3367 +#, c-format +msgid "Cannot represent relocation type %s" +msgstr "" + +#: config/tc-h8500.c:323 msgid ":24 not valid for this opcode" msgstr "" -#: config/tc-h8500.c:340 +#: config/tc-h8500.c:330 msgid "expect :8,:16 or :24" msgstr "" -#: config/tc-h8500.c:397 +#: config/tc-h8500.c:387 msgid "syntax error in reg list" msgstr "" -#: config/tc-h8500.c:415 +#: config/tc-h8500.c:405 msgid "missing final register in range" msgstr "" -#: config/tc-h8500.c:502 config/tc-h8500.c:509 config/tc-h8500.c:515 +#: config/tc-h8500.c:492 config/tc-h8500.c:499 config/tc-h8500.c:505 msgid "expected @(exp, Rn)" msgstr "" -#: config/tc-h8500.c:531 +#: config/tc-h8500.c:521 msgid "@Rn+ needs word register" msgstr "" -#: config/tc-h8500.c:541 +#: config/tc-h8500.c:531 msgid "@Rn needs word register" msgstr "" -#: config/tc-h8500.c:838 config/tc-sh.c:1357 +#: config/tc-h8500.c:828 config/tc-sh.c:1403 #, c-format msgid "unhandled %d\n" msgstr "" -#: config/tc-h8500.c:866 config/tc-sh.c:1382 +#: config/tc-h8500.c:856 #, c-format msgid "operand must be absolute in range %d..%d" msgstr "" -#: config/tc-h8500.c:955 config/tc-sh.c:1580 +#: config/tc-h8500.c:945 config/tc-sh.c:1610 #, c-format msgid "failed for %d\n" msgstr "" -#: config/tc-h8500.c:1120 config/tc-sh.c:1681 config/tc-sh.c:1926 -#: config/tc-w65.c:759 +#: config/tc-h8500.c:1110 config/tc-sh.c:1711 config/tc-sh.c:1956 +#: config/tc-w65.c:752 msgid "invalid operands for opcode" msgstr "" #. Simple range checking for FIELD againt HIGH and LOW bounds. #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1119 +#: config/tc-hppa.c:1155 config/tc-hppa.c:1169 #, c-format msgid "Field out of range [%d..%d] (%d)." msgstr "" #. Simple alignment checking for FIELD againt ALIGN (a power of two). #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1133 +#: config/tc-hppa.c:1183 #, c-format msgid "Field not properly aligned [%d] (%d)." msgstr "" -#: config/tc-hppa.c:1162 +#: config/tc-hppa.c:1212 msgid "Missing .exit\n" msgstr "" -#: config/tc-hppa.c:1165 +#: config/tc-hppa.c:1215 msgid "Missing .procend\n" msgstr "" -#: config/tc-hppa.c:1345 +#: config/tc-hppa.c:1395 +#, c-format msgid "Invalid field selector. Assuming F%%." msgstr "" -#: config/tc-hppa.c:1372 config/tc-hppa.c:6839 config/tc-hppa.c:6845 -#: config/tc-hppa.c:6851 config/tc-hppa.c:6857 config/tc-mn10300.c:924 -#: config/tc-mn10300.c:2133 -msgid "could not set architecture and machine" -msgstr "" - -#: config/tc-hppa.c:1378 +#: config/tc-hppa.c:1428 msgid "-R option not supported on this target." msgstr "" -#: config/tc-hppa.c:1394 config/tc-sparc.c:802 config/tc-sparc.c:838 +#: config/tc-hppa.c:1444 config/tc-sparc.c:803 config/tc-sparc.c:839 #, c-format msgid "Internal error: can't hash `%s': %s\n" msgstr "" -#: config/tc-hppa.c:1402 config/tc-i860.c:190 +#: config/tc-hppa.c:1452 config/tc-i860.c:190 #, c-format msgid "internal error: losing opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-hppa.c:1471 config/tc-hppa.c:6978 config/tc-hppa.c:7033 +#: config/tc-hppa.c:1523 config/tc-hppa.c:7054 config/tc-hppa.c:7111 msgid "Missing function name for .PROC (corrupted label chain)" msgstr "" -#: config/tc-hppa.c:1474 config/tc-hppa.c:7036 +#: config/tc-hppa.c:1526 config/tc-hppa.c:7114 msgid "Missing function name for .PROC" msgstr "" -#: config/tc-hppa.c:1582 config/tc-hppa.c:4812 +#: config/tc-hppa.c:1633 config/tc-hppa.c:4911 msgid "could not update architecture and machine" msgstr "" -#: config/tc-hppa.c:1789 +#: config/tc-hppa.c:1841 msgid "Invalid Indexed Load Completer." msgstr "" -#: config/tc-hppa.c:1794 +#: config/tc-hppa.c:1846 msgid "Invalid Indexed Load Completer Syntax." msgstr "" -#: config/tc-hppa.c:1830 +#: config/tc-hppa.c:1883 msgid "Invalid Short Load/Store Completer." msgstr "" -#: config/tc-hppa.c:1889 config/tc-hppa.c:1894 +#: config/tc-hppa.c:1943 config/tc-hppa.c:1948 msgid "Invalid Store Bytes Short Completer" msgstr "" -#: config/tc-hppa.c:2205 config/tc-hppa.c:2211 +#: config/tc-hppa.c:2259 config/tc-hppa.c:2265 msgid "Invalid left/right combination completer" msgstr "" -#: config/tc-hppa.c:2260 config/tc-hppa.c:2267 +#: config/tc-hppa.c:2314 config/tc-hppa.c:2321 msgid "Invalid permutation completer" msgstr "" -#: config/tc-hppa.c:2368 +#: config/tc-hppa.c:2422 #, c-format msgid "Invalid Add Condition: %s" msgstr "" -#: config/tc-hppa.c:2379 config/tc-hppa.c:2389 -#, c-format -msgid "Invalid Add and Branch Condition: %c" +#: config/tc-hppa.c:2433 config/tc-hppa.c:2443 +msgid "Invalid Add and Branch Condition" msgstr "" -#: config/tc-hppa.c:2410 +#: config/tc-hppa.c:2464 config/tc-hppa.c:2602 msgid "Invalid Compare/Subtract Condition" msgstr "" -#: config/tc-hppa.c:2450 +#: config/tc-hppa.c:2504 #, c-format msgid "Invalid Bit Branch Condition: %c" msgstr "" -#: config/tc-hppa.c:2536 +#: config/tc-hppa.c:2590 #, c-format msgid "Invalid Compare/Subtract Condition: %s" msgstr "" -#: config/tc-hppa.c:2548 -#, c-format -msgid "Invalid Compare/Subtract Condition: %c" -msgstr "" - -#: config/tc-hppa.c:2563 -msgid "Invalid Compare and Branch Condition." +#: config/tc-hppa.c:2617 +msgid "Invalid Compare and Branch Condition" msgstr "" -#: config/tc-hppa.c:2659 +#: config/tc-hppa.c:2713 msgid "Invalid Logical Instruction Condition." msgstr "" -#: config/tc-hppa.c:2714 +#: config/tc-hppa.c:2768 msgid "Invalid Shift/Extract/Deposit Condition." msgstr "" -#: config/tc-hppa.c:2826 +#: config/tc-hppa.c:2880 msgid "Invalid Unit Instruction Condition." msgstr "" -#: config/tc-hppa.c:3174 config/tc-hppa.c:3205 config/tc-hppa.c:3238 -#: config/tc-hppa.c:3270 +#: config/tc-hppa.c:3257 config/tc-hppa.c:3289 config/tc-hppa.c:3320 +#: config/tc-hppa.c:3350 msgid "Branch to unaligned address" msgstr "" -#: config/tc-hppa.c:3450 +#: config/tc-hppa.c:3528 msgid "Invalid SFU identifier" msgstr "" -#: config/tc-hppa.c:3500 +#: config/tc-hppa.c:3578 msgid "Invalid COPR identifier" msgstr "" -#: config/tc-hppa.c:3629 +#: config/tc-hppa.c:3707 msgid "Invalid Floating Point Operand Format." msgstr "" -#: config/tc-hppa.c:3746 config/tc-hppa.c:3766 config/tc-hppa.c:3786 -#: config/tc-hppa.c:3806 config/tc-hppa.c:3826 +#: config/tc-hppa.c:3824 config/tc-hppa.c:3844 config/tc-hppa.c:3864 +#: config/tc-hppa.c:3884 config/tc-hppa.c:3904 msgid "Invalid register for single precision fmpyadd or fmpysub" msgstr "" -#: config/tc-hppa.c:3883 +#: config/tc-hppa.c:3961 #, c-format msgid "Invalid operands %s" msgstr "" -#: config/tc-hppa.c:4001 -#, c-format -msgid "Cannot handle fixup at %s:%d" +#: config/tc-hppa.c:4079 +msgid "Cannot handle fixup" msgstr "" -#: config/tc-hppa.c:4296 +#: config/tc-hppa.c:4380 msgid " -Q ignored\n" msgstr "" -#: config/tc-hppa.c:4300 +#: config/tc-hppa.c:4384 msgid " -c print a warning if a comment is found\n" msgstr "" -#: config/tc-hppa.c:4366 +#: config/tc-hppa.c:4455 #, c-format -msgid "no hppa_fixup entry for fixup type 0x%x at %s:%d" +msgid "no hppa_fixup entry for fixup type 0x%x" msgstr "" -#: config/tc-hppa.c:4533 +#: config/tc-hppa.c:4633 msgid "Unknown relocation encountered in md_apply_fix." msgstr "" -#: config/tc-hppa.c:4676 config/tc-hppa.c:4701 +#: config/tc-hppa.c:4775 config/tc-hppa.c:4800 #, c-format msgid "Undefined register: '%s'." msgstr "" -#: config/tc-hppa.c:4735 +#: config/tc-hppa.c:4834 #, c-format msgid "Non-absolute symbol: '%s'." msgstr "" -#: config/tc-hppa.c:4750 +#: config/tc-hppa.c:4849 #, c-format msgid "Undefined absolute constant: '%s'." msgstr "" -#: config/tc-hppa.c:4851 +#: config/tc-hppa.c:4950 #, c-format msgid "Invalid FP Compare Condition: %s" msgstr "" -#: config/tc-hppa.c:4907 +#: config/tc-hppa.c:5006 #, c-format msgid "Invalid FTEST completer: %s" msgstr "" -#: config/tc-hppa.c:4974 config/tc-hppa.c:5012 +#: config/tc-hppa.c:5073 config/tc-hppa.c:5111 #, c-format msgid "Invalid FP Operand Format: %3s" msgstr "" -#: config/tc-hppa.c:5091 +#: config/tc-hppa.c:5190 msgid "Bad segment in expression." msgstr "" -#: config/tc-hppa.c:5150 +#: config/tc-hppa.c:5249 msgid "Bad segment (should be absolute)." msgstr "" -#: config/tc-hppa.c:5193 +#: config/tc-hppa.c:5292 #, c-format msgid "Invalid argument location: %s\n" msgstr "" -#: config/tc-hppa.c:5224 +#: config/tc-hppa.c:5323 #, c-format msgid "Invalid argument description: %d" msgstr "" -#: config/tc-hppa.c:5247 +#: config/tc-hppa.c:5346 #, c-format msgid "Invalid Nullification: (%c)" msgstr "" -#: config/tc-hppa.c:5983 +#: config/tc-hppa.c:6066 #, c-format msgid "Invalid .CALL argument: %s" msgstr "" -#: config/tc-hppa.c:6114 +#: config/tc-hppa.c:6188 msgid ".callinfo is not within a procedure definition" msgstr "" -#: config/tc-hppa.c:6134 +#: config/tc-hppa.c:6208 #, c-format msgid "FRAME parameter must be a multiple of 8: %d\n" msgstr "" -#: config/tc-hppa.c:6153 +#: config/tc-hppa.c:6227 msgid "Value for ENTRY_GR must be in the range 3..18\n" msgstr "" -#: config/tc-hppa.c:6165 +#: config/tc-hppa.c:6239 msgid "Value for ENTRY_FR must be in the range 12..21\n" msgstr "" -#: config/tc-hppa.c:6175 +#: config/tc-hppa.c:6249 msgid "Value for ENTRY_SR must be 3\n" msgstr "" -#: config/tc-hppa.c:6231 +#: config/tc-hppa.c:6305 #, c-format msgid "Invalid .CALLINFO argument: %s" msgstr "" -#: config/tc-hppa.c:6342 +#: config/tc-hppa.c:6416 msgid "The .ENTER pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6358 +#: config/tc-hppa.c:6432 msgid "Misplaced .entry. Ignored." msgstr "" -#: config/tc-hppa.c:6362 +#: config/tc-hppa.c:6436 msgid "Missing .callinfo." msgstr "" -#: config/tc-hppa.c:6426 +#: config/tc-hppa.c:6502 msgid ".REG expression must be a register" msgstr "" -#: config/tc-hppa.c:6442 read.c:4728 +#: config/tc-hppa.c:6518 msgid "bad or irreducible absolute expression; zero assumed" msgstr "" -#: config/tc-hppa.c:6453 +#: config/tc-hppa.c:6529 msgid ".REG must use a label" msgstr "" -#: config/tc-hppa.c:6455 +#: config/tc-hppa.c:6531 msgid ".EQU must use a label" msgstr "" -#: config/tc-hppa.c:6508 +#: config/tc-hppa.c:6584 msgid ".EXIT must appear within a procedure" msgstr "" -#: config/tc-hppa.c:6512 +#: config/tc-hppa.c:6588 msgid "Missing .callinfo" msgstr "" -#: config/tc-hppa.c:6516 +#: config/tc-hppa.c:6592 msgid "No .ENTRY for this .EXIT" msgstr "" -#: config/tc-hppa.c:6543 +#: config/tc-hppa.c:6619 #, c-format msgid "Cannot define export symbol: %s\n" msgstr "" -#: config/tc-hppa.c:6601 +#: config/tc-hppa.c:6677 #, c-format msgid "Using ENTRY rather than CODE in export directive for %s" msgstr "" -#: config/tc-hppa.c:6718 +#: config/tc-hppa.c:6794 #, c-format msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" msgstr "" -#: config/tc-hppa.c:6800 +#: config/tc-hppa.c:6876 msgid "Missing label name on .LABEL" msgstr "" -#: config/tc-hppa.c:6805 +#: config/tc-hppa.c:6881 msgid "extra .LABEL arguments ignored." msgstr "" -#: config/tc-hppa.c:6822 +#: config/tc-hppa.c:6898 msgid "The .LEAVE pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6861 +#: config/tc-hppa.c:6937 msgid "Unrecognized .LEVEL argument\n" msgstr "" -#: config/tc-hppa.c:6897 +#: config/tc-hppa.c:6973 #, c-format msgid "Cannot define static symbol: %s\n" msgstr "" -#: config/tc-hppa.c:6932 +#: config/tc-hppa.c:7008 msgid "Nested procedures" msgstr "" -#: config/tc-hppa.c:6942 +#: config/tc-hppa.c:7018 msgid "Cannot allocate unwind descriptor\n" msgstr "" -#: config/tc-hppa.c:7040 +#: config/tc-hppa.c:7118 msgid "misplaced .procend" msgstr "" -#: config/tc-hppa.c:7043 +#: config/tc-hppa.c:7121 msgid "Missing .callinfo for this procedure" msgstr "" -#: config/tc-hppa.c:7046 +#: config/tc-hppa.c:7124 msgid "Missing .EXIT for a .ENTRY" msgstr "" -#: config/tc-hppa.c:7084 +#: config/tc-hppa.c:7162 msgid "Not in a space.\n" msgstr "" -#: config/tc-hppa.c:7087 +#: config/tc-hppa.c:7165 msgid "Not in a subspace.\n" msgstr "" -#: config/tc-hppa.c:7178 +#: config/tc-hppa.c:7256 msgid "Invalid .SPACE argument" msgstr "" -#: config/tc-hppa.c:7225 +#: config/tc-hppa.c:7303 msgid "Can't change spaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7354 +#: config/tc-hppa.c:7432 #, c-format msgid "Undefined space: '%s' Assuming space number = 0." msgstr "" -#: config/tc-hppa.c:7378 +#: config/tc-hppa.c:7456 msgid "Must be in a space before changing or declaring subspaces.\n" msgstr "" -#: config/tc-hppa.c:7382 +#: config/tc-hppa.c:7460 msgid "Can't change subspaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7417 +#: config/tc-hppa.c:7495 msgid "Parameters of an existing subspace can't be modified" msgstr "" -#: config/tc-hppa.c:7468 +#: config/tc-hppa.c:7546 msgid "Alignment must be a power of 2" msgstr "" -#: config/tc-hppa.c:7510 +#: config/tc-hppa.c:7588 msgid "FIRST not supported as a .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7512 +#: config/tc-hppa.c:7590 msgid "Invalid .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7692 +#: config/tc-hppa.c:7770 #, c-format msgid "Internal error: Unable to find containing space for %s." msgstr "" -#: config/tc-hppa.c:7731 +#: config/tc-hppa.c:7809 #, c-format msgid "Out of memory: could not allocate new space chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:7817 +#: config/tc-hppa.c:7895 #, c-format msgid "Out of memory: could not allocate new subspace chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:8511 +#: config/tc-hppa.c:8589 #, c-format msgid "Symbol '%s' could not be created." msgstr "" -#: config/tc-hppa.c:8515 +#: config/tc-hppa.c:8593 msgid "No memory for symbol name." msgstr "" -#: config/tc-i386.c:581 +#: config/tc-i386.c:594 #, c-format msgid "%s shortened to %s" msgstr "" -#: config/tc-i386.c:636 +#: config/tc-i386.c:649 msgid "same type of prefix used twice" msgstr "" -#: config/tc-i386.c:654 +#: config/tc-i386.c:667 msgid "64bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:658 +#: config/tc-i386.c:671 msgid "32bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:691 +#: config/tc-i386.c:704 msgid "bad argument to syntax directive." msgstr "" -#: config/tc-i386.c:734 +#: config/tc-i386.c:748 #, c-format msgid "no such architecture: `%s'" msgstr "" -#: config/tc-i386.c:739 +#: config/tc-i386.c:753 msgid "missing cpu architecture" msgstr "" -#: config/tc-i386.c:812 config/tc-i386.c:835 config/tc-m68k.c:3802 +#: config/tc-i386.c:767 +#, c-format +msgid "no such architecture modifier: `%s'" +msgstr "" + +#: config/tc-i386.c:821 config/tc-i386.c:4628 +msgid "Unknown architecture" +msgstr "" + +#: config/tc-i386.c:856 config/tc-i386.c:879 config/tc-m68k.c:3826 #, c-format msgid "Internal Error: Can't hash %s: %s" msgstr "" -#: config/tc-i386.c:1088 +#: config/tc-i386.c:1132 msgid "There are no unsigned pc-relative relocations" msgstr "" -#: config/tc-i386.c:1095 config/tc-i386.c:4622 +#: config/tc-i386.c:1139 config/tc-i386.c:4827 #, c-format msgid "can not do %d byte pc-relative relocation" msgstr "" -#: config/tc-i386.c:1112 +#: config/tc-i386.c:1156 #, c-format msgid "can not do %s %d byte relocation" msgstr "" -#: config/tc-i386.c:1221 config/tc-i386.c:1314 +#: config/tc-i386.c:1263 config/tc-i386.c:1357 #, c-format msgid "no such instruction: `%s'" msgstr "" -#: config/tc-i386.c:1230 +#: config/tc-i386.c:1273 config/tc-i386.c:1389 #, c-format msgid "invalid character %s in mnemonic" msgstr "" -#: config/tc-i386.c:1237 +#: config/tc-i386.c:1280 msgid "expecting prefix; got nothing" msgstr "" -#: config/tc-i386.c:1239 +#: config/tc-i386.c:1282 msgid "expecting mnemonic; got nothing" msgstr "" -#: config/tc-i386.c:1257 +#: config/tc-i386.c:1300 #, c-format msgid "redundant %s prefix" msgstr "" -#: config/tc-i386.c:1325 +#: config/tc-i386.c:1398 #, c-format msgid "`%s' is not supported on `%s'" msgstr "" -#: config/tc-i386.c:1330 +#: config/tc-i386.c:1403 msgid "use .code16 to ensure correct addressing mode" msgstr "" -#: config/tc-i386.c:1338 +#: config/tc-i386.c:1410 #, c-format msgid "expecting string instruction after `%s'" msgstr "" -#: config/tc-i386.c:1359 +#: config/tc-i386.c:1431 #, c-format msgid "invalid character %s before operand %d" msgstr "" -#: config/tc-i386.c:1373 +#: config/tc-i386.c:1445 #, c-format msgid "unbalanced parenthesis in operand %d." msgstr "" -#: config/tc-i386.c:1376 +#: config/tc-i386.c:1448 #, c-format msgid "unbalanced brackets in operand %d." msgstr "" -#: config/tc-i386.c:1385 +#: config/tc-i386.c:1457 #, c-format msgid "invalid character %s in operand %d" msgstr "" -#: config/tc-i386.c:1412 +#: config/tc-i386.c:1484 #, c-format msgid "spurious operands; (%d operands/instruction max)" msgstr "" -#: config/tc-i386.c:1435 +#: config/tc-i386.c:1507 msgid "expecting operand after ','; got nothing" msgstr "" -#: config/tc-i386.c:1440 +#: config/tc-i386.c:1512 msgid "expecting operand before ','; got nothing" msgstr "" #. We found no match. -#: config/tc-i386.c:1782 +#: config/tc-i386.c:1856 #, c-format msgid "suffix or operands invalid for `%s'" msgstr "" -#: config/tc-i386.c:1793 +#: config/tc-i386.c:1867 #, c-format msgid "indirect %s without `*'" msgstr "" #. Warn them that a data or address size prefix doesn't #. affect assembly of the next line of code. -#: config/tc-i386.c:1801 +#: config/tc-i386.c:1875 #, c-format msgid "stand-alone `%s' prefix" msgstr "" -#: config/tc-i386.c:1837 config/tc-i386.c:1852 +#: config/tc-i386.c:1911 config/tc-i386.c:1926 +#, c-format msgid "`%s' operand %d must use `%%es' segment" msgstr "" -#: config/tc-i386.c:1867 -msgid "Extended register `%%%s' available only in 64bit mode." -msgstr "" - #. Prohibit these changes in the 64bit mode, since #. the lowering is more complicated. -#: config/tc-i386.c:1938 config/tc-i386.c:1989 config/tc-i386.c:2004 -#: config/tc-i386.c:2032 config/tc-i386.c:2060 +#: config/tc-i386.c:1999 config/tc-i386.c:2053 config/tc-i386.c:2068 +#: config/tc-i386.c:2096 config/tc-i386.c:2124 +#, c-format msgid "Incorrect register `%%%s' used with`%c' suffix" msgstr "" -#: config/tc-i386.c:1944 config/tc-i386.c:1994 config/tc-i386.c:2065 +#: config/tc-i386.c:2005 config/tc-i386.c:2058 config/tc-i386.c:2129 +#, c-format msgid "using `%%%s' instead of `%%%s' due to `%c' suffix" msgstr "" -#: config/tc-i386.c:1957 config/tc-i386.c:1975 config/tc-i386.c:2019 -#: config/tc-i386.c:2046 +#: config/tc-i386.c:2021 config/tc-i386.c:2039 config/tc-i386.c:2083 +#: config/tc-i386.c:2110 +#, c-format msgid "`%%%s' not allowed with `%s%c'" msgstr "" -#: config/tc-i386.c:2106 +#: config/tc-i386.c:2170 msgid "no instruction mnemonic suffix given; can't determine immediate size" msgstr "" -#: config/tc-i386.c:2132 +#: config/tc-i386.c:2196 #, c-format msgid "" "no instruction mnemonic suffix given; can't determine immediate size %x %c" msgstr "" -#: config/tc-i386.c:2157 +#: config/tc-i386.c:2221 msgid "" "no instruction mnemonic suffix given and no register operands; can't size " "instruction" msgstr "" -#: config/tc-i386.c:2205 +#: config/tc-i386.c:2269 msgid "64bit operations available only in 64bit modes." msgstr "" #. Reversed arguments on faddp, fsubp, etc. -#: config/tc-i386.c:2273 +#: config/tc-i386.c:2337 +#, c-format msgid "translating to `%s %%%s,%%%s'" msgstr "" #. Extraneous `l' suffix on fp insn. -#: config/tc-i386.c:2280 +#: config/tc-i386.c:2344 +#, c-format msgid "translating to `%s %%%s'" msgstr "" -#: config/tc-i386.c:2551 +#: config/tc-i386.c:2617 +#, c-format msgid "you can't `pop %%cs'" msgstr "" #. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. -#: config/tc-i386.c:2584 +#: config/tc-i386.c:2650 #, c-format msgid "translating to `%sp'" msgstr "" -#: config/tc-i386.c:2627 +#: config/tc-i386.c:2693 +#, c-format msgid "" "Can't encode registers '%%%s' in the instruction requiring REX prefix.\n" msgstr "" -#: config/tc-i386.c:2679 config/tc-i386.c:2751 config/tc-i386.c:2798 +#: config/tc-i386.c:2755 config/tc-i386.c:2845 config/tc-i386.c:2881 msgid "skipping prefixes on this instruction" msgstr "" -#: config/tc-i386.c:2819 +#: config/tc-i386.c:2901 msgid "16-bit jump out of range" msgstr "" -#: config/tc-i386.c:2828 +#: config/tc-i386.c:2910 #, c-format msgid "can't handle non absolute segment in `%s'" msgstr "" -#: config/tc-i386.c:3085 -msgid "only 1 or 2 immediate operands are allowed" -msgstr "" - -#: config/tc-i386.c:3115 config/tc-i386.c:3353 -msgid "GOT relocations not supported in 16 bit mode" +#: config/tc-i386.c:3217 +#, c-format +msgid "@%s reloc is not supported in %s bit mode" msgstr "" -#: config/tc-i386.c:3152 config/tc-i386.c:3389 -msgid "bad reloc specifier in expression" +#: config/tc-i386.c:3293 +msgid "only 1 or 2 immediate operands are allowed" msgstr "" -#: config/tc-i386.c:3170 config/tc-i386.c:3424 +#: config/tc-i386.c:3316 config/tc-i386.c:3504 #, c-format -msgid "ignoring junk `%s' after expression" +msgid "junk `%s' after expression" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:3177 +#: config/tc-i386.c:3327 #, c-format msgid "missing or invalid immediate expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:3208 config/tc-i386.c:3454 +#: config/tc-i386.c:3358 config/tc-i386.c:3565 #, c-format msgid "unimplemented segment %s in operand" msgstr "" -#: config/tc-i386.c:3210 config/tc-i386.c:3456 +#: config/tc-i386.c:3360 config/tc-i386.c:3567 #, c-format msgid "unimplemented segment type %d in operand" msgstr "" -#: config/tc-i386.c:3252 config/tc-i386.c:5392 +#: config/tc-i386.c:3404 config/tc-i386.c:5588 #, c-format msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'" msgstr "" -#: config/tc-i386.c:3258 +#: config/tc-i386.c:3411 #, c-format msgid "scale factor of %d without an index register" msgstr "" +#: config/tc-i386.c:3524 +#, c-format +msgid "bad expression used with @%s" +msgstr "" + #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:3435 +#: config/tc-i386.c:3546 #, c-format msgid "missing or invalid displacement expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:3541 +#: config/tc-i386.c:3652 #, c-format msgid "`%s' is not a valid base/index expression" msgstr "" -#: config/tc-i386.c:3545 +#: config/tc-i386.c:3656 #, c-format msgid "`%s' is not a valid %s bit base/index expression" msgstr "" -#: config/tc-i386.c:3620 +#: config/tc-i386.c:3731 #, c-format msgid "bad memory operand `%s'" msgstr "" -#: config/tc-i386.c:3635 +#: config/tc-i386.c:3746 #, c-format msgid "junk `%s' after register" msgstr "" -#: config/tc-i386.c:3644 config/tc-i386.c:3759 config/tc-i386.c:3795 +#: config/tc-i386.c:3755 config/tc-i386.c:3870 config/tc-i386.c:3908 #, c-format msgid "bad register name `%s'" msgstr "" -#: config/tc-i386.c:3652 +#: config/tc-i386.c:3763 msgid "immediate operand illegal with absolute jump" msgstr "" -#: config/tc-i386.c:3674 +#: config/tc-i386.c:3785 #, c-format msgid "too many memory references for `%s'" msgstr "" -#: config/tc-i386.c:3752 +#: config/tc-i386.c:3863 #, c-format msgid "expecting `,' or `)' after index register in `%s'" msgstr "" -#: config/tc-i386.c:3774 +#: config/tc-i386.c:3887 #, c-format msgid "expecting `)' after scale factor in `%s'" msgstr "" -#: config/tc-i386.c:3781 +#: config/tc-i386.c:3894 #, c-format msgid "expecting index register or scale factor after `,'; got '%c'" msgstr "" -#: config/tc-i386.c:3788 +#: config/tc-i386.c:3901 #, c-format msgid "expecting `,' or `)' after base register in `%s'" msgstr "" #. It's not a memory operand; argh! -#: config/tc-i386.c:3829 +#: config/tc-i386.c:3942 #, c-format msgid "invalid char %s beginning operand %d `%s'" msgstr "" -#: config/tc-i386.c:4267 +#: config/tc-i386.c:4117 +msgid "long jump required" +msgstr "" + +#: config/tc-i386.c:4417 msgid "Bad call to md_atof ()" msgstr "" -#: config/tc-i386.c:4431 config/tc-sparc.c:548 -#, c-format -msgid "No compiled in support for %d bit object file format" +#: config/tc-i386.c:4581 +msgid "No compiled in support for x86_64" msgstr "" -#: config/tc-i386.c:4449 +#: config/tc-i386.c:4602 msgid "" " -Q ignored\n" " -V print assembler version number\n" @@ -3583,67 +3789,63 @@ msgid "" " -s ignored\n" msgstr "" -#: config/tc-i386.c:4456 +#: config/tc-i386.c:4609 msgid " -q quieten some warnings\n" msgstr "" -#: config/tc-i386.c:4475 -msgid "Unknown architecture" -msgstr "" - -#: config/tc-i386.c:4515 +#: config/tc-i386.c:4710 config/tc-s390.c:1592 msgid "GOT already in symbol table" msgstr "" -#: config/tc-i386.c:4636 +#: config/tc-i386.c:4842 #, c-format msgid "can not do %d byte relocation" msgstr "" -#: config/tc-i386.c:4697 +#: config/tc-i386.c:4894 config/tc-s390.c:1957 #, c-format msgid "cannot represent relocation type %s" msgstr "" -#: config/tc-i386.c:4994 +#: config/tc-i386.c:5190 #, c-format msgid "too many memory references for '%s'" msgstr "" -#: config/tc-i386.c:5157 +#: config/tc-i386.c:5353 #, c-format msgid "Unknown operand modifier `%s'\n" msgstr "" -#: config/tc-i386.c:5364 +#: config/tc-i386.c:5560 #, c-format msgid "`%s' is not a valid segment register" msgstr "" -#: config/tc-i386.c:5374 config/tc-i386.c:5495 +#: config/tc-i386.c:5570 config/tc-i386.c:5691 msgid "Register scaling only allowed in memory operands." msgstr "" -#: config/tc-i386.c:5405 +#: config/tc-i386.c:5601 msgid "Too many register references in memory operand.\n" msgstr "" -#: config/tc-i386.c:5474 +#: config/tc-i386.c:5670 #, c-format msgid "Syntax error. Expecting a constant. Got `%s'.\n" msgstr "" -#: config/tc-i386.c:5544 +#: config/tc-i386.c:5740 #, c-format msgid "Unrecognized token '%s'" msgstr "" -#: config/tc-i386.c:5561 +#: config/tc-i386.c:5757 #, c-format msgid "Unexpected token `%s'\n" msgstr "" -#: config/tc-i386.c:5705 +#: config/tc-i386.c:5901 #, c-format msgid "Unrecognized token `%s'\n" msgstr "" @@ -3652,7 +3854,7 @@ msgstr "" msgid "Unknown temporary pseudo register" msgstr "" -#: config/tc-i860.c:181 config/tc-mips.c:1027 +#: config/tc-i860.c:181 config/tc-mips.c:1248 #, c-format msgid "internal error: can't hash `%s': %s\n" msgstr "" @@ -3689,7 +3891,7 @@ msgstr "" msgid "Illegal operands for %s" msgstr "" -#: config/tc-i860.c:873 config/tc-sparc.c:2730 +#: config/tc-i860.c:873 config/tc-sparc.c:2731 msgid "bad segment" msgstr "" @@ -3743,54 +3945,54 @@ msgstr "" msgid "5-bit field must be absolute" msgstr "" -#: config/tc-i860.c:1306 config/tc-i860.c:1329 +#: config/tc-i860.c:1305 config/tc-i860.c:1328 msgid "A branch offset requires 0 MOD 4 alignment" msgstr "" -#: config/tc-i860.c:1350 +#: config/tc-i860.c:1349 #, c-format msgid "Unrecognized fix-up (0x%08x)" msgstr "" -#: config/tc-i860.h:82 +#: config/tc-i860.h:80 msgid "i860_convert_frag\n" msgstr "" -#: config/tc-i960.c:549 +#: config/tc-i960.c:550 #, c-format msgid "Hashing returned \"%s\"." msgstr "" #. Offset of last character in opcode mnemonic -#: config/tc-i960.c:583 +#: config/tc-i960.c:584 msgid "branch prediction invalid on this opcode" msgstr "" -#: config/tc-i960.c:623 +#: config/tc-i960.c:624 #, c-format msgid "invalid opcode, \"%s\"." msgstr "" -#: config/tc-i960.c:628 +#: config/tc-i960.c:629 #, c-format msgid "improper number of operands. expecting %d, got %d" msgstr "" -#: config/tc-i960.c:860 +#: config/tc-i960.c:861 #, c-format msgid "Fixup of %ld too large for field width of %d" msgstr "" -#: config/tc-i960.c:977 +#: config/tc-i960.c:978 #, c-format msgid "invalid architecture %s" msgstr "" -#: config/tc-i960.c:997 +#: config/tc-i960.c:998 msgid "I960 options:\n" msgstr "" -#: config/tc-i960.c:1000 +#: config/tc-i960.c:1001 msgid "" "\n" "\t\t\tspecify variant of 960 architecture\n" @@ -3801,205 +4003,208 @@ msgid "" "\t\t\tlong displacements\n" msgstr "" -#: config/tc-i960.c:1403 +#: config/tc-i960.c:1404 msgid "too many operands" msgstr "" -#: config/tc-i960.c:1462 config/tc-i960.c:1689 +#: config/tc-i960.c:1463 config/tc-i960.c:1690 msgid "expression syntax error" msgstr "" -#: config/tc-i960.c:1500 +#: config/tc-i960.c:1501 msgid "attempt to branch into different segment" msgstr "" -#: config/tc-i960.c:1504 +#: config/tc-i960.c:1505 #, c-format msgid "target of %s instruction must be a label" msgstr "" -#: config/tc-i960.c:1543 +#: config/tc-i960.c:1544 msgid "unmatched '['" msgstr "" -#: config/tc-i960.c:1554 +#: config/tc-i960.c:1555 msgid "garbage after index spec ignored" msgstr "" #. We never moved: there was no opcode either! -#: config/tc-i960.c:1620 +#: config/tc-i960.c:1621 msgid "missing opcode" msgstr "" -#: config/tc-i960.c:1923 -msgid "invalid constant" -msgstr "" - -#: config/tc-i960.c:2035 +#: config/tc-i960.c:2036 msgid "invalid index register" msgstr "" -#: config/tc-i960.c:2058 +#: config/tc-i960.c:2059 msgid "invalid scale factor" msgstr "" -#: config/tc-i960.c:2241 +#: config/tc-i960.c:2242 msgid "unaligned register" msgstr "" -#: config/tc-i960.c:2264 +#: config/tc-i960.c:2265 msgid "no such sfr in this architecture" msgstr "" -#: config/tc-i960.c:2302 +#: config/tc-i960.c:2303 msgid "illegal literal" msgstr "" #. Should not happen: see block comment above -#: config/tc-i960.c:2532 +#: config/tc-i960.c:2533 #, c-format msgid "Trying to 'bal' to %s" msgstr "" -#: config/tc-i960.c:2543 +#: config/tc-i960.c:2544 msgid "Looks like a proc, but can't tell what kind.\n" msgstr "" -#: config/tc-i960.c:2574 +#: config/tc-i960.c:2575 msgid "should have 1 or 2 operands" msgstr "" -#: config/tc-i960.c:2583 config/tc-i960.c:2602 +#: config/tc-i960.c:2584 config/tc-i960.c:2603 #, c-format msgid "Redefining leafproc %s" msgstr "" -#: config/tc-i960.c:2633 +#: config/tc-i960.c:2634 msgid "should have two operands" msgstr "" -#: config/tc-i960.c:2643 +#: config/tc-i960.c:2644 msgid "'entry_num' must be absolute number in [0,31]" msgstr "" -#: config/tc-i960.c:2652 +#: config/tc-i960.c:2653 #, c-format msgid "Redefining entrynum for sysproc %s" msgstr "" -#: config/tc-i960.c:2759 +#: config/tc-i960.c:2760 msgid "architecture of opcode conflicts with that of earlier instruction(s)" msgstr "" -#: config/tc-i960.c:2780 +#: config/tc-i960.c:2781 msgid "big endian mode is not supported" msgstr "" -#: config/tc-i960.c:2782 +#: config/tc-i960.c:2783 #, c-format msgid "ignoring unrecognized .endian type `%s'" msgstr "" -#: config/tc-i960.c:3064 +#: config/tc-i960.c:3055 #, c-format msgid "leafproc symbol '%s' undefined" msgstr "" -#: config/tc-i960.c:3074 +#: config/tc-i960.c:3065 #, c-format msgid "Warning: making leafproc entries %s and %s both global\n" msgstr "" -#: config/tc-i960.c:3183 +#: config/tc-i960.c:3174 msgid "option --link-relax is only supported in b.out format" msgstr "" -#: config/tc-i960.c:3226 +#: config/tc-i960.c:3217 write.c:2670 msgid "callj to difference of two symbols" msgstr "" -#: config/tc-ia64.c:4077 +#: config/tc-ia64.c:1052 +msgid "Unwind directive not followed by an instruction." +msgstr "" + +#: config/tc-ia64.c:4416 msgid "Register name expected" msgstr "" -#: config/tc-ia64.c:4082 config/tc-ia64.c:4368 +#: config/tc-ia64.c:4421 config/tc-ia64.c:4707 msgid "Comma expected" msgstr "" -#: config/tc-ia64.c:4090 +#: config/tc-ia64.c:4429 msgid "Register value annotation ignored" msgstr "" -#: config/tc-ia64.c:4114 +#: config/tc-ia64.c:4453 msgid "Directive invalid within a bundle" msgstr "" -#: config/tc-ia64.c:4181 +#: config/tc-ia64.c:4520 msgid "Missing predicate relation type" msgstr "" -#: config/tc-ia64.c:4197 +#: config/tc-ia64.c:4536 msgid "Unrecognized predicate relation type" msgstr "" -#: config/tc-ia64.c:4217 config/tc-ia64.c:4242 +#: config/tc-ia64.c:4556 config/tc-ia64.c:4581 msgid "Predicate register expected" msgstr "" -#: config/tc-ia64.c:4229 +#: config/tc-ia64.c:4568 msgid "Duplicate predicate register ignored" msgstr "" -#: config/tc-ia64.c:4251 +#: config/tc-ia64.c:4590 msgid "Bad register range" msgstr "" -#: config/tc-ia64.c:4279 +#: config/tc-ia64.c:4618 msgid "Predicate source and target required" msgstr "" -#: config/tc-ia64.c:4281 config/tc-ia64.c:4293 +#: config/tc-ia64.c:4620 config/tc-ia64.c:4632 msgid "Use of p0 is not valid in this context" msgstr "" -#: config/tc-ia64.c:4288 +#: config/tc-ia64.c:4627 msgid "At least two PR arguments expected" msgstr "" -#: config/tc-ia64.c:4302 +#: config/tc-ia64.c:4641 msgid "At least one PR argument expected" msgstr "" -#: config/tc-ia64.c:4338 +#: config/tc-ia64.c:4677 #, c-format msgid "Inserting \"%s\" into entry hint table failed: %s" msgstr "" #. FIXME -- need 62-bit relocation type -#: config/tc-ia64.c:4758 +#: config/tc-ia64.c:5147 msgid "62-bit relocation not yet implemented" msgstr "" -#: config/tc-ia64.c:4820 +#. XXX technically, this is wrong: we should not be issuing warning +#. messages until we're sure this instruction pattern is going to +#. be used! +#: config/tc-ia64.c:5220 msgid "lower 16 bits of mask ignored" msgstr "" -#: config/tc-ia64.c:5317 +#: config/tc-ia64.c:5775 msgid "Value truncated to 62 bits" msgstr "" -#: config/tc-ia64.c:5668 +#: config/tc-ia64.c:6126 msgid "" "Additional NOP may be necessary to workaround Itanium processor A/B step " "errata" msgstr "" -#: config/tc-ia64.c:5849 +#: config/tc-ia64.c:6309 #, c-format msgid "Unrecognized option '-x%s'" msgstr "" -#: config/tc-ia64.c:5877 +#: config/tc-ia64.c:6337 msgid "" "IA-64 options:\n" " -milp32|-milp64|-mlp64|-mp64\tselect data model (default -mlp64)\n" @@ -4009,33 +4214,37 @@ msgid "" " -xdebug\t\t debug dependency violation checker\n" msgstr "" -#: config/tc-ia64.c:6147 config/tc-mips.c:1014 +#: config/tc-ia64.c:6351 +msgid "--gstabs is not supported for ia64" +msgstr "" + +#: config/tc-ia64.c:6618 config/tc-mips.c:1227 msgid "Could not set architecture and machine" msgstr "" -#: config/tc-ia64.c:6223 +#: config/tc-ia64.c:6725 msgid "Explicit stops are ignored in auto mode" msgstr "" -#: config/tc-ia64.c:6273 +#: config/tc-ia64.c:6775 msgid "Found '{' after explicit switch to automatic mode" msgstr "" -#: config/tc-ia64.c:6686 +#: config/tc-ia64.c:7222 #, c-format msgid "Unhandled dependency %s for %s (%s), note %d" msgstr "" -#: config/tc-ia64.c:7962 +#: config/tc-ia64.c:8498 #, c-format msgid "Unrecognized dependency specifier %d\n" msgstr "" -#: config/tc-ia64.c:8753 +#: config/tc-ia64.c:9300 msgid "Only the first path encountering the conflict is reported" msgstr "" -#: config/tc-ia64.c:8756 +#: config/tc-ia64.c:9303 msgid "This is the location of the conflicting usage" msgstr "" @@ -4115,91 +4324,94 @@ msgstr "" msgid " -cpu-desc provide runtime cpu description file\n" msgstr "" -#: config/tc-m32r.c:688 +#: config/tc-m32r.c:691 msgid "Instructions write to the same destination register." msgstr "" -#: config/tc-m32r.c:696 +#: config/tc-m32r.c:699 msgid "Instructions do not use parallel execution pipelines." msgstr "" -#: config/tc-m32r.c:703 +#: config/tc-m32r.c:706 msgid "Instructions share the same execution pipeline" msgstr "" -#: config/tc-m32r.c:773 config/tc-m32r.c:870 +#: config/tc-m32r.c:776 config/tc-m32r.c:872 #, c-format msgid "not a 16 bit instruction '%s'" msgstr "" -#: config/tc-m32r.c:780 config/tc-m32r.c:877 config/tc-m32r.c:1033 +#: config/tc-m32r.c:783 config/tc-m32r.c:879 config/tc-m32r.c:1035 #, c-format msgid "unknown instruction '%s'" msgstr "" -#: config/tc-m32r.c:789 config/tc-m32r.c:884 config/tc-m32r.c:1040 +#: config/tc-m32r.c:792 config/tc-m32r.c:886 config/tc-m32r.c:1042 #, c-format msgid "instruction '%s' is for the M32RX only" msgstr "" -#: config/tc-m32r.c:798 config/tc-m32r.c:893 +#: config/tc-m32r.c:801 config/tc-m32r.c:895 #, c-format msgid "instruction '%s' cannot be executed in parallel." msgstr "" -#: config/tc-m32r.c:854 config/tc-m32r.c:918 config/tc-m32r.c:1090 +#: config/tc-m32r.c:856 config/tc-m32r.c:920 config/tc-m32r.c:1092 msgid "internal error: lookup/get operands failed" msgstr "" -#: config/tc-m32r.c:903 +#: config/tc-m32r.c:905 #, c-format msgid "'%s': only the NOP instruction can be issued in parallel on the m32r" msgstr "" -#: config/tc-m32r.c:932 +#: config/tc-m32r.c:934 #, c-format msgid "" "%s: output of 1st instruction is the same as an input to 2nd instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:936 +#: config/tc-m32r.c:938 #, c-format msgid "" "%s: output of 2nd instruction is the same as an input to 1st instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1250 config/tc-ppc.c:1459 config/tc-ppc.c:3681 read.c:1358 +#: config/tc-m32r.c:1252 config/tc-ppc.c:1571 config/tc-ppc.c:3966 msgid "Expected comma after symbol-name: rest of line ignored." msgstr "" -#: config/tc-m32r.c:1260 +#: config/tc-m32r.c:1262 #, c-format msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-m32r.c:1274 config/tc-ppc.c:1481 config/tc-ppc.c:2392 -#: config/tc-ppc.c:3705 +#: config/tc-m32r.c:1276 config/tc-ppc.c:1593 config/tc-ppc.c:2615 +#: config/tc-ppc.c:3990 msgid "ignoring bad alignment" msgstr "" -#: config/tc-m32r.c:1301 config/tc-ppc.c:1492 config/tc-ppc.c:3717 read.c:1382 -#: read.c:2108 +#: config/tc-m32r.c:1288 config/tc-ppc.c:1630 config/tc-v850.c:383 +msgid "Common alignment not a power of 2" +msgstr "" + +#: config/tc-m32r.c:1303 config/tc-ppc.c:1604 config/tc-ppc.c:4002 #, c-format msgid "Ignoring attempt to re-define symbol `%s'." msgstr "" -#: config/tc-m32r.c:1310 +#: config/tc-m32r.c:1312 #, c-format msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-m32r.c:1786 +#: config/tc-m32r.c:1789 msgid "Unmatched high/shigh reloc" msgstr "" -#: config/tc-m68hc11.c:305 +#: config/tc-m68hc11.c:327 #, c-format msgid "" "Motorola 68HC11/68HC12 options:\n" @@ -4215,55 +4427,55 @@ msgid "" " (used for testing)\n" msgstr "" -#: config/tc-m68hc11.c:346 +#: config/tc-m68hc11.c:368 #, c-format msgid "Default target `%s' is not supported." msgstr "" #. Dump the opcode statistics table. -#: config/tc-m68hc11.c:365 +#: config/tc-m68hc11.c:387 msgid "Name # Modes Min ops Max ops Modes mask # Used\n" msgstr "" -#: config/tc-m68hc11.c:415 +#: config/tc-m68hc11.c:437 #, c-format msgid "Option `%s' is not recognized." msgstr "" -#: config/tc-m68hc11.c:636 +#: config/tc-m68hc11.c:658 msgid "#" msgstr "" -#: config/tc-m68hc11.c:645 +#: config/tc-m68hc11.c:667 msgid "#" msgstr "" -#: config/tc-m68hc11.c:654 config/tc-m68hc11.c:663 +#: config/tc-m68hc11.c:676 config/tc-m68hc11.c:685 msgid ",X" msgstr "" -#: config/tc-m68hc11.c:681 +#: config/tc-m68hc11.c:703 msgid "*" msgstr "" -#: config/tc-m68hc11.c:693 +#: config/tc-m68hc11.c:715 msgid "#" msgstr "" -#: config/tc-m68hc11.c:703 +#: config/tc-m68hc11.c:725 #, c-format msgid "symbol%d" msgstr "" -#: config/tc-m68hc11.c:705 +#: config/tc-m68hc11.c:727 msgid "" msgstr "" -#: config/tc-m68hc11.c:724 +#: config/tc-m68hc11.c:746 msgid "